Yazan: dp | 13 September 2011 | No Comments
Categories: Computers, Perl
Next up in the Perl Module of the Day series is Getopt::Long::Descriptive. It gives you the ability to have options passed to your programs like Getopt::Long, but allows you to also set up some descriptive text to be displayed when you need it, formatted in a nice, consistent way. Use is pretty straight-forward. Call it [...]
Yazan: dp | 17 March 2011 | No Comments
Categories: Computers, Software
PHP has a nifty function callednl2br, which will convert newlines within text to tags (optionally enabling the XHTML syntax). I’m curious though, why a br2nl function was never written? Instead, now I have to hack one together. BLARGH!
Yazan: dp | 28 January 2011 | No Comments
Categories: Computers, Software
Image by hongiiv via Flickr Parallel::Iterator is a Perl module that can make your scripts much faster if you perform long-running tasks within a loop. It does this by managing a forking system in the background, allowing your long-running tasks to execute in parallel, instead of one at a time. Your existing code probably looks [...]
Yazan: dp | 16 December 2010 | No Comments
Categories: Computers, Internet, Software
Image via Wikipedia A few weeks ago, I wrapped up (mostly) a project that I’ve been working on for a while, BuckeyeTrailerCenter.com. It was largely a learning experience for me, as I wrote it from scratch, ground up, using Zend Framework. I’ve never used a “proper” MVC system before, so this was an interesting project. [...]
Yazan: griffigr | 05 June 2010 | 1 Comment
Categories: Software
So, you’ve been charged with the responsibility of giving your company website a facelift. Your logo looks as though it was designed by a six year-old, the overall design screams, “1998,” and the blinking text effects are starting to cause problems with your epileptic readers. Let’s be honest. You’ve got a lot of work ahead [...]
Yazan: dp | 06 May 2010 | No Comments
Categories: Servers
Yesterday, I managed to delete the primary database that we use at work. I won’t go in to how this happened, other than to say: Fuck you MySQL Workbench. I was trying to get a map of the table relations within the database. Needless to say, it didn’t work. After the immediate pants-wiping, I restored [...]
Yazan: dp | 12 April 2010 | 1 Comment
Categories: Servers
This is a great read about working with udev, specifically, getting things working after you’ve written your rules, and they still don’t work. Remember that udev has a different $PATH than everything else, so qualify your paths to mount, etc. udev debugging toolbox « Web 0.2.
Yazan: dp | 11 January 2010 | No Comments
Categories: Projects, Servers
I’ve recently been posting my benchmark scripts to github. You can find them here: gms8994′s benchmark at master – GitHub. I’ve also started posting the results within the wiki, each page with the same name as the script. For example: comparing MySQL inserts with one set of values, or multiple sets of values.
Yazan: dp | 16 December 2009 | No Comments
Categories: Software
It’s amazing how much content a company can add in a year, especially when that company writes articles for it’s living. A year and a half ago, I wrote this code against Sphinx: $cl = new SphinxClient (); $res = $cl->Query ( $q, $index ); foreach ( $res["matches"] as $docinfo ) { $excerpt = $cl->BuildExcerpts(array($contents), [...]
Yazan: dp | 02 June 2009 | No Comments
Categories: Uncategorized
Recently, I needed to find all of the data in a table that was being used for HTML output, that had non-printable characters. The following SQL statement should do that for you: select id, name from table_name where name not regexp ‘^[a-zA-Z0-9_ ,&;\/<>(²):%*#?$|!+.\"\'-]+$; This code is MySQL specific, but should be applicable anywhere, really.