Tuesday, November 13, 2007

Windows Error


I had used vncviewer to test things out on a shared windows box. I came back to my desk to find this beauty on the screen.

Sunday, November 11, 2007

IE6 Menu List Item Spacing Nightmare SOLVED (border-top)

So I was working on a new menu system for Dishola.com yesterday. Typically, I get everything looking great in Firefox, and then spot check in IE so that I can begin the torture.

And there it is, the well-documented IE6 LI spacing bug, staring me in the face.


Though, just recently I'd made up an example list item menu and it didn't have this problem, so I wondered WTF. I began researching and came across this gem of a solution (http://www.alistapart.com/articles/multicolumnlists) from A List Apart, and many other sites echoed this as the way to fix things. So I selected the text block and removed lines, and lo and behold, it works. But goddamn, why? And why was my simple example not exhibiting this behavior?

So I went, line by line, trying to figure out how to cause this bug. Trying to find the thing that would trigger the rendering problem. I was just sure it had to be some weird character my editor was inserting, or maybe when I saved the file, I was causing it unwittingly. But no, it all comes down to the fact that I was using border-top to try and get some nice bordering.

Here's the relevant CSS:
#navbar li ul li {
float: none;
border-top: 1px solid #ccc; /* BLIMEY, IT'S YOU - BASTARD! */
}


Simply changing that border-top to border-bottom, or removing it entirely, fixes the IE6 render issue. Not very intuitive eh? Try looking at this page in IE 6 and you'll see what I mean.


Good (no border-top)




Bad (w/ border-top)


Wednesday, November 7, 2007

Frameworks and Helpers

I've been recently refactoring and adding new features to Dishola.com and started off taking greater advantage of CakePHP's Form helper object. But here's the rub, and this applies to all framework objects, the more advantage you take of these things at the markup level, the less your presentation layer is separable from your controller logic. And of course, helper code generally has its own quirks for handling customizations that don't fit the mold, so now you're programming your presentation layer in another language other than markup. Sometimes you want a small bit of text after the label, sometimes after the input, so you tweak things in the helper code, but now you've got this spaghetti of stuff that's in some ways handy and also language-binding for your webapp.
I'm always pondering switching languages, or rather, the ability to. I don't want to be owned by my language or my framework. In theory, great full-stack framework webapps should be easily rewritten into one another without too much work at the controller(business logic) level. So why muck that up by leaning on your framework to help with your presentation? Sure it aids rapid development, but at the cost of making you your framework's bitch.

Sunday, October 28, 2007

Gimp Release Candidate Adds The Best Feature Ever


For the longest time, my main gripe with the gimp has been with the inflexibility of the select box. Before, you had to slowly drag the mouse, watching the width/height coordinates and let go at just the right time to get a box of a particular size. I'm sure there's a plugin script out there somewhere that could readjust the box, but I tried to find one, and write one, without luck.

Today, I got rid of the the gimpshop package on my ubuntu laptop (kept crashing on select) and low and behold, I see a Gimp Release Candidate with a beautiful gimp-balloon logo. And check out the flexibility of the box select now. I am so happy! Gimp users of the world rejoice at this awesomeness!

Tuesday, October 23, 2007

Fonts in gutsy, boldness in Firefox, etc.. redux

http://linux-blog.org/index.php?/archives/227-KDE-and-Xorg,-Fonts-and-DPI.html

Reading this article, which corresponded nicely to my Thinkpad T60p's screen, and adding that one line to my xorg.conf, basically fixed the suckiness of fonts I've since experienced after upgrading to gutsy.

Yay for obscurity!

Monday, October 8, 2007

Running a site on a Virtual Private Server with LAMP

Thought I'd jot a few notes on my experience running a site (www.dishola.com) on a VPS.

My single biggest problem has been monitoring memory usage. VPSen throttle you on a) bandwidth, b) disk space, c) CPU, and d) memory. The first three are usually quite easy to monitor on graphs and also, I've found, hard to over-consume. Disk space is probably the easiest one of the bunch to off-site, via S3 and others. But memory. Man. Every so often I'll get pegged with a burst of traffic and apache sucks up that last bit of memory, and then wham - the VPS kernel starts trying to kill things - apache, mysql, etc.. but it doesn't work. Even when the traffic looks like it's come down again, the memory situation is still "stuck". Fortunately, because of Xen and GPLHost's awesome technology, it's real easy - and seems safe - to recycle the machine and then all is normal again. Granted, I'm running a memory-needy webapp on 256MB of RAM. I wish one of these folks (GPLHost, slicehost, etc.. ) would offer VPS where I could buy the pieces of the puzzle I need in increments. I think I could easily buy up more RAM and give back disk and CPU. Oh well.

Wednesday, September 26, 2007

Vesa Driver on the T60p (aka the hell of fglrx)

So, I'll admit I like to futz with the software on my machine. If I didn't things probably would work more reliably. But I'm an admitted linux nerd, and like most of this kind, I am a tinkerer. I've been running linux as a workstation for 8 years. I have tried every window manager there is. blah blah blah.

So I upgraded my Ubuntu feisty system to gutsy - primarily because I wanted some crypto support. Things were going pretty well during my piecemeal aptitude installs. I don't do wholesale upgrades to unstable anymore - I've learned that much. Anyhow, so I upgraded xorg, rebooted and shocker! - X failed to start. A nice ncurses window tells you nicely that X didn't start, and then drops you to a TTY.

So I log in, and since I've had generally torturous experiences before with the Ubuntu-shipped fglrx drivers (fglrxinfo showing Mesa, things generally sucking...) I ran the ati-driver-installer-8.39.4-x86.x86_64.run to install ATI's (which was working fine before I'd upgraded xorg). So I fire up gdm, and KAAABLAAM - backlit screen of death.

The keyboard seems to be working though - my function actions generally seem ok (screen dimmer, that dumb little keyboard light that makes the ThinkPad seem like a Neanderthal compared to the Mac, etc..). But I can't Ctrl-Alt-F1 to a TTY. Crap. Ctrl-Alt-Delete works apparently, as I'm suddenly rebooting.

Say hello to the automatic starting of X/crashing of X (and rendering useless of this laptop). Seriously frustrating. I try logging in during that brief window of time before X starts and killing gdm as fast as I can about three times. Impossible. So I boot into single user mode via grub. It asks me for the root password for maintenance. FUCK. I do not know root; I have been religiously using sudo.

I close the lid very hard and grit my teeth. I am seriously pissed now.

init=/bin/sh is your friend (Ilya's mine, as he helped me on the busride home). "mount - o remount,rw /" works, and I remove the rc2.d symlink that's starting gdm and ruining my night. I boot up, and run the /usr/share/ati/fglrx-uninstall.sh script that I can only find after running updatedb. It seems like it would be a handy thing to mention in the installer, or to make as a switch to the installer. It clears my xorg.conf file of all things fglrx. Hmm. I'd planned on just trying again with the Ubuntu fglrx. Ok, to hell with it, I'll start up with the "vesa" driver. Unfortunately, it put me in 1024 resolution at first and things looked crappy. So I manually added my 1450 resolution to the modes line, and although Xorg.0.log had said that mode wouldn't work, voila it does. Only someone who'd been in this realm of hell many times before would even have tried this.

Things look incredibly good with the latest vesa driver. International fonts have depth where they previously looked flat. My gnome-terminal is transparent. vmWare runs much faster. The icons in my window manager look crisper. I wasn't using anything that needed 3D before anyways, so if that's the only thing I'm missing, um - who cares?

Suspend works. I haven't owned a laptop running linux that worked with suspend since back in the days of apm. And at that time, the laptop I had needed ACPI in order to work at all. So I've never had suspend working on a laptop is what I'm saying. I am thrilled. I hadn't considered the vesa driver prior to - I'd tried the open source ati driver, but it doesn't work at all with the laptop chipset.

Maybe now that AMD has bought ATI, and pledged to give up the magic so that a working open source driver can be built, this situation will improve. I am not holding my breath though - for now I have vesa.