July 25th, 2008
Yeah, I know. Cheesy title. But, it’s true. I’ve been using Git for the past several months and am amazed at it’s powerful simplicity. The concepts are easy to grasp thanks to great documentation and real world examples.
I’d heard all the rage about the other SCM’s. I’ve looked into Mercurial and Bazaar, but wasn’t as impressed with them as I was with Git. After following the timeline of emails as Linus wrote and shared his new creation and watching his visit to Google, I gained a whole new respect for distributed revision control (DRC).
It’d been hard to miss all the talk around DRC, but thought it’s only benefits were to interact with my repository when I didn’t have connectivity. I was almost always connected, so my Subversion repository was all I needed - so I thought. Having read a post about cloning repositories, I decided to investigate why so many people were now using Git. While researching Git, another article about “forking” caught my attention and slowly I started to see all of the wonderful benefits I’d been missing by not using a DRC - specifically Git.
Most notably:
- Branching - the way it’s suppose to work! This is “throw away” branching at it’s best!
- Cloning - This is extremely useful when stumbling across projects on services like Github. Instead of the traditionally checking out a copy of the trunk or a branch in CVS and Subversion, Git clones the entire repository into a local directory for you and “…creates remote-tracking branches for each branch in the cloned repository”. A great example is Reddit. When they released the code, I cloned the repository and every few days I can run “git fetch” to update the remote-tracking branches. I can run “git pull” to update the remote-tracking branches as well as “merge the remote master branch into the current master branch, if any”.
- git-svn - Simply put, this is brilliant!!! Having all of my repositories in Subversion this allowed me to have a “trial run” with Git. I was able to make a local “Git clone” of my Subversion repository, interact with it and “sync” the changes I truly wanted committed to the Subversion repository. I could create as many throw away branches as I liked and the Subversion repository never knew anything about them. Needless to say, the VERY DAY I started playing with Git, I made my last commit to my Subversion repository and haven’t looked back since.
- git-stash - Again, BRILLIANT!!! Stash “saves your local modifications away and reverts the working directory to match the HEAD commit”. Every developer I’ve talked to about this with has the same reaction - (AWESOME!!!!) - as we’ve all been in the situation where they were working on a new feature and they need to fix a bug. Most of us have a “fixes” version of trunk in a separate directory for just this purpose. But with git-stash, you can have this freedom with a single working copy!
- git-diff - Git tracks content, not files. Each commit is tracked by it’s sha1sum, shown beside each when issuing a “git log”.
I was also impressed with the wealth of information and comparisons of Git with other SCM’s others had put together.
Recent news about Gist show the flexibility of Git repositories. Thanks to services like Github Git is gaining more respect and notoriety, almost like the movement when Subversion first came on the scene.
Posted in Git | 1 Comment »
July 23rd, 2008
Finally, after months of users begging Google to support Perl on Google App Engine (GAE), there looks to be a positive response as Brad explains.
The majority of the work will have to be done by the Perl community, but Google is giving Brad and other Google developers “20%” of their time to be devoted to this “pet project“.
When launched I played with GAE briefly and once I saw the support for Django I took another look. Since I don’t program daily in Python it takes me longer to the most basic things I as spend my time writing pseudo code when unsure and looking up syntax later. I’ve yet to test the sample Django app out on GAE, but hope to someday soon.
Posted in Catalyst, Perl | No Comments »
July 10th, 2008
It appears that to the Catalyst community YAML isn’t the best config file format any longer as they’ve chosen to switch in favor of Config::General - which defaults to the "apache config format"
From Config::General’s POD:
The format of config files supported by Config::General is inspired by the well known apache config format, in fact, this module is 100% compatible to apache configs, but you can also just use simple name/value pairs in your config files.
Catalyst::Plugin::DebugCookie even provides the updated configuration style in it’s POD:
<Plugin::DebugCookie>
secret_key 001A4B28EE3936
cookie_name my_secure_debug_cookie
</Plugin::DebugCookie>
The following command can be used to dump an existing Catalyst app’s config into an Apache style conf file. You’ll definitely have to edit the resulting file, but at least it’s a start.
perl -Ilib -e 'use MyApp; use Config::General; Config::General->new->save_file("myapp.conf", MyApp->config);'
Posted in Catalyst, Perl | No Comments »
July 2nd, 2008
I’m a fan of The Big Idea with Donny Deutsch watched a show I’d DVR’d the other day. The show was about the "Comeback" mindset. Most of us know that our dreams don’t come true overnight and that on the way to our dreams we often have a hard road and sometimes get discouraged. The show featured people who had been knocked down, but came back.
Of the guests on the show the following quote by Dr. Karen Reivich made the most impact on me:
Resilience. It’s learnable. The heart of resilience is believing that you can affect change. [It] might not affect the whole situation, but there is an aspect of the situation you can control.
Excellent advice not only when times are tough, but as motivation when solving even the most difficult day-to-day problems.
Posted in Life Experience, Motivation, Uncategorized | No Comments »
July 1st, 2008
I’m not sure how I’ve made it this far in my career and never knew that grep had a color option to highlight the term you’re searching for in the results. Guess I’ve never really needed it that bad, but since stumbling across this, it’s made things a lot easier to view.
To make this seamless you can add this to your .bash_rc or .bash_profile:
alias grep="grep --color=auto"
Thanks to asommer’s .bash_rc for pointing this out.
Posted in Linux, Uncategorized | No Comments »
May 28th, 2008
I’m working on a project using Catalyst , and I initially coded the password hashing (compare the passwords then build the digest, used during the signup and change password processes) directly into my controller (could be placed in a Utils package) and passed the digest to the create/update like so:
my $pass = $c->req->param("password");
my $digest = Digest->new('MD5')->add($pass)->digest;
...
$c->user->password($digest);
Reading the Catalyst mailing list I learned about store_column(), part of DBIx::Class::Row .
Upon storage of a row (an update or create), it allows you to override the default "store this value" and manipulate the value into whatever you’d like.
Using the code below I was able to move this logic out of the controller/Utils package and into the model where it belongs.
sub store_column {
my( $self, $col, $val ) = @_;
$val = Digest->new('MD5')->add($val)->digest
if $col eq 'password';
return $self->next::method( $col, $val );
}
This technique can also be used to perform calculations .
Posted in Catalyst, Perl | 1 Comment »
March 30th, 2008
I’ve tried to monitor the CPAN recent feed to keep up with updates to modules I use and find other useful modules, but the volume of updates has gotten to much to handle. While it’s great to see so many updates, I simply don’t have the time to look through them all.
Apparently, I’m not the only one with the problem as a while back NotiCPAN was created to notify users of updates to specific modules. Problem is you must select each individual module you’d like to watch.
In the sprit of being lazy, I thought up a way to monitor what I’d like via a Yahoo Pipe. With it I’m able to enter the types of modules I’m interested in and subscribe to it in Google Reader. I like the fact that I can watch all Catalyst modules by simply specifying that I want “Catalyst” in the title or if I specify “YAML::Tiny” it’ll watch that one module for now and if others enter that namespace it’ll automatically pick those up.
It’s a very simple concept, but has helped me a great deal.
Feel free to check out the pipe and I’d love to hear of other uses.
Posted in Perl | No Comments »
March 29th, 2008
Doing some resent work with jQuery a div that is initially hidden from the user, I went round in cirlces when I kept getting nothing when trying to get the div’s margin information via:
$('#myitem').offset()
I kept getting zero returned for the top and left margins. What I needed to do was to show() the div:
$('#myitem').show().offset().hide()
This allows me to get the margins, but ultimately keeps the div hidden from the user.
Hopefully, documenting this here will help someone if they run into in the future, or it’ll help me the future me if I ever forget.
Posted in Javascript, jQuery | No Comments »
December 13th, 2007
There seems to be a lot of work around generating Charts and Graphs as over the past few months there have been several major graphing/charting projects to come to my attention.
Google Chart API - Most recently Google jumped into the graphing and charting arena by providing a REST API. This is another good move for Google and looks to be a solid first release, providing more initial documentation that I’ve seen in any of the Google API’s.
Open Flash Chart - These are really slick graphs and charts! Want interactive, easy to implement, and (yes, I’ll say it again) slick looking graphs and charts? Then have a look at Open Flash Chart (OFC) and you’ll quickly understand why I think it’s one of the best of the bunch. They have every type of graph or chart you’d need and make getting your data to the SWF file a snap. Just provide it with a data structure by using one of the many helpers for just about any language and you’ll have impressive graphs and charts in minutes. It’s gonna be interesting to see which major companies will come to use these graphs and charts.
Flot - Uses jQuery to produce some very nice graphs and charts. This is definitely a project to watch in the future.
Posted in APIs, Javascript, jQuery | No Comments »
November 26th, 2007
Never be afraid to make decisions. All decisions are temporary. Make them, and be willing to be wrong. The only way to get better is to learn from your mistakes and accept that you’re only as good as you can be in any given moment.
This is the third item in a list of six tenets of design, but in my opinion should be number one. Why? It’s a primary concept of programming (and life) - trial and error - and might be the key concept that helps bridge the gap between programming and design.
I am a programmer. When I make a mistake with code I have a compiler to tell me that it’s wrong. I make an attempt at a fix. Wrong again. Rinse and repeat. Until it’s right.
Who knew the concept could be that simple for design?
While I am in no way a designer, I’ve learned several techniques to structure information so that users can quickly find what they are looking for. I didn’t learn it overnight (just like programming). Nor have I learned it all. I’ve read
a
few
books
, blogs and studied great designs. They all make it look so easy! But, it’s just like programming - they rinsed and repeated until they got it right.
I’ve been through several iterations when coding the design for this blog, but until now I can say that I haven’t truly thought of designing in the same way I do programming. I guess I just expect to magically be able to create the perfect design in the first sitting, rather than let it evolve.
What makes designing different than programming is that there is no right answer. It’s how I view it that makes it good or not. Maybe this shift in thinking will help me to take risks - temporary risks - with my designs, until I get it good enough - for me.
Posted in Design | No Comments »