Viewing: Entries in 'Programming'

Wordpress, jQuery and ‘noConflict’

September 5, 2008 @ 21:31:19

I’ve been working on a plugin for Wordpress and have, until now, been using Mootools. I decided that I should try and simplify things by using jQuery, since it is already included with Wordpress.

So let me take you through my links and hopefully summarize what I’ve learned. First though, let me say, I’m assuming that you already know what it means to hook into the Wordpress application flow by adding “actions”. If not, read up.

»»» but wait, there’s more reading to do »»»

LOLCode Has Me LOL’ing OMG DOOD

September 1, 2008 @ 23:04:07

Not only is LOLCode funny, but it’s effin real. Here are the specs and here are some implementations.

But who cares. It’s just plain funny. I mean, I’ve read the two front page examples (very bottom of the home page) at least twenty times and it still manages to entertain.

COUNT!!1

HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
	UP VAR!!1
	VISIBLE VAR
	IZ VAR BIGGER THAN 10? KTHXBYE
IM OUTTA YR LOOP
KTHXBYE

GeSHi (used by WP-Syntax) needs to get up in that piece so my blog can have syntactically correct formatting of LOLCode.

Heads-Up Regarding the CodeIgniter Video Tutorial

August 23, 2008 @ 16:13:49

I’ve finally gotten around to working through the second video tutorial for CodeIgniter. It’s centered around creating a blog in about 20 minutes (it continues from the shorter, “Hello World” intro tutorial…so if you haven’t already, I’d start from there).

There’s a small error I didn’t notice (but should have). It had me stumped for a bit but, as is most always the case, the solution was painfully obvious.

»»» but wait, there’s more reading to do »»»

Reading Lines Using Java

August 21, 2008 @ 20:41:29

Every year or so, for whatever reason, I end-up trying to read text files line by line using Java. I always start out thinking regular expressions, and it always starts to look unnecessarily convoluted.

Three or four years ago I came across BufferedReader and, whatdya know, its got the function readLine. Of course, each time I start anew, I forget the lessons I’ve previously learned. Then, when the code’s starting to look rough, I remember “Oh yeah, there’s a really easy way to do this.” So I find the old code and voilĂ .

I realize this is simple stuff. It’s just one of those things that’s worth putting out there for the occasional search result that might help someone out .

/* Note that I've left out exception handling. */
 
ArrayList<String> lines = new ArrayList<String>();
File file = new File("C:\path\to\file.txt");
 
BufferedReader reader = new BufferedReader(new FileReader(file));
 
String line;
while((line = bufferedReader.readLine()) != null)
     lines.add(line);			
 
bufferedReader.close();

Firebug’s Future

August 12, 2008 @ 17:17:09

Firebug is a fantastic tool. It works as an add-on to Firefox and can be used for all sorts of fun stuff. It is a javascript debugger (breakpoints, variables and watch expressions). It can also be used to “inspect” whatever web page you happen to be visiting (hover over areas of the page to see its corresponding HTML and CSS). It’ll even profile the javascript.

The original author, Joe Hewitt, open sourced Firebug sometime last year and back in mid-July, John Resig (a well-known javascript guru and Mozilla employee) announced that he was taking over its development. Today he laid out his initial plans:

  • Improve the knowledge of Firebug that we have
  • Build a runnable set of test cases to prevent regressions
  • Track the state of Firebug performance
  • Audit and Improve

I can’t wait to see how Firebug evolves now that Resig has reign.

Available Online: When Print Has No Space for Content

August 9, 2008 @ 22:17:59

Dr. Dobb’s Journal is a pretty well-known magazine geared towards software engineers, and they’ve been at it for more than thirty years. The articles are generally pretty hit or miss for my taste. I was just reading the August 2008 print edition, specifically Disentangling Concepts in Object-Oriented Systems. It’s pretty meh in my opinion, but that’s neither here nor there. The problem I found is something I’ve come across before in this magazine, but this time it was just plain absurd.

»»» but wait, there’s more reading to do »»»

Do More to Do Better

August 4, 2008 @ 18:29:35

Coding Horror, a blog that I’ve started reading regularly, has some fantastic advice on how to improve your skills (regardless of the domain): Quantity Always Trumps Quality.

When it comes to software, the same rule applies. If you aren’t building, you aren’t learning. Rather than agonizing over whether you’re building the right thing, just build it. And if that one doesn’t work, keep building until you get one that does.

This is advice that I sincerely need to start following. I tend to have the debilitating problem of starting to work on an idea but never completing it because of constant tweaks and muddles and experiments and refinements ad nauseam. With an approach like that, your results are always incomplete. And when you feel like you can never complete something, you tend to move on to something else (i.e. quit).

When I used to create and record music, it was the same thing. The difference, however, was that there was always something to show for the effort, even if I wasn’t totally satisfied. No matter my perceived flaws, there was still a piece of recorded music I could share with others. But when the code isn’t finished, or the design still “in-flux”, it’s pretty difficult to call it a day and let the beast loose on the world.

I hereby resolve to…oh who am I kidding.

Friendly Reminder - mod_rewrite needs AllowOverride All

February 17, 2008 @ 02:15:56

Running Wordpress locally and not sure why the permalink or category pages are resulting in 404 errors?

It’s more than likely due to mod_rewrite not being allowed to do its job. If you don’t know anything about mod_rewrite, here is a nice howto. Also, of course, is Apache’s own documentation.

In a nutshell, the redirects created by Wordpress in your .htaccess need the authority to send a page request elsewheres. Open httpd.conf and make sure that you have AllowOverride set to All.

»»» but wait, there’s more reading to do »»»