I downloaded Zend Studio today and gave it a whirl. I’m not sure why I hadn’t been using it all along to hack out PHP. I was skrewin around with GD. I didn’t realy accomplished anything beyond realizing how cool Zend Studio is.
It’s supposed to tell you your os, browser, and ip with an adjustable header/title thing. I didn’t put simple translations for all the HTTP_USER_AGENT strings, just a couple.
usage: http://www.haqur.com/script/SpyPanel/?header=insert_text_here

It’d be cool to throw together a script that creates those ticker banners like Sue has at the header of her blog.
Try my script to make your own spypanel box thing.
The huge downfall of scripting languages (for me) is that they require every computer they are run on to have the interpreter installed or I have to jump through a hundred loops to get the script to compile as an executable. For that reason (and because I have two weeks of downtime now) I am porting as many of my scripts as I can over to C/C++. I just spent the last 4 hours (I know, I’m lame) hacking together the most frequently used script. *drum role please* Here it is.
GEMS File Rearranging Script.
What it does: In all simplicity it just moves and renames files. We have to produce audio for the blind people who vote on the touch screen voting equipment. It’s easiest for us to label it like so:
R10.wav — the race audio w/10 being the race ID number.
R10_10.wav – the first candidate w/10 being the candidate ID number.
R10_20.wav – the second candidate w/20 being the candidate ID number.
This allows us to keep everything in order and burn audio CD’s to ship to our customers so they can proof the audio for pronunciation and whatnot. All in all having everything ordered like that just makes our life 100x easier. The script which was initially 15 lines of PHP simply rearranged all the audio so GEMS (the proprietary software used to program the machines for the election) could import the audio. It goes a little something like this:
R10.wav – stays the same.
R10_10.wav – this gets changed to 10.wav and gets placed in the newly created folder 10. The folder represents the race id number and the filename within it represents the candidate ID.
R10_20.wav – this gets changed to 20.wav and gets placed in folder “10”. And so on.
Here is the source code.
Here is the binary compiled by Bloodshed Dev-C++.
I’m far from a C coder so don’t be too much of an asshole if you see how bad my code is. Some constructive criticism would be nice though. I know I completely slaughtered the source but it’s cool to have an interperter independant executable. If you are good at C/C++ I would realy enjoy seeing how your source code for this would work.
One script down.. A whole shitload to go.
I’m sick of having defined categories for Purleydreaming. Having anything ‘fixed’ is always a bottleneck so I want to jump on the ‘tag’ bandwagon. The actual code behind moving the literature website from categories to tags is easy enough. It’s quite straight forward. I’m having problems figuring out how to layout the database so it works as efficient as possible. My first thought was to just ad a ‘tags’ field to each submission to PD thus implementing tags. That of course wouldn’t work very well when you wanted to make a tag cloud representing the most popular tags. Ontop of adding all the tags in an extra field on the submitted works table I could just make a ‘tags’ table that had the tag id, tag word, and the count updated every time someone submits something. That sounds alright but how do I work in searching and organizing by tags? That I supposed would be another table referencing tags to submissions. I can’t seem to think of a better way. I know there has to be a better way then that. How the heck do you setup your database to implement a tagging feature?
I could make it work with what I just explained but I believe there is a better way and since I’ve re-designed databases because I seriously f*cked them up from the start I’ve learned that’s not what I want to continue doing. Any pointers or suggestions would be greatly appreciated.
—- UPDATE —-
I ran across this site which explains a few tags database schemas and has essentially solved my initial question with a question of ‘which of these methods or DB schemas should I use’. I’m leaning more toward the Toxi solution. Seeing those schemas in some relation to delicious is calming. I’ll se how it works out for me.
I have to say that being able to script has to be one of the handiest skills I have. I spend a lot of time in front of a computer just ‘making shit happen’. There’s nothing cooler than running into a predicament working on a certain project and busting into the ‘scripts’ folder to finding a clearly labeled problem solver that I threw together some time earlier. I even enjoy noticing the amount of scripts I have growing. Or passing time browsing through old archives of scripts stored for absolutely no reason. I’m not a fan of losing even the least used scripts. Fuck a live Flickr frame, I need a frame demonstrating and describing the volumes of short scripts I’ve crapped out. Functional art?
“Oh fuckit, I’ll just make a script”
And never again manually repeat that task.
Purelydreaming has a little site-wide chat at the bottom of the page respectively called ‘The Commons’. It’s always been kinda lame so I hit it withi some AJAX using the MyBIC framework. It was amazingly easy to impliment. Mixing the AJAX base in with a teeeeny bit of extra Javascript made it pretty cool. It’s more like a ‘live’ chat now. I think it’s pretty spiffy. Note: the commons chat is for people who are logged in. heh. Removed the anon comments due to annoying people.
Ontop of that I added RSS feeds to peoples submissions. I don’t know why I didn’t do that any sooner. RSS feeds for people submitting their poetry, essays, short stories, etc only makes sense. I personaly enjoy the addition. I also have to work on RSS feeds into the journals and such.
Although I don’t write much in the way of stories or poetry anymore but I’m still quite proud of Purelydreaming.