Free software or the dawn of the small software firm?

February 21st, 2010 View Comments

About a month ago I was chatting with a friend of mine about web-based software.  I was talking about basecamp, which I really like but was unsure if I could justify paying for as a starving Masters student.  My friend said “….  Wait, you are thinking about *paying* for a web app?!?”  The concept completely stunned him, paying for something on the internet when everything he used, facebook, google docs and gmail were all free seemed ludicrous.  Sometime more recently another of my friends mentioned in passing to me “I would never pay for software.”

Although linux never really took off as a mainstream operating system, popular web platforms and applications like wordpress, nginx and rails seem to be making a strong case that free software may be the way of the future on the internet.  Maybe soon we will never pay for things that people with college degrees who could easily have been highly paid engineers spent years working on.  I have only one caveat, and that is What The Hell!!?!

I was recently reading an article on “The developer as a starving artist“. This article claims that as tools for development make development faster, simpler and cheaper, developers will be churning out great projects for free for fun. There will still be money in software but it will be in providing these “for fun” applications, in the same way people make money using apache to sell web hosting. The excellent developers will make money while most will be like artists “scraping by”.

The issue with this is that to be a *good* developer you actually have to be really smart. Really smart people go to college and take degrees that are hard to get into and pay them money, they don’t decide to work for free. If we stop paying developers then the same really smart people currently becoming developers will abandon software development for other lucrative professions that require being very smart.  This will make software crappy and good software will once again be in greater demand.  (aka able to charge.)

What about my thoughts on the future of the industry? As software development becomes easier and cheaper smaller teams of devs can build more extensive applications faster. What this means is that something like ebay, which was written by and employs many developers, can be replicated and improved upon by a dedicated group of 2-4 developers in under a year. Amazon took massive amounts of money to develop, now I can build an online store in under a month by myself. the key being to do this well, you still need a group of *good* developers. I think more startups will start to challenge big complacent companies, and we will begin to see more competition across product spaces. For a developer to make 180 000$ per year, a pretty dang good salary, they need to make an app that only 1000 people are willing to pay 15$ per month for! Once upon a time starting a serious software company was a large capital and time investment, now it’s more like opening a McDonalds. Given these economics and the speed of creating good applications it almost doesn’t make sense to go work a full time job unless a developer *needs* a stable income because they have children or something.

Developers go forth and prove me right. Make good apps that people will pay for and let the free software enthusiasts be damned. Good software is worth money and always will be.

Who develops using Safari?

February 17th, 2010 View Comments

All my macy web developmenty friends can never seem to get over the fact that I do all of my initial development and testing of site in firefox.  ”It’s so clunky compared to safari”, “It’s so slow” etc. etc.  And I have tries safari.  I have tried using it many many many times.  I would use it.  It feels nicer and slicker like they mention, but am I the only one or is the safari debugger bugtastic?  It is actually absolutely stunning to me that it ever made it through QA.  I find about 50% of the time when I put a breakpoint into my JS in Safari I get the following:Safari happily breaks, wags it’s tail and asks for a pat on the head, but it completely refuses to show me my code!  Where is the code paused?  I have no idea, somewhere in this blank screen.

So then there’s the webkit nightlies.  People swear by them up and down and promise they will do all the fancy things firebug let you do like edit css inline.  So on a few occasions I brave the nightlies.  The problem is they always work even worse than my vanilla Safari. Sometimes they don’t even show the JS files as existing.  The last time I tried webkit the debugger did the following mysterious thing basically making them totally unusable.I can’t read that!!!  That’s two files in one window…  It seems like you would have to *try* to make something that bad happen.

So for all the safari developers out there.  Am I missing something??

Perl LWP multiple select

October 11th, 2009 View Comments

The problem, you wish to create a perl script to interact with a CGI program that would normally take a multiple select as input. How do we submit this using LWP???

The answer is actually what you might expect, but there is no documentation for it anywhere on the interwebs that I could find so I had to do my own testing to make sure things behaved the way I wanted. Lets say the select in the form that would normally talk to the CGI looks as follows:



(Stolen from here: http://www.htmlcodetutorial.com/forms/_SELECT_MULTIPLE.html)

and we want to submit mushrooms and greenpeppers. Our perl will look as follows:

my $response = $browser->post( $url,
[
"toppings" => "mushrooms",
"toppings" => "greenpeppers",
]
);

You might feel the urge to do the following:

my $response = $browser->post( $url,
[
"toppings" => ["mushrooms","greenpeppers],
]
);

And you will most likely find it works. Please refrain or much confusion will ensue if you ever change the content type to “form-data” so you can submit a file. File submission also takes an array reference to the location of the file.

Rails ActionMailer and gmail

June 30th, 2009 View Comments

Ok… So this took me longer than it should have to work out. There was much advice about using some sort of tls configuration in the actionmailer config. Don’t listen!! :-P It didn’t seem to work for me.

This is what did work:

Step 1:
Run this from your app root.

curl -s http://s3.amazonaws.com/drawohara.com.ruby/tls_smtp.rb > ./lib/tls_smtp.rb

Step 2:
Add an initializer ie. config/initializers/smtp_config.rb with the following:

require 'tls_smtp'

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'mydomain',
:authentication => :plain,
:user_name => 'name@domain',
:password => 'uber-secure'
}

Do it!! I hope you find this before you get very annoyed at the not working and seeming 0 debugging output like I did!

Absolutely Stupid.

April 7th, 2009 View Comments

So I slept 2 hours last night.  About 4 hours the night before and maybe less the night before that and then again the same the night before.  But I’m running over some code I wrote here and I have done…  the STUPIDEST thing I have ever ever ever ever done since I began programming.  That’s 8 years folks.  It’s so stupid that I actually laughed out loud.  It’s unbelievable that even at my most tired ever my auto-pilot did not steer me away from this.  Anyways, I am running an external program to do some machine learning and I need to keep track of the order the instances being trained are are being written to the file it reads from for later processing and no identifier can be written to the training file.  Natural thing to do, store the instances identifiers in an array right? *WRONG* apparently the natural thing to do is write them to a file as I write the training file and then read the order I wrote them to that file about 10 lines later.  Seriously.  It results in like 600mb of unnecessary file IO in like 10 lines.  I’m sure my delirious self thought there was some good reason to do this, but for the life of me I can’t figure out what that could possibly have been.

*Hanging head in shame.*

Perl Unique Elements in Arrays

April 5th, 2009 View Comments

It took me a little bit so figure this out so I thought I’d share it.  In order to just get unique elements out of an array try:

my @list = ( "a", "a", "b" );

my %set = map { $_ => 1 } @list;
my @uniqueList = keys %set;

for( my $i = 0; $i < scalar @uniqueList; $i++){
print $uniqueList[$i];
}

It will print:
ab

Perl in Bioinformatics and the Blosum Matrices

April 1st, 2009 View Comments

Considering perl is the language of bioinformatics it is ridiculous a quick google search did not return a module which has built in amino acid comparison matrices. I know, reading one in probably takes 10-15 minutes to write at most, but every 10 minutes people spend on soemthing that *SHOULD* already be done is a wasted 10 minutes.

Anyway, I might remedy this at some point, but should you plan on reading in the BLOSUM62 matrix here is a quick fix. Perl is not my fav language and I am no perl hackomotron, so I assume something about this is wrong, but it works. use at your own discretion and hopefully you found this in < 2 minutes. If I ever do choose to remedy this situation properly I will add an addendum to this post.

blosum62:
ACID A R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4
S 1 -1 1 0 -1 0 0 0 -1 -2 -2 0 -1 -2 -1 4 1 -3 -2 -2 0 0 0 -4
T 0 -1 0 -1 -1 -1 -1 -2 -2 -1 -1 -1 -1 -2 -1 1 5 -2 -2 0 -1 -1 0 -4
W -3 -3 -4 -4 -2 -2 -3 -2 -2 -3 -2 -3 -1 1 -4 -3 -2 11 2 -3 -4 -3 -2 -4
Y -2 -2 -2 -3 -2 -1 -2 -3 2 -1 -1 -2 -1 3 -3 -2 -2 2 7 -1 -3 -2 -1 -4
V 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4 -3 -2 -1 -4
B -2 -1 3 4 -3 0 1 -1 0 -3 -4 0 -3 -3 -2 0 -1 -4 -3 -3 4 1 -1 -4
Z -1 0 0 1 -3 3 4 -2 0 -3 -3 1 -1 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4
X 0 -1 -1 -1 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 0 0 -2 -1 -1 -1 -1 -1 -4
* -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1

readBlosum.pl:

use strict;

sub readBlosum{
open BLOSUM , "blosum62" or die "Unable to open inputFile.";
my $line = ;
my @acidIndices = split(/ /, $line);
my %blosumMatrix = ();

while () {
my($line) = $_;
my @scores = split(/ /, $line);
my $currAcid = $scores[0];
for ( my $i = 1; $i < scalar @scores; $i++) {
$blosumMatrix{$currAcid}{$acidIndices[$i]} = $scores[$i];
}
}

close BLOSUM;
return \%blosumMatrix;
}

my $blosumMat = &readBlosum();
print $blosumMat->{"Z"}->{"X"};

Also
a) Feel free to tell me what I am doing wrong, I always welcome an opportunity to actually learn this language with very little work.
b) How the F*** am I supposed to attach files to a blog post that aren't media files?? That would be very useful!

Perl And Structs

March 29th, 2009 View Comments

One of the most frustrating thing about perl is the lack of ability to create structs. Structured data makes life easier to program and easier to understand! It’s entirely possible I’m just missing the point here and I’ve been stumbling around blind for over a year now, but if that’s the case then maybe my thesis should instead be “the problem with perl is lack of easy to find documentation”. ;-) Ok, granted OO perl does exist, and you can make structs sort of it just doesn’t seem as simple or elegant as it does in C. Maybe I’m just old fashioned.

Anyways, as far as I can tell the following is the only way to make a struct. Seems ugly and insufficient.

use Class::Struct;

struct( 'test_type' => [ t1 => '$', t2 => '@' ]);

my $testObj = new test_type;

$testObj->t2(0, "Hello");
$testObj->t2(1, "Goodbye");

$testObj->t1("Joel is awesome");

my $array = $testObj->t2;
my $numElements = @$array;

for( my $i = 0; $i < $numElements; $i++){
print $testObj->t2($i) . "\n";
}

EDIT:
I guess I should mention that perl hashes can serve a similar purpose, but I also find them unsatisfactory. Maybe I just like strongly typed languages, but I think structs make code more readable than just using hash.

Auto indent in emacs

March 27th, 2009 View Comments

I think from time to time I will put up the answers to things I try and do from time to time and sometimes forget how. That way maybe google will lead people here for easy answers.

To auto-indent a section in emacs:
1. Select Section.
2. C-M-\

Also remember, and I am never wrong, emacs is awesome.

DemoCamp Edmonton

March 12th, 2009 View Comments

This is my second demo camp and the first that has involved social drinking for me. (Read too much to drink.) I was very surprised by the turnout, more than actually turned out for last time’s surprising turnout. Seems that lots of Edmontonians are interested in software. This isn’t that surprising given the active community of Computer Scientists at the University of Alberta. It is actually good evidence that fostering community in the students of a faculty is actually almost as important as the education given. Many of the people I have met were actively involved in CS at U of A. Well done uacs.

JJ out. Bedums and Sleepums and all that.

Where Am I?

You are currently browsing the Software Development category at Where Is Joel?.