About: I am a digital artist and computer geek with interests in Linux, open source design programs, and saving the world. You will find me blogging here about art, life, technology, and other mildly amusing things. More »

Archive for the “Programming” Category

Front Page Realign

I did a considerable realign of the chromakode.com front page today while chilling online with Whatah. We both decided out of the blue to redesign our websites, and after hours of tinkering, we both managed to overhaul them in an afternoon. There’s all sorts of new delicious markup-y goodness for you and your web browser to enjoy, as well as huge bandwidth wasting backgrounds a-plenty.

I decided to be a little bit risky this time and do some subtle transparency over large swaths of the layout… it shall be interesting to see the browser compatibility fallout from this one (I laugh at how badly this breaks now in IE) . Here’s a screenshot of it on my desktop for your comparison/reference. Also, here’s the original mockup I made when first envisioning the design. All in all, I’m really happy about the update. The typography is something I fussed with the most on this, and I finally feel like I can be satisfied with the lettering looking good on-screen. Yay! Well, I’m excited and exhausted.

The most evil python script you will likely ever encounter.

A little while ago I told Whatah about a little obfuscated Python toy I had hatched together about a year before. Unfortunately, this hack was extremely version-dependent, so when I brought up the code (from the era of 2.3) to send to him, of course it did not work with Python 2.4. Well, I wanted it to work. So I got to tinkering again and this evening, with Whatah’s help, we have made this little critter much much more evil. Consider it a programming puzzle, a riddle written in Python. There shall be no hints, though if you are willing to run code before knowing fully what it does, you are a braver fiddler than I…

# Abandon all hope, ye who enter here
_=lambda _, __:getattr(_.__dict__, "values")()[__];__=__builtins__;___ =['\'<BZh91AY&SY', 'e3', '93', 'd9', 'e6', '00', '00', '12', '9f', '80pe', '00', '08', '08@@\\n.g', 'dc', 'a0 ', '00P', 'a0', '00h', '00', '00j', "9bS&\\'", 'a9', 'a7', 'a9', '906SH-f', 'c1', 'f6', '8cS', '12', 'a9', 'ad', 'c1', '08', 'ee_', '0b', 'd9d', 'c1', '17', 'd7', '93', 'bc', '9e', 'ceI', 'c0', '1a', '87guj', '0cc', 'aadF', '18', 'ec', '89', '12', 'fc]', 'c9', '14', 'e1BC', '8eOg', '983\''];_one = _(_(__, 92), 46);_1=lambda ___:_(__, 96)(___);_2=lambda ___: _one('', ___);_3=lambda ___:_(__, 112)(_(__, 0111+2), ___);_4=(98, 122, 50);_24=_1(_2(_3(_4)));_6=lambda __:_(_24, 4)(__);exec _6(eval(_one(r'\x', ___))[1:-1:1])

Lots of improvements to the “Story Game”

Enter the story game.

The latter part of this weekend and memorial day were spent debugging the PHP/Ajax story game I wrote about earlier. Why all this debugging you may ask? Well, as insta had put it, I dove in way too fast. I decided that I should move everything over to MySQL and custom database session management. This promptly led me to the brink of insanity and nearly giving up the project entirely. Well, while I have gone insane, I didn’t give up, and sure enough - last night I actually got it working.

Yay! This switch to a database backend has given me the control I needed to implement some new ideas from the past week. After some more MySQL tinkering, and throwing in some JSON magic to pack several variables into one refresh request, things are actually starting to look pretty cool.

Learning a little AJAX

Today was spent experimenting with something I’ve intended to for a long time: PHP and AJAX. I finally bit the bullet and started learning it in earnest.

This morning was spent searching for a suitable PHP toolkit to tinker with. The one I finally arrived at is the SAJAX toolkit, a moderately minimal framework for creating simple callbacks and recievers without having to go through the nitty-gritty of the lower-level XMLHttpRequest APIs. After playing around with it for a while, I really like it. There are some things that are quite confusing to me as a first time user, such as the asynchronous nature of things and the effects on variable scope - but all in all it’s quite a nice system to play with.

I also discovered a quite wonderful little Firefox extension called FireBug. It has to be the most clean and cleverly put together all-purpose debugger I’ve ever seen. It’s very beautifully designed, too. It looks to be extremely useful in debugging javascript, css, and xhtml source in the future. It sure helped me out debugging XMLHttpRequests today!

An exercise in spontaneous javascript coding.

Whee! Somehow, tonight became an exercise in spontaneous javascript coding.

I was just hanging out early this evening when my good friend Insta popped up and said hello. I showed him a little error page I had been working on, and our conversation rapidly spiraled into a rather random little javascript idea of his that would make a “hella cool” error page. Well, I thought it was pretty hella cool too, so I proposed that we write it. He gave me a few starting pointers, and after a little while I was blindly blazing away at this language I had never seriously used before. Well, one thing led to another, and it turned out I would be spending the next several hours going from nearly nothing to DOM access in javascript to pull off this little effect.

Why I consider CSS to be a horrible design language.

Writing CSS (CSS2) never ceases to amaze me. Whether it’s tweaking this blog, trying to re-theme a php app, or simply experimenting in the Web Developer Extension, I am always struck by how difficult and confusing it is to try to implement very simple design patterns.

Be it centering objects, making layouts use the maximum amount of space, or simply trying to use floats properly, I am always amazed by how seemingly obvious code does not work the way I should think it does. It seems rather silly to me that such a language would be designed such that web designers must resort to specialized recipes to deal with seemingly simple and common page layout designs. While powerful, CSS seems to become more and more a search for hacks and snippets to make many designs possible. Browser support is also an elusive and secretive gem; unless explicitly stated, what works in one browser will probably at some point fail mysteriously in another.

Powered by WordPress :: Plugins Used :: I believe in modern browsers.