Jump to content
Larry Ullman's Book Forums

Antonio Conte

Members
  • Content Count

    1084
  • Joined

  • Last visited

  • Days Won

    126

Everything posted by Antonio Conte

  1. I agree. That said, you need some sort of planning in the beginning, and agile development is a method that easy to start out with. Simply put, you'll struggle without some tools in your toolkit, and agile development is a simple way to start out. Let's call a spade a spade here: Agile development is a method that has been proven successful for small start-up companies. All projects fails without sound leadership and a solid planning phase. I wouldn't blame agile development in itself regarding your project. That's an over simplification at best. Agile development is not a fix-all solution, but a tool. You don't user a hammer on a screw, and you need to tailor the principles from agile development to fit your needs. Agile development might not have been the correct fit for your project, but it does not take merits from the method.
  2. You need to learn about development methods and business planning. There's been a lot of buzz over agile development and lean startup the last couple of years. There's a reason for that. Starting a small business i tricky, and can be overwhelming. This method and this approach gives you a simple, proven way of beginning with that. Agile development in a nutshell: Your start a project by defining the overarching requirements and deadline You break the requirements down into smaller part-requirements with own deadlines. You focus on the most critical requirements (functionality) first. You rinse and repeat into the project is done. It's very hard to calculate the time needed on the first project. This is where agile development shines. Since you've clearly broken your large project into smaller, manageable parts, you'll be able to gain insight into your overall time left. Am I behind schedule? Your list of requirements will tell you. You might not calculate correctly at first, but experience will make you better to the next time. Calculating time is almost impossible at first. The general rule is to plan for more time than you think you need. You might need to do research, fix bugs or re-write code along the way. Git and GitHub is perfect for organizing projects this way. GitHub is a revision controll system based on commits. You create your over-all milestones (smaller deadlines) and assign your part-requirments to them in a logical way. This way, you can focus on solving one problem at a time in a given time-frame. (week-based for example) A milestone is reached when all requirements are "fixed" with commits. That's a small introduction. I suggest you read up on the subject or watch videos on agile development. It may sound like a fancy buzz word, but it's only a super-simple way to break projects down into manageable parts. A couple of days of research should be enough to understand it.
  3. Laravel is generally consider to be a really good framework. It has a fast-paced development schedule, is developed by a large community using GitHub, and is generally a really solid piece of work. It can be installed using Composer, utilizes the PSR-1standard, (namespaced class) is loosly-coupled, so you can utilize parts of the framework in your projects, is based on the MVC pattern and uses routing. Without really diving into any of the frameworks, I would say Laravel looks best on paper. The YII 2 Framework has to do some serious work before it can really compare to Laravel's code quality. However, that does not mean it's a better framework for YOU. Do as Larry said and check out both. I think YII really makes sense from my coding background, and it's definitely an awesome framework. I wouldn't hesitate to recommend YII after looking at how the Framework works and after reading Larry's book. That is also a solid argument for YII; You won't find an equally good resource teaching you Laravel. Larry has a magical talent for teaching away stuff. That's worth it's weight in gold.
  4. I always solve that with floating. No need for hacks.
  5. It can have different meanings from what I understand. Both for building up the crowd for applause and to insult. From Urban dictonary: It's absolutely pro Margaux. I tried to be funny, but I guess I had to explain my own joke in the end.
  6. Check out the <base> head HTML element. That may help you. I second Margaux too. Open the source, and check where the references are pointing.
  7. What? You disliked the track-pad on Macs? Seriously? I'm in shock. It's the only track-pad ever made that actually works how you expect it to, in my opinion. It's one of my main reasons for going for a Mac laptop in the first place. I normally want to throw every other laptop into a brick wall after five minutes of usage. I don't even bother with a mouse when I use Photoshop. I had a Pro before, I switched because the Air was perfect for my personal usage. They are both awesome in my opinion. I absolutely second your opinions on price, though. It's not a great value-proposition by any stretch of the imagination. I think they are worth it personally, though. They also keep value really good. I earned around 150 dollar on the used Macbook Pro I owned for a year. Games are tricky on Macs, yeah. That's why I keep my windows machine. Check out a game called The Binding of Isaac if you like random-generated rougelikes. You'll get it for under 5 bucks, and I've put 100 hours into the game. A lot of cool indie games available for Mac too. Steam has a section for Mac-supported games. Limbo is awesome, yeah! Keep on enjoying your new iMac! It's something special opening Apple products. They really know how to give you a good experience. Quality! We only use iMacs at work, and they are awesome. (But I actually use my Air there too... I love that machine...)
  8. I would say it really depends on your usage. Keep in mind that the Air does lack ports for ethernet and DVI/HDMI and has only two USBs. The SSD, light weight, great screen and small size is the strength. I love the machine, and would not consider a Pro now, but keep that in mind. I have the 13 inch, and absolutely love it!
  9. Xampp works on OSX as well, but even better, OSX comes with Apache, PHP and Ruby pre-installed. All you have to do is to activate it, and maybe do some symlinking so you can run php in the command line without using the runnable path. Just search for how to do that. Simple! MySQL and PHPMyAdmin is also pretty easy to install. Search for guides there as well. I really love my Air for development. I prefer it greatly over my stationary windows machine. Looking forward to pictures.
  10. One quick question to your YII guys: Do you use the forms helpers and other output factories, and why?
  11. Object relational impedance mismatch is a problem where your objects (or models) cannot be directly linked to the database structure. (And they should most often not) This is not an uncommon problem, as relational data most often be joined to create a model instance. My question is whether you really need all this inheritance? The fact that you duplicate all these models really seem like a code smell to me. I don't know the problem you are trying to solve here, but it might be worth looking up a principle called "Composition over inheritence". That's fancy speak for "Interfaces instead of inheritance". What that basically allows you to do is to remove a lot of inheritance while keeping classes to "contracts" they agree upon by implementing the interface. This will allow you to do dependency injection instead of tighly binding your models together. This will also greatly simplify your UML scheme, and that's always nice... Don't really now if this will help you with the problem, but that's the general approach you'd take without a framework. I'm not to versed in YII to guarantee it'll work here, but I see no reason why not.
  12. I don't know if it that's simple, margaux, but maybe it is? Do you only need these numbers, or is there a pattern you want to find here? If it's simply the numbers, then this will suffice: $integers = array(2,1,4,3,6,6,8,9); $size = count($integers); for ($i = 0; $i < $size; $i++) { echo $integers[$i] . ' '; }
  13. You need to find the correct mathematic formula. Simple as that. I'm not really sure you need nested loops for this, but math is in no way my strong suit. That's my feeling though.
  14. http://www.larryullman.com/forums/index.php?app=forums&module=extras&section=boardrules
  15. I would really recommend you starting from the beginning with any book about introductory OOP. There's a solid learning curve at first when you switch from procedural to object-oriented programming, and most of that is due to the way you have to think about code. It's a very common mistake to jump straight into code, as many feel they already master coding to some degree. While that's true for many, the basic theory is insanely important, and has very little to do with coding skills. As I said earlier, it's a different approach to coding, not necessarily harder or more advanced. I don't really remember the chapters in this book. You can probably skip some of the first chapters, but make sure you don't skip any OOP theory from the get go. While much of the stuff explained might seem below your current coding level, (and it likely is) it's fundamental in OOP. Make sure to don't blaze through theory because it seems simple. It'll pay of later to focus. What I consider essential for understanding object-orientation: - Theory about a Class and an Object. Read this thoroughly. Read it more than once. - Theory about class structures and code planning (i.e what constitutes a class. This is very important and it's not obvious at first) - Delegation. (A method should do only one specific job) - Visibility (public, protected, private) - Class scope and application scope. - Polymorphism (building of existing classes) Larry is very good at explaining all this, but make sure to take it slow from the start. It will really pay of later. Learning object-orientation is not tricky from a of coding skill level standpoint, but because of the theoretic foundation you need to write good code. Good luck, and have fun.
  16. You need to pass the Database connection resource ($dbc) along for the function to be able to use it. The theory behind this is called scope, and determines where variables are available. The $dbc variable won't exists inside the function check_login unless: 1. You pass it as an argument, as done above 2. Declare it global inside the function Passing it as an argument is considered the best practice of the two, as global variables are generally bad. That's another discussion though. Here's how you do that: function check_login($username, $password) { global $dbc; // Declare variable global. You can use it below now // Other stuff here }
  17. Don't mind with the SSL. While it's very noble of you to want to protect your users, the security level should reflect what you are trying to protect. Security is only a reflection of handling risk, and should be implemented accordingly. This does not mean security should be taken lightly, however, you seem to have a healthy perspective on the whole deal. If you are interested in the topic, some information from Wikipedia might be interesting: - http://en.wikipedia.org/wiki/Information_security - http://en.wikipedia.org/wiki/Risk_assessment My two cents. If they're even worth that.
  18. Using an outer join will turn out to be tricky. I thought it was viable at first too, but could not really find a way to make it work. The problem is that it only works one way, as Larry stated. I wasted 10 minutes before I picked up on that. There's a lesson to be learnt there. Haha. You could probably make it work with outer joins, but I would guess you would need controll structures for that to work. I can't really see the point in putting so much logic into a query though. Your solution seems very reasonably to me, Jon.
  19. Look at the views, my man! Seems like a lot of people like to read about your progress. Btw. You've evolved so much as a coder since you started here. That's so cool to notice. Good luck moving forward Edward. Nice work.
  20. I think your keyboard is drunk, damilola. It replaces characters with silly replacement symbols. Tell it to sober up!
  21. Correlation does not imply causation. While you are obviously correct for many reasons, you could theoretically build something that would break by calling close(). It does not makes sense, but that was not the point of discussion here. <?php // Open connection $db = new Db(); // Run query and receive result resource $result = $db->query(); while ( $row = $result->fetch() ) { echo $row['data'] . '<br>'; } // Close connection $db->close(); while ( $row = $result->fetch() ) { echo $row['data'] . '<br>'; } class Db { private $result; public function query() { // Mock result array $result = new Object( array( array('id' => 1, "data" => "Testing"), array('id' => 2, "data" => "this"), ) ); return $this->result =& $result; } public function close() { // Call free in object class $this->result->free(); $this->result = null; } } class Object { private $array; private $position = 0; public function __construct(array $result) { $this->array = $result; $this->position = 0; } public function fetch() { if ( $this->valid() ) { $value = $this->current(); $this->next(); return $value; } else { $this->rewind(); } return false; } public function free() { $this->array = null; } protected function valid() { return isset($this->array[$this->position]); } protected function current() { return $this->array[$this->position]; } protected function next() { ++$this->position; } protected function rewind() { $this->position = 0; } }
  22. I don't really know, Jon. If I had to take a guess, I would think not. (at least directly) Garbage collectors are generally based on call stacks and memory references/values. When references exists, garbage collectors will generally ignore cleaning up before script execution is done. As the MySQLi package has it's own classes for prepared statements and results (as they are other objects/resources) it would surprise me if the result was directly linked with the connection. At best, it would hold one of those references I talked about. As I wrote this, I wanted to test it out. I wrote a small script that disconnects, sleeps 5 seconds, and utilizes the result. It worked perfectly fine: // Open connection $mysqli = new mysqli('localhost', 'root', '', 'conte'); // Run query and receive result resource $result = $mysqli->query('SELECT * from test'); // Close connection $mysqli->close(); // Let's sleep.... sleep(5); // Try using result while ( $row = $result->fetch_array(MYSQLI_ASSOC) ) { echo $row['data'] . '<br>'; } // Free resources $result->free(); Considering this, I don't think closing the connection removes the result from memory. That's all garbage collection, is my guess. If the MySQLi class was in charge of the result, all known references would be deleted. (leaving the $result variable link to a non-existing reference) This is not technical proof by any stretch of the imagination, so don't spread any of this a "a fact/the truth". I do believe this is how it works though. However, I've never once bothered freeing a result set before this very day. I rarely also never free objects/arrays from memory, so I wouldn't really think too much about this. I don't close connections neither. Shame on me. :/
  23. PHP does garbage collection pretty good, so you don't really need to call that. It does free up resources quicker though, so doing it dosen't hurt.
  24. From what I can remember, can't you identify base64 by a pattern? I think the ending always have to be the same or something like that. It should be possible to prevent that way.
×
×
  • Create New...