If you're just getting started with Scala and/or the Simple Build Tool, I hope the following video will help. It's a five-minute introduction to the Simple Build Tool, or SBT:
I hope that was helpful. I'll try to make more Scala and SBT videos as time allows.
If you want to connect to the NeuroSky ThinkGear API -- what they call the ThinkGear Socket Protocol -- this code shows you how to do it, at least in Scala. It consists of a few pieces of code I pulled from this GitHub repo. I wrote this code to help debug a problem I was seeing with the data.
The RawReader class does all the work. It opens a socket on the right port, then sends the necessary JSON to that socket to get things started. After that I just read the raw data that the API writes to the socket.
This is the fifth in a series of tests using the NeuroSky MindWave headset, their ThinkGear software, and my own custom software to record brainwaves over time, and graph them. I intentionally tried to focus/concentrate very hard at the beginning of this test, and then transitioned into meditation. I continued to meditate throughout the session, but according to their software/hardware, I tailed off at the end. In my opinion, this is a problem with their hardware -- it becomes less accurate as you use the system longer.
Wow, this is just wicked. I lived in Talkeetna, Wasilla, and Palmer, Alaska, and never had air conditioning the entire time. I hope everyone finds a way to stay cool.
The premise is this: You put on a MindWave headset, start the recorder, and then do whatever you want to do -- work, meditate, sleep, whatever -- and the recorder records your brainwaves while you do those things. It writes the data in a CSV format so you can graph it, or do anything else you want with it.
After hearing about ShadajL’s presentation at Scala Days 2013 using a MindWave headset, I decided to buy a headset to see how if it really works. After a little while I got the hang of using the headset, so I decided to try ShadajL’s NeuroSky Scala library (named neuro-thinkgear) to see how it works as well.
If you ever wanted to get access to global operating system keystrokes from a Java or Scala Swing application, you can do it with the jnativehook library. Here’s a short demo:
Here’s the full Scala source code for the demo. I put a few comments in the code to highlight the important areas:
Is Swing dead? I don’t know. I’ve written several Swing apps that I use every day, but I can’t speak for the rest of the world.
What I can say is that I really like Scala Swing. How I wish it was available ten years ago ... you’ll never know.
But getting to the point, after working with Scala Swing a little bit, I decided to see if I could write a web browser with it. The short answer is that here’s what the browser looks like:
I ordered one of these Brainwave Starter Kits today. It includes something called a MindWave Mobile device, which is supposed to provide some brainwave biofeedback. I did this out of curiosity after learning that a young developer created a Scala game that he can play with biofeedback.
The Scala Cookbook is coming soon ... July 22, 2013, to be exact. It’s available for pre-order on Amazon.com now, so I thought I’d share some information about the book here today.
I woke up this morning thinking it must be about 200 days to Christmas. Foregoing any easier ways to determine that, I decided it would be a good time to use the nscala-time library, a Scala wrapper around Joda Time.
Sticking with the time theme, I haven’t much free time today, so without further ado, here is some Scala code that determines the number of days between today and Christmas: