Category Archives: Technology

Confessions of a Gamer

I’m coming out… I’m a Gamer.

You can find Starcraft being taught at UC BerkeleyThis study shows that playing real-time strategy (RTS) games improved “cognitive flexibility” in those who played it.

I’m not ashamed of being a gamer any more… but only because I’ve made it to the top of my Starcraft ][ silver league bracket:

Screenshot2013-02-01 22_54_10

A good game can teach one to optimize for every single possibility, to close every possible gap, to maximize every resource and to utilize all surpluses, to minimize any waste. You’ll still get whopped from time to time, which is important because it’s the losses that teach you much more than the wins, if and only if you really analyze why you lost, and come up with corrections to prevent that means of losing later. Things start to work better for you in the long run. These are lessons that can be applied to real life. I believe that some games, when properly applied, can actually sharpen the mind.

Better living through Starcraft!

Hardware Keyboards On Android Have a Long Way To Go

image

I love my Asus Eee Pad Transformer Prime, but the keyboard is not perfect.  It works better than the touchscreen on my netbook, but it’s still very unrefined. I did however manage to use it to write this post.

Mostly, the keyboard problems are the fault of Android app developers who did not anticipate a keyboard being a primary interface to their app.  Here are some apps that don’t quite work how they should:

ConnectBot – Key maps for special characters !@#$%^&*() are broken.  These work fine for password inputs, but once I’m logged in, they’re dead.  The #1 SSH client for Android is useless for all but the most basic commands.
a
Gmail and Google Earth – I love using the keyboard shortcuts for these desktop apps, but they have not been ported over to their Android counterparts yet.

Voice Input – When I dock my transformer to its keyboard, I lose all ability to issue voice commands or speech to text. The virtual keyboard has a nice microphone to invoke the speech capture, but no such hardware button is part of the Asus keyboard.

None of these problems are insurmountable.  Hopefully the experience of having a keyboard on a tablet will improve with some basic software updates.

WordPress Tip: Custom shortcode for including CSS & HTML

If you want to include HTML and/or CSS in your blog post, try adding this to your theme’s functions.php:
[php]function include_func($atts) {
extract(shortcode_atts(array(
‘html’ => ”,
‘css’ => ”,
), $atts));
if ($css!=”) {
global $stylenum;
if (!isset($stylenum)) $stylenum=0;
$thisstylename=’externalStyle’.$stylenum;
wp_register_style($thisstylename,’/’.$css);
wp_enqueue_style($thisstylename);
$stylenum++;
}
if ($html!=”) {
ob_start();
$filename=getcwd()."/".$html;
include($filename);
$output=ob_get_contents();
ob_end_clean();
return $output;
}
}
add_shortcode(‘include’,’include_func’);[/php]

Usage in a wordpress post:

Continue reading WordPress Tip: Custom shortcode for including CSS & HTML

WordPress Tip: Use Chrome’s Code Inspector to Edit HTML Inside Visual Editor

Using WordPress’ visual editor is nice, the TinyMCE Advanced Plugin makes it even more powerful.  But it’s nice to be able to go back and change the HTML.  Using the HTML tab in WordPress is not necessarily the best way to edit HTML, especially if you are interested in switching back and forth between Visual and HTML.   If you are working with a large document, the HTML tab will always start you at the top.  So every time you switch to HTML you have to search (either visually or with find) to find where you were at in the HTML.   There is a better way… Continue reading WordPress Tip: Use Chrome’s Code Inspector to Edit HTML Inside Visual Editor

301 Redirect Using PHP & BASH For Static Content Migration

Here is a handy BASH Script for redirecting static content to a new location

Example: redirect foo.html bar.html

This will make foo.html redirect to bar.html and save the old foo.html as foo.html_

[bash]#!/usr/local/bin/bash
SOURCE=$1
DEST=$2
OLDSUFFIX="_"
echo "Source: $SOURCE Dest: $DEST"
if ([ -z $SOURCE ] || [ -z $DEST ]); then {
echo "usage: php_redirect [SOURCE] [DEST]";
echo "Old file will be saved as [SOURCE]$OLDSUFFIX";
}
else {
if [ ! -f $SOURCE ]; then
echo "Source: \"$SOURCE\" does not exist"
else {
mv $SOURCE $SOURCE$OLDSUFFIX
echo "<?php header(\"Location: $DEST\");" > $SOURCE;
echo "Success! $SOURCE is saved as $SOURCE$OLDSUFFIX, $SOURCE is redirected to $DEST";
}
fi
}
fi[/bash]