Love Komodo Edit and CodeIgniter? Yeah, me too. I created a CodeIgner snippet package which will greatly improve your productivity.
Enjoy!
P.S. I’m sure I’ll be adding more snippets in the future so check back every once and awhile for updates.
Love Komodo Edit and CodeIgniter? Yeah, me too. I created a CodeIgner snippet package which will greatly improve your productivity.
Enjoy!
P.S. I’m sure I’ll be adding more snippets in the future so check back every once and awhile for updates.
As root
/usr/libexec/mysqld –skip-grant-tables –user=root
mysql -u root
UPDATE mysql.user SET Password=PASSWORD(’newpassword’) WHERE User=’root’;
FLUSH PRIVILEGES;
quit
The original version of the Doctrine for CodeIgniter 1.0 plugin by Nicholas Husher is set up so the generated models don’t go into the models directory of the application directory used by CodeIgniter.
So I decided to modify it a bit so the generated models go into and can be accessed from the system/application/models/ directory. I’ve also created a controller which, when called, will generate the data model ORM classes for you.
A big thank you goes out to both Nicholas and the Doctrine team for making a great ORM for use with CodeIgniter.
Download it here.
If you are using Google Apps Gmail for your domain name’s email. Then you will want to drag the link below inspired by GmailThis! below to your bookmarks bar. Then go to your browser’s bookmark management dialog window and open the properties for this bookmark to replace MYDOMAINNAME with the domain name that you are using Google Apps Gmail for in the URL field. Now you will be able to send a link with the page’s title as the subject and the URL link as the body for any page you are currently on. It will open a small window which is ready for you to add recipients and click send. So now you have the same functionality you would get from using your browser’s method for desktop email clients.
Tags: bookmarklet, gMail, Google Apps, send link
This is a simple BlogEngine.NET control which can be used in a custom page within a BlogEngine.NET site to display posts from a certain category for use in a custom landing page or the likes. It can be easily modified to show posts from all categories too.
Download it here.
As many of you know MySQL lacked such basic functionality for way too long. Sadly this also means that many developers using it don’t use them when appropriate since they have gone without them for so long and now most applications today are written using ORM which can negate the needs for such things.
However there are situations where stored procedures are beneficial and when they are not. Being a database and object oriented developer I can see why people in either camp has their own preference. Regardless, let me outlines the pros and cons so you may decide for yourself if they may be of use along with a simple example of one so you know how to create and use them if needed. Since they are rather simple I won’t get too extensive with it.
Pros:
Cons:
Sample Stored Procedure:
CREATE PROCEDURE spGetLogin(username VARCHAR(50), password VARCHAR(50))
BEGIN
DECLARE success INT;
IF SELECT COUNT(*) FROM Users u WHERE u.username = username AND u.password = password > 0 THEN
SET success = 1;
ELSE
SET success = 0;
END IF;
SELECT success;
END
There is also triggers which react to commands on a table however even though they may seem useful I find them to be evil in my experience. I mean lets say you want to log activity using one so for every SELECT, UPDATE, or INSERT you will have a second INSERT’s overhead. You can also create functions however I have never seen much use for them as most of the reasons you would want to use them are already covered by stored procedures. That is not to say triggers and functions are useless. There are the rare occasion they can prove to be useful.
So as you can see they have some pretty good benefits and some awful downsides. However sometimes they are the best tool for the job and now you know how to decide if that is the case.
Feel free to add any critisism, comments or quetions!
Tags: Functions, MySQL, ORM, Stored Procedures, Triggers
People keep saying how Chrome doesn’t have extensions even though it has since days 1, Google Gears. Go to your gMail account or even your WordPress’s admin. Of course they are working on an official extensions framework but give them some credit, Google Gears can do some things FF plugins can’t and of course the opposite is true. Check out http://code.google.com/events/io/sessions.html for more info.
Tags: Extensions, Google Chrome, Google Gears, Plugins
RESTful communication is a great method for light weight communication across systems not requiring the complexity or standards based interoperability of web services. I have used these methods for years with multiple vendors and clients for various CRM related tasks and it worked great. Of course the system supported web services however the need to use them was rare in comparison.
Now it is no longer something used just for B2B based communication but also for standard everyday services such as Twitter. So I will use their REST based API to demonstrate how to read, write and authenticate using REST.
Below is a simple read in order to retrieve the friends timeline for the authenticated user.
Here we will now write to the service by updating the twitter user’s current status.
So as you can see REST calls are the easy part of handling RESTful communication. It is nothing more than standard HTTP calls. It is what you do to and with the data that is the hard part. So now you can see why it is so simple and light weight. Of course I could go into detail describing REST however it is outside the scope of this article and the code pretty much says it all. Enjoy!
Tags: HTTP, HTTP Authentication, REST, Twitter
Most tech savvy users hate to have unecessary Windows services running since they take up RAM and CPU cycles and doing nothing for you in return. So, lets take this preference a step further.
As a Microsoft based (.NET/SQL Server) developer we usually need SQL Server running on our boxes for testing purposes. Some of us, like myself, has to install the full version and not just the express version. Since we only need it at times like those and being a rather hefty service(s) I like to shut them down it down when I am not using it. It is a rather simple process to make this work.
First you'll need to run the services.msc command. When the service console pops scroll down the the SQL Server service, right click it and choose properties. First thing you'll want to do is to set the drop down to manual. Then you'll want to copy the value for service name. Finally hit the stop button and click ok.
Now fire up Management Studio and hit cancel on the login dialog if you haven't already changed this setting. The click on the options menu, choose external tools and follow the steps below.
Tags: Management Studio, Services, SQL Server
A little while ago I was speaking with technical writer, Jon Arking, about test driven development which led me to a conclusion that I believe will be a benefit to anyone reading this. The topic was my experience with test driven development. However it also led into my thoughts on the subject as well.
I do agree with many aspects of the overall Agile methodology. However I definitely agree with all of them. One example would definitely have to be paired programming. I do see the advantages of it however as any software engineer knows, there is a point in our day while developing where we get into a "zone" where we are totally immersed in our development effort and the ideas just keep flowing. I don't see this happening with paired programming. But anyway, let me get to the point of this article, test driven development.
There are 3 sides I see developers fall into involving unit testing. There is the stadard unit testers, those who do not use unit testing and the test driven developers. Many from the 2 sides not a part of test driven development have made many arguments against it. They believe it is slows down development or that there is no point in testing anything that hasn't even been written yet. Well I hope the perspective and analogy helps them to understand test driven development.
In many sciences, a scientist comes up with a prototype. With that prototype they perform the many tests and modifcations needed before producing anything production worthy. Even in the development of the prototype they performed various tests to get to the point where they have a prototype worthy enough of using it to help them advance it to the level where it can be of use to the general public.
In computer science, this would be considered test driven development. These scientists don't come up with an idea and go right to building/creating something meant for use by the general public and perform testing on these production models while producing them. The production/general public release of their innovation was created without the requirement of testing because it has already been through thorough test during and after the development of the prototype. At that point everything has been thoroughly tested and calculated that there is no need for any such testing in the development of a production/general public release.
I see no reason why computer science should be any different and as I have just stated, this is where test driven development becomes the perfect fit for us to follow the same methods of other science related fields. We come up with an idea and throughout each step of flushing out that idea we test it to make sure we are on the right track. Then after all the ideas are flushed out and tested we have our prototype upon which we can then perform more comprehensive testing.
Once all of this has been completed we can then, very quickly, produce a production worthy application or subset of an application. Everything is layed out in detail and thoroughly tested. This allows us to be completely confident in the final product. Also, we have the benefit of the Agile aspects this brings us for any future changes such as all the tests we already have in place to be reused to ensure any changes that do come along are released with the same quality as the original release.
I don't think it is either faster or slower than other methods. However there are aspects I am sure of, it will provide rock solid software and just makes sense when looking at it from this perspective.
Tags: Agile, Iterative Development, TDD