Tuesday, March 13, 2007

Python, Perl, Forth

Python: Clever. Named after the comedy troop Monty Python, this language packs a lot of power into every function and feature. You find surprises around every corner, but you have to keep your eyes peeled or you won't "get" them. It keeps the amount of stuff you have to type to a minimum, so it's incredibly productive.

Perl: Newbie-friendly. This language combines incredible power and flexibility with a syntax that, although slightly ugly and perhaps even clunky, is extremely easy to pick up. Each function is very well documented, and everything can be done in More Than One Way -- so you can easily mimic the style of your favorite language.

Forth: Powerful. Invented by Chuck Moore in the 60s, this language at it's finest is basically a dictionary, some simple stack-based primitives, and an interpreter. You start at the bottom and work your way up, learning much in the process, especially how to factor your code. In Forth you can tell right away if your code has unnecessary complexity -- it's all right there in front of you.

I initially learned Perl, and still use it for most things involving text processing where my knowledge of Bash scripting doesn't suffice. Then I turned to Python, when I was interested in creating a Multiuser Dungeon (MUD) program, and learned a lot -- but couldn't quite master it. Lately I have spent several months (over the past 2-3 years) learning Forth, specifically RetroForth. It is a real eye-opener when you have to allocate your own memory on the heap, even for simple string manipulation.

This week I went back to studying Python. I think in terms of productivity and fun job opportunities, this likely holds the most promise. But I won't neglect the other languages I have studied, including Scheme, C, C++, and even Java. Each gives useful perspective and teaches one to think like a computer scientist in different yet important ways.

Sunday, March 11, 2007

What is Brainwave Entrainment?

Before you try any of the plethora of products out there utilizing binaural beats, check out this free open-source project: http://uazu.net/sbagen/. It is easy to use and can generate powerful scripts.

Now that you have a tool to try this out with, I shall endeavor to explain how this phenomenon works. Human brainwaves are divided into roughly four categories:

  • 0.5-4 Hz - Delta
  • 5-8 Hz - Theta
  • 8-12 Hz - Alpha
  • 13-30 Hz - Beta
The human brain tends to generate a lot of different waves at any given time. But one particular frequency will dominate. Delta dominates during deep sleep and sleepwalking, and Theta during REM sleep and vivid dreams. Alpha dominates during periods of relaxation and the early stages of falling to sleep, and Beta dominates when you are wide awake.

When you see or hear a stimulus at regular intervals, this generates a similar frequency in the brain. It's similar to hearing a tune and wanting to sing along. The main trouble is that your ears can't hear frequencies lower than about 30 Hz. That is where binaural beats come in.

If your ears hear two frequencies, one in each ear, the difference between the two is heard as a third tone. For example, 440 Hz in one ear and 450 Hz in the other ear comes off as 10 Hz. If you have it tuned to 1 Hz, you can tell even more easily -- that's one beat per second. So for example 100 Hz in the left ear and 101 Hz in the right ear produces a steady pulsing sound, which incidentally corresponds to a Delta frequency in your brain.

I am still in the process of testing brainwave entrainment at various frequencies. They appear to make me tired, energetic, and euphoric at various times. Theta and Delta unsurprisingly make me sleepy -- not something I necessarily want when I'm trying to get work done. Sometimes I just get a headache (probably from too high of volume). I believe when I find the right mix, it will be a very powerful personal development tool indeed.