Posts

Showing posts with the label programming

Simple fix to Gnome Terminal

I often double click on a filename or folder and then paste it with the middle button (the scroll wheel), in Linux. What annoyed me was that it doesn't get the ~ character so if I'm cutting an pasting my current path as shown on the command line scott@home:~/src/folder/name$ Double click, middle click gives me /src/folder/name and not ~/src/folder/name . How annoying, I have to cursor all the way to the beginning and enter the tilde character. Even worse if there's an error message like: Error in ~/src/folder/name.cc:123 Double click, middle click gives me now /src/folder/name.cc:123 . Now I have to edit both sides. The fix is simple, go to your Gnome Terminal|Profiles... and edit your default profile. The first pane called "General" and has a field called "Select-by-word characters". Add the tilde (~) and remove the colon (:) and you're done. There, I just saved you 2 thousand keystrokes a year.

Detecting copy-and-pasted Code

I came across this interesting little program to detect code that appears to be copied and pasted from one place to another. It's about $20.00 and is free to try for Linux and Windows and works with any text. It doesn't seem like a difficult program to write, sounds like it might be similar to the rsync algorithm . Differences would be that you would chunk into n lines instead of bytes and you would store all the checksums in a hash table, to find duplicates. Maybe cleaning up whitespaces and removing comments might also improve the algorithm.

New Programing Styles

I just learned of two new (bad) programming styles I never hear of before: Cowboy Programming : "It is characterised by a single programmer jumping into the writing of the software often working from his own idea of what the software should do." Shotgun Programming : "The way a shotgunner approaches programming is to blindly start shooting first and ask questions later. And when something does work, well, don't sit around worryin' about why, just start doin' it again!". I actually worked with more than one person who coded like that. If left alone for two weeks (on a problem that should take two days) I got code that worked (barely) but was so fragile and full of bugs that suggesting a change would bring tears to their eyes.

The break-dancing chicken

Stevey Yegge has a long post rant about agile programming on his blog. It's a long post but it's funny as hell. ... I only had one high-level takeaway, one marketing message I wanted to get out to developers everywhere: It's OK to say No to Agile .... Well, any time you find a community whose overall Humor Level is rated at "Homeland Security", it's a pretty good indicator that you don't ever want to have to deal with them. Ever. As I've done for a great many other programming languages, I've bashed on Perl's technical weaknesses at length in the past. To my continued amazement, the Perl folks are the only ones who never get upset. They just say "Haha, yeah, boy, you're right, it sure is ugly. Heh. Yeah, so, um, anyway, I'm going to get back to work now..." It's awesome. I've gained so much respect for them. It's almost enough to make me go back to programming in Perl. Well, almost. If there's one thing I...

New PostgreSQL Version

Version 8.2 of PostgreSQL is in beta now and is said to be 20% faster overall. It has a new Generalized Inverted Index which works well for text searches terabytes in size, and is the only open source database of it's kind which has this feature.