Search The Three — Bugs…

March 10th, 2007

If you’ve had a chance to check out my 48 hour search project from about 2-3 weeks ago (i don’t really remember, and i’m to lazy to double check, live with it…hehehe), you might have noticed that the results from Google and/or Windows Live Search isn’t always correct. And if you’ve used Internet Explorer to attempt to view the site, well shit, i haven’t even dared doing that cause of the fear! the fear man!

Anyway, jokes aside (or so you are lead to believe), the classes handling the results from the different search engines are far from perfect. The Yahoo class works alright cause of Yahoo’s extremely easy to use search API, but Google and Windows Live’s API’s are far greater pains in the ass to use…… Hence, i didn’t have time to implement them properly (48 hour side project and all, remember? ;) ), but i will be fixing it at some point soon… (hopefully before i mature enough to require reading glasses just to see my own hands)

As for Internet Explorer compatibility, it’s coming, with one or two or all UI elements removed since IE just doesn’t render PNG’s properly even with any and all available fixes (during the limited one page load test i conducted on a PNG heavy page with the fix and IE).

So if you’re lucky, there might be a TITLE tag left for IE users when i’m done removing incompatible elements ;) :D

And in other news, OMFG i want (need) a MacBook Pro :cry: !!! (anybody feel like donating their kidney (i’m seriously joking :P ))… zee ol’ PowerBook is just not fast enough to run itunes and toast my breakfast at the sametime anymore… darn advances and updates to technology!

over and out, hopefull you haven’t died from brain damage while reading my rant ;)

Last minute bugs which are missed are annoying, to say the least… well v0.9.1 had one, namely Alternative Glass variants all had the blue header, rather than the glass one the normal Glass variants have, but all fixed now :)

http://adiumxtras.com/index.php?a=xtras&xtra_id=3629

I’d just like to let everyone (2-3 people) who might visit here that i’ve created a promo code with my awesome host, namely Dreamhost. Their truely awesome for the price, and their support staff are great, i’ve always gotten a response back within an hour, at which point they’ve already gone ahead and fixed the issues at hand for me :)

Anyway, you will get a $20 discount if you enter ZHUOQE as the promo code when you signup. Also you will be helping out a broke web-developer cause i get some cash when you sign up ;)

Modern Bubbling 0.9.1

February 28th, 2007

Small update with an added feature, and the most critical bug fixed :)

Thanks to Tony Via who created a mod which added a header, i managed to squeeze a few hours aside in the middle of the night to work a bit on Modern Bubbling. I added Tony’s header with modifications, and another header style. I also fixed the custom font bug, or should i say, no-custom font, cause thats basically what it was, you were stuck with 11px Helvetica no matter what you picked in the message style preferences.

Anyway, enough talking, here it is:
http://adiumxtras.com/index.php?a=xtras&xtra_id=3629

hope you enjoy ;)

Mac OS X is an excellent web-development platform if you ask most (except if you ask Windows fanatics). It’s UNIX based, comes with Apache 1.3 pre-installed and ready to rock ‘n’ roll basically. But the default factory settings for Apache and more generally don’t fill all the requirements of the average web-developer, so you change settings, install this, install that, customize a few more things, and before long you’re not sure what you did and where sometimes. And this becomes a problem if/when it comes time to reinstall OSX on your little baby, or simply when your old baby is to old and ugly and you throw it out the window from the 4th floor head first in favor of a brand new and cute little baby. *evil grin*

Whatever the reason, it’s always a pain in the ass to reinstall a system, specially when you’ve installed and reconfigured a lot of background daemons and services. Hence I thought I’d share my method of configuration which makes it quite easy just lifting it all from one system to another.

What I’m gonna outline here is installing PHP 5, MySQL and additional tools, and reconfiguring apache the way I’ve done it.

So lets start by downloading PHP 5 for your system from here:
http://www.entropy.ch/software/macosx/php/

It’s a no brainer, just extract the tar.gz archive and double click the .pkg installer package and follow instructions. This will leave you with a working PHP install located in “/usr/local/php5/”.

Then lets move on to MySQL, download the package for your system here:
http://mysql.org/downloads/mysql/5.0.html#Mac_OS_X_(package_format)

Again, its an easy .pkg installation. Optionally, you can install the preference pane which is an easy way to start and stop MySQL. If you want the MySQL daemon to run at system startup, use the .pkg startup item installer, as the option in the preference pane doesn’t seem to work at all :P

The MySQL GUI Tools are very useful, and are available here:
http://mysql.org/downloads/gui-tools/5.0.html#OSX

As for Apache, there’s a few things to do, first of all you should make sure you’ve turned on “Personal Web Sharing” under the Sharing preference panel in System Preferences. Next we’re gonna add a single line to Apache’s configuration file. Use any text editor of your choice, to open “/etc/httpd/httpd.conf”, you can use the terminal based pico editor by running this in a terminal:

sudo pico /etc/httpd/httpd.conf

Then right at the bottom of the file, add the following on a new line (if you’re using pico, you can quickly scroll down using ctrl+v):

Include /Users/username/Library/httpd/*.conf

Obviously, make sure to replace “username” with your own username. The idea here is that we have apache automatically include all .conf files located in your own “~/Library/httpd/” folder.

Now, before we do anything else, I recommend you open your “~/Sites/” folder with the finder, create a new folder called “_public”, and move everything inside your Sites folder into the newly created _public folder. We’re gonna reconfigure your _public folder to be Apache’s root directory rather than “/Library/WebServer/Documents”.

Then open the “~/Library/” folder in your home folder, and create a folder named “httpd”, in there lets create “_main.conf”, and put this in it (the “Listen” settings you don’t really need unless you want them):

DocumentRoot “/Users/username/Sites/_public”
Listen 80
Listen 3000
Listen 8080

Again, replace “username” with your own username. Save the file, and run the following command in the terminal and enter your password when asked to relaunch Apache.

sudo apachectl graceful

Open http://localhost/ in a web browser, and you should see the contents of your own _public folder :)

Then you can continue to create an “aliases.conf”, “virtual_hosts.conf” and more in “~/Library/httpd/” and apache will automatically include them. This way, you only need to do a single modification to the bottom of httpd.conf on any new system aswell, and just place your config files in the correct dir, and you’re ready to rock ‘n’ roll ;)

What I’ve also done myself, is that I create virtual hosts for the different projects I’m working on. So lets say I’ve got a new project now called “Banjo”, then I would create “~/Sites/banjo/” and I’d create a virtual host entry in “virtual_hosts.conf” that looks like this:

<VirtualHost *:80>
   ServerName banjo
   DocumentRoot “/Users/username/Sites/banjo”
</VirtualHost>

Then I open “/etc/hosts” with a text editor, and I create a new entry which looks like this:

127.0.0.1 banjo

Once all is saved and done, I restart Apache with “sudo apachectl graceful”, open http://banjo/ in a web browser, and I’m all set to create another world dominating merciless enemy business killing machine of a site… Heh

Myself I’ve got phpMyAdmin installed in “~/Sites/_public/mysql/”, which makes it accessible at http://localhost/mysql/. Also, I have a virtual host configured, and a entry in the hosts file so I can also access from http://mysql/ :D

Then of course, I use TextMate, and I’ve got a TextMate project with all the Apache and PHP configuration files, which I can quickly open using Quicksilver by pressing cmd+space and typing “httpd” and pressing return cause the project file is called “httpd”. But the rest of my workflow is a story for another time ;)

I hope some of you have found this useful, saionara fili moy…

…so, here i am two days later after i felt like making some uber-combined search thing… lol… its uber-alpha/beta/omega/malaka/whatever, so don’t complain if it doesn’t work… lol

End result, its cool, but i’m far from happy with it, somewhat sloppy code, and the worst browser compatibility of any project i’ve ever done, Safari and Firefox should be alright, IE is outta question with all the png’s and shit i’m using in the design… lol

anyway, botton line, it works, thats the only reason its online, cause i’m a perfectionist at heart, and i’m not happy with it right now… but i don’t have anymore time to throw away on it right now… lol… not to mention, that it became kinda bloated and sluggish cause my design inspiration took a turn for the weird… lol

but but… check it out for yourself and see what you think…

http://www.searchthethree.com/

Exceptions… wiiee :D

February 7th, 2007

Ok, so this is gonna sound like i’m a complete n00b, but i’ve recently fallen in love with Exception handling in PHP5 :$ .

The reason why i never even looked at it before, is cause i’ve always strived for PHP4 compatibility, but with this latest project (more on it at a later date ;) ), PHP4 has gone out the window :D .

As for updates, not much, but i did recently upload a new quick PHP function to Code Yard. It’s called dir_exists(). It’s useful for checking if a directory exists, and if not, it will create it recursively, and return true or false. It works in PHP 4 and 5, in 4 it simply loops to create all required dirs since mkdir() doesn’t support the recursive argument.

Thats it for now, more updates soon, i’ve just been really busy the last few weeks with shit… GRRR

So, i’ve finally gotten off my ass, and submitted my first message style for Adium. The plan was to add a few more things to it before i released it, but that was 3 weeks ago, and i haven’t had time to work on it, so i decided to just release it in its current form cause its stable, works well, and looks nice :)

Check out Modern Bubbling here: http://adiumxtras.com/index.php?a=xtras&xtra_id=3629
Hope you like it :D

Digg it here: http://digg.com/design/Modern_Bubbling_a_most_excellent_Adium_message_style

parseCSV 0.2.0

January 1st, 2007

I have to get some real work done, that i can post about, cause this is starting to feel like i’m a broken record player just, cause all i’ve posted about lately is parseCSV{}… lol

Obviously having major hard drive problems haven’t helped :P

Anyway, i spent the most part of today updating parseCSV{}, finishing an automatic delimiter character detection, cause the original project i created it for, requires such a function. The reason being so users don’t really have to know what a delimiter character is, or which one the file their attempting to upload uses. Eitherway, its a very handy function, and hardly slows down the script at all.

The original reason i started working on it cause i realized some versions of MS Excel for Windows uses ; instead of , as a delimiter no matter which CSV option you choose. And the script was being used to upload that from Excel, which caused issues, so to simplify matters, some type of auto-detection was required…

The auto() function works by simply analyzing a specific number of rows (15 by default) from the beginning of the csv file/data, and eliminating characters that simply can’t be the delimiter cause it doesn’t exist on every row, or the the number of times a character appears in a row isn’t the same on all rows. Rarely will any other character than the actual delimiter get past this stage of elimination, but if more then one character does, the script goes on to further analyze details to choose which character is the most likely to be the delimiter.

Code Yard updates

December 16th, 2006

I just updated and added a few PHP scripts to Code Yard that might be useful for some :)

  • Updated and fixed some bugs in parseCSV{} and parseINI{}.
  • speedometer{} — Class for simplifying calculation of script execution time.
  • walkDir{} — Class for recursively getting a list of directory contents. It returns both a multi-dimentional array, and a plain array with full paths, both types of output are optional increase performance. The number of directory levels to walk down into is also configurable.
  • rfile() & wfile() — Functions for reading and writeing to local files. I wrote these about 3-4 years ago, and i’ve used them ever since, they’ve undergone some slight modifications since then, but their still basically the same. Their quite flexible, fast, and save a lot of time.
  • randpass() — Function with a quite self-explanatory name. Generates a random password of any desired length using the character ranges you specify. It can be made more flexible, but its perfect for most situations when you need to generate a random password.

Cleaning Up After SVN

December 12th, 2006

If you’re using SVN for keeping your source safe for web apps, you may notice uploading the working folder also uploads all those hidden .svn folders. Not ideal.

Here’s the shell command to delete all those .svn files from your working directory:

find -d "your/working/directory" -name ".svn" -exec rm -r '{}' ; -print

The -d flag (-depth) means the find command will “process each directory’s contents before the directory itself” so the rm (delete) command won’t complain it can’t find a file in the structure it just deleted.

(I am not responsible if this screws up your project, I assume if you’re a developer and you’re using SVN you *should* know what you’re doing. However, just in case you don’t, once you run this command you won’t be able to update your working copy, nor commit or anything else, so… [insert cautionary advice here])

I usually hit cmd+tab and then mouse over the app icon i’m looking for and let go to switch to that app; it’s faster than cmd+tab+tab+(repeat for every app open). I randomly (read: accidentally) scrolled with the mouse while while doing this once, and surprisingly, it scrolled through the app icons. :D

I had no idea it would work like this, nor have I read any thing that hinted to that behavior, but it seems really handy for people with multiple displays who like to use the cmd+tab/mouse app switch combo.

How do YOU switch? How does YOUR productivity workflow look? And finally, does anyone even use that “crazy delicious” formula meme anymore?

Code Yard and PHP CSV Parser

November 23rd, 2006

Today i’ve setup a new project, called Code Yard. All it really is, is a Subversion repository for me to collect all my small random pieces of code (classes, functions, etc.) which i reuse every now and then. It’s purpose is to let me more easily manage all the small pieces of code currently spread out a bit all over the place in old and current projects, and to allow others who might find my code useful, or just save them 5 minutes of work :)

And with that explained, the first piece of code i’ve added is a PHP class called parseCSV. I’ve recently written this class for a small project i’m working on, i was quite surprised to find that there was a quite lack of CSV support in PHP, and an even larger vacuum of 3rd party classes available that fully supports the most common types of CSV files.

Hence i wrote parseCSV to be fully compatible with the Wikipedia article available on the topic. Which also seems to be the exact CSV formatting MS Excel uses for example. I based my class on the processing concept of Ming Hong Ng’s CsvFileParser class.

SCPlugin r390, PowerPC Binary

November 17th, 2006

Download: [link removed, binary out of date and very buggy]

A lot of you probably use Subversion, and a quite useful little thing for OSX users is SCPlugin. Its a finder plugin which offers quite a lot of svn features directly in the finder. But its only available from source, or some quite outdated binaries, so I went about to build my own binary from the latest svn revision.

Personally I use SCPlugin solely for its small icon badges on files in the finder indicating their current status, which I find quite useful. As for actual svn actions, I mainly use svnX, which is a very nice, simple but yet advanced Subversion client. It gets rid of some of headache you can have using the shell command :)

Download the above file, extract “SCFinderPlugin.plugin”, place it in “~/Library/Contextual Menu Items” and relaunch finder. Its a PowerPC only build, since I’m not exactly an OSX developer, and building OSX apps ain’t something I really do, nor know much about…

So if you’re looking for an Intel binary, best i can do is refer you here: http://funkatron.com/wp/archives/os-x/binary-build-of-scplugin/

I would like to point out that I’m not fully sure how good this build works.
Myself I tested updating a working dir, which didn’t really work as expected, but that might be cause I’ve got the new Subversion 1.4 installed which heavily changed the work dir database. The icon badges doesn’t always appear from the beginning, but they eventually will.

Update: This binary does not work with working directories handled by Subversion 1.4.x. My previous installation of svn 1.4 turned out to not work correctly, and old copies of 1.3.2 were still being used. Now i’ve made sure 1.4 is installed properly, and SCPlugin just flips out with errors locking up the finder for about 20-30 seconds.
I’ll look into a 1.4.x compatible copy as soon as i have some free time :)

echo ‘Hello World’;

November 6th, 2006

So, the domain and svn repositories have been up and running for a few weeks now, so here’s a blog, which probably nobody will be reading for some time to come i believe…

Incase someone does happen to stumble across this little post, you might be wondering what this oddly empty site is for. Well, come here and sit in my lap little boy cause Santa’s about to tell yee!…

zhuoqe.org has one intended purpose, and that is to serve as development domain for all types of weird, funky, illegal, doped up, purple, and otherwise mind boggingly insane projects. Jokes aside, all this site is for is to work as a testing environment and svn repository for all my different projects.

Also, lets not forget that there’s another party involved in a few of projects that will soon be featured. Namely sxtxixtxcxh (at zhuoqe dot org).

Oh, and don’t forget to check his projects (which are actually online and working, unlike my own projects :P).

Currently, the only public svn repository is Adiumlogs, which is PHP log parser for the popular Adium chat client for Mac OS X. Adium stores logs in a neat html format, so its easy to read from external sources. A demo of Adiumlogs is available at http://adiumlogs.zhuoqe.org/ (note that the directory listing is not part of Adiumlogs, its part of dList, another project which is almost ready for its first public release).

A log viewer/manager for Proteus, my own favorite OS X chat client is on my todo list, specially since the built-in log viewer doesn’t work properly :P.

That will be zee all for now, if you have any questions, well just don’t!… cause i will answer them, and you could get brain damage ;).