CSS Blows

It can’t center vertically without a hack. It can’t center horizontally. EMs don’t work. Things that line up in Firefox don’t line up in Internet Explorer. Things that hover in Safari don’t hover in Opera. Footers don’t stay at the bottom. IBM can spell its name with xenon atoms, but pixels can’t be controlled.

I call bullshit.

Leave a comment »

Error 500

Twitter and Blogger are farking slow. This is all I’ve got.

Leave a comment »

Possible Switch to Blogger

WordPress is waaaay too restrictive. Screw you guys, I’m going to mcandre.blogspot.com.

Comments (2) »


Foxmarks is good stuff. Sure, I use Del.icio.us and I’ve tried Ma.gnolia.com and Google Bookmarks and Google Browser Sync. But Delicious and other bookmarking services fail to include JavaScript bookmarklets or favelets. There was a need to sync mine between computers:

The bookmarks toolbar is a great idea. I use the left side for these tools and the right as a pool of temporary links. Foxmarks supports bookmarklets, syncing them between Firefox on Mac, Linux, and Windows. It fills this niche nicely. It’s not intended for publicizing links like Delicious, just storing and syncing for private use. Jimmy, this is for you! Convince Flock to incorporate it.

Leave a comment »

A Phenomenal Grasp of Grammar and a Superlative Command of Syntax

Sure, I’m only in my second year at George Mason for my Computer Science degree. But I’ve seen Java, I’ve seen Lua, I’ve seen C and Lisp and JavaScript (yes, that one is a programming language, too). At this time, I have decided to flout convention and talk about a syntax in general for an object oriented language. Call it Floop. Call it EEzle. I don’t care. It represents what I have come to like and dislike in basic syntax of a few programming languages, most of them scripting (Python, Lua, Ruby).

Arrays and Hashes

Arrays in Python are great. You slice them up so:


And so on. Ruby uses colons for symbols, so it can only attempt this with its slice() method. This is also why Python’s simple dictionary syntax is not viable for Ruby.

some_python_dict={"bat":2, "cat":3, "dog":7}

some_ruby_hash={"bat"=>2, "cat"=>3, "dog"=>7}

Either one of these seems reasonable. Equals with greater-than creates a sort of arrow.

Lua is cool in that all its arrays are also hashes, indexed with integers:

lua_list={2, 3, 7}

lua_table={bat=2, cat=3, dog=7}

I would have all arrays really be hashes like Lua’s tables. How hard is performance hit? For those who haven’t seen Lua code, list indexes start at one, not zero! I’m down with that, though it does take a little while to get used to.

Python tuples to me are pointless. We might as well use lists. How hard is performance hit using dynamic lists instead of tuples? For all situations, lists can indeed be used instead of them. For example, passing arguments:

bat, cat, dog=(2, 3, 7)
bat, cat, dog=[2, 3, 7]

# the former is probably used by the Python parser to do:
bat, cat, dog=2, 3, 7

This isn’t going to turn into a Java-harping fest, but I do want to point out that ArrayLists are bitches. Even with Generics, it’s still a paint to quickly setup lists within lists like I would do with Lua/Python/Ruby


Lua’s default scope for every variable is global. This does make sense for game scripting, but if I were so inclined to write, say an HTML rendering engine, I would be compartmentalizing every variable in sight.

-- the following is global

-- the following is local
local x=5

My OO sense tells me to use “local” everywhere in Lua. Even in Perl:

my $x=5

Must. Keep. Things. Local. We’re not using BASIC, are we?

Another thing that trips me up, as I remain a newbie in several languages at once is accessing a module/class/instance variable/method/class method.

C has this:

int a=something->apples;

Perl has this:


And this:


C++ has this:


Python uses dots for everything (my choice):


I haven’t dug into Lua enough to learn about its ability to roll your own OO system, so I proceed with Ruby.

Ruby has this:

something.da() # yes, yes, I know the parenthases are uncessesary

And this:


And this:


What’s the difference? Please comment!

Cocoa’s API uses underscores like the developers are being paid by the character. _some_long_ass_method_that_starts_with_an_underscore(). There is a pattern that methods start with underscores if they take parameters. Bollocks. Nobody else does this, because it is stupid.

I believe that privacy for variables is pointless. It’s not really a security measure, as there are super super easy ways around the protections. In C++, you can overwrite the “private” keyword be declaring that “private” means “public.” And in Ruby, you can just define the class all over again with the “attr_accessor :some_var” method. Sure, you don’t want us programmers to screw up data in objects, but why give us monkeypatching on one hand and private data members with the other?

One of my projects was to recreate Liero in Python. I decided to make the weapons mod system simple. One way to make a new weapon quickly is to copy an old one, change the constants like THRUST and GRAVITY in the weapon .py file, and change the bitmap image. When the game loads the mod, the weapon class creates a new class with the same THRUST and GRAVITY constants. I thought they were class variables. No, they are not. I made the same mistake in Ruby, and realized that once one of these variables is changed in a subclass, the variable in a superclass is also changed. AAAAAH! Not good. There must be a way to make a tiny dynamic class for a weapon mod or user script or whatever, like but definitely not exactly this to be saved in WackWeapon.rb:

class WackWeapon

I’ve decided to instance_eval() my user scripts for Alchemy. Imagine that the class Recipe is already defined, and the following will be read into a new Recipe object:



def block(page)
page.links.reject! { |link| @whitelist.any? { |regex| link=~ regex } }

Instead of trying to load class variables, I just use instance variables. This setup does not allow a Recipe to extend another Recipe, though. Each must be made from scratch.

Core Library APIs

Python’s print() really ends up calling sys.out.write(). Java should add a print() that calls System.out.print(). That way, Java’s HelloWorld wouldn’t look like hell. public static void main(String[] args)? STFU.

I hate forcing paramater or return types anyway. I’m using this object to do what I want, now that object. I can’t waste my time telling the language which object I’m going to use. Screw that. I’ll use common sense plus comments plus the documentation to specify the paramater and return types, and nowhere else. The only caveat is overloading functions. Without specifying parameter types, there’s no way to actually do this. The first solution that comes to mind in Python is to make little functions that convert several types into the intended type:

# takes float
def do_thing(x):
if isinstance(x, list): _do_thing_list(x)
elif isinstance(x, int) _do_thing_int(x)
else: print x

# takes list
def _do_thing_list(x):
for e in x: do_thing(x)

# takes int
def _do_thing_int(x)

Thanks WordPress for making sure I can never properly display Python code blocks. Every attempt to insert spaces and tabs is thwarted.

Anyway, you can see some of the problems with trying to use the same syntax with different languages. Hopefully, purpose, then style demands the syntax of a language, rather than my biased and unlearned expectations of what a language should look like. I winced at snippets of Ruby code, and some things that still bother me will be resolved in future versions (Ruby’s getting real Char#ord, Int#chr, String#[i], and hopefully String#each_byte and String#bytes methods). Like tuples and lists, there always seems to be multiple ways to do the exact same thing. Should I use curly braces or do/end? I pick curly braces because they stand out against the otherwise largely alphabetic code. I can’t think of anything to use for block arguments besides pipes (|’s). When I do, Matz is going to hear from me!

One pitfall: In Python, “or” does the same thing as the old ||. “and” does the same thing as &&. But in Ruby, these cannot be used interchangeably. Statements that choose some value or nil must be phrased, “some_value || nil”. Trying to replace || with “or” will raise an error.


Which brings up another point. Are things Errors or Exceptions? Be consistent. Among other things that were actually very surprising in Ruby are IO errors, which form some sort of error code rather than an actual Exception class. I guess any object can be raised, even stupid Errno:ENOENT’s.

Leave a comment »

Website of the day: Access Firefox

Access Firefox is very cool. The website is maintained by Ken Saunders, who is legally blind. He is able to enjoy the web thanks to wonderful accessibility support in Firefox.

The site links to large and high contrast themes, as well as extensions that can read text out loud, mouse gestures, and web developer tools that can customize web pages for super easy viewing.

Metal Lion 300 is a cool theme that can bundle with the Metal Lion HiViz Sidebar, a tool to tweak how text is displayed.


There’s also the big ass theme Kempelton Large.

I just had to try it out. And that made me look for other large themes.

Comments (1) »

Ubuntu 7.10 Gutsy Gibbon on an Intel MacBook

Ubuntu 7.10 is good stuff. The new version is faster, more stable, polished, and even a little too sparkly. There’s a burn animation for tooltips!

Getting my Mac ready for the install was easy. Leonardo pointed out Ubuntu’s MacBook guide, which is very helpful. I used rEFIt as a boot manager. It’s graphical and already has icons for Mac OS, Windows, and Linux. To install that, I just ran the DMG.

After that, GParted was able to steal some gigs from my Mac partition to make room for Linux. That part actually took a couple hours, so don’t be surprised if the screen doesn’t change for quite a while. After chopping up the hard drive, I was still able to successfully boot back into Mac OS, and nothing was missing or corrupted.

The live CD is a fully functional version of Ubuntu that runs straight from the CD drive–no modifications are made to the hard drive until you decide to install it.

During the installation process I chose to install onto the “largest continuous free space.” This is the space left over from partitioning with GParted. After a reboot, my Mac partition is still great and I can now boot Ubuntu Linux.

The few things that didn’t work correctly had tutorials for fixing:

A good place to start looking if you have any problems is the Community Ubuntu Documentation.

MP3s and other audio/video formats may not legally be included with Ubuntu. Therefore, you must install codecs (via the documentation) and for Real media (*.rm, *.ram, etc.) I had to install RealPlayer.

I ended up picking the Crux theme:

It’s cool. For games I chose AssaultCube and Wormux. Hey, Wormux developers! I found a bug. If you eliminate all but one guy on each team, then use one of them to kamikaze the other, the game doesn’t end in a draw. It hangs.

There’s a free equivalent to many non-free programs you use. Some are available for Windows and Macintosh. Find them or roll your own, that’s the Linux way.

Update: I now have a dock, kind of like Mac’s: the Avant Window Navigator.

Its animations are slow and the icons lose their sharpness for some reason, but some cool applets for it will become available soon.

I once dimmed my screen. Although I have since brightened my screen, every time I restart Ubuntu, my brightness level is reset to the lowest one. Bug report here.

Yes, vi and emacs are good. I do prefer a GUI, though. gedit does fine. I can’t say the same for Scribes, since Scribes has one window for every open file. Kate is fine, but only has one look, and like many of these editors, can’t open up a folder recursively. Even when they do, they try to open up files in the hidden .svn folder. It’s so easy to do this the smart way. I’m sticking to gedit for the time being.

Gah, mouse all over the place! Ubuntu doesn’t fine tune the mouse like Mac OS does. Every third word doesn’t appear correctly in my blog editor. A brush of touchpad can send the cursor to Mars or scroll down. The disable-trackpad-for-two-seconds-after-each-key-press trick does not really fix this problem.

Note: The WordPress editor doesn’t perform Undo correctly in Firefox on Ubuntu. I had three more screenshots in this post that were deleted when Control+Z caused all of them to disappear, and Redo did nothing. I don’t know who to blame on this one.

Again, there’s a problem with running Digital Paintball on anything but Windows. Yes, there is a Qudos installer. It needs to update to build019 already. And dang it, I’m a noob at compiling full-fledged applications for Mac OS. Someone needs to donate a MacBook to the dev team with specific instructions. “This device is to be used only for developing Digital Paintball for Macintosh computers.”

One more thing: Screenshot doesn’t include the window border when CompizBeryl flashy animations are running.

This just in: It looks like the Samba problems have cleared up! Now they install.

Comments (5) »


Get every new post delivered to your Inbox.