hback - 0.0.2

This is an update to my hback memory game. You can always grab the latest version from hback-latest.tar.gz.

Based on feedback (kudos James and Joseph) I’ve refactored a lot of the code and added the following feature requests:

  • Left and right arrows toggle the buttons on/off. Joseph’s suggestion worked fine, but on my setup it only highlighted the correct button. This seems a little counterintuitive to me since the API calls it an “activation”; my version looks for key events and automatically toggle the buttons.
  • Game has a Pause mode which can be toggled on/off with 'p'
  • Added some comments ;-)
  • Added a score logger which I think would be cool for eventually analyzing lots of data (eg. pretty graphs of user improvement over time). This can be disabled with turnOffLogging=True in hback.hs, although I don’t see why you would want to: I’m not sending your data over the wire to analyze average IQs of Haskell hackers (yet).

I think the biggest changes are under the hood: I refactored the widgets and state data structures and, as a consequence, a lot of the remaining code. Hopefully the code is a little clearer on what it’s doing and why. Send in all your feedback and ideas! (I do try to get around to implementing them, eventually.)

Per user requests, here are some of the liberties I took with the original paper:
(more…)

Planet-Friendly Benz: The Mercedes Hybrid

I had an opportunity to ride around in on a Mercedes Hybrid this weekend. Who ever said Benz drivers are inconsiderate to the environment as they blast along in their AMG’s and S600’s? When they finally do arrive at their destination, they have no problem joining the greenies at their peace-loving rallies; and what better way to spread the earth-love than on a brand new bike?

Except, of course, this is Mercedes-Benz we’re talking about: among the first of car makers to introduce crumple zones, disc brakes, ABS, air bags, and electronic traction control systems. So forget everything you know about the bicycle! Welcome to the new age: with the help of alien technology the user can now pedal less and enjoy the scenery more. Let’s get down to the brass tacks; all of us here are technically-minded, Haskell and Lisp are not alien technologies, so why should a bicycle be? The motor is a 24V 300 watt DC Motor with a 20 cell 24V 5amp/hour Nickel Cadmium battery. For the less technically inclined that means we can go 19 miles at a nice cruising speed of 15 mph.

Mercedes Hybrid Bike

(more…)

hback - A Haskell N-Back Memory Game

hback-0.0.tar.gz
Update: Released hback-0.0.2
Download Latest: hback-latest.tar.gz

Based on a recent research paper that claims fluid intelligence could be improved by training working memory, I wrote up a dual n-back test memory game in Haskell and gtk2hs. This is an alpha release: all comments are most welcome.

Gameplay

The n-back memory game tests whether the player can remember if the nth previous turn matches the current one. The dual n-back test will measure how well the player can remember both visual and graphic stimuli simultaneously.

(more…)

hlean 0.1.2

I’ve updated the hlean program. Aside from some cosmetic changes, documentation, and cabal package options, the main change is the segmentation fault fix. The program now correctly builds as a cabal package and runs. See hlean for a full description and usage details. You can download hlean 0.1.12 here. See the included README.txt for installation instructions.

ghc, readline, and buffering woes

Here’s a very simple Haskell program:

import System.Console.Readline

main :: IO ()
main = do
  putStr "Key: "
  k <-  readKey
  putStrLn [k]

Looks pretty innocent, right? And it runs just fine with runhaskell. But as soon as you try to compile it with ghc and run it, Segmentation Faults occur. This was a bug that recently bit me with my hlean program.

(more…)

hlean 0.1.1

UPDATE: hlean 0.1.2 available

I needed a program to find duplicate files in my constantly growing jungle, commonly referred to as a $HOME directory. I also needed a real motivation to sit down and write something in Haskell. After several cups of tea, I realized I could kill both birds with one heavy laser-targetting sniper rifle. After all, isn’t that what they say about Haskell: once you can get it to compile, you’re almost done?

hlean.hs is a command line program that takes any number of directories passed as arguments, recursively find all files, hashes them (defaults to sha256), and asks what to do with any duplicate sets found. It works fine for me, but since this is the first release, there are certainly some rough edges and caveats. Additionally, only you are responsible for your data; use this at your own risk: I cannot be held responsible if your computer blows up in a freak fire accident and coincidentally all the monkeys escape from the zoo.

(more…)

FreeBSD 7.x Installation - Part 2

This is the second installment of getting FreeBSD up and running with minimum hassle. Do check out the first part.

In this installment we will setup the firewall, Xorg, and basic multimedia and development ports: all the basic essentials to make use of your desktop machine. The ports list is very skimp on purpose: since there is no way I can think of everything most of us use daily, I’m not even going to try. But if you can follow along and get this much setup, you will have absolutely no problem finding and installing all the actual applications you can’t live without.

(more…)

FreeBSD 7.x Installation - Part 1

This will be a quick walk through for installation of a FreeBSD 7.x system. The idea is to install a minimal system, recompile the base system with optimizations specific to the architecture, and then install all remaining software from ports (ala Gentoo Linux, except you get a stable BSD system :). This is more of a checklist for future reference and does not replace the FreeBSD Handbook and relevant man pages. Without further adieu…

(more…)

Obligatory First Post

In the wonderful tradition of the internet, this weblog is created to misinform the masses and entertain the few.

With the precedent already well established on the tubes of the interwebs, I will make no effort to research my material and curb my biases. Rather, by posting many half-baked and incorrect ideas, I will light the fire that hopefully attracts the fellow traveler along with the many likely moths. Whenever the kind soul in question takes the time to correct me, I will pass on any enlightenment in the modest cloak of updates: a writer is never wrong, he is merely free to change his opinion without justification.