Archive

Archive for May, 2009

Companies that Use Perl

May 22nd, 2009 4 comments

perl

The Planet Perl Iron Man Blogging Competition has come about because many people in the Perl community are getting concerned about the state of Perl. It is feared that the popularity of Perl is waning, and that it will become increasingly difficult to find gainful employment as a Perl programmer. I certainly hope that this isn’t going to be the case. Perl is an excellent language that can get the job done! Not to mention that my marketability will be severely hampered is Perl were to become obsolete. The general sentiment within the Perl community is that it is our responsibility to promote Perl, and increase its longevity together. I’m all for this, and am happy to do my part by blogging :)

As it stands right now, Perl is far from dead! There is a very active Perl community out there, and there always has been. I expect though, that it’s always been a community that isn’t to keen on touting their own horns. Let alone get in to promotion or marketing… yikes!

To prove that Perl is long from dead, I thought I’d list some of the big companies out there that are using Perl* in some capacity or another:

Do you know any other companies that are using Perl? Help the community out, and add them to the Perl 5 Wiki!

* Sourced from the Perl Jobs list, and the Perl 5 Wiki.

Categories: Perl/mod_perl Tags:

How Perl Became My #1

May 15th, 2009 No comments

As a part of the Planet Perl Iron Man Blogging Competition, Graeme Lawton asks the question: How did you get hooked? What better time to tell the story of my love affair with Perl, than now!

To be totally truthful, I didn’t pick Perl, Perl picked me! In university, I took one class where we learned a little Perl, but the rest of the time it was heavy Java, some C/C++, and some Lisp of all things! It wasn’t until I got out into the working word that Perl got its hold on me.

I struggled to get that first job out of university. My resume was rather un-standard, with far more soft skills gained from my experience than technical skills, and a Philosophy degree to throw everyone for a loop. I was so grateful to get the job that I finally got: Web Programmer at a leads generation and sales company. The main language used there was perl, under mod_perl, so I had to get crackin’ and learn on the job. A year an a half later I’d left that company, but I couldn’t part with my Perl! I found another Perl programming job, and then another. I also started up this little thing called List Central using Perl under mod_perl.

Reasons I love Perl:

  • !,@,$,%,&
    • Unlike the general sentiment of the ruby/python people, I love the funny symbols used in Perl. Once you get to know what they signify all quickly convey their meaning, and it’s easy to speed up the rate of development, because you know what you are dealing with.
  • Flexibility
    • The flexibility of Perl is huge for me! I’m not big on the Perl one-liners that Perl is famous for. I like that I don’t have to be all cutesie and smartie pants showing off how few lines I can complete a task in. I like to be verbose and include all of my braces, and with Perl I can! And those that like the one-liners, they can enjoy their way too!
  • CPAN
    • CPAN is super useful. One of the most comprehensive and well documented libraries available in any language. And it’s all open source. A beautiful example of the power of open source!
  • Objects or Scripts

    • Again, this is part of the whole flexibility thing. Perl is capable of quick and dirty scripts as well as massive projects designed with proper object orientation. With Perl, the developer gets to decide!

How did you get into Perl? Why do you love it?

Categories: Perl/mod_perl Tags:

Bootstrapping it All the Way

May 11th, 2009 No comments
Bootstrapping

Bootstrapping

I’ve mentioned previously that I am, at least currently, a one-woman operation here at List Central. I am positive that I can build List Central into something that can sustain itself. The initial costs are are coming out of my pocket, thus, I am keeping the costs to a minimum until the point comes when List Central can afford more with the income it generates. In time, I want to see List Central grow into a larger business that employs talented people, until then, I’m bootstrapping it!

What is bootstrapping you ask? Bootstrapping is a “self-sustaining process that proceeds without external help” [Wikipedia April 20th, 2009]

In The Bootstrapper’s Bible Seth Godin outlines The Bootstrapper’s Manifesto and provides a road map for first time bootstrappers. Ready Godin’s e-book was a real turning point for me and List Central, as I got real excitement and motivation from it’s digital pages. The Bootstrapper’s Bible helped me by:

  • Showed me that I was far from alone in my quest
  • Gave me valuable tools to help me meet my goals
  • Inspired me with confidence
  • Convinced me to be persistent through the many challenges of bootstrapping a new business
  • Told me the name for what I was doing: Bootstrapping!

Free copies of Seth Godin’s e-book “The Bootstrapper’s Bible” are still available, so grab yourself a copy while you still can!

Changing Pixel Colors With ImageMagick

May 8th, 2009 2 comments
ImageMagick

ImageMagick

On List Central, users will be able to choose from a selection of themes for their main page. The themes available only vary by color. To make this happen I have several sets of CSS files; when the user logs in, the system checks which theme s/he selected, and serves the appropriate CSS files. These sets of CSS files are automatically created from a base set of CSS files when a them is created in the List Central Administration.

Aside from the CSS files, there are several images on the users’ main page that vary depending on what theme is selected. In the name of saving time in the future, I set out to figure out a way to create these images automatically as well. I really don’t like busy work, and I’m willing to go to great lengths to find a way around having to do any!

My general approach was, for each image, go through each and every pixel in the image, and see if it is one of the colors I want to change. If it is, then I change it, else, I don’t do anything with it. I’m assuming that the image will only have the colors I want to change in it. The code can easily be modified to handle this case differently.

On with the code!

my @BaseColors = (‘#ffffff’, ‘#0000ff’, ‘#00ff00′, ‘#ff0000′, ‘#000000′);
my @NewColors = (‘#ffffff’, ‘#121d52′, ‘#1d687a’, ‘#bdeaff’, ‘#f8f8ff’);

my $imSrcImg = new Image::Magick;
my $imagefile = ‘source_image.png’;
my $warn = $imSrcImg->Read($imagefile);
print ‘READ WARN: $warn’;

my ($width, $height) = $imSrcImg->Get(‘width’, ‘height’);
print ‘GET WARN: $warn’;

my $size = $width . ‘x’ . $height;
my $iMagickNew = new Image::Magick(size=>$size);
$warn = $iMagickNew->ReadImage(‘NULL:white’);
print ‘ReadImage WARN: $warn’);

# Iterate over every pixel in the image and change
for my $y (0..($height-1)){
   for my $x (0..($width-1)){

      my (@pixel) = split(/,/, $imSrcImg->Get(‘pixel[$x,$y]‘));

      my $red = DecToHex($pixel[0]);
      my $green = DecToHex($pixel[1]);
      my $blue = DecToHex($pixel[2]);

      my $color = ‘#’ . $red . $green . $blue;

      # Check all of the colors we are going to be changing
       for(my $i = 0; $i < @BaseColors; $i++ ) {

         # Change pixel color if the pixel is the color of one
         # of our base colors but not if it's the color we
         # want to change it to already to save a fraction
         # of a moment
         if($color eq $BaseColors[$i] && $color ne $NewColors[$i]){

               # Pull out the red, green, & blue components
               my $r; my $g; my $b;
               my $changeToColor = $NewColors[$i];
               if($changeToColor =~ m/#([wd]{2})([wd]{2})([wd]{2})/){
                  $r = $1; $g = $2; $b = $3;
               }

               # Convert to hex
               my $red = HexToDec($r);
               my $green = HexToDec($g);
               my $blue = HexToDec($b);

               my $toColorHex = '#'.$r.$g.$b;
               my $toColorDec = '$red, $green, $blue';

               my $x2 = $x + 1; my $y2 = $y + 1;
               my $warn = $iMagickNew->Draw(fill=>$toColorHex, primitive=>’point’, points=>’$x,$y’);
               print ‘Changing pixl [$x,$y] from $color to $toColorHex ($toColorDec)nWARN: $warn’;
            }
         }
      }
}

# Write the new image, then we are done
my $newImage = ‘new_image.png’;
my $warn = $iMagickNew->Write($newImage);
print ‘WARN: $warn’;

# Converts a decimal number to a hexidecimal number
sub DecToHex {
   my $dec = shift;

   my $hex = sprintf(‘%X’, $dec);
   if($hex =~ m/^([wd]{2})/){
      $hex = $1;
   }

   $hex = lc($hex);
   return $hex;
}

# Converts a hexidecimal number to a decimal number
sub HexToDec {
   my $hex = shift;

   my $dec = hex($hex);

   return $dec;
}

WARNING: This code will not work as is. There are apostrophes that should be double apostrophes and other such aesthetic changes.

I’ve played around with ImageMagick in the past, so it was the logical choice for my image manipulation package.

I had one major sticking point in trying to get my pixels to change color, which all stemmed from the lack of quality documentation available for the ImageMagick perl package. I love PerlMagick! It is super powerful! It has always baffled me how poor the documentation is. Hopefully my sharing this tidbit will help some other poor soul out there who is struggling with Perl Magick.

Here’s the crux of it: You cannot get a pixel to display in a certain color with:

$iMagick->Set(‘pixel[49,49]‘=>’red’);

as you might assume from the documentation. You have to use the ‘Draw’ subroutine like this:

$iMagick->Draw(fill=>red, primitive=>’point’, points=>’49,49);

It took me hours to figure that out!

I hope my future users like the whole theme selection business on List Central after all of this effort! It was fun to make it happen though! Its a win win!

The List Central Elevator Pitch

May 7th, 2009 2 comments
Elevator Pitch - Going Up?

Elevator Pitch - Going Up?

Elevator Pitch:

“An elevator pitch (or elevator speech) is an overview of an idea for a product, service, or project. The name reflects the fact that an elevator pitch can be delivered in the time span of an elevator ride (for example, thirty seconds and 100-150 words).”

[Wikipedia April 6th 2009 - http://en.wikipedia.org/wiki/Elevator_pitch]

Typically the ‘elevator pitch’ is intended for possible funding sources, such as Venture Capitalists or Angel Investors. For me, I’m not intending to go out for funding for List Central, I’m bootstrapping this one the whole way, but I have still found the need to hone my elevator pitch. There are many occasions when a quick, succinct, and intriguing summary of your project is needed.  Networking events, social events with friends and family who want to know how you spend your time, discussions with potential collaborators, and  attracting future users. Darren Rowse, of Problogger, suggests to the students of his 31 Days to Build a Better Blog Challenge that the most important reason to compose an elevator pitch is to ensure that “YOU as a blogger to have thought through and crystallised in your mind what your blog is about“. I must say, I agree with him, both for bloggers, and for small business owners who aren’t necessarily looking for funding such as myself.

With all of this in mind, I set out to write my elevator pitch for List Central. What do you think of it? Le me know in the comments, because I would love to know.

List Central Elevator Pitch

An emerging publishing platform found somewhere between blogging, and micro-blogging to be known as List-blogging. With the social ranking of Digg, the utility of  Remember the Milk, the link and image sharing  Delicious and Flickr and the content ownership of Facebook, coming together to create a niche online social community and utility for people who love lists.

The flexible interface enables users to create, manage, and share lists of any variety, for the purpose of fun, organization, online social interaction, and even self-promotion. With both public and private lists, List Central allows users to organize their thoughts, work flow and life management, while also having fun sharing lists with others. Bloggers will find List Central to be particularly beneficial, as it can be used both to organizing blogging activities, and to promoting posts in a new and interesting way.

Created by a creative and highly motivated web-prenuer who is skilled in the fields of web development and design, and is eager to build List Central into a much loved loved corner of the Internet for a wide variety of users.

Categories: Business Tags: