Tuesday, July 01, 2014

Why Sweatband/Helmet/Cap Could Make Better Wearable Than Watch

Compare to a wrist watch, sweatband/helmet/cap wearable provides the following advantages:

  • Speaker
    • Close to ears, can have wired earphone
    • Or simple a speaker close to head bone might work well
  • Microphone: being at fixed distance from your mouth, and close to head bones, the microphone can be designed to be efficient. Compare to watch, you no longer need to raise your hand to talk
  • Camera: head is always more stable, and provides good stabilization for human vision, thus better for camera too.
    • More stable than watch
    • Better view of the world around you (imaging playing tennis, rowing boat or skiing, a camera on the watch won't deliver much quality)
    • Panorama with multiple cameras is possible
  • Ambient Light Sensor: wrist watch are frequently under sleeves or in pockets, it just cannot give an accurate reading of the user's actual ambient light. However a sensor on the head enjoys all the day light a user might enjoy
  • Physiology Measurements: there are way more vital signs that can be measured near brain than on the wrist
    • Skin resistance change: monitor sweating
    • EEG (brain waves): measure brain activities, alertness, attention and focus, etc. Might be good for mediation, board games, ...
    • EOG/ENG: Eye movements tracking, can be used to diagnose dizziness, balance problem, ...
    • Hear rate: pulse can be taken from temple
    • Blood pressure: can be taken from temple
    • Blood oxygen level: can be taken from temple
    • Body temperature
  • Movements tracking: because they are on head rather than wrist, they subject to less swing or up and downs, can track human movements more accurately
    • Orientation tracking is more accurate (in terms of North/South/East/West and also Up/Down. You will have more confidence in telling the user is in upside down position.)
    • Acceleration is more accurate. For example, when basketball player go for a slam dunk, their hand movements will be very complicated, and you won't know how much power they put in the jump, or how high their jump is, but a sweatband (LeBron James?) can give very accurate reading;


Disadvantages?

  • The electronics on sweatband has to be feather light
  • Not suitable for work place in the current western culture (while wearing watch at work is widely acceptable, wearing a band or cap at work is still a bold fashion statement)
  • The user cannot see it (Oh, maybe something like Google Glass, but retractable will solve this problem)
Potential Applications
  • Yoga training
  • Meditation training
  • Sleep disorder assistance: it knows your toss and turns, you blood oxygen level change, heart rate change and eye movement changes (rapid eye movement sleeping), ...
  • Patient assistance: dizziness, epilepsy early warning
  • Sports life panorama video 
  • Athlete training assistance: tracking and feedback on gait, gravity center change, speed, acceleration, fatigue, ...
  • Car Black Box: it is no longer necessary, just make sure your cap power is on
  • ...
(Published on July 1, 2014, All Rights Reserved)

Wednesday, June 04, 2014

Apple's Swift language - first impressions

Just a quick first impression.
Pros:

  • Lots of language sugar, should reduce some boilerplate code
Cons:
  • Deviation from JSON format see to be arbitrary decision. Why not 

let people = {"Anna": 67, "Beto": 8, "Jack": 33, "Sam": 25}

  • Plenty other seemingly arbitrary decisions that are not intuitive. E.g. 
    • Use let to make a constant and var to make variable (why not const vs var?)
    • func getName() -> String, why not func getName() : String?
  • The biggest problem probably is still same as Object-C, you learn it to only write client program for one vendor's hardware. Will Swift ever be open and adopted on server side or other vendors?

Wednesday, May 28, 2014

Coldfusion 9 CFQuery problem

Environment:

  • Coldfusion 9.1.1.274733
  • MS SQL Server 10.50.1600


Symptoms
Here is a really weired and rare problem. With a CFQuery tag like this:
<cfquery datasource="..." dbtype="ODBC" name="local.qry" result="local.result"></cfquery>
I'm getting error message like these:
Element QRY is undefined in LOCAL
Or
Variable QRY is undefined.

After some digging, I found the cause, and subsequently an interesting solution.

Cause
I ran the query in SQL Server Management Studio. The "Results" grid is showing no rows. The real interesting thing is that the "Messages" panel actually has a warning which took me a while to notice:
Warning: Null value is eliminated by an aggregate or other SET operation.


So if all the following conditions are met, my query variable will became undefined, instead of an cfquery object with no row.
  • Result is empty
  • A warning is shown when run the query in SQL Management Studio
Solution
In the SQL query add this line on top to suppress warning:
SET ANSI_WARNINGS OFF;
(I found this solution here: https://forums.adobe.com/thread/577811?start=0&tstart=0)

Thursday, May 01, 2014

Github Public Repository Created to Illustrate Selenium WebDriver + ExtJS + JUnit

I posted a series about ExtJS testing using Selenium WebDriver and JUnit. They turned out to be pretty popular. Some reader want to see more implementation details. I committed a Github public repository with complete implementation of the core concepts described in my post. Here is the link:
Github Public RepoSJTXE(Selenium Javascript Testing eXtension for ExtJS)


By the way, you might also consider testing using Jamine and PhantomJS. They are better for blazing fast unit testing. Not quite fit for GUI testing though.

Friday, March 07, 2014

Mutli-line String Literal in Java

Eclipse Preferences: Java > Editor > Typing, check "Escape text when pasting into a string literal". Once turned on, it automatically add "\r\n" when I am pasting multi-line string into a string literal. Very nice.

Wednesday, March 05, 2014

Windows PowerShell Script to Delete Old Files

Just starting to dab into PowerShell script after it has been in the wild for 8 years. Turns out to be surprisingly good. First you have a nice editor (PowerShell ISE), second is the vast amount of cmdlets that make coding go fast.

Here is a script to delete old files that are 30 days or older. It used to take at least 40 lines of VBS to achieve.

Before you get too excited, a few things to be aware of:
  • Availability of PowerShell: WindowsXP may not have it, and Windows 7 may only have it up to version 2. So, if you found some exciting cmdlets, chances are they are not available on your OS by default
  • Executing a PowerShell file takes extra effort. It's forbidden by default. So you have to do either of the following:
    • Open PowerShell, and execute this command: 
         Set-ExecutionPolicy RemoteSigned
    • Or, when running a file use this command line (notice full path to the ps1 file has to be provided here): 
         PowerShell.exe -ExecutionPolicy ByPass c:\scripts\myScript.ps1


Tuesday, February 11, 2014

Read MS Access File into CFQuery

Here is code snippet that will read arbitrary Microsoft Access file, and return the result in CFQuery. No Coldfusion data source is required.

Environment:
- Coldfusion 9, 64-bit

Notice, in the snippet, there is a dump of all DB drivers loaded by Coldfusion. So, if you ever need access to other dynamic data connection, just swap out the connection string in the sample.