Jim Stitzel

Web, Graphic, and WordPress Design

  • Home
  • Web Design
  • Email Jim

Science-Based Medicine » Study shows antidepressants useless for mild to moderate depression? Not exactly.

By Jim on February 4, 2010

Science-Based Medicine » Study shows antidepressants useless for mild to moderate depression? Not exactly. This is an excellent article on what happens when scientists report their findings irresponsibly, particularly when the study in question is poorly designed from the outset. When the desire for notoriety outweighs good scientific method and design, science and progress suffer.

Posted in Asides | Tagged medicine, psychiatry, science | Leave a response

Hubble captures picture of asteroid collision! | Bad Astronomy | Discover Magazine

By Jim on February 2, 2010

Hubble captures picture of asteroid collision! | Bad Astronomy | Discover Magazine.  I absolutely love astronomy. It is by far my favorite branch of the sciences — and Phil never has any shortage of really cool stuff to report on. Check out what happens when Hubble spies the collision of two asteroids.

Posted in Asides | Tagged astronomy, science | Leave a response

YouTube – Farming For Generations

By Jim on February 2, 2010

YouTube – Farming For Generations. This is a great thumbnail look into the average American farm operation and how important family farms are to providing the food you and I eat every day.

Posted in agriculture | Tagged corn, family farms | Leave a response

A Call For Author Support « Whatever

By Jim on February 2, 2010

A Call For Author Support « Whatever. Yes, this is exactly what I’m talking about. I’ll very likely not give any more of my business to Amazon, but rather, I’ll give that same business to other retailers and purveyors of fine fiction (and non-fiction). Amazon screwed over a lot of my favorite authors with this tantrum, so — as an amateur writer myself — I’m more than happy to give some of that screwing right back.

Posted in Asides | Tagged Amazon, books, fiction | Leave a response

All The Many Ways Amazon So Very Failed the Weekend « Whatever

By Jim on February 1, 2010

All The Many Ways Amazon So Very Failed the Weekend « Whatever. If you missed the Amazon/Macmillan pissing contest this weekend, check out this article over at John Scalzi’s website. It’ll give you a pretty good look into the petulant hissy-fit that Amazon threw over the weekend.

Posted in Asides | Tagged Amazon, books, Macmillan | 2 Responses

The Intervention is Not Going Well « Whatever

By Jim on January 29, 2010

The Intervention is Not Going Well « Whatever. It is reasons just like this one that I love Scalzi’s blog. The man — he is funny!

Posted in Asides | Tagged John Scalzi | Leave a response

The Voice of Agriculture – American Farm Bureau

By Jim on January 28, 2010

Statement by Bob Stallman, President, American Farm Bureau Federation, Regarding President Obama’s State of the Union Address. America’s farmers are crucial to its lifeblood and economy. Encourage your leaders to remember this when they vote on policies that will affect American agriculture.

Posted in Asides | Tagged agriculture, politics | Leave a response

AgriNews.com: United Egg Producers executive warns about HSUS effort

By Jim on January 28, 2010

AgriNews.com: United Egg Producers executive warns about HSUS effort. PETA and the HSUS are evil organizations. They like to promote themselves as animals rights organizations, but when it comes right down to it, they’re not much better than agro-terrorists. Their goals are inherently bad for US agriculture and economics.

Posted in Asides | Tagged agriculture, HSUS, PETA | Leave a response

‘Scary time’ to be in the political middle, Arlington family says | Top Stories | News f…

By Jim on January 28, 2010

‘Scary time’ to be in the political middle, Arlington family says | Top Stories | News f… Amber is a friend of mine from my high school graduating class. I have to say that I completely agree with her and her husband’s comments in this article.

Posted in Asides | Tagged politics | Leave a response

No Warrant Necessary to Seize Your Laptop | Freedom to Tinker

By Jim on January 28, 2010

“The U.S. Customs may search your laptop and copy your hard drive when you cross the border, according to their policy. They may do this even if they have no particularized suspicion of wrongdoing on your part.” (via No Warrant Necessary to Seize Your Laptop | Freedom to Tinker.)

Posted in Asides | Tagged freedom, legal rights, privacy | 2 Responses

Obligatory Quick Assessment of the iPad « Whatever

By Jim on January 28, 2010

“I suspect I’ll hold out from getting the first generation version, especially as I so recently purchased an iPod Touch, and wait to see what the early adopter complaints and their fixes are before considering this for a purchase.” (via Obligatory Quick Assessment of the iPad « Whatever.)

Posted in Asides | Tagged Apple, iPad, John Scalzi | 8 Responses

Clinton County Farmers Market

By Jim on January 27, 2010

Facebook – Clinton County Farmers Market. The new Facebook group for the Clinton County Farmers Market in Frankfort, IN. If you’re a local, check it out!

Posted in Asides | Tagged agriculture, farming | Leave a response

FBlog – Enough is Enough! I Don’t Abuse My Animals!

By Jim on January 27, 2010

FBlog – Enough is Enough! I Don’t Abuse My Animals! Major news organizations run the stories that make them money, which end up being the sensational ones. Unfortunately, this usually means that outlier behaviors are given the perception of being the norm.

Posted in Asides | Tagged agriculture, Farm Bureau | Leave a response

Configuring Texmaker USB With MiKTeX Portable

By Jim on January 12, 2010

Note: this article is for Windows platforms only.

After a lot of trial-and-error — not to mention a wee bit of teeth gnashing, hair pulling, and weeping uncontrollably — I have finally managed to get Texmaker USB configured work with MiKTeX Portable. Since there seems to be a relative dearth of information on this particular setup on the Web, I thought I’d detail the setup for anyone else trying to get these two programs to communicate. It’s a bit of work to set up, but the bonus is that it doesn’t require any batch files to run and each module can be updated independently.

First of all, you need to create an empty folder somewhere. I called mine LaTeX Portable. Then, download the following programs:

  • MiKTeX Portable – extract into the new folder you just made
  • Texmaker USB – extract into LaTeX Portable/miktex-portable/ (you’ll need to create a new directory for MiKTeX Portable)
  • Foxit Reader Portable – extract into LaTeX Portable

When you’re done, you should have three subdirectories in your LaTeX Portable folder, one each for MiKTeX Portable, Texmaker USB, and Foxit Reader Portable.

LaTeX Portable
    |_____FoxitReaderPortable
    |_____miktex-portable
    |_____texmakerwin32usb

Then, go to http://pages.cs.wisc.edu/~ghost/ and download the latest versions of Ghostscript and GSView (8.64 and 4.9, respectively, at the time of this writing). Both of these files are self-extracting executable archives. Save them to your computer. Rather than running the .exe files, use a program like 7-zip to extract their contents to your LaTeX Portable directory. Again, you’ll need to create a new directory for each of these archives to extract the files into. When you’re done, your folder structure should look something like this:

LaTeX Portable
    |_____FoxitReaderPortable
    |_____ghostscript
    |_____GSView
    |_____miktex-portable
    |_____texmakerwin32usb

Inside your ghostscript directory, you’ll see:

ghostscript
    |_____gs864w32
        |_____gs8.64
        |_____filelist.txt
        |_____setupgs.exe
        |_____uninstgs.exe

Copy the gs8.64 directory into your GSView directory, then delete the ghostscript directory. Your LaTeX Portable folder structure should now look like:

LaTeX Portable
    |_____FoxitReaderPortable
    |_____GSView
        |_____gs8.64
        |_____gsview
        |_____pstotext
    |_____miktex-portable
    |_____texmakerwin32usb

The next step is to configure Texmaker to access the MiKTeX Portable and Ghostscript/GSView files. Launch Texmaker, then click on Options -> Configure Texmaker. The Commands screen should pop up by default. We’re going to modify most of these fields so that Texmaker can process your .tex files while still being able to run from a USB stick on any Windows computer.

LaTeX: "../miktex-portable/miktex/bin/latex.exe" --src -interaction=nonstopmode %.tex %0 "%N%T"
dvips: "../miktex-portable/miktex/bin/dvips.exe" -o %.ps %.dvi
Bibtex: "../miktex-portable/miktex/bin/bibtex.exe" %
Makeindex: "../miktex-portable/miktex/bin/makeindex.exe" %.idx
Dvi Viewer: "../miktex-portable/miktex/bin/yap.exe" -1 -s @%.tex %.dvi
PS Viewer: "../GSView/GSviewPortable.exe" %.ps
PdfLaTeX: "../miktex-portable/miktex/bin/pdflatex.exe" -interaction=nonstopmode %.tex
Dvipdfm: "../miktex-portable/miktex/bin/dvipdfm.exe" %.dvi
ps2pdf: "../miktex-portable/miktex/bin/ps2pdf.exe" %.ps
Pdf Viewer: "../FoxitReaderPortable/FoxitReaderPortable.exe" %.pdf
metapost: "../miktex-portable/miktex/bin/mpost.exe" --interaction nonstopmode
ghostscript: "../GSView/gs8.64/bin/gswin32c.exe"

Set your QuickBuild to run PdfLaTeX + View PDF. Once you make these changes, your portable LaTeX setup should be all configured and ready to work on any USB stick.

Inverse Search

To set up Yap to run inverse search, it’s important to run it as an administrator (Right-click -> ‘Run as Administrator’) so that it will be able to permanently save your setting. Go to View -> Options -> Inverse DVI Search. Click ‘New’. Type

Texmaker

in Name and

"%f" -line %l

where it says to specify the program arguments. YAP doesn’t support relative paths, so you’ll have to point YAP at the absolute path to Texmaker. Once you’ve completed all three of these steps, click ‘Ok’ and Texmaker will be displayed in the list. Select Texmaker, click Apply, and Ok. You should now be able to conduct both Forward and Inverse search.

Additional resources:
GSview 4.9 and Ghostscript 8.60 Portable
“Forward/Inverse search” with Texmaker

Posted in Geekery | Tagged FoxItReader Portable, LaTeX, MiKTeX Portable, Texmaker USB | 10 Responses

Excluding Page IDs from a Custom Query

By Jim on December 14, 2009

Available on the DailyBlogTips website is a theme called StudioPress_Red. The theme uses a custom query to list the pages in the site navigation while applying a ‘current page’ class for styling the nav bar. The navigation code sets up a nav scheme with the traditional ‘Home’ button followed by the listing of pages. This works out just fine for the typical blogger who has his blog as his home page. It breaks down a bit, however, for the blogger who wants to set one of her static pages as the Home page, since she will then have both the ‘Home’ button as well as the selected page’s button showing in the nav bar. Typically, with the wp_list_pages function, you can simply add an exclude parameter to hide any pages you don’t want to show. With the StudioPress_Red theme, however, it not quite that straightforward.

Below is the block of navigation code from the header.php file. Line 47 (highlighted) is the line of interest that needs to be modified in order to exclude the appropriate pages from the nav bar:

<div id="nav">
<?php function get_the_pa_ges() {
  global $wpdb;
  if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
     $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
}
  return $these_pages;
 }

 function list_all_pages(){

$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;

if (is_page($the_page_id)) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}

return $output;
 }
?>
<ul>
<?php

if (is_home()) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
echo list_all_pages();?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Nav -->

What line 47 is doing is talking to the WordPress database and retrieving all published pages by their ID numbers and returning the titles of those pages to the navigation list, sorted by the pages’ IDs. In order to exclude certain pages from the list, a new parameter
needs to be added to line 47 to tell function to skip a page that’s set as the Home page. Unfortunately, even the WordPress Codex doesn’t provide any real documentation for page exclusions in a custom query, so you have to know your WordPress core and MySQL syntax to make it work.

Prior to WordPress 2.7, post ID numbers were saved to the database under the post_id field. From WordPress 2.7 and on, post_id was changed to just ID. So, in order to exclude the Home page ID from our custom query, we have to add and ID !="##" to line 47, where ## is the ID number of the page you want:

<div id="nav">
<?php function get_the_pa_ges() {
  global $wpdb;
  if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
     $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" and ID != "##" order by ID');
   }
  return $these_pages;
 }

 function list_all_pages(){

$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;

if (is_page($the_page_id)) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}

return $output;
 }
?>
<ul>
<?php

if (is_home()) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
echo list_all_pages();?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Nav -->

This tells the query to find all published pages that don’t have an ID of ## and return those page titles for display in the nav bar. Since I don’t work with the way WordPress communicates with the database very often, it took me a couple of hours of (nearly futile) research and experimentation to figure out what would work here. Hopefully you’ll find this information useful.

Posted in WordPress | Tagged $wpdb, custom query, navigation, page list | 1 Response

Bulk Clean-up of ‘Approved’ Spam Comments

By Jim on December 5, 2009

I recently had to clean up the database for a WordPress installation where several thousand spam comments had managed to slip by the filters and get themselves approved. Naturally, going through and marking each individual one as spam would have been a mind-numbing and infuriating process, and there is no ‘Check for Spam’ button in the approved comments queue. Obviously, you can’t allow those spam comments to just sit there, so here’s the solution. Fair warning: it’s a bit geeky.

Log into your phpMyAdmin interface and navigate to the comments table (wp_comments by default). Click on the SQL tab ,paste this snippet of code in, and click ‘Go.’

UPDATE wp_comments SET comment_approved='0' WHERE comment_approved='1'

This will bump all approved comments back to a pending status, which you can then go into and click the ‘Check for Spam’ button. Depending on your server’s settings and the number of spam comments you have to deal with (7000+ in my case), you may end up with a timeout error of some kind, which is ok. Just back up your browser and repeat the check process until all spam comments have been filtered into the appropriate queue. What you should have left are your legitimate comments. (Any leftover spam you should be able to clean up manually without too much trouble.)

From there, depending on how many legitimate comments you have remaining in the pending queue, you can either do a bulk approve using WordPress’s native functions or simply reverse the SQL command you issued above:

UPDATE wp_comments SET comment_approved='1' WHERE comment_approved='0'

Voila! Like magic (and with a bit of brute force), you’ve just gotten rid of a LOT of approved spam comments. It’s not necessarily the most elegant solution, but it beats having to click on every spam comment and preserves all the legitimate comments your readers have made.

Oh, and don’t forget to empty out your spam queue.

Posted in WordPress | Tagged comments, moderation, MySQL, spam | Leave a response

Fallen Out of Favor: AVG

By Jim on December 4, 2009

noavg Once upon a time, AVG was one of the best free anti-virus programs available. It was fast, thorough, and had a small footprint. Somewhere around version 7 or 8, however, AVG took a turn for the worst — that is to say, it started to turn into what is (unaffectionately) called “bloatware.” It quickly became clear that AVG now requires more of your computer’s resources to run, negatively affecting the operation of all your other processes. AVG 9 was supposed to rectify this by being faster and having a smaller footprint, but in recent weeks, I’ve removed the software from several computers because of the amount of interference it creates with normal operations. Much as I loved AVG in the past, I can no longer recommend it as a quality anti-virus program.

Fortunately, though, Microsoft also recently released a new free program called Security Essentials. Even before it was officially released, Microsoft Security Essentials was receiving rave reviews from beta testers and early previews. Subsequent tests have shown that the program catches up to 95% of viruses — and it has a teeny-tiny footprint. Even while running a full scan, you never notice that Security Essentials is there. Pair it up with Spybot Search & Destroy, and you have a winning combination.

Posted in Geekery | Tagged anti-virus, AVG, Microsoft Security Essentials | 2 Responses

Closing Comments to Control Spam

By Jim on November 18, 2009

About a week ago, I set WordPress to automatically close comments on posts over 90 days old on my Reclaimer website. Spam comments over there have become completely unreasonable lately, with Akismet catching and filtering out upwards of 300 spam a day. The vast majority ended up going into the Pending queue rather than the Spam queue for whatever reason. No big deal, mind you; it was only one additional step to filter them into the Spam buffer and then out of the system completely, but it was becoming a tad annoying. That was when I decided to try closing comments to see what effect it would have on spam. Very few of my readers, even new ones, ever comment on the old archives anyway, so cutting that section out of dialogue was no huge loss.

I also use the IntenseDebate commenting system on all my WordPress installations. I was puzzled to discover that setting WordPress to automatically close comments had no effect on IntenseDebate. I spent a little while trying to figure out why before finally giving up and just accepting that something somewhere was broken.

Today, it clicked in my head – IntenseDebate doesn’t replace the native WordPress commenting system; it simply overlays it. By changing the auto-close setting for comments, WordPress closed the native commenting system without affecting the IntenseDebate commenting system (which seems to be a little more robust about handling spam). Spammers appear to target the native WordPress commenting system while ignoring the IntenseDebate system – possibly because IntenseDebate loads via javascript – and since the native system is closed on the posts they target, they don’t have a way to infiltrate. In the last week, I’ve watched the number of spam that slip through go from 300+ a day to just one or two a day. The difference is remarkable, and I’ve heard zero complaints from readers about not being able to comment on older posts.

Probably I should have realized how this worked sooner, but sometimes I’m just a little slower on the uptake.

Posted in Geekery | Tagged IntenseDebate, spam, WordPress | 4 Responses

MediaTemple (dv) and suPHP

By Jim on November 17, 2009

A while back I switched my web hosting from Bluehost to MediaTemple. Basically, I needed the additional bandwidth and the ability to have full control over my server setup. MediaTemple came highly recommended, and I’ve never been sorry I switched.

The downside was that the ability to easily upgrade plugins and the core software in my various WordPress installations become a bit more rigorous. It’s a common complaint that MediaTemple server installations won’t treat users as the owners of installed files. For WordPress installations, this means that any time a site owner attempts to install new plugins or themes or update existing ones, the owner has to provide the appropriate FTP credentials.

A little research turned up suPHP as the solution. Trouble is, suPHP is a little bit of a headache to install for those not entirely comfortable with back-end installations. Fortunately, I came this how-to the other day, which details the way to go about installing suPHP on a MediaTemple (dv) server. It took me about an hour of twiddling with things to finally get it all up and running, but I finally have suPHP installed on my server, thus automating the upgrade and installation process for WordPress installations everywhere. If you’re hosted on MediaTemple (dv), I’d recommend taking a look at the tutorial.

Posted in Geekery | Tagged MediaTemple, suPHP | 2 Responses

HowTo: Install Ghostscript on MediaTemple

By Jim on November 13, 2009

This is a repost of my original writeup over on Shamus Writes.

I thought I’d go ahead and describe the process for installing Ghostscript on a MediaTemple (dv) server, especially since I’ve already got one reader who would like to see it.

Use your favorite shell client to log on to your (mt) account as root. I use PuTTY Portable from the “portableapps.com”:http://portableapps.com website. At the command line typ:

cd /usr

Type:

wget http://ghostscript.com/releases/ghostscript-8.63.tar.gz

Once the file is done downloading, type:

tar -xvf ghostscript-8.63.tar.gz

Once _that’s_ done, type:

cd ghostscript-8.63

Type:

./configure

which will run for a moment and display a long list of output. Once you have the command line back, type:

make

which will take a bit longer to run than the configure command. Again, once you have the command line back, type:

make install

which will actually install Ghostscript on your server. Provided everything went well and no error messages showed up at any step along the way, you should now have Ghostscript installed. The default location for Ghostscript is:

/usr/local/bin/gs

Typing:

which gs

in the command line will confirm this. If you want to do cleanup, just move back up a directory to

/usr

and type :

rm ghostscript-8.63.tar.gz
rm -vrf ghostscript-8.63

From there, just configure whatever script you want to run with ImageMagick and Ghostscript according to said script’s specifications and have fun!

Posted in Geekery | Tagged Ghostscript, MediaTemple, web servers | Leave a response

Next »
ABOUT JIM
Jim cultivates interests in a variety of areas. He writes webcomics and the occasional short story, reads prolifically, designs web sites and graphics, and takes pictures. He and his wife are also first-generation farmers who run a 40-acre farm in central Indiana where they raise horses, chickens, bees, and fruit trees.

  • Hoping for a convincing snow day tomorrow. So, so tired. Would love nothing better than a good excuse to stay in bed (after feeding horses). 4 hrs ago
  • More updates...

Archives

  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009

Copyright © 2010 Jim Stitzel.

Powered by WordPress and Hybrid. Site design by Jim Stitzel.