Category — blog
JWU Guest Lecture: Introduction to JavaScript and AJAX
I was invited to give a talk at JWU for an audience of graphic design students on how to enhance their XHTML/CSS skills with JavaScript and AJAX. Enjoy the slides, and I’m looking forward to part 2!
February 10, 2009 No Comments
Wordpress tip: Move comments from one post to another post
I recently ended up with two posts on this site about the same project — one was a short summary, and the other a long, detailed article. I decided to consolidate them into the longer article, but I didn’t want to lose the six comments that had been posted to the short article.
I couldn’t find a way in the Wordpress UI to move comments from one post to another, so I jumped into the database. If you run Wordpress on a host, they probably provide a MySQL management tool like PHPMyAdmin, or you can log in with a mysql client.
First, find the table that contains the posts for your blog (the table name usually ends in _posts). Find the ID that matches the post you want to move comments from, and the ID for the post that you want to move comments to.
Note: An easy way to do this is to search by the post title. If you need to write the SQL by hand, use something like this:
SELECT * FROM wp_posts WHERE post_title LIKE '%posttitlekeyword%';
Replace wp_posts with the name of the database table containing your posts, and posttitlekeyword with a relatively unique keyword or phrase from the title of your post.
Second, switch to the comments table. Each comment is linked to a particular post by the ID in the comment_post_ID field. You want to switch all of the entries that point to the ID for the first post to the ID for the second post. You can do this in a visual interface by searching for the relevant comments and updating them one by one, or using this SQL:
UPDATE wp_comments SET comment_post_id=2 WHERE comment_post_id=1;
Change 1 to the ID of the original post and 2 to the ID of the post you want to move the comments to.
Note: You are making changes to your Wordpress database! If things go awry, you could lose your data. Make sure you have a robust backup strategy before you attempt to change anything.
January 31, 2009 3 Comments
Twitter: A greasemonkey script to show who follows you
A couple of days ago I saw @skap5’s comment:
“Dear Twitter Is it too much to ask to add a follower marker so I can know if someone is following me and not just if I am following them?”
I think that Twitter could benefit from displaying more information on the home page, and this idea was easy enough to code up. It should save some time and make the Twitter homepage that much more useful.
The script displays a tiny icon on top of the portrait of people who are following you back on your Twitter home page. It leaves your non-followers alone, though it would be easy enough to develop a version that puts silly mustaches on them.
This is only a first version, and I welcome your comments and suggestions.
If you already have Greasemonkey installed, get the script here, or install it from here as a Firefox extension thanks to the script compiler.
The icon is a free icon courtesy of famfamfam.
Updated February 5, 2009: The script has been updated to work with Twitter’s recent UI changes.
Updated March 31, 2009: The script has been updated to account for Twitter’s recent UI changes and the addition of AJAX updates.
January 1, 2009 9 Comments
Mobile app: WHEREAMI <username>
WHEREAMI is a mobile application that accepts a username as input, searches public profiles on various location-aware services, and returns the user’s last known location via text message.
Just text 41411 with whereami <username>, where <username> is a username that you or someone you know is likely to use.

For example, if you text whereami hmason to 41411, you’ll see a response much like the image to the left.
This app works on the principle that people tend to use the same username for many applications. The WHEREAMI script will search through a variety of web services for a result for that username. All of the information is public and available without logging in.
Right now, the script will search Brightkite, then Dopplr, and finally Twitter. If you know of another site with public user location information, please comment below and I’ll add it!
October 19, 2008 11 Comments
What am I like? How about you?
My Path 101 Personality Quiz Traits
Highest Scoring Traits
Lowest Scoring Traits
Like-minded people work in:
Biotechnology and Pharmaceuticals
Medical Equipment Manufacturing
I’ve always been skeptical of and fascinated by personality tests. On the one hand, it’s your personality — who could possibly know more about you than you do? On the other, there’s something alluring about quantifying your characteristics, especially when you can compare them to others.
These are my results from the Path101 personality test. Go see how you compare!
September 26, 2008 No Comments
Welcome
Hello, and welcome to everyone who found this site via Torley’s story on the Second Life blog!
I lead the Immersive Media Lab at J&W University. Several of our projects have utilized Second Life, including Virtual Morocco (cultural exchange and tourism promotion for the country of Morocco) and SLMetrics (a study of behavior modeling in virtual environments).
This isn’t a Second Life blog, but you will find LSL scripts and other related ephemera around.
You can subscribe to the RSS feed for this site, or find out more about me at HilaryMason.com.
July 21, 2008 1 Comment
The Essential Elements of Geek Culture (March, 2008)
I was talking to my web programming seminar about regular expressions and made an allusion to the xkcd comic on that topic. Unfortunately, none of them had seen it, probably because none of them were familiar with xkcd.
Students should become familiar with the concepts and practice of the discipline, but also with the culture and in-jokes that will help them fit in when they get into industry or graduate school. I also like to get people to laugh in ways that are relevant to the subject material (yes, I use a lot of cheesy geek jokes — ask me to tell you my LISP joke sometime).
I asked the Twitter community what other geek cultural elements I should introduce the students to, and here are the answers:
- The comics: xkcd, Penny Arcade
- The cute things: Kitty Hell, Pink Tentacle, Cute Overload, icanhazcheezburger (which is also, apparently, a business)
- Current events: Fake Steve, The Onion, Fark
- The blogs: Boing Boing
- The IRC: bash.org
- The shopping: Think Geek, Jinx
- The field trip: ROFLcon (Who wants to go?)
This list is thanks to (in order of appearance) @mediacrisis, @rubaiyat, @techpickles, @mattgillooly, @hempstyle, and @inkedmn.
March 26, 2008 7 Comments
LSL: Notecard Selector
One of my friendly librarian colleagues in SL asked if I had a script to generate dialogs and allow users to select notecards handy. I didn’t, so I coded it up. It seems like it could be useful to others, so here you go:
This script is in LSL, for Second Life. Just copy and paste it into a script, throw a few notecards into the object, and you’ll be ready to go!
// Notecard Selector // by Ann Enigma // This script presents users with a list of notecards in a dialog box, and allows them to select one // Note: The names of the notecards must be less than 24 characters long // This script is licenced under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License // http://creativecommons.org/licenses/by-nc-sa/3.0/us/ // configurable options string message = "Which notecard would you like to read?"; // the message on the dialog box integer command_channel = 616; // the channel on which to listen for commands (you probably won't need to change this) // the script list notecards; default { state_entry() { integer i = 0; // read the title of each notecard into a list for(i=0;i<llGetInventoryNumber(INVENTORY_NOTECARD);i++) { notecards = (notecards=[]) + notecards + [llGetInventoryName(INVENTORY_NOTECARD,i)]; } llListen(command_channel, "", "", ""); // listen for a dialog button press } touch_start(integer total_number) { llDialog(llDetectedKey(0), message, notecards, command_channel); // present the dialog } listen(integer channel, string name, key id, string message) { if (llListFindList(notecards, (list)message) != -1) { // this is a valid notecard llGiveInventory(id, message); // give the user the notecard } } changed(integer changed_bitfield) { // if the object's inventory changes, reset the script if (changed_bitfield == CHANGED_INVENTORY) { llResetScript(); } } }
March 17, 2008 13 Comments
Following a group of Twitterers without exhausting SMS
I’m at SXSW, and I want an ability to see the latest Tweets from the group of Twitterers that I follow who are here in the area. I also have a limited number of text messages on my phone (1500, but still).
I coded up a quick app that allows you to great a group of twitterers and see their latest tweet on a mobile-friend page. Check it out.
Comments are welcome!
March 8, 2008 No Comments
How to Control Second Life with a Wii-mote (on a Macbook Pro)
My research group had some fun controlling SL with a Wii-mote a few weeks ago. It’s easier than you think! Several people have asked how we did it, so I hope these quick instructions might come in handy.
- Download, install, and run DarwiinRemote.
- Turn Bluetooth on on the Macbook. You can do this by opening the Bluetooth Preferences Pane (Apple menu, System Preferences and choose “Bluetooth” under Hardware) and clicking the big “Turn Bluetooth On” button. If Bluetooth is already on, you can skip this step!
- Hold the Wii-mote in front of the Macbook and press buttons 1 and 2 simultaneously. The LEDs on the Wii-mote will flash.
- As you move the Wii-mote, you’ll see your movement plotted on the screen, as you see below.
- Drop down the option box and choose “Mouse Mode On (Motion)”.
- Load up Second Life.
- Fly! By default, you can control the direction with the direction keys at the end of the Wii-mote.
- Laugh with glee, because this is cool.
![]()
January 28, 2008 4 Comments






