Category Archives: Computers

A Fresh Look

I’ve been tossing around the idea of revamping CoffeeBear.net’s theme for ages now. Many months ago, I started building a new theme entirely from scratch but I ran into some difficulties with it and ran out of time motivation for doing that. Then a while ago, I saw the Romangie theme get posted to the WordPress Themes directory. I liked most everything about the theme, so I decided to dump the what I’d started working on and build a child theme instead.

And that brings us to today when I decided to go ahead and pull the trigger activating the new look. Most of changes are centered around two areas: support for the Now-Reading Reloaded plugin1)Though I see after activating the new theme that I forgot to customize Now-Reading’s Tag page. Whoops, I’ll have to get that fixed ASAP! and switching up the colors. My colors all come from this photo being run through the Colorpeek service to get this palette.

Hopefully this fresh look works well for all my faithful visitor(s); but if you do find a problem please let me know.

Notes   [ + ]

1. Though I see after activating the new theme that I forgot to customize Now-Reading’s Tag page. Whoops, I’ll have to get that fixed ASAP!

Week 05: Cage Without a Key

Week 05: Cage Without a Key

That’s the thing about depression: A human being can survive almost anything, as long as she sees the end in sight. But depression is so insidious, and it compounds daily, that it’s impossible to ever see the end. The fog is like a cage without a key.

— Elizabeth Wurtzel

Wait, Week 05? What ever happened to Week 04? Well, my proper camera met with a bit of an accident back on Christmas day and it’s been finally sent in for repairs. It took me a bit to locate my old P&S1)This is my old Canon PowerShot S500 Digital Elph. It’s a decent camera, though its autofocus is annoyingly slow.. Plus, I’ve just been feeling a bit down of late. When I first realized I’d missed week 04, I planned on posting 2 photos for week 05 to make up for it. Unfortunately, I’ve not been shooting as many images and this was the only halfway decent one of the few I did have. Maybe I’ll post an extra image later in the year to make up to week 04; we’ll just have to wait and see.

Side note: I’ve been working on a new theme for this site and unlike most themes I’ve done this time I plan to do it all from scratch (sort of). I’m using a combination of HTML5 Boilerplate an 960 Grid System to build it, rather than working with an existing WordPress theme. Why? In part because I’ve not worked with HTML5/CSS3 yet and want to and in part because I feel Ian Stewart’s right when he says You should be building your own WordPress Theme Framework. …. Make it your own. When you’re done you’ll have the best WordPress Theme — for you.

Notes   [ + ]

1. This is my old Canon PowerShot S500 Digital Elph. It’s a decent camera, though its autofocus is annoyingly slow.

Brain Dump 01

One of my goals for this year1)I don’t really do new year resolutions, but I do occasionally set personal goals for the new year around January 1st. is to write more here; so while I don’t have a single idea that feels worthy of a full post, here’s a dump of various things floating around/through my skull today.

  • Is today stupid driving day or something? I’ll grant I left for work a few minutes later than usual, but it seems odd that so many people would continually be pulling out into moving traffic (from driveways and side streets) and then going so slowly2)Example in a 40mph zone, a car pulled out of a driveway less than half a block ahead of me, pulled across the lane I was driving in into the other lane and then just as I caught up to them they pulled right back in front of me.. Fortunately the roads were relatively clean this morning, so I was able to stop before plowing into any of those idiots, but still….
  • Back in the day when Javascript was new to the web, many sites used it to frequently touch my browser in the bad way. So I quickly grew to hate it and pretty much ignored/disabled it for years. In more recent times, Javascript usage has grown up/cleaned up its act. To the point where I’m actually interested in learning to use it. So I’ve been searching around for some decent tutorials but haven’t had a lot of luck. Most tutorials either assume you already know quite a bit about Javascript or are so extremely dated that they’re useless. I did run across 2 sites with tutorials that don’t seem to be too awful: Codecademy3)Codecademy gives a decent general knowledge of Javascrip. Though the site is far from perfect, with bugs in the lessons that prevent you from completing them or with questions that unclear in what they are looking for and hints that can be utterly useless and jQuery for Absolute Beginners4)While technically these tutorials cover jQuery (a Javascript library) rather than “pure” Javascript and while covering an older version of jQuery (1.2.6), it still has been very interesting to go over so far.
  • I’ve been thinking about about redesigning this site, but I’m trouble deciding what to do. I’ve got some ideas floating around in my skull, but I might hold off until I can look into working up a logo.

Notes   [ + ]

1. I don’t really do new year resolutions, but I do occasionally set personal goals for the new year around January 1st.
2. Example in a 40mph zone, a car pulled out of a driveway less than half a block ahead of me, pulled across the lane I was driving in into the other lane and then just as I caught up to them they pulled right back in front of me.
3. Codecademy gives a decent general knowledge of Javascrip. Though the site is far from perfect, with bugs in the lessons that prevent you from completing them or with questions that unclear in what they are looking for and hints that can be utterly useless
4. While technically these tutorials cover jQuery (a Javascript library) rather than “pure” Javascript and while covering an older version of jQuery (1.2.6), it still has been very interesting to go over so far.

State of the Word

At WordCamp San Francisco 2011, Matt Mullenweg gave the a presentation entitled State of the Word. During the presentation, he talked about the 2011 WordPress User/Developer survey they did.

Then today they released an anonymized copy of the data as a compressed CSV file. I took a quick look at the CSV and whipped up the following MySQL script to load the data.

<br />
CREATE TABLE `survey` (<br />
 `id` int(11)  NOT NULL AUTO_INCREMENT,<br />
 `year_submitted` year,<br />
 `how_use` varchar(255) DEFAULT NULL,<br />
 `job_type` varchar(255) DEFAULT NULL,<br />
 `c_do` text,<br />
 `c_cms_blog` varchar(255) DEFAULT NULL,<br />
 `c_customize` varchar(255) DEFAULT NULL,<br />
 `c_number` varchar(255) DEFAULT NULL,<br />
 `c_percent` varchar(255) DEFAULT NULL,<br />
 `c_done_with_wp` varchar(255) DEFAULT NULL,<br />
 `c_living` varchar(255) DEFAULT NULL,<br />
 `d_do` text,<br />
 `d_cms_blog` varchar(255) DEFAULT NULL,<br />
 `d_customize` varchar(255) DEFAULT NULL,<br />
 `d_number` varchar(255) DEFAULT NULL,<br />
 `d_percent` varchar(255) DEFAULT NULL,<br />
 `d_done_with_wp` varchar(255) DEFAULT NULL,<br />
 `d_cost` varchar(255) DEFAULT NULL,<br />
 `d_living` varchar(255) DEFAULT NULL,<br />
 `u_do` text,<br />
 `u_installed` varchar(255) DEFAULT NULL,<br />
 `u_installed_other` varchar(255) DEFAULT NULL,<br />
 `u_customize` varchar(255) DEFAULT NULL,<br />
 `u_living` varchar(255) DEFAULT NULL,<br />
 `x_living` varchar(255) DEFAULT NULL,<br />
  PRIMARY KEY (`id`)<br />
) ENGINE = MyISAM COMMENT = 'WordPress 2011 Survey Results';</p>
<p>LOAD DATA INFILE '/var/lib/mysql/anon-data.csv'<br />
 INTO TABLE `survey`<br />
 FIELDS ENCLOSED BY '&quot;' TERMINATED BY ','<br />
 LINES TERMINATED BY '\r'<br />
 IGNORE 1 LINES<br />
 (`how_use`, `job_type`, `c_do`, `c_cms_blog`, `c_customize`,<br />
`c_number`, `c_percent`, `c_done_with_wp`, `c_living`, `d_do`, `d_cms_blog`,<br />
`d_customize`, `d_number`, `d_percent`, `d_done_with_wp`, `d_cost`, `d_living`,<br />
`u_do`, `u_installed`, `u_installed_other`, `u_customize`, `u_living`,<br />
`x_living`);</p>
<p>UPDATE `survey` SET `year_submitted` = YEAR(NOW());<br />

This has only been tested on MySQL 5.1.54-1ubuntu4. It should work on any recent copy of MySQL, but YMMV. Also, I added 2 additional fields to the table. One is a simple ID field to make it easier to reference individual responses while the other is `year_submitted`. I added the latter field; so if they reuse this survey next year, I can simply add that year’s responses to the same table and track the differences. If I find the time, I may try digging into the data to see if I can find anything interesting in it (but don’t hold your breath on me finding the time to do so).

WordPress 3.1 is Out

The latest, greatest version of WordPress was released yesterday. It comes with a whole lot fixes and new features. One of those new features is an admin bar similar to the one used on WordPress.com; however the admin bar only includes specific links rather than being automatically populated with all the various links that my install of WordPress has (from various plugins). I found the lack of those links for one particular plugin particularly annoying. A quick bit of research and a little bit later, I developed the Now-Reading Admin Bar Menu plugin.

I also noticed after the update that one of my client sites wasn’t working correctly. It turns out there’s a bug in WordPress 3.1 which breaks category exclusion. On my client’s site, I was using this code:

function exclude_category($query) {<br />
$cat_id = '-'.get_cat_id('meetings');<br />
if ( $query-&gt;is_home ) {<br />
$query-&gt;set('cat', $cat_id);<br />
}<br />
return $query;<br />
}<br />
add_filter('pre_get_posts', 'exclude_category');

Fortunately that bug I linked to also includes a workaround. By changing the above bit of code to read as follows, I was able to fix my client’s site. ^_^

function exclude_category($query) {<br />
$cat_id = '-'.get_cat_id('meetings');<br />
if ( $query-&gt;is_home ) {<br />
$query-&gt;set('category__not_in', array($cat_id));<br />
}<br />
return $query;<br />
}<br />
add_filter('pre_get_posts', 'exclude_category');

Copyright © 2004 – 2018 CoffeeBear.net. Powered by WordPress.