Posts Tagged windows

Abusive and fun comments in source code

Posted by on Wednesday, 29 April, 2009

From time to time I have noticed you get some interesting comments in various programs. I thought I would share some of the more amusing comments I’ve found.

In http://code.google.com/p/xee/source/browse/trunk/XeePhotoshopLoader.m?spec=svn28&r=11 . Clearly a programmer whos had a bad day.

Change log

r11 by paracelsus on Sep 11, 2007 Diff
Photoshop loader is DONE for now, fuck you
Adobe

// At this point, I’d like to take a moment to speak to you about the Adobe PSD format.
// PSD is not a good format. PSD is not even a bad format. Calling it such would be an
// insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
// worked on this code for several weeks now, my hate for PSD has grown to a raging fire
// that burns with the fierce passion of a million suns.
// If there are two different ways of doing something, PSD will do both, in different
// places. It will then make up three more ways no sane human would think of, and do those
// too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide
// that *these* particular chunks should be aligned to four bytes, and that this alignement
// should *not* be included in the size? Other chunks in other places are either unaligned,
// or aligned with the alignment included in the size. Here, though, it is not included.
// Either one of these three behaviours would be fine. A sane format would pick one. PSD,
// of course, uses all three, and more.
// Trying to get data out of a PSD file is like trying to find something in the attic of
// your eccentric old uncle who died in a freak freshwater shark attack on his 58th
// birthday. That last detail may not be important for the purposes of the simile, but
// at this point I am spending a lot of time imagining amusing fates for the people
// responsible for this Rube Goldberg of a file format.
// Earlier, I tried to get a hold of the latest specs for the PSD file format. To do this,
// I had to apply to them for permission to apply to them to have them consider sending
// me this sacred tome. This would have involved faxing them a copy of some document or
// other, probably signed in blood. I can only imagine that they make this process so
// difficult because they are intensely ashamed of having created this abomination. I
// was naturally not gullible enough to go through with this procedure, but if I had done
// so, I would have printed out every single page of the spec, and set them all on fire.
// Were it within my power, I would gather every single copy of those specs, and launch
// them on a spaceship directly into the sun.
//
// PSD is not my favourite file format.

Heres another amusing one.

* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
* !!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

At the top of a particularly convoluted and otherwise completely uncommented code:
// Abandon all hope, ye who enter here.
In some PHP code for a webpage :

// Since this file is loaded on every page, and since
// I want the following function on every page, I’m going to
// cheat and include it here even though it has nothing to
// do with the other things in this file.
// If you don’t like it, bite me!

Seen, and believed…

[some long and messy code] # too drubnk to make this workkkkj. debugg latter.

The source code of PerlLanguage’s Net::IRC modules has numerous chunks of funny conversation from the #perl IRC channel in it. My favorite:

# — #perl was here! —
# Larry Wall is a lot sexier than Richard Stallman
# But I’ve heard Stallman is better in bed.
# Does he leave the halo on?
# * aether cocks her head at skrew…uh…whatever?
# Stallman’s beard is a sex magnet.
# Larry’s moustache is moreso, Fimm.
# oh yeah…women all over the world are hot for stallman….
# Moustaches make my heart melt.
# I dunno, there’s something about a man in hawaiian shirts…

Spotted this in the source code for one of the ApacheAnt tasks:

: /*
: * build notes
: * The reference CD to listen to while editing this file is
: * Underworld Everything, Everything
: * variable naming policy from Fowler’s refactoring book.
: */

/usr/src/linux is full of fun.

/*
** “seek and ye shall find”…praying never hurts either…
** ggg sacrafices another 710 to the computer gods.
*/

* These chips are basically fucked by design, and getting this driver
* to work on every motherboard design that uses this screwed chip seems
* bloody well impossible. However, we’re still trying.
* skb to avoid No=0 (choose one: Ugly [ ] Tasteless [ ] VMS [ ]).

For an illuminating experience, try grep -ir word /usr/src/linux, where word is one of the following: fuck, shit, damn, hack, kludge, “:-(“, “no idea”, awful, stupid, and of course XXX… I’m sure you can think of your own candidates.

One could probably make some significant contributions to the Linux codebase simply by doing this, then seeing if they can figure out how to fix the problem the coder was griping about. Hell, there are probably several Linux kernel hackers who do just that, though admittedly a lot of the problems are related to bizarre hardware or outside software which the system has to interface with, which the coders can do much about. Even so, it would probably be a useful thing to do. KiboDebugging??

* Found at the beginning of a loop that could run forever:
/* And now, ladies and gentlemen, the chord from HELL! */

* Found near a particularly nasty fix for a fencepost error:

/* There are dumber f**ks than me out there, but not many */

* Found near a piece of code that handled memory resizing, it made the new generation of neural nets inside the space for the previous failures. If it didn’t have to realloc at all the branch that executed was labeled:

/* These clothes are a little tight, but the price was right */

* Finally, there was an error message in some of a test code that said:

“Nostradamus told me this would happen. Smug bastard.”

Here are excerpts from some code found whilst doing an upgrade to a new server structure.

#include <wchar.h> //I hate strings.
#include <tchar.h> //I HATE STRINGS!!!
#include <string> //I HAT TEH STRINGES!!! DIE! DIEDIE! DIE!!!!!!

/// A class for interfacing dotnet code with (product)’s plugin API.
/// As you may have noticed, making .NET code work with API code is a
/// pain in the ass, because it never occurred to Microsoft that .NET code
/// might one day have to exist on the same computer as API code. As
/// unbelievable as it is, programmers need to have their non-.NET software
/// [use] functions that were written in managed code. So, to better the meet the
/// needs of their developers, Microsoft made the process as inconvienient
/// as they possibly could. Enjoy.

/// This function converts stuff from a .NET String to an LPTSTR.
/// May whoever decided it should be this complicated be required to
/// write it 20,000 times on a tiny whiteboard with perfect penmanship,
/// rot in jail for two years, then have to try clean it all off using
/// nothing but his own saliva and a toilet brush without getting any
/// ink on his gloves.

Found in a depracated .c file:

/* fit round peg into square hole, if necessary… */
/* well, actually any damn peg into whatever hole we have to work with… */
/* use (the) force, if necessary */


Applications for new users.

Posted by on Tuesday, 7 April, 2009

Often a lot of new users have used windows for several years before switching to linux and half the problem is that they have no idea what the equivalent program is to run. This document is a small idea just to get you started.

Media

I have done this one first because often the first thing i do when installing is want to play either a movie or mp3s.

Video

xine is good for divx vcd dvd and a few others I find , its to be great for most every day movies. Though it isnt that great for things like playlists. Best of all it has a nice gui to work with, and has similar keybindings to windows so doesnt confuse you as much.

Mplayer is a great player and plays even more formats than xine, however its gui isnt that great and its dependant on installing win32 codecs (which isnt that great a hassle). If in doubt i find it plays a lot of streaming formats that xine just doesnt handle. And at a pinch you can use its aalib plugin and play your movies in ascii in console!.

VLC is a less used and yet still good media player. I havnt used it as much but it appears to be quiet handy.

DVD

Ogle is pretty much the only DVD player that supports menus, and although other players play dvds I still prefer ogle for the job. Great gui, nice easy design and use.

MP3s

XMMS is Winamp basicly, Takes most of the themes (well at least the older ones anyway) and even used to be written by the same people (previously known as Linamp). Supports playlists, loading directories and most other usual things from an mp3 player. Great plugins and other options.

MPG123 Is a great console mp3 player, there are a fair few of them so I will limit myself to this one for now. You can use mp3blaster or cplay for playlist abilities in console.

WEB

Email

Evolution Is a great mail client, it looks and feels a lot like Outlook. Its got all the functionality of most decent email clients and looks great.

Kmail Is another great mail client. Good if you are using KDE. Has support for pretty much everything much like Evolution.

Mutt Is a console email program, supports threading and is apparently quiet good to use. I have personally never really used it, but it comes well recommended by many.

WWW

Firefox Is the web developers web browser of choice, its multi platform and works brilliantly. Its quick, and configureable.

Mozilla is a little more bulky and slower than firefox however it contains a great email client, web page composer and other great features. Its also multi platform.

Konqueror Is a lightweight browser and file manager that comes with KDE. Its great for quick opening and a lot of sites are easily viewd under it. It has its drawbacks when it comes to complex javascript or css based sites however.

Files

File Management

Konqueror Is a great file manager that comes with KDE. It can open ftp:// or files over ssh using fish:/ amoung tons of other helpful plugins (CVS via cervisia is also handy). Thumbnail displays and file previews are great.

Nautilus is a File manager that works better with Gnome. It Does pretty much everything Konqueror can do only it works better with gnome.

Chat

IMs

Kopete is a great IM manager, it does MSN, AIM, ICQ, Jabber, IRC, SMS, Yahoo, and Gadu Gadu (whatever that is). It has a nice look to it and it docks in KDE awesomely.

Gaim is the Gnome equivalent to Kopete, looks great and is easy to use for multiple networks.

AMSN is a great stand alone MSN client, very much like the windows one.

LICQ is a good stand alone ICQ client, very much like the windows one, with themes etc.

IRC

Xchat is a great gui IRC client, takes scripts of all sorts and very configureable. A popular choice for a lot of Linux users. Looks similar to mIRC.

Irssi is a popular choice for console based IRC. Though it does have a gui, its text version is by far better to use. Supports windows, themes, colours, etc and all the usual things.

WEB
Graphics

GIMP is pretty much the ONLY decent graphics program for editing and manipulations, Though it is very different to anything in windows in some respects. Its great to use once you are used to it.

Since this is more of an overview I have left a lot of applications out that are also very good. This is enough to get you started with the more commonly used software. Take the time to look at other applications and choose whichever suits you best. Everyone has different needs and requirements and there is plenty of software to go around and play with.

Liz Last-Modified: 2007-03-07 19:38:50