May 30th, 2008

Iterating Sparse Arrays in Lua 5.1

The Lua programming language is a scripting language that is light-weight (in terms of both syntax and size), fast, and easily embedded. I won’t spend a lot of time introducing Lua here (though I may do that in another article). If you haven’t used it, but you’re interested in getting started, a good place to look is the well-written Lua documentation.

I’m currently writing a library of higher-order functions in Lua called lua-functional. One of the early challenges was how to allow iteration over sparse arrays. Out of the box, Lua doesn’t stops iteration after reaching the first nil value. This article explores a two possible solutions to this problem and their consequences.

Read the rest of this entry »

May 13th, 2008

Samsarin PHP Widget 1.3.2

I’ve just posted the latest update to the Samsarin PHP Widget. This version adds the ability to clear out the contents of one or all widgets with the click of a button. It was also qualified with Wordpress 2.5.1 in Firefox, Safari, and Internet Explorer.

Thanks go to Kris for help in testing this feature.

May 5th, 2008

Cool learning software: Mnemosyne

A couple weeks ago I came across an article about learning through spaced-repetition. The article claims that when you first learn something new you will tend to forget it rather quickly, but if you recall it at an optimal time (near when you would forget it) you will remember it for an even longer interval. As you continue to recall this information at these critical points the interval grows longer and longer, until it is measured in years. The article refers to software called SuperMemo, which can be purchased for the Windows operating system, but is not available for OSX, which I happen to use.

The idea of spaced-repetition was interesting enough for me to experiment. Initially I thought I might be stuck writing my own software, but fortunately I came across a very cool open source project called Mnemosyne, which works similarly to SuperMemo: it uses flash cards that quiz you on a piece of knowledge at critical times determined by its algorithm. Here’s an example of one of the cards in my system (from the European geography card deck):

Mnemosyne Screenshot

Cards can include graphics, sounds, or text. You can import card decks or you can create your own. I’ve been using it for about about two weeks to study European geography and Spanish (in combination with LiveMocha). So far, I’ve found the system to be very helpful with both subjects, so I will continue the experiment. If you’re interested in learning a new subject, I would definitely recommend taking a look at this.

Read the rest of this entry »

July 2nd, 2007

Samsarin PHP Widget 1.2

This new version of Samsarin PHP Widget increases the number of widgets available from 9 to 25. Enjoy!

May 21st, 2007

Samsarin PHP Widget 1.1

I’ve just posted Samsarin PHP Widget 1.1. If you are using Wordpress 2.2, please upgrade to this version. Wordpress 2.2 introduced an incompatibility in the widget library, which this new version addresses. Thanks to JR and Kathryn for posting comments and helping me locate this issue.

March 11th, 2007

GNU Screen: Working with the Scrollback Buffer

GNU Screen is a UNIX tool that allows multiple console applications to be run, each in its own “window”, from the same terminal. In a single Screen session, you can run interactive shells, mail programs, SSH sessions, and other console based applications, and you can easily switch between these using hotkeys. You can even split up the Screen display so that multiple Screen windows can be viewed at the same time.

If you’ve never used Screen, but frequently use console applications, it is definitely a tool worth exploring. An introduction to Screen can be found on the Kuro5hin website.

In this article I share my experience with one of my favorite screen features: its scrollback buffer. As you interact with a Screen window, Screen stores a configurable number of lines of history in its scrollback buffer. The scrollback buffer makes it easy to browse or even search through the history of your windows. In addition, it makes it easy to copy and paste any section of text from the history.

Read the rest of this entry »

March 10th, 2007

Samsarin PHP Widget 1.0

I’ve received numerous requests for the Samsarin PHP Widget, so I am happy to announce that is now available here. This widget makes it easy to add PHP code into the sidebar while using Automattic’s Widget plugin.

March 10th, 2007

Samsarin PHP Widget

If you are not familiar with Wordpress widgets, take a look at Automattic’s Widget plugin. The plugin makes it easy to reconfigure your Wordpress sidebar by dragging and dropping widgets into place on a sidebar menu.

The Samsarin PHP Widget adds a new text widget that allows PHP to be included inline.

Read the rest of this entry »

August 2nd, 2006

Customizing WordPress Home with Thumbnailed Articles

Though WordPress websites often have a very similar look and feel (lists of blog posts), it is actually very customizable. In this article, we explore a way to make a unique home page that displays a list of articles with thumbnails (see the final screenshot below).

Final Page

Read the rest of this entry »