CosmosDB – Vintage Edition

When seeing this #CosmosDB is the first thing that comes to mind 🙂

Google as Xerox PARC?

This wired article titled If Xerox PARC Invented the PC, Google Invented the Internet, is an old one – from 5 years ago, but it is still an inspirational read. So many things lined up for Google, to be where they are today.

I still get goose bumps reading that article – but then I am a geek, if that wasn’t obvious. Whilst, grid computing with GFS, MapReduce, Hadoop, are still very much relevant and great (and most others still trying to use and understand it); Dynamo (from Amazon) and BigTable lead to NoSQL which is great and still worth spending a lot of time learning, playing, and, experimenting – I would love to hear on what they are doing now with Colossus (think of that as GFS vNext), Caffeine and, Spanner.

7 years is an eternity and who knows what is cooking? And of course what are both Microsoft and Amazon doing to compete around this. How can you not continue to be excited the world we are living in? 🙂

bash on Windows is real–not a VM

I have talked to a few folks recently, and they still don’t believe bash on Windows (RS1) is ‘real’ and think it some kind of a VM. No it is not. It is the ‘real’ user mode running on Windows. It is not Cygwin, and it is not a VM. It is essentially all of the user mode (I.e. Linux without the kernel).

The kernel in this case is a wrapper around the NT kernel that translates the Linux commands to Windows and then things run. As far as Linux is concerned, its the same code and doesn’t have any changes). Technically this is called Windows Subsystem for Linux (WSL).

On windows, this is installed in the user space; so each user get their own instance effectively which is isolated from the other users. Once you install it (and if you are still reading this, then you probably know how to install it), then this shows up under C:\Users\your-user-ID\AppData\Local\lxss. If you can’t find that folder, you can still type it and navigate to it. Below is  a screen shot on what this looks like:

image

It is a little interesting and been mucking around this. Here is you can see the installation of gcc:

image

And here is the output of the CPU details:

image

root@localhost:/proc# cat cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 78
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 2808.000
cache size      : 256 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor
bogomips        : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 78
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 2808.000
cache size      : 256 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor
bogomips        : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 78
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 2808.000
cache size      : 256 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor
bogomips        : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 78
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 2808.000
cache size      : 256 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor
bogomips        : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

root@localhost:/proc#

All, in all a very interesting world. A few things to note:

  • This is still in beta, so there will be issues.
  • It is user mode and not server mode. Live with it.
  • There would be path issues if you stray into the 256 character limit of Windows and then try and manipulate it in bash.

Happy hacking!

bash and Windows 10 on Fire!

OK, now this is cool – not only is bash on fire, but I can miracast directly from Windows to another device.

The first video shows a few basic shell commands and then catches fire!

And this second video – essentially miracasts the same video you just saw on my TV without any special adapters. The TV is connected to the network and is showing a channel. Windows RS1 (“Anniversary Edition”) can find that on the network (from a Surface Book) and directly stream to that. The TV automatically switches over the input from cable and shows the video; and when I stop, it switches back to the cable input. Sweet. 🙂

What is Love?

#Love is … staying friends throughout a holiday with no WiFi. ????

Rules of Threading (revised)

I still stand by the rules of threading, but saw this on twitter and thought it was great.

How a litter of puppies can explain the rules of thread? Awesome. 🙂

Embedded image permalink

 

God Mode in Windows 10

Got this tip via Jay Doscher at work.
1. Right-click on the desktop
2. Select New ==> Folder.
4. Rename the new folder to this: GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
5. You should now have an icon labeled GodMode and the icon changes too.

GodMode Icon

And as you an see there are many things in there:

GodMode Details

PS – this also works in Win 7 and 8.

Playing with Google Glass

Don’t know how many folks know, but I got a google glass recently and only now have had some time to start playing with it. There were a few challenges but I finally got Glass ‘talking’ to my Windows 8.1 machine and can now replicate the glass display (that is a post for another time, but it did take me some hit and try to figure out what I was doing wrong). This is pretty important, as without this I won’t be able to show much demo’s or make it very useful.

Here are a few photos showing the silliness in the whole thing. In the second photo, I am taking a picture from glass, whilst taking a picture from Glass – does that classify as a Picture-in-Picture? Perhaps. 🙂

Google glass on Windows
Google glass on Windows
Glass and Windows 8 - picture in picture
Glass and Windows 8

The Wired Child

Interesting read for any parent!

The Wired Child

LeapMotion SEHException

If for some reason when you try and run your code and you get a PINVOKE exception (like the one below), then most likely you don’t have the LeapMotion binaries in your Debug (or Release) folders.

System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'Leap.LeapPINVOKE' threw an exception.
Source=LeapCSharp.NET4.0
TypeName=Leap.LeapPINVOKE
StackTrace:
at Leap.LeapPINVOKE.new_Listener()
at Leap.Listener..ctor()
at HelloLeap.MyListener..ctor()
at HelloLeap.Program.Main(String[] args) in c:\Users\amit.bahree\Documents\Visual Studio 2013\Projects\HelloLeap\HelloLeap\Program.cs:line 14
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
HResult=-2146233036
Message=The type initializer for 'SWIGExceptionHelper' threw an exception.
Source=LeapCSharp.NET4.0
TypeName=SWIGExceptionHelper
StackTrace:
at Leap.LeapPINVOKE.SWIGExceptionHelper..ctor()
at Leap.LeapPINVOKE..cctor()
InnerException: System.DllNotFoundException
HResult=-2146233052
Message=Unable to load DLL 'LeapCSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=LeapCSharp.NET4.0
TypeName=""
StackTrace:
at Leap.LeapPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Leap(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at Leap.LeapPINVOKE.SWIGExceptionHelper..cctor()

On the other hand if you get a SEHException from LeapMotion (something like the one below) then the issue is either you don’t have the right version of the assemblies (e.g. you are compiling a x64 version, but have the x32 binaries, or vice-versa).

System.Runtime.InteropServices.SEHException occurred
HResult=-2147467259
Message=External component has thrown an exception.
Source=Your.Some.Assembly
ErrorCode=-2147467259
StackTrace:
at Leap.LeapPINVOKE.Controller_EnableGesture__SWIG_1(HandleRef jarg1, Int32 jarg2)
at Somewhere.In.Your.Code bin
at Some.Assembly in d:\Data\src\SomeCode\YourFile.cs:line 23
InnerException:

The solution is simple in both cases to copy the binaries (which can be found in LeapSDK\lib) to the Debug and Release folders.

Sleeves and LeapMotion

I have seen this a few times now so I know it is not a one off, but it seems that the sleeves of my shirt seem to throw off the Leap Motion sensor and it detects it as another hand – and ends up showing three hands.

I thought it was my watch which might be causing some issue, but that was not it. It goes away when I am wearing a t-shirt, but the tracking is quite off when wearing a full sleeve shirt.

I have been meaning to record a video, but not had a chance to do it yet. I was wondering, has anyone else also seen something similar?

Writing a compiler using C#

I was cleaning out my old papers (finally!) and came across an old paper I had titled “Compiler Writing Tools using C#” which essentially shows how you can write a number of tools like lex and yacc but instead of C/C++ on Unix, you use C# and .NET.

This paper covers the tokenizer, grammar, DFA, NFA, etc. I think conflicts and precedence is one area it would need a little more work. But overall its a very interesting piece of work – especially for one to learn the ropes if a lot of this is new.

Of course, writing compilers with C, overall is not the most productive experience (it sure is fun though!); if you have never done it before Standard ML or Haskell would be a better place to start. If you want to stick to .NET and roll out your own language (or create extensions) then check out this paper on MSDN.

All of this brought back memories when I wrote my own C++ compilers mainly with those tools on Unix System V and also on Xenix. Most people did not know (or perhaps remember) that Microsoft had a Unix version called Xenix which was later bought over by SCO and eventually become part of SCO Unix. Back in the days I use to run a dual-boot machine with Xenix and DOS. 🙂

Creating Word Maps / Word Clouds

I am giving a presentation next week on NoSQL and as part of that I wanted to create a Word Map, similar to the ones I have seen in the Guardian over the years. After searching a little, I came across the following two sites which do an excellent job of this. Both of them allow a number of options to customise the output and I think are very cool!

The first one is Jason Davies, World Cloud that is open source and you can integrate online searches, twitter searches, etc. The word map below is an example output when I search “bahree” on twitter.

The second one is Wordle, which is equally impressive but is a closed Java applet with some portions of the code copyrighted by IBM. With Wordle, you can enter some text, use a RSS feed or enter a del.icio.us user name to see their tags. I use my blog’s RSS feed to create the word map below.

image

A great example of a MANET

I have been doing some research on MANETs and UAV’s and this TED talk is a great example of how a number of nodes operate in a MANET and implement some predetermined algorithm, which in this case is the Bond Theme Song. Worth watching. 🙂

Kinect SDK

Microsoft recently release the Kinect SDK which allows you to implement a Natural User Interface and program against it! There is a lot of interest  around including claims on how Robotics will change to how you can integrate a light sensor.

You can use Visual Studio (C++, C# and VB.NET supported) and get quite interesting results.

Here are a series of links below which will help you get started.

  1. Download and install the Kinect SDK
  2. Download and install Quickstart Samples and Slides (zip file)
  3. Understanding the Kinect hardware
  4. Setting up your Dev Environment
  5. Understanding the basics of skeletal tracking using the Kinect sensor
  6. Understanding camera fundamentals
  7. Understanding the audio fundamentals
  8. Playing with the Coding4Fun Kinect toolkit and seeing how one can build cool apps such as:

Keep and eye out on the Coding4Fun Kinect blog.

Tips on Buying a UPS?

After moving to Bangalore, it turns out that I would need to get one or more UPS’s for the machines at home. The place we will be moving to in a few weeks does have power backup, but if/when there is a power cut it takes a few minutes for the generators to kick in and is not instantaneous as I was thinking.

I have never bought a UPS until now and don’t have any experience with it – what are the things that I need to consider? I will have the following equipment running which will need to be powered up for about 15 minutes:

  • 4 Desktops (including a MCE and WHS)
  • Two 17” LCD Monitors
  • A set of powered Speakers (optional)
  • Few switches
  • KVM Switch
  • VOIP Phone
  • Wireless Router
  • DSL Modem

Would it make sense to buy a few smaller UPS’s instead of one big one? Which is a good one? How much wattage/capacity should I look to get? Can one get second-hand ones – are they recommended? Does the UPS required any maintenance or are they maintenance free these days? 😕

Of all the machines, the WHS is one of the most critical ones. Is there any UPS’s which work well with some Add-Ins? I am interested in WHS shutting down in an orderly fashion so as to save all the data whenever the UPS battery gets low (in case for some reason the generators don’t kick in).

Upgrading through every version of Windows

Upgrading through *all* versions of Windows from v1 thru to Win7.

Opensource ZigBee stack?

I was planning on getting the Telegesis ETRX2USB and wanted to know if there are any open source (or shareware) open source ZigBee stacks that I can use with that?

I also wanted to know if there is any opensource (or not too expensive), network management or network analyser for a ZigBee network? Essentially I want to be able to programatically view network and node information on the ZigBee network (e.g. S/N ratio, signal strength, etc.) – something similar to Ember’s Insight Desktop which shows the details I am interested in. I could not find anything specific and would be interested in getting ideas.