Wednesday, December 28, 2016

new keyboard

My corsair k70 RGB broke a little while ago and I was relying on my Macbook keypad for most of the typing. Coming from mechanical keyboards, it was a difficult choice to stick to laptop keyboard especially when sitting when you are on a desk. I decided to have a backup keyboard. My hunt started with few specific needs.
  1. Should be mechanical type
  2. Not heavy on the pockets
  3. Compact
Now That the Cherry's patent has expired for the mechanical switches, we can find tons of imitation keyboards on the market. I found few keyboards online which falls under this bracket. 

AUKEY Mechanical Keyboard

Though I have few products from Aukey, I was a bit reluctant looking at the specs and the images. [ My impression is purely by the specs and published images ] 

LINGBAO JIGUANSHI Mechanical 

First thing that caught my eye was the size. This is a compact size 87 keys. Look wise its alright. But to make decisions purely on the aesthetics is not wise. 

Qisan / MagicForce 68-Keys Mini Design 
This one looked interesting aesthetically. It uses Cherry MX - Red. My previous keyboard was Brown. This comes in different flavors. You could choose OUTEMU Or Kailh or Cheery Mx. I was a bit surprised to see these option from one manufacturer. I chose the cherry MX Red which at the time of purchase was £63 on Amazon. I Will leave the link for all the 3 variants below. They have one without backlight. But, who would want one without backlight! I have been using MagicForce for over a month now and I am pleasantly surprised how good It feels. And the build quality is amazingly good for the price I paid. I am so comfortable with this that my K70 is in the drawer, I could not find time to fix that. Qisan Mechanical Keyboard Cherry MX Red http://amzn.to/2hqTIJz 
Qisan Mechanical Keyboard Cherry MX Brown http://amzn.to/2hLhBcz 

Cheaper option without backlight Qisan OUTEMU switch http://amzn.to/2hlCLgm

Friday, November 25, 2016

Embed git commit hash in a scala web service

One of the Scala service I was working on needed an endpoint which would inform what version of the code has been deployed on the server.

There are multiple ways of doing it. Embedding it into Manifest files is one easy way, but I found this https://github.com/sbt/sbt-buildinfo plugin.  It works by generating a scala source file from build definition. Full details can be found here

Project name, Version and other build time details are already defined in build.sbt file of the sbt project. Now I need git details to be added to this BuildInfo.scala source file.

https://github.com/sbt/sbt-git plugin does exactly what I need. It's a plugin which offers git integration with sbt.  Now I can use sbt-git to fetch commit SHA and use BuildInfo plugin to generate scala source which stores this information at build time.

build.sbt file looks like this

import Dependencies._

name := "myService"
version := "0.1"
scalaVersion := "2.11.8"
libraryDependencies ++ testLibraryDependencies
val gitCommitString = SettingKey[String]("gitCommit")

gitCommitString := git.gitHeadCommit.value.getOrElse("Not Set")

lazy val root = (project in file(".")).
  enablePlugins(BuildInfoPlugin).
  settings(
    buildInfoKeys := Seq[BuildInfoKey](version, gitCommitString),    
    buildInfoPackage := "buildInfo",   
    buildInfoOptions += BuildInfoOption.ToMap,    
    buildInfoOptions += BuildInfoOption.ToJson
  )

After compiling my project, buildinfo plugin will generate BuildInfo.scala source file in target->scala-{version}->src_managed directory. This source contains the app version and git commit hash




 BuildInfoOption.ToJson
Above line enables it to render into json format.

I added a new route for the service  /version
package com.brainchunk.routes

import akka.http.scaladsl.server.Directives._
import buildInfo.BuildInfo

trait VersionApi {
  private val resource = "version"
  val versionApi =
    path(resource) {
      get {
        complete(BuildInfo.toJson)
      }
    }
}

Now the endpoint should return json as below

$ curl localhost:8081/version

{"version":"0.1", "gitCommit":"23962adddf6e55d3f43466283cd3418a9133ee6c"}


Note:
IntelliJ IDEA is not very happy with this BuildInfo being in target/../src_managed location. Workaround has been mentioned here

https://youtrack.jetbrains.com/issue/SCL-7182#u=1402953965717


Sunday, July 03, 2016

Image classification with TensorFlow

Lately I am spending time experimenting with scikit-learn and TensorFlow (Google) open source library for Machine Learning.

Using image recognition library from TensorFlow, I hacked together a web service with an end point where I can send an image and get back with prediction for the content of the image.
To consume the API, initially I thought of making an Android app, later it made sense to follow up on my previous post and use a chat bot. My experimental project was simple, I should be able to send an image to my chat-bot in WhatsApp, and get back the prediction.

Tensorflow is easy to learn and use and it has decent documentation. I trained the model using sample image database downloaded from google example. To create the web endpoint, I used flask, a python web framework.
Now I can test, my web service by uploading my test image
          


Prediction :
[
  {
    _score: "0.623313",
    _string: "catamaran"
    },
    {
      _score: "0.099451",
      _string: "dock, dockage, docking facility"
    },
    {
      _score: "0.0621891",
      _string: "liner, ocean liner"
    },
    {
      _score: "0.0246246",
      _string: "fireboat"
    },
    {
      _score: "0.0244034",
      _string: "speedboat"
    }
]
Prediction engine is 62% sure that the image is of a catamaran. Close enough.

Now, I could hook this up to my WhatsApp bot. I used yowsup python library to get this up and running. I just had to register my spare mobile number with WhatsApp server. With a bit of fiddling around, the bot was ready to talk to the prediction API.
Now I can send a picture, and get back the prediction in JSON format.

Screenshot_20160619-183759.png



Thursday, February 19, 2015

Current state of Wearables and Clinical trials

I have been fascinated by sensor networks from my graduation days. Spent many sleepless nights playing around with Microcontrollers, miniature robots talking to each other over a close net WIFI network using XMPP. Then in 2005 something terrible happened, I got a job. My journey into software development world started. But electronics and hardware has always been my main inspiration.

My fascination with sensor network started from my pre graduation days, I hadn’t heard the term IoT at that time. It was all Wireless sensor network, building miniature robots sending messages to each other over bluetooth and closenet WIFI network. Good old days…

Looking at the current trend with wearable technology and healthcare industry, it seems that the way forward for clinical trials is remote uninterrupted data collection or Device Driven Clinical Trials as I like it to be called. This is nothing new, but the concerns I have is with the wearable devices available in the market today. These limits the usecase for collecting sensible data. For example commercial fitness band/activity trackers like FitBit,Garmin is more focused towards capturing the activity like Steps, Run some times heartbeat. These data is good to track ones activity but would fail when it comes to collecting data for a clinical trial [ it may sound exaggerated, but bare with me ]

Consider a usecase where a patient signup for a clinical trial which is using cutting edge technology to capture data from the patient. He would be given a traditional “fitness band”  so that his activity can be electronically captured.  What happens if the patient experiences a sudden increase in his heart rate? And data is captured in the EDC as at 7:00PM the patients heart rate is 110bpm. We cannot make sense of only one kind of objective data.

To have a meaningful metrics we need meaningful data. To capture meaningful data we need to have as much objective data as possible. To achieve this we need to look at the kind of wearable fit for the purpose.

IoT for the rescue:
I am using IoT loosely here. Internet of Things has become a phenomenon far greater than selfies. people took selfies even before the invention of digital cameras, but only recently ‘selfies’ became an internet rage.

IoT in wearables, in other terms can be described as connected sensor network. Below is a simple breakdown of what would consist of a wearable suitable in the field of clinical trials [ not just limiting to the ones mentioned]
Screen Shot 2015-02-18 at 22.19.58.png Screen Shot 2015-02-18 at 22.20.39.png



Heart rate at 110bpm alone does not given enough information, patient may be just playing, or having an argument with his wife or even it may be due to severe  side reaction to a drug. Other data such as respiration rate, perspiration and body temperature to name few we may would be useful. All these data can be transmitted in realtime to a cloud service and later imported to an EDC system.

These sensors can be embedded in a smart clothing, that we we won't be embarrassing patient by making them wear a computer over there neck and looking for a power outlet.

In the next post I will share the setup I have developed using Android/MQTT/RoR/MongoDB/ to capture the data into an intermediate datastore and later can be pushed to any Electronic data capture system

Saturday, November 17, 2012

OpenHome with BubbleUPnP

with UPnP device we get a wireless freedom of streaming content on many devices. With many more devices being DLNA certified there are many more kind of devices hitting the market right from mobile phones to smartTVs. In DIYers world one good thing about non proprietary software stack means more freedom. Many years DIY home media servers have been rely on open source software to stream content through out the house. Having to setup this by yourself is a mighty task given the complexity of h/w supporting the s/w, for such kind there is always a non-cheap option [ set up a small apple shop at home iphone+ipad+appleTV] for the rest we have mediatomb, minidlna to name a few.

In my case, I already had minidlna running on my pogoplug seamlessly streaming video and audio to my devices. The missing functionality of a good home media system is the media renderer. [ note: this is different from client, a dlna client can be used to browse media server content and play them, while a control point+renderer allows you to play the media on a different device] Consider a simple use case, you are watching a movie in the living room and you decide to watch it in your bedroom TV, in this case, using a control point you can transfer the movie to continue on the TV in your bedroom.

There is no single open source software which has such great feature [ LinuxMCE was an interesting project, Openhome.org is another interesting project ]. But can be achived with combination of tools. For my setup I chose BubbleUPnP.

BubbleUPnP server has the support for creating an Openhome playlist which is exactly what I was looking for. This feature helps in setting up the device specific playlist. This means you can have different playlist per renderer, your living room TV can have a different playlist and your bedroom hifi system can have a different playlist, and since the playlist is not savedin the control point, you can switch from one rendere to another with outloosing the playlist.

setup:
Seting up BubbleUPnP is documented for windows and Linux systems. For my setup i wanted to run BubbleUPnP server on my pogoplug , rendere on my HP touchpad and control point on my Nexus one

Media server:
pogoplug running minidlna+BubbleUPnPserver
HP touchpad BubbleUPnP rendere
Nexus one  - BubbleUPnP rendere+controlpoint

BubbleUPnP server setup:
Getting BubbleUPnP server up on pogoplug is a bit tricky. It needs java to be installed first. Download the latest java runtime for embedded linux from oracle site, untar the file

tar zvxf ejre-1_6_0_34-fcs-b04-linux-arm-sflt-eabi-headless-19_jul_2012.tar.gz
mkkdir /usr/local/java
mv ejre-1_6_0_34 /usr/local/java


Next download the server package from here http://www.bubblesoftapps.com/bubbleupnpserver/
and run the script
bubbleupnpserver/launch.sh
if Java installation is successful, you must now see that the server is running and You can configure the server and renderer from the webinterface on http://:5850

For further configuration related help can be found here

Thursday, October 11, 2012

Jenkins Slave and Domain user profile

Jenkins has a neat feature of configuring your Windows Slave to run as a domain user. This is important feature when you have a configuration set for a particular user in the domain and you need to use that profile when you start the slave from. This pretty well works if followed the exact steps as mentioned in jenkins wiki and forum, how ever I couldn't get this working right may be I was missing few steps there. 

In my case, Mapped network drive was not available when I run a windows batch command from jenkins.
I did some debugging using a simple Job which prints the path and the %username%, I found that Jenkins Slave was running as admin account. So now I have the root cause being found, I headed to stackoverflow, found dozens of people having similar issue, followed all the possible solution provided by experts there, but non worked for me. With hope of finding some answer I explored jenkins service on my slave machine, interestingly I found a parameter Log on as:... , it was clear that if I could give the domain user details here, the slave would start with domain user credentials. This one Step solved my hour long problem. 


Friday, May 04, 2012

Samsung Galaxy S3 coming to Vodafone-uk


Vodafone announced the launch of latest and the greatest [ for now] of the smartphone to be available in UK exclusively on their Network.

More info..
http://blog.vodafone.co.uk/2012/05/03/the-samsung-galaxy-s3-is-coming-to-vodafone/

Friday, April 27, 2012

Rasberry PI: Too long a wait

Today In my mail box.

"Dear customer,

Having successfully passed its CE compliance testing, we can now confirm that your Raspberry Pi will be delivered by the end of June. You will receive a confirmation email prior to your Raspberry Pi being shipped.
Prepare for your Raspberry Pi
Get ready for your Raspberry Pi by downloading all the software you need. To get started, visit our download centre.
If you have any further questions, please visit our FAQ page on element14 for more information.
Once again, thank you for being patient. We hope you’ll enjoy the limitless computing potential and enjoyment the Raspberry Pi offers.
Farnell element14 "

Should I be happy that i got the shipping dates, or mourn till I get it!!
Thinking about the possibilities of this little beast, It would be worth the wait

Monday, February 20, 2012

Family portrait



My most loved Nokia N900, along with other devices,

2. Google Nexus - Android Gingerbread
3. Nokia C7 running Symbian/Nokia Belle
4. IPhone 4

My preference follows the list above :)

Wednesday, October 19, 2011

DIY: convert your SIM to Micro-SIM

for all you DIYrs , here is a template to cut your normal SIM to a Micro SIM form factor. Micro SIM is supported by many handset manufacturer.




A simple template is available here as PDF, go ahead and give it a try.


Original post: http://www.stochasticgeometry.ie/2011/10/13/n9-unboxing/
you have to Scroll down to see this DIY.

P.S. do read his other post, really interesting blog.

Wednesday, October 12, 2011

vahIna: search for vehicle Information

Another simple application developed in my spare time. This app can be used to search for vehicle information by entering the Vehicle registration number. Works for Karnataka registered vehicles.

Update:
Application is available in the android market, below is the link

Who can use this application?
- Second hand Car/ bike dealers or consultants. They are constantly approached by sellers to help them sell there vehicle. This application can help them quickly identify the Owner and the car details.

Screen shots of the application:

Tuesday, October 11, 2011

simple Android app to search Indian Central Acts

I have developed a simple Android based application to search for Central Acts of Parliament as on Date right from 1836 onwards. The data includes all the Sections, Schedules, Short Title,Enactment Date and also very significant Foot-Notes in every act.

Search facility is available on the fllowing fields:

1. Act Number
2. Free Text Search

Below are the screen shots of the application.

Main view , search by Act Number

Result obtained is shown as below, you can download the full text.

Search by entering free text


why i developed this?

Short answer is "Just because It can be done."

Saturday, July 23, 2011

NAS@home

Finally Debian is up and running on my NSLU. It took 12hrs to get it working, with power cuts in the middle of installation i was scared that i would brick my device. luckily all went well.

Current Setup,

NSLU running on debian lenny
OpenSSH
Mediatomb
samba
motion - for webcam

todo:
3gUSBModem support
DynDNS - so that i can access my NAS and security cam from internet

Monday, June 06, 2011

DIY gorilla-pod

On a casual visit to SP Road, found a shop selling Loc-Line modular hose at Rs 99/pc. Couldn't resist to start off my DIY tripod build.

Parts:
  1. 3 modular hose at Rs 99/pc




Bolt and Nut matching the size of the camera mount. Typically a standard size for most of the cameras.

small piece of Acrylic Sheet. I had few pieces left from my previous projects,it a 6mm sheet. A drill to make the holes for the hose.


Just took 30mins in assembling , and works great.


Unfortunately the camera is busy doing its job else where. [ these pics are from my N900 ]
will post the actual camera mounted on this soon.


Next step:
building a holder for my N900, to make it compatible with my new tripod








Thursday, May 12, 2011

My new toy


Just bought this, there was an Indian made available in local electronics market, but the build quality was way to0 bad.

Sunday, January 16, 2011

Google Realtime + Google Alert = Push Twitter... sort of

"It lets you see up-to-the-second social updates, news articles and blog posts about hot topics around the world" This is what Google has to say about its offering called RealTime Search. This has a very good feature where in an email alert can be created for social updated or new topic discussion happening around the world and in outerspace ;) One example use case would be to set an alert such that when somebody mentions your twitter handle you can get an instant email alert.

To set up ,go to http://www.google.com/realtime then type in your handle for me it is @brainchunk. Google would populate the real time results. Now scroll to the bottom of the page where you can see "Create an email alert for @brainchunk", Click on this and you would be redirected to Google's another service Google Alert, here set your preferences. That's it. Next time some one mentions your handle you would get an instant notification. This is just one use case of Google Alert. You can Create many other Alerts as well.

Sunday, November 21, 2010

Sony W90 under my knife


A water damaged sony W90.
few drops of sea water was enough to corrupt its circuitry.

Sunday, October 17, 2010

Google Reader and Twitter

I am more addicted to Google Reader than twitter. Once nice feature in Reader is that you can get instant update from twitter, Just Go to "Add Subscription" enter the twitter handle name, and do a search. The updates are now in my Google Reader :)

Sunday, November 15, 2009

samsung mobile innovator 2009: bangalore

Samsung held a samsung mobile innovator 2009 core member meet on 13th November in Bangalore.
Agend of the meeting
release of Java SDK ,Windows SDK, Sansung App store called the A-Store and a small announcement of their new platform Bada.

Though Bada was in already big debate with why samsung would try to get a new platform into already crowded mobile OS space, Samsung kept it very low saying that this is an super set of their earlier famous proprietary platform SHP and targetting mid and higher mid range phones. "Current mobile OSs is not very open to operators and since we are closely working with operators we have open up the device for developers to exploit the network services and the device capability", said Amy VP, Samsung india

Amy said, the device based on BADA would be available by April, 2010.
He aslo added BADA would open up the access lower level to developer with exposing over 2000 more APIs. he also mentioned, this is the first time any one is giving in dept device access.

For a question from one of the veteran from mobile Apps space "with Bada, would samsungs be less focus on other platform like windows and symbian?" the samsung team give an very polite answer saying that samsung would keep its current focus on other plaform and continue its product lines.

Bada SDK would be available soon and development would be based on C++. Bada is a suer set of SHP and BADA apps would not be backward compatible with SHP phones.

Saturday, October 24, 2009

My last blog post as....

and tomorrow i will be a "married man" ,
and will be more responsible... hopefully