Windows Tesla Auth Token Generator

If you have a Tesla, and are using (or wanting to use) 3rd party tools or data loggers, the one think they of course need is to authenticate your details with Tesla. A simple, but insecure way is to use your Tesla credentials - and surprisingly many people just happily share and use this. I wasn’t comfortable doing this - after-all, they have access to your account where you can control a lot of things....

August 6, 2018 · Amit Bahree

Download Build deck and video (2018)

Just as last year , I wrote a PowerShell script using which you can download the PowerPoint decks, and, videos from Microsoft Build’s conference, instead of streaming it (or manually download it one by one). You can choose if you want the decks, or the videos, or both. For the videos you can choose the desired resolution (Low, Medium, High) – of course the higher the resolution, the more space is needed....

May 27, 2018 · Amit Bahree

Download Build (2017) decks and video

Update: Modified the script to handle multiple instances but pay heed to the warning here . Similar to last year , I have a PowerShell script that will allow you to download the various PowerPoint decks and videos to watch locally rather than stream. This makes some improvements from the earlier scripts (e.g. if a file is already downloaded it will skip downloading it again) and does the following: Creates the relevant folder which includes the Session details (including the Title, and the Presenters) For each session, saves the description in a text file in the created folder....

May 24, 2017 · Amit Bahree

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....

April 20, 2016 · Amit Bahree

Download Build (2016) decks and videos

Update - Was a typo in the script, which I fixed. If someone had an issue, copy it again and give it a go. I prefer to download and see the decks and videos ‘offline’ instead of streaming, as I can easily pause them and then pick off where I left - especially handy when I need to go to a meeting, or take care of some work, or just on a crappy network....

April 13, 2016 · Amit Bahree

Unity and Visual Studio

Have been playing, a little with the new Visual Studio “preview” version (the installation of which is super smooth and takes waaaaay less time!). And as part of that saw the Unity Debugger option. Was this always there or is that new? Or did the Unity Tools beta add it? Interesting times to start playing with this, primarily for AR/VR and #HoloLens.

April 6, 2016 · Amit Bahree

Humans and threading

We, humans, are multi-threaded by design and can do many things in parallel - with two exceptions I think. The only two blocking function we have to deal with are sneezing and farting. During these times, all current activity must be suspended for the duration. And of course it can be pretty annoying (or depending on the function, embarrassing). So next time you check in some code, think about it - is this smelly and sneezy (yep, that’s a word, now) or have I done the right thing?...

March 12, 2016 · Amit Bahree

Open Live Writer

Just downloaded and installed and posting this via Open Live Writer . Remember the lovely (but dead) Windows Live Writer from Microsoft? Well this is a forked version of that which is open source, based on MIT license. The editor is offline and is very similar to word and can support a number of blogging platforms – including the common ones as you would expect. You can muck around the code (zip) or check it out on GIT ....

February 21, 2016 · Amit Bahree

Is rand() harmful?

​I saw this awesome presentation on why rand() is considered harmful. When you need a random number, don’t call rand() and especially don’t say rand() % 100! This presentation will explain why that’s so terrible, and how C++11’s header can make your life so much easier. If you need uniqueness and non-deterministic, especially on the context of security or crypto then you need to think about a few things. For example the frequency, non-uniform distribution, and not using a pseudo random number generator (such as Mersenne twister ) and not a linear congruential generator ....

November 6, 2013 · Amit Bahree

C++ Comment

1 2 3 4 5 6 7 8 9 10 11 12 13 14 int MyFunction() { // There once was a man named Dave int Result = 0; // Whose code just wouldn't behave MyObject \*Ptr = new MyObject(); // He left to go to a meetin' Result = Ptr->DoSomething(); // And left his memory a leakin' return Result; }

September 22, 2013 · Amit Bahree

How to insult a developer?

August 6, 2013 · Amit Bahree

How not to handle exceptions!

Was trying to pay my Electricity bill online via a site called Bangalore One , which is the Governments, premier one-stop shop for Electronic Delivery of Citizen Services. I could not pay because it seems like some backend services they need for credit card payment is down. How do I know this? Because the site is revealing too much detail! See the exception details pasted below. This is a great example of what not to do!...

July 19, 2013 · Amit Bahree

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....

October 2, 2012 · Amit Bahree

Metro Apps in C++ anyone?

In Visual Studio “11” when I try and create a new C++ Metro app using the built-in template, I get the following error: “Can’t find localized resources”. I wonder if anyone else has managed to get around this? I am running the Consumer Preview Build of Win 8 (Build 8250).

May 19, 2012 · Amit Bahree

AWS Extension for Visual Studio

I had forgotten that I had the AWS Extension for Visual Studio installed until recently I noticed AWS Explorer item in the View menu option. This add-in allows you to explore the various features that Amazon exposes right from within Visual Studio. The toolkit makes it easier for developers to debug and deploy a .NET solutions that uses AWS. When you install this, you also get AWS SDK for .NET which provides one with all the building blocks that are required for consuming the IaaS services exposed by AWS including SimpleDB , S3 and EC2 ....

April 14, 2012 · Amit Bahree

Troubleshooting WCF Performance - Part 1

More related details on Dustin’s post - WCF scales up slowly with bursts of work .

May 26, 2011 · Amit Bahree

PowerShell script to kill named processes

There are times when you need to kill a number of processes in one-go like today when Chrome crashed a few times hanging all the running instances – next time Google says, one tab cannot bring down all of them – send them my way :). For such times, a PowerShell script is all you need. I wrote up a simple one which takes the process name as input and then kills all the processes which match that name....

May 23, 2011 · Amit Bahree

Twitter Trends

I was excited to find that Twitter had a JSON (Javascript Object Notation) endpoint for the current trending topics and decided to write a simple consumer which can read this and then spit it out in a simple console. And JSON being so simple and more or less “universal” meant that there are multiple implementations for .NET. Of course if you got lots of bandwidth you can roll out your own parser....

March 4, 2011 · Amit Bahree

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....

January 16, 2011 · Amit Bahree

C++ Message queuing options?

I am thinking of implementing a queue in one of the projects I am working on right now (sorry cannot go into more details until it gets published - hopefully in a few months). Anywyas, this is in C++ which needs to run on Ubuntu and my queueing experience (with C++ or otherwise) is only with MSMQ which is brilliant, but does not help me here as that run only on Windows....

December 29, 2010 · Amit Bahree

SQL Syntax Error (with MySQL)

Say you are writing a new stored procedure (for MySQL) and when you execute it, you get an error something like shown below - as you probably figured out all it means is that there is a syntax error with in the SQL. Often the error is misleading especially if it is a complicated query. One easy way to help narrow down the issue is to run it in a SQL Console which usually provides a better clue that can be your pointer to fixing the issue....

December 24, 2010 · Amit Bahree

Impressed with Doxygen

I have recently started using Doxygen in anger and have been quite impressed with it. In addition to the documentation of code that you would expect, one of the most powerful and coolest features is the ability to create various types of diagrams showing various aspects of the application such as collaboration diagrams object and call graphs, etc. The easiest way to configure your application is to use Doxywizard . On Linux, if you do want the object and call graphs then you would need to choose to enable the DOT option....

October 30, 2010 · Amit Bahree


I had a need to dump some data I am getting from a real-time sensor network to a database and I choose MySQL - just because it is cheap and cheerful and will fit perfectly with what I am looking for. Now, I have never programmed for MySQL though I have used it in the past as a consumer (e.g. the backend of this blog). MySQL does expose a C API that one can use, but it seems quite arcane to use and does not quite conform to the C++ style (especially when using STL)....

October 23, 2010 · Amit Bahree

invalid use of incomplete type ‘blah'

When you try and compile some code and you get an error along the lines of invalid use of an incomplete type ‘whatever type’ then in most cases it means you need to include the header file where that type is displayed. For example I had the following events in my header file: 1 2 3 protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); When when I tried to compile gave the following error: invalid use of incomplete type ‘struct QGraphicsSceneMouseEvent’...

April 18, 2010 · Amit Bahree

Finding an element in a list

Often you need to search through an array or list to find a specific element and of course you need this search to be as fast and efficient as possible. One of the best ways to do this is using a binary predicate function. A binary function is a function object (which are also called Functors ) and is any object which can be called as if it was a function....

April 5, 2010 · Amit Bahree