The Code Cave’s 1 year Blogaversary: Confessions of a Code Monkey

     (#)
    (oo)
   (—–)
    >0<

It was one year ago, Feb 28, 2006 to completely precise, that TheCodeCave.com first came on line.  A week later I had a fairly functional website, running WordPress with a theme I was satisfied with and a bunch of great ideas. 

This site was mostly meant for my own convenience as a place where I could put Delphi and PHP code fragments  that I knew I could find later.  I have used it for that again and again and again.  It is a MUCH better resource than Microsoft Outlook’s sent folder.  Plus, now that someone named Meagan works at the office, every time I simply type ME in the To: address of an email, I send stuff to her instead of my home account.  (Sorry, Meagan, for all of those meaningless code fragments in your email account.)

Anyway,  my wife first suggested the name The Code Cave.  Since I liked caving and coding, it made sense to her.  Since it had multiple meanings, I, of course loved, it.  (A code cave, you know, is empty space in an executiple where all sorts of neat treasures can be hidden.)  So it worked.  

A year later, the site has a google rank of 357,000, which is not to shabby in my book.  Especially since I had a couple dry spells of 1 post per month.  I’ve just gotten my first Adsense check deposited and that pays for next year of hosting in full.  So, the site is self sufficient.   I’ve also been told that I’ve helped loads of people (Sweet).  And my life is enriched by coming to know loads of new people I’ve met through the site.

Not a bad year…   Her sites have done well too.  She hosts KnitChat.com of course (where I’d been doing php and WordPress for a whole year before TheCodeCave. came around), and Loom Out Loud, and now  a new knitting magazine site: Loom Knitter’s Circle.

 I plan to do a number of “Posts that never made it” posts, the first one of which was the Delphi source code for turning any 1and1 account into a Dyn DNS server posted yesterday.  I had a whole series of web automation posts planned, but I never put them up.  I hope to get a number of them up. I’ve found that when I stop using this site a repository, and start using it as a blog, I get less code up here and less posts up here. So, the posts will get up here when they get up here.

So, for an old Borland Turbo Prolog/Turbo C/Turbo Pascal coder, my venture into the web has been a good experience…  And I can’t wait to tell you all some of the good stuff that I’ve got going on right now…  I’m juggling a few nifty things right now and hopefully I’ll have some good news to share as a result. I’m smilin’ just thinkin’ about it.

code monkey – noun –

Download link

1. A person only capable of grinding out code, but unable to perform the higher-primate tasks of software architecture, analysis, and design. Mildly insulting. Often applied to the most junior people on a programming team. 2. Anyone who writes code for a living; a programmer. 3. A self-deprecating way of denying responsibility for a management decision, or of complaining about having to live with such decisions. As in “Don’t ask me why we need to write a compiler in COBOL, I’m just a code monkey.”      — The Jargon File

TheCodeCave.com Joins Delph Feeds

There’s been a lot happening in Borland lately, specificaly in CodeGear territory.  These are exciting times.  I’ve got a whole lot of stuff that I want to tell you about.  However, first I’d like to introduce you to a site that you may not have heard of: Delphi Feeds.

Delphi feeds is a sort of one-stop-shop for Delphi related projects.  With some new and exciting projects coming out, your gonna be able to keep up to date there.  TheCodeCave ‘s Delphi category has now been added as of the feeds available on that site. 

 So, what that means is we might be getting a little more traffic here.  Also you’ll probably see some re-posts of my favorite Delphi projects I’ve shown here.  Perhaps I’ll update them to run in BDS 2006, Spacely or Highlander. 

What in the world is Spacely and Highlander?  Well, I can’t divulge too many details, but those familiar with the Codegear road maps know that Spacely is the version of Delphi due out at the end of March.  Spacely is the name used while it is in the testing phase. Spacely is an ONLY Delphi 2007 release.  Highlander on the other hand is a the BDS 2006 successor with the full trimmings.  You can find all these details and more by doing a little Googling and by visiting Delphi feeds.

I’ll have a detailed post about the Delphi for PHP release coming up shortly… This product has me the most excited.  It will revolutionize php development.  Please stay tuned…

Please let me know if you see any oddities on this site

Oddities other than my picture that is (BTW Should I keep this new one or go back to the old one?)

I’ve just upgraded the theme from Binary Blue 1.1.1 to 1.4.0. I did it at 2am when I should have been sound asleep. I know for a fact that I was very out of it and spending large chunks of time staring at the screen with my brain turned off. I’m lucky I remembered to breath! I’ll have to go over my conversion steps again this evening. I can see there are some things I skipped over in my customization of this theme. It seems to be generally functional though. So, if you see anything that is broken please let me know.

New Blog Feature – Now Reading….

I’d decided to install Rob Miller’s “Now Reading…” version 4.0 plugin ages ago to replace my Read in 2005 and 2006 categories. But I knew there was a new version of my current theme out. So, it didn’t make sense for me to manually add the required template changes especially when the new version of Binary Blue supported Widgets and writing a Now Reading Widget woud be simpler than updating the template all the time. Skip a few months and now Rob himself has investigated widgets and made his own available for Now Reading. So I rushed over to his site, grabbed it and installed it right away! S0000 SWEEET!

Unfortunately, my excitement got the better of me. I failed to notice that the download page for Now Reading had, not only the widget available, but also an updated version of the plug in. The current version of Now Reading was 4.2 and installing the plug in with 4.0 caused the side bar to blow up with a missing function error. I realized my probably mistake right away, uninstalled it all and reinstalled in the correct order with the latest.

Unfortunately, my woes did not end there. I found three problems with 4.2 that could be fixed with relative ease. The first problem was a ” *Fatal error*: Cannot redeclare now_reading_add()” Error. That was very easy to find. I had one link that didn’t work and one link for the same page that did work. A quick change to make now-reading-admin.php always use the “post.php?page=now-reading-add.php” syntax instead of “post.php?page=now-reading/now-reading-add.php” and the problem was solved.

The next problem was a “1 book *Warning*: Cannot modify header information -” error message that came up each time I edited a book. That looked just like a debug comment, and indeed Rob confirmed that this one was fixed in his own code already but didn’t say how. I didn’t have access to check out the latest code yesterday, so I fixed it myself. The total_books routine takes a parameter to termine whether or not to print to the screen. In one place, the parameter was needed but not specified. So I changed
if ( $count > total_books(0) )
to:
if ( $count > total_books(0, false) )

and that problem was solved.

I sent those two changes and a recommendation that the widget check for the correct version of the plugin to him and he replied with a thanks, he’d put in the changed the code as I’d suggested (b4 or after I don’t know) and notice that 4.21 was released! Cool, that means no one else should get these errors.

Unfortunately, I noticed two minor things after that point. First, one book I entered had an apostrophe in the title. Unfortunately, the plugin now put a slash in front of the appostrophe. I SUSPECT that this is a WP 2.03 issue and I have not reported it to Rob. I’ll install 2.04alpha/beta/whatever soon and see if the problem goes away.

The next minor issue was reported to Rob with the fix. After I put in the 12 books I read this year, the plugin was reporting that I had an average of 144 books a month. I admit that my 2 books* a month average this year is pathetic compared to last year’s 3.6 (I read nothing in March this year oddly enough – I guess that’s when I started the blog and nothing struck me as interesting enough to take my time away from that. And I’ve also been reading a lot from Orson Scott Card’s Intergalactic Medicine Show), but I’m not going to bolster it to 144 books a month…

So, I dug into the average query and found the problem…

I shot another email to Rob just before two this morning:

>I’ll add a version check to the widget now, good idea.
Thanks!

Oh and I have one more update if you haven’t fixed this one already too..

Your average books calculation was off. You’re missing a MIN statement around the b_added.

So it should look like this:
SELECT
( COUNT(*) / ( TO_DAYS(CURDATE()) – TO_DAYS( MIN(b_added) ) ) ) AS books_per_day
FROM
{$wpdb->prefix}now_reading
WHERE
b_status = ‘read’

Nice plugin… Now I’m just trying to remember all of the books I’ve read so far this year… I just remembered another… So that’s 12…

That change is in template-functions.php around line 145. I think I’ll keep my current version installed till the fix is out.

So, now you can look at my sidebar now and see all of the books I am reading and have read this year. And if you like the idea of any of the books I’ve read, you can purchase it through the links and I’ll get a peice of the action. (Actually for now Rob will. I’ve not put in my own Amazon ID yet.) I don’t think I’ll put in last year’s 44+ books for a while yet. Each book deserves a comment but that’s 44 more blog entries I need to write. So, I’ll piece meal them in. If you like what you see, please visit Rob’s site and download the latest and greatest versions of now reading. Just click this link: http://robm.me.uk/projects/plugins/wordpress/now-reading/

BTW, I put together the promised context menu post I mentioned the other day, but was debugging something and decided to backup the file and wipe out most of the file so that I could Isolate what I was debugging. Unfortuately, I forgot I’d also already changed the name of the working file. *smacks head* So, I lost some of my change and all of my extended commenting. I just need to re-review the comments ( the second time you put in comments they are never as good as the first time you put them in ) and I’ll publish the post. Probably tomorrow. I’ve got a lawn to mow and a carpet or two to shampoo… Cheers!

* One of the people in our shipping department had a discussion with the UPS guy saying both stated that they’d each only ever read 1 book cover to cover. How sad (not not meaning pitiful but saddening) is that…

New Links

I’ve finally had some time to add a few of the links I’ve been planning for my Links roll.

One of the neat things (well I think it’s neat) I wanted to do was add a group of music links.

I’ve found that you can browse the MSN music site and get Top Playlists for your favorite bands. Then you can grab the asx file from your cache and put it on your own website.

It’s all legit since it goes through MSN’s site for the music and displays all appropriate ads in the media player.

I think it’s kinda cool. I admit I kept on going further and further back into my eccentric music tastes to see if I could stump it. I could not find any “Mad at the World”, but I did find some other goodies like Barren Cross. And of course Steve Taylor. These are just some of the things I listen to on a daily basis. I need to throw in The Bobs too, since they are a regular.

WordPress 2.0 themes are now available.

The first of the WordPress 2.0 themes are up! I’m trying out the new BinaryBlue theme.  But it has a BIG surprise waiting for non-localized blogs that try it.  It will crash your blog and your admin pages.

It is a localized theme. That means that you HAVE to have a special setting in your WP-Config . 

You know that section in wp-config.php that most of us have ignored? the one that says:
[PHP]
// Change this to localize WordPress.  A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to ‘de’
// to enable German language support.
define (‘WPLANG’, ”); 

[/PHP]
Well, if you don’t have a value in there when you choose the new Binary blue theme, you only get this :

Cannot instantiate non-existent class: cachedfilereader […]

on every page of what you had previously thought of as your blog…

Luckily, the fix is simple… change the define line in the config file to this:
[PHP]

define (‘WPLANG’, ‘en_US’);

[/PHP]

and your site will work again (after it does some initial chugging to apply the localization – give it half a  minute…)

Beyond that, the theme is wonderfully well organized.  The options page is a treat and the developer, and you can see from his comments , that he is helpful and seems to know his stuff.  I’d like my WP3.0 theme to be as well organized.  This theme, though still 1.0, sets the standard that many should follow. 

I do wish there was a readme file that explained that step or that localization was turned off by default. 

I also tried turning on the ie7 “fixes” feature that the author gets tripple Kudos for turning into a configurable option rather than just building it in, and it caused some of my posts to wrap the sidebars down to the end of the page.  So that option is off again.

I’ll try do a full review of it over the weekend. 

 Hey, Kevin should create a blog entry for theme reviews that we can all point our tracebacks to…   Good idea?