US cities may have to be bulldozed in order to survive – Telegraph

June 19th, 2009

‘Dozens of US cities may have entire neighbourhoods bulldozed as part of drastic “shrink to survive” proposals being considered by the Obama administration to tackle economic decline.’

via US cities may have to be bulldozed in order to survive – Telegraph.

see also this /. post

Pretty interesting story about how vast potions of formerly prime land within cities are being razed in order to return them to nature and reduce the drain on government (and related) serivces. Having been to Detroit (only for a short weekend) I was amazed at how run down and empty large portions of the area/city seemed to be. Its understandable how downsizing it looked at as a failure, it’s just not a part of progress as we’ve come to know it. However, in the case of many rust-belt cities we’ve already “lost” they are ghosts of their former prosperous selves and the only way to move forward is to shrink them down to a manageable size.

SET Energy » US bike sales higher than car sales in 2009

May 27th, 2009

“During the first quarter of 2009, more bicycles were sold in the US than cars and trucks. While the Great Recession is hurting bike sales, they didn’t fall as fast as automobiles. Around 2.6 million bicycle purchases were made, compared to ~2.5 million cars and trucks that left our nation’s lots.”

via SET Energy » Blog Archive » US bike sales higher than car sales in 2009.

Pretty cool, though it would be interesting to know what percentage of the bikes sold are being used as a mode of transportation, not just for kids/playing.

The Associated Press: Obama changes office name, pushes Web work

May 12th, 2009

“Coupled with that, Obama read a 33-page report with comments from his pre-presidency Web site, letting him know his supporters’ single top priority for the new administration: changing the nation’s policy banning marijuana.”

via The Associated Press: Obama changes office name, pushes Web work.

You have to wonder how seriously Obama will take that request. I have a hard time imagining he’d would take action on it given that I’ve never heard him publically speak about it, but who knows. It’s pretty interesting that it was the most frequently mentioned request/comment. Also interesting that pot supporting people feel free enough to speak up on the record in favor of legalization. I’d imagine at least part of the reason it is the number one request is internet demographics, people who are internet savvy and motivated enough to visit Obama’s pre-election site happen to coincide with the pro-pot segment. At least I have a hard time seeing the greater population careing one way or another.

The Associated Press: EPA: ethanol crops displaces climate-friendly ones

May 5th, 2009

WASHINGTON (AP) — The Environmental Protection Agency says that corn ethanol — as made today — has a worse impact on climate than gasoline when land use changes are considered.

via The Associated Press: EPA: ethanol crops displaces climate-friendly ones.

A prediction about Obama

April 29th, 2009

I’m going to go out on a limb and make a rather bold prediction. That not only will Obama be reelected, but there will be a decently strong movement for the lifting of the term limit when his 2nd term is coming to a close. I say this as I sit here watching his 100 day news conference. I’m as impressed with him and his answers now as I was when I watched him speak in 2004. I’m not sure that policy-wise he’s that special, but I think as a person and leader there’s something here that is. Something that I haven’t seen before and can only hope we see again.

Japenese Game: Don’t Ram The Boobs!

April 27th, 2009
YouTube Preview Image

Where are we going…and why are we in this hand basket?

April 22nd, 2009

“Where are we going…and why are we in this hand basket?”

301 Redirects – Getting Old Feed URLs to Work With Wordpress

April 21st, 2009

If you have an established blog and have readers who subscribe to your feed you’ll likely loose them when you migrate to Wordpress and your RSS feed URL changes. Wordpress feed look like http://www.mysite.com/blog/feed/ if you’re blog is at http://www.mysite.com/blog/. My previous blog software’s RSS feed url looked like http://www.mysite.com/blog/?wl_mode=rss2. I didn’t have too many subscribers, but there were a few and I didn’t want to leave them hanging so I set about using a 301 permanent redirect to solve this problem.

Fixing this is pretty straightforward, just a couple of lines of code. For me this the following placed near the top of index.php does the trick.

if ($_GET['wl_mode'] == 'rss') {
        header("HTTP/1.1 301 Moved Permanently");
        header("Location: http://" . $_SERVER['SERVER_NAME'] .  "/blog/feed");
        exit();
}

It looks for the get parameter wl_mode to be ‘rss’. If wl_mode is defined and equal to ‘rss’ it sets two headers in the response and then exits. The first tells the client to redirect and that the redirect is permanent. The second gives the location to redirect to, the server name of the request, from the variable so that it matches whatever hostname the request was made to and the path of Wordpress’s RSS feed, ‘/feed’. The ‘/blog’ is where Wordpress is installed on my site, if your root is Wordpress you’d just have ‘/feed’.

What if your old url wasn’t wl_mode=rss. If it’s a different parameter or set of parameters you’d just swap them out. What if the old feed is not a parameter, but a URL/path? Something like the snippet below should be useful there.

if ($_SERVER['REQUEST_URI'] == '/blog/old/feed/path') {
        header("HTTP/1.1 301 Moved Permanently");
        header("Location: http://" . $_SERVER['SERVER_NAME'] .  "/blog/feed");
        exit();
}

5 Minute Custom Wordpress Theme

April 18th, 2009

Creating a custom wordpress theme is really easy especially if you’re starting with a template (a site design you want to use.) This is often the case when you’re trying to add a blog to an existing site or convert an existing website you’re happy with to use wordpress for blogging/content management. I won’t go in to details about how to install wordpress, there’s already a great guide for that. I’ll just outline the steps involved in creating a custom them to get wordpress to look & feel the way you want it to.

Laying the Foundation – Creating the Theme Directory

We’ll start out creating a directory to house our theme files (there’s only going to be 2 of them.) To do that we’ll log on to our server and execute the following:

$ cd /whereever/wordpress/is/installed/wp-content/themes
$ mkdir custom

If you don’t have shell access to you server use whatever mechanism you’ve uploaded/edited the sites files with in the past.

Step One – HTML – index.php

There’s only two files required to create a template for wordpress, index.php and style.css. We’ll start with index.php. To create an initial version of this file we’ll pick up where we left off a minute ago and do the following. If you’re familiar with another editor, feel free to use it, choices include vi, emacs, … but pico is one of the simplest to use (ctrl-O to save, ctrl-X to exit, more commands are listed across the bottom.)

$ cd custom
$ pico index.php

That will start up pico editing a file named index.php, the main template file for you new custom theme. We’ll start with a simple html page you can copy-n-paste in to this file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>;
      charset=<?php bloginfo('charset'); ?>" />
    <title>
      <?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?>
    </title>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
      type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml"
      title="<?php bloginfo('name'); ?> RSS Feed"
      href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="application/atom+xml"
      title="<?php bloginfo('name'); ?> Atom Feed"
      href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  </head>
  <body>
    <div id='header'>
      Insert Your Header HTML here
    </div>
    <div id='content' class='span-16 prepend-1'>
        <?php if (have_posts()) : ?>
          <?php while (have_posts()) : the_post(); ?>
            <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
              <h2><a href="<?php the_permalink() ?>" rel="bookmark"
                title="Permanent Link to <?php the_title_attribute();
                ?>"><?php the_title(); ?></a></h2>
              <small>
                <?php the_time('F jS, Y') ?>
                <!-- by <?php the_author() ?> -->
              </small>
              <div class="entry">
                <?php the_content('Read the rest of this entry »'); ?>
              </div>
              <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />');
                ?> Posted in <?php the_category(', ') ?> |
                <?php edit_post_link('Edit', '', ' | '); ?>
                <?php comments_popup_link('No Comments »',
                                          '1 Comment »',
                                          '% Comments »'); ?>
              </p>
            </div>
          <?php endwhile; ?>
            <div class="navigation">
              <div class="alignleft"><?php
                next_posts_link('« Older Entries') ?></div>
              <div class="alignright"><?php
                previous_posts_link('Newer Entries »') ?></div>
            </div>
        <?php else : ?>
          <h2 class="center">Not Found</h2>
          <p class="center">Sorry, but you are looking for something that isn't
            here.</p>
          <?php get_search_form(); ?>
        <?php endif; ?>
      </div>
      <div id='sidebar' class='span-6 last'>
        <?php get_sidebar(); ?>
      </div>
    <div id='footer'>
      Insert Your Footer HTML here
    </div>
  </body>
</html>

Don’t worry if that looks like a mass of gibberish, there’s only a small portion of it that you’ll have to worry about, the two sections in red. In them you will place your header and footer HTML, whatever logos and/or text you’d like to see at the top of the page. If you’d like to have a navagation bar across the page you can create a second div following the header dive and put links to the various sections of you site there. The footer is a good place to put a copyright notice, links to email you or any other information you’d like to have appear at the bottom of all of your pages.

If you’re working with an existing template you want to insert wordpress into, you’ll take the section in blue and place it in the content section of your template. You may have to mess around with it a bit to get exactly what you’re looking for, but keep at it it shouldn’t take too long.

Step Two – CSS – style.css

We’re half the way to a new custom Wordpress theme. The next thing we’ll need to do is create style.css.

$ pico style.css

At this point if you want to save the file you can go to the admin section for you blog and click on the ‘Appearance’ link and you should see your new ‘custom’ theme. Clicking on it should pop up a preview of what your blog will look like using this theme. It probably won’t look like much yet, but it’s a nice clean workspace in which you’ll be able to mold things to your liking. If you don’t have visitors to your blog yet, or don’t mind them seeing the work in progress you may go head and apply your new theme. If you’re not ready for that you’ll need to continue to use the preview feature to view your work.

So one of the biggest problems with this theme is the sidebar is way down at the bottom below all of the content. We’ll need to add some css to address this issue, luckily there’s not much to it, at least to move the sidebar up. You’ll just need to add the following to style.css and refresh.

#header
{
}

#content
{
  float: left;
  width: 600px;
}

#sidebar
{
  float: left;
  width: 200px;
}

#footer
{
  clear: both;
}

The css above makes both #content and #sidebar float left and then limits #content’s width to 600 pixels and the sidebar to 200. So the blog will be 800 pixles wide. The only other thing going on is that we’ve asked the footer to clear both, which essentially means that it should go below any floating divs before it. This is obviously pretty rudimentary and doesn’t do much for the ascetic appeal of our blog, but everything “works” from here it’s just fiddling with css (which is way beyond the scope of this post.) Take a look at the HTML generated by this theme using view source and you should be able to track down the id’s and class’s you need to address to shape things up. Web developer Tool-bar can be really helpful for this work, check it out.

Conclusions

So we’ve created a simple, although still ugly, wordpress theme from scratch. It uses lots of defaults that can be customized to your liking, but it’s a good start. If you have any questions feel free to hit me up at rwmcfa1 <at> neces.com. Don’t have the time and/or desire to mess with custom wordpress instalation/development get in touch.

Hey Ya

April 17th, 2009
YouTube Preview Image

Surprisingly good acoustic version by “Ted”