Archive for August, 2007

How Many Virtual Destktops do You Use?

Friday, August 31st, 2007

How many virtual desktops do you usually run on your machine? This question is probably directed more towards the Linux users rather than the Windows folk. When I’m using my XP box I usually stay with a single desktop, because none of the virtual desktop solution work well on that platform. Yes, there is the Virtual Desktop Manager power toy, and about a billion other small applications that try to offer similar functionality. But most of them are clunky and do not offer me the same level of functionality that the linux does. What I really look for in a desktop manager is:

  1. Speed - most virtual desktop managers suffer from slow redraws, but that is probably just a XP thing
  2. Some sort of context menu “Send Window To” functionality. Not all windows tools offer this.
  3. Elegant pager integrated into the task bar
  4. Pager must show window outlines and and/or icons
  5. Need to be able to drag and drop window outlines from one desktop to the other on the pager

Last 3 items offer huge productivity gains, and yet no windows app I have seen so far managed to tackle all 5. Both Gnome and KDE have all of this out of the box.

On my Kubuntu laptop I currently have 6 virtual desktops and I’m using all of them:

Virtual Desktops

I essentially use them to separate my workspaces based on the task I’m trying to accomplish. So the first desktop is dedicated to a maximized KMail instance - because I want to have a good reading surface for my emails. Similarly second desktop is pretty much just for Firefox for the very same reason - ease of reading.

My third and fourth desktops are usually reserved for IDE’s and graphical tools. Right now I have Gimp and Komodo Edit open on them. The 5th desktop is usually my “assorted xterm and gvim” workspace. I switch there if I want to edit some config files, install software and etc. My last desktop is usually running an rdesktop session to one of the Windows servers I’m currently working with.

I find that having these separate workspaces really streamlines my work. Being able to seamlessly switch from my email, to the browser and then to IDE without juggling windows is a great benefit. But what do you think? Do you like having multiple desktops? Or do you think it doesn’t really matter?

Windows people - give me suggestions for really good virtual desktop managers. I would love to see one that works as well as KDE or Gnome equivalents.

Favorite Mode of Communication: IM or Email?

Thursday, August 30th, 2007

What is your preferred mode of communication? Personally, I’m an email person. If you want to get in touch with me, the fastest way is probably via email because I always have it in front of me. I essentially don’t check my email - my email client is always open and it makes sounds when new email comes in. I also have a plugin in my browser which also notifies me when something hits my gmail account. So chances are that if I’m at my desk, I will see your email within minutes from when it drops into my inbox - and I will probably reply to it immediately.

My brother on the other hand hardly ever uses email. He has some sort of yahoo or hotmail account that he uses for signing up for online services, but he completely ignores all the Gmail invites I send him. He simply doesn’t use email for social purposes. If you want to get a hold of him, you have to use IM or just call him. If you email him, your message will get lost in the avalanche of spam and probably accidentally deleted when he logs into his account again in 2 months. His IM on the other hand is on 24/7. If he is our of the house, or sleeping he has an away message in place to capture all the IM’s sent to him during the day.

Not a very robust solution btw - a simple power outage forcing a shutown will destroy all the queued messages he might have gotten so far. Then again, maybe the client he uses has resolved this issue already. Unlikely though.

So here is what I noticed: my generation is mostly reliant on Email as the primary mode of electronic communication. My brother’s generation and below (he is a Junior in College now) on the other hand seems to rely on IM, supplementing it’s lack of permanence with messaging systems on social networks. These people don’t have actual emails. Or rather they do - one for work, and one for school. And they check both of them only when they have to. So if you send them something on a Friday afternoon, you won’t likely get an answer till Monday or later in the week. But you can easily MySpace or Facebook them and get a response immediately regardless of the time of day or night.

I find it very odd because dealing with the awkward MySpace messaging system gives me diarrhea. Compared to a feature set of your average webmail client (especially in post Gmail era where everyone uses AJAX and gives you pentabytes of space) the social network alternatives are just retarded. But then again, who am I to judge.

What is your favorite mode of electronic communication?
View Results

I wonder what will happen in 10-20 years. I have no doubts that email will remain one of the primary modes of electronic communication in the corporate world and academia. But what about social circles? Will social networks, and hybrid apps like twitter replace email as the prominent communication medium for just shooting the shit? What do you think?

Configure Linux Startup Applications with sysv-rc-conf

Wednesday, August 29th, 2007

How do you control your background services in Linux? Purists will probably say that renaming the symlinks in the rc folders is the way to go, but for me that’s a pain in the ass. I much more prefer some simple app where I could just click bunch of check-boxes on a single page to enable and disable starting up of various apps at different run levels. KDE has a built in tool for this called KSysV but it’s UI is atrocious. I mean, please check out this screenshot and tell me - does that look like a clean UI design?

KSysV is a Mess

What the hell were they smoking? It actually takes you a minute or two to realize that you disable applications by dragging and dripping their respective icons to the recycle bin icon in the corner. I guess it makes management of the services a bit easier but it could be much cleaner.

I recently discovered sysv-rc-conf app that actually manages to nail the simplistic service management paradigm I was really looking for - by using freaking checkboxes:

sysv-rc-conf

It’s not often that a curses utility written in perl completely owns a polished KDE app on clarity, usability and UI design. But this is exactly what we have here. You don’t want the service to run, you un-check the box. No dragging and no dropping stuff between boxes, searching and etc. Just pick an app, go across and check or un-check boxes as needed. And if you want more control, just run it with -p and you will get into the priority mode:

sysv-rc-conf in priority mode

Here you can actually edit the K and S records for each app on each run level. Now, KSysV might have some a bit more functionality, but sysv-rc-conf is simple, powerful and easy to use.

My Dapper installation didn’t have it installed by default, but I found it in the universe/admin repositories. You can get it by doing:

apt-get install sysv-rc-conf

or

aptitude install sysv-rc-conf

What is your favorite tool for managing SysV stuff? Let me know in the comments!

Blogs Without Comments

Tuesday, August 28th, 2007

How do you feel about blogs without comments? It seems that lately it is fashionable to say that “comments don’t scale“. I guess Joel Spolsky is probably the most quoted individual who argued against having open comments on your blog. His position is a bit extreme:

When a blog allows comments right below the writer’s post, what you get is a bunch of interesting ideas, carefully constructed, followed by a long spew of noise, filth, and anonymous rubbish that nobody … nobody … would say out loud if they had to take ownership of their words.
(…)
I don’t know how many times I’ve read a brilliant article someone wrote on a blog. By the end of the article, I’m excited, I’m impressed, it was a great article. And then you get the dribble of morbid, meaningless, thoughtless comments.

This is little harsh. I do not think this applies to this blog at all. Most of the comments I get here are insightful, funny and worth reading. Many of them actually complement the post, adding new content that I simply missed. I would argue that comments here generally add value to the post. But then again, my average traffic load here is relatively low and signal to noise ratio is very good.

I totally agree with Jeff Artwood when he says:

I firmly maintain that a blog without comments enabled is not a blog. It’s more like a church pulpit. You preach the word, and the audience passively receives your evangelical message. Straight from God’s lips to their ears. When the sermon is over, the audience shuffles out of the church, inspired for another week. And there’s definitely no question and answer period afterward.

I don’t want to be preaching to my readers. I want a conversation. I want to get to know my readers, and find out what they think on a given subject. We all blog for different reasons, but ultimately we all want people to read our stuff. So having a mechanism that lets your readers give you feedback is really important.

I view comments as a community building tool. Right now I have small group of regulars around here who frequently read and comment on posts, an comment on each others comments. And I think it’s great. I love that we have our small community growing here. And as such we still need to work on some inside jokes, and memes btw. )

I do not believe that you can have an insightful conversation using the “everyone posts on their own blog and links to eachother” methodology. What you get then is bunch of people preaching from their respective soap-boxes and cherry-picking arguments they want to discuss. Furthermore these commentaries are now spread over many websites, with no organized way of jumping from one to the other. If you disabled comments then you probably also do not allow tracebacks. So the only way I can know that someone commented on your article, is to randomly visit their blog. Does that facilitate good discussion? No.

With comments on the other hand, you get chronologically sorted, organized conversation right below the original post. In such setup it is easy to have actual debates with arguments, counter arguments, ripostes and etc. So while comments can be a mindless random drivel, they can also be an insightful discussion.

Not to mention that comments provide me with instant gratification/validation mechanism. When I get 0 comments on a post, I kinda know that no one was particularly interested in that one. And even if they were, they just didn’t have much to say about it. But when a topic sparks a conversation I instantly get that “Oh, people are actually reading this stuff!” feeling. And no amount of looking at the server logs, or website stats can compare with actually reading what people thought about your post.

Of course if you get few hundred comments per post, the nice benefits I outlined above are greatly diminished. It’s easy for discussions to turn into bickering and flame wars, and with high volume of posters it is usually difficult for the blog author to effectively moderate.

Still, we are not without tools to combat crappy comments. Take Slashdot for example - if you brows it with a filter that only shows you the posts moderated above certain threshold you can cut out most of that “noise, filth, and anonymous rubbish” that Spolsky seems to despise so much. Same goes for Digg for example - crappy and unpopular comments get buried and hidden increasing readability of the thread.

Community moderation combined with regular ant-spam measures does work - and it works well enough. All you need to do is to slap something like the Digg inspired Comment Karma plugin onto your blog, and the signal to noise ratio increases instantly.

A blog without comments is like a public panel without a Q/A session. I personally find that comments add value to the original content more often than not. What do you think?

Comments on a Blog:
View Results

What would you rather have - a high traffic blog with comments, even if they tend to be a bit chaotic, or pristine church pulpit blog that allows no comments? Given a choice, I’ll always pick the former over the latter.

Install Games on a Separate Partition

Monday, August 27th, 2007

Here is a windows tip that may save you from re-installing games in case of a Windows meltdown. Simply, make it a rule to install all the games on a separate partition. I started doing that a while ago because of shrinking disk space on my C: drive. After my HD died I thought I would clean out some space and delete all these game folders. But before I did that I started randomly clicking their executables to see if they would still work. Remarkable number did.

Of course you may lose your configuration settings and saved games. This is especially true for some games that keep their data in the Application Data folder (as they should). But if you have your user profile backed up (as you should), restoring this stuff should not be an issue.

In general, anything that does not use some sort of abusive copy protection like Steam, Starforce, SecuRom and etc will work. The games that won’t work, sometimes will ship with a small setup executable in their root folder which can be run to install required registry entries and/or associated mallware. You should probably look for files named like setup.exe and etc.

This of course may work for other applications as well. But you are probably better off reinstalling some of your utilities and application suites to get back correct file associations, shell extensions and etc.

Firefox: Web Page Printing Problems

Monday, August 27th, 2007

I had a page recently that would just not print properly in Firefox, even though IE 6 and 7 were printing it correctly. When I went to print-preview FF would tell me that there are 3-4 pages of content to be printed. However once you send the page to the printer, only a single sheet of paper would come out, with some overlapped text on the bottom. It took me a while to figure out what was happening. It turns out that FF doesn’t like absolute positioning. In my CSS I had something like:

#sidebar {
	position: absolute;
	width: 200px;
}
 
#content {
	margin-left: 200px;
	float: left;
}

The content was a big div that essentially held all the text that was to be printed. In my print.css style sheet I decided to hide the sidebar like this:

#sidebar {
	display: none;
	visibility: hidden;
}

Apparently this was not enough. I tweaked the CCS for a little bit and came up with the following solution:

#sidebar {
	position: static;
	display: none;
	visibility: hidden;
}
 
#content {
	position: static;
}

For some reason, when I only specified static positioning for the sidebar, it would still print everything on a single page. So if you are getting similar problem, explicitly define all the elements you want to print as having a static positioning. Absolute positioning of even a single element will mess up printing for all the other non-top-level elements on the page for some reason.

Random Sunday Mix

Sunday, August 26th, 2007

Here is some more craziness for the random Sunday mix:

  • Evil Monkeys Raep Kenyan Villagers - best story evar. Apparently a horde of super monkeys is sexually abusing Kenyan villagers, and stealing their food. I don’t care if it’s true, because it is awesome! Evil Raep Monkeys FTW!
  • Communist China outlaws reincarnation - ah, the bizarre absurdities of a communist regime. Remember kids - living in a communist country is like playing Paranoia - just more real, and you don’t get to create a new character when you die.
  • There is a gaping hole in my universe - scientists discover a gaping hole devoid of all matter or anti-matter. What is in there? No one knows. My guess is that someone divided by zero, or measured the exact weight of the Higgs boson over there.
  • Baloon Tower Defense - (flash game) combines the best parts of the ballon game and tower defense!
  • Paint-ball Game - (flash game) paint lines to lead the ball to the target
  • Dots Game - (flash game) same game as this, but done in flash.

Enjoy!

Superbad

Saturday, August 25th, 2007

It’s Saturday, so it means it’s time for a review! This time it’s not anime though so don’t run away. mrgreen

Superbad

Funniest movie of the summer

I went to see Superbad with high expectations. It was highly recommended, highly rated, and everyone was raving about it for like a week now. This is usually a recipe for disappointment, as few movies ever live up to the hype that surrounds them. But it wasn’t. Surprisingly Superbad was as funny as everyone was making it to be. So let me join the chorus of voices saying: if you haven’t seen the movie yet, go see it today. You are missing out.

Superbad

This is one of these movies that you probably should see twice or three times because you are laughing so hard missing half of the lines. A lot of the humor in this movie is delivered via the snappy, witty profanity filled dialog. It is reminiscent of the “40 Year Old Virgin” style irreverent banter but more filthy, absurd and overflowing with clever, and very graphic and often innovative one liners, and expressions. All the actors deliver these lines with impeccable timing.

Superbad

Michael Crea - of the Arrested Development fame (and most recognizable of the 3 protagonists) is funny, but he was almost upstaged by his co-stars Jonah Hill and Christopher Mintz-Plasse. Crea is essentially playing his old character, George Michael again but this time less quirky, and more normal in a way. He is funniest when playing a straight man to Hills’s irreverent, sex obsessed, filthy mouthed performance. Mintz-Plasse on the other hand, generates pure awesomeness when paired up with the misfit cops played by Seth Rogen and Bill Hader. In fact, McLovin is now an internet meme. Or so I’ve heard at least.

McLovin

Don’t think this movie is just a gag reel, or a stream of loosely connected dialog based skits. The plot, while not very complicated is tightly scripted and delivers a lot of situational comedy as well. The story essentially follows the characters of Crea, Hill and Mintz-Plasse - high school geeks, who try to get to buy booze and get to the only house party they were ever invited too - and possibly their only chance to get laid before college. Unfortunately at every step something goes wrong - and they end up having series of misadventures leading them to weird and unexpected places. Sounds familiar? Yes, this is an old and tried setup - but in Superbad it was executed flawlessly.

Superbad

How do you describe the humor of this movie? I think writers Seth Rogen and Evan Goldberg are making their own unique brand here. Take the general theme and topic matter from the first American Pie, throw in some dorky awkwardness of Napoleon Dynamite caliber, mix it with the 40 Year old Virgin style of delivery and a lot of original humor and you get Superbad.

Superbad

I truly think that this is the new cult summer high school teen movie. Superbad is the new American Pie - as filthy, irreverent and goofy, and equally as funny. And possibly even hitting closer to home, because while the characters of American Pie were all moderately popular and liked, the protagonists of Superbad are all miserable dorks. And let’s face it - most of us were probably friends with a “McLovin” rather than with a “Stiffler” back in high school.

My rating: 5.0 stars
*****

Seriously, go see that movie! I haven’t LOL’d so hard in ages.

Biggest Regex In The Word

Friday, August 24th, 2007

There are two common pattern matching problems that appear simple on the surface, but are very complex if you think about them. These are matching emails and URI’s in free form text. Everyone wrote a URL or an email validation script at one point or another. And I’m willing to bet that 90% of these validation scripts out there are just plain wrong.

The URI matching problem was definitively solved sometime in 1999 by a perl script that generated the ultimate regex to catch all legal URI’s as specified in RFC’s. What is the end result?

Here it is in all of it’s unholy, unreadable glory: the 7.4Kb regex of doom. It appears that you need exactly 7579 characters to pattern match every possible legal url out there. Or possibly even more because this one doesn’t actually account for https:// addresses. And you thought this was an easy issue that could be solved by a one liner. Shame on you!

In all fairness, how often do we really need the regex of doom though? In most cases (not all mind you) something as simple as “give me all strings that start with http:// and are delimited by spaces on both sides” will work almost as well, and probably much faster.

Let’s face it. Who wants to have something like that sitting in their codebase? You can’t read it, you can’t verify that it works via code inspection, and generating the regex from scratch using the perl script included on the linked page, is probably the only way you can maintain it. Trying to modify it by hand is just asking for a one way trip to Painsville, NJ (that’s the fabled fictional town that invated brain pain if you didn’t know).

via GDR

Mount Remote Drives on KDE Startup With a Zenity Dialog

Thursday, August 23rd, 2007

I use Kubuntu on my laptop. I noticed that wherever I go, I usually end up mounting some windows shares or remote drives. I have 5 or 6 entries in fstab but I don’t have them auto mounting at startup. Why? Because it’s a laptop. Sometimes I use it at home, sometimes I use it at school, and sometimes I use it at work. And depending on where I am at the moment different drives need to be mounted.

Most of the time these shares will get mounted as I access them with KDE apps (thank you kio slaves!) but some of my perl scripts require this or that share to be mounted to run. And I habitually forget to mount stuff every morning, and don’t realize it until some cron job starts spewing errors. So I wrote myself a simple script that will prompt me to mount my drives at startup. I used zenity to create a nice looking GUI dialog:

#!/bin/bash
 
l=$(cat ~/.mountme | xargs)
input=$(zenity --list --checklist --column "Mount" --column "FS" $l --separator=" ")
 
retval=$?
 
case $retval in
	0)
		array=($input)
		for i in ${array[@]}; do mount $i; done
		;;
	1)
		exit;;
esac

The scrupt makes some assumptions. First one is that you have file called .mountme in your home directory. This file should contain annotated list of all the filesy stems you want to show up in your dialog box. Mine looks like this:

TRUE //dc01/Public
TRUE //dc01/Private/maciak
FALSE //dc02/Share
FALSE //elrond/Share
FALSE //eoran/Shared
FALSE //grendel/Share

Each line should consist of two words. First word should be a TRUE/FALSE statement. Each line annotated with TRUE will show up as pre-checked in the zenity dialog. Lines annotated with FALSE will be un-checked.

The second word on the line should be the actual path to the remote file system you want to mount, as it appears in your fstab. Each line has to have a corresponding fstab entry. Finally, watch out for spaces in the paths - they will break stuff.

The script will read in this file, flatten it out using xargs and pass it to zenity as one of the arguments. It will produce a dialog like this:

Zenity Mount Script

The output of zenity will be a space separated lists of paths to be mounted. I plugged it into array and then use a loop to mount each of them in succession.

The only thing left was to make this dialog appear every time I log into KDE. To do this you have to create a small .desktop file in your ~/.kde/Autostart/ directory. I called mine remotemount.desktop:

[Desktop Entry]
Exec=~/bin/remotemount
Name=RemoteMount
Type=Application
X-KDE-StartupNotify=false
X-KDE-autostart-phase=2

The Exec line is the important one. It specifies the path to your script. I have it in ~/bin. The two X-KDE-autostart-phase variable tells KDE to wait until everything else loads before launching this app. It doesn’t really make sense to have this dialog pop-up before for example my Kmail and assorted apps like Kgpg and etc…

Is this a perfect solution? Of course not, but it works. Why don’t I parse the fstab directly? I could but it would mean more scripting. I like to keep things simple.


Bad Behavior has blocked access attempts in the last 7 days.