January 7, 2009

Pages


Search Site


Topics



Archives

Tweets

Entries for month: October 2007

Joel on Ajax

October 11 2007 by Adam
I am pretty late to the game on this one – I have nearly 500 unread posts in my RSS aggregator in my "ColdFusion & Tech" folder alone! But I thought it would be pertinent to mention Joel's recent post, Strategy Letter VI. Whether you agree or disagree, he raises an excellent point for discussion — much like one of my favorite TV shows: Penn & Teller: BS. Joel thinks that developers should focus on features, and let the efficiency catch up later:
The winners are going to do what worked at Bell Labs in 1978: build a programming language, like C, that?s portable and efficient. It should compile down to ?native? code (native code being JavaScript and DOMs) with different backends for different target platforms, where the compiler writers obsess about performance so you don?t have to.
There is some controversy on the article, and I'm a little surprised at how little attention it's gotten. It was only dugg a handfull of times, it only returns 280-something results in a Technorati Search, and even gets some staunch criticism on his own section of Reddit. I also happened to read the critique at Ajaxian – with more valid points and a pretty decent discussion going on in the comments. It will be interesting to see how things pan out. Personally I think it will be somewhere in the middle. Maybe Google will be the ones to develop the NewSDK that Joel goes on about. Or they buy it. ;)

Posted in AJAX |

Update those plug-ins!

October 08 2007 by Adam
I've just subscribed to the Announcements RSS Feed for both Subclipse and CFEclipse. I was behind by at least a few revisions on Subclipse which was keeping me from accomplishing something, and it occurred to me that there is no poke feature — at least none that I'm aware of — in Eclipse, to let you know when new versions of your plugins are released. I very much like this feature in other applications, like Pidgin (formerly "gaim"). As it turns out, not only are new releases announced on the CFEclipse news feed, but the other things Mark Drew posts — like screencasts on new features — are also included. Without the poke feature, I suppose this is the next best thing. Now if I can just find a way to keep up with all of the RSS feeds I'm subscribed to.

Posted in Meta |

Regular Expression Search and Replace with Perl

October 05 2007 by Adam
God, I thought I was done with Perl. It always finds a way to resurface in my life, though, and I don't suppose that's such a bad thing. On a debian server I'm running, I had the need to create an HTML file with links to a series of files in the same directory. With a couple of commands, this was cake! First, list all of the files and save the output to an html file:
ls myfile* > myfilelist.html
This creates a file myfilelist.html with contents similar to:
myfile1.txt
myfile2.txt
myfile3.txt
myfile4.txt
myfile5.tar.gz
myfile6
Then we want to turn this list of file names into links. This is pretty easy with a RegEx search and replace:
perl -p -i-OLD -e 's/(^myfile*$)/<a href=\"$1\">$1<\/a><br\/>/g' myfilelist.html
There are a million and one perl documentation sites out there so I'm not going to document every flag and every option, but the important stuff is:
  1. The i flag tells it to edit inline. Using -i-OLD will backup the file as [filename]-OLD before performing the search and replace.
  2. 's/x/y/g' does a Global Search and replace of x with y.
  3. Don't forget to escape special characters like quotes and slashes.

Posted in Misc |