Chaos reigns within.
Reflect, repent, and reboot.
Order shall return.

#haiku #GeekyHaiku

Oh what a mess

Ridiculous mess
iOS development
conceived by hipsters

#Haiku #GeekyHaiku #GeekyJokes

Machine Learning basics

Thinking about #machinelearning? It will be helpful to understand some numerical computations and concepts that affect the #ML algorithm. 

One might not interact with these directly, but we surely can feel the effect. The things you need to think about are:

1. Overflow and underflow – thinking of them as rounding up or down errors that shift the functions enough, and compounded across the iterations cam be devastating. Of course can also easily get to division by zero. 

2. Poor conditioning – essentially with small changes of input data, how large can the output move. You want this small. (And in cryptography you want the opposite, and large). 

3. Gradient optimizations – there will be some optimization happening in the algorithm, question is how does it handle various local points on the curve? Local minimum, saddle points, and local maximum. Generally speaking, it’s about optimizing continuous spaces.

Some algorithms take this a step further by measuring a second derivative (think of it as measuring the derivative of a derivative – the curvature of a function). 

4. Constrained Optimization – sometimes we just want to operate on a subset – so constraints only on that set. 

All of these come into play some way, directly or indirectly and having a basic understanding and constraints around this would help a long way. 

Whats the difference between #AI, #ML, and #DeepLearning?

I know I have had to explain this a lot in most #AI related conversations that I have had – and lately those have been quite a lot. In my experience, most people use these terms interchangeably when they are meaning one over the other.

Whilst they all are (inter)related and one might help trigger the other, they are still fundamentally different and at some point, it is good to understand the differences. I like the image below (source) that whilst on one hand is showing a time graph, the correlation between them and how one is a subset of the other is what is interesting.

AI vs Machine Learning vs Deep Learning
#AI vs #ML vs #DNN

#AI is getting more powerful and the potential of it which personally really excites me is the paradigm shift we are starting to see. Fundamentally it is changing on how we use, interact, and, value computers and technology.

It is shifting from us learning machines and their idiosyncrasies (remember when being computer literate was a differentiator on a resume) to this shift where technology learns us and interacts with us in a more natural, and dare I say human manner.

AI paradigm shift

I almost see it as StarTrek (and now showing my age) – the computer is everywhere, yet it is no where. It is embedded and woven into everything we do on the Enterprise rather an some “thing” one interacts with.

And it is awesome to start seeing some of this coming to life, even if it is in a demo as outlined at Build a couple of weeks ago. #AI in the Workplace and how it interacts with objects in real-time and can invoke and interact Business workflow (such as workplace policies).

AI in Workplace
AI in Workplace
Policy violation - detected using AI
Policy violation

The degree of calculations is pretty phenomenal – 27 million / sec [separately I would love to understand the definition on calculation 🙂 ]. But then given where we are heading with a fully autonomous car generating about 100GB of data each second, this isn’t small potatoes.

And whilst you can read up more on these terms and how they link, I really like to move away from the different terms which most people confuse in the first place and start thinking of more business outcomes and how enterprises and people will use.


To that end, the three buckets of Intelligent Automation, Robotic Process Automation (RPA), and Physical Automation is what we have found work better. On RPA, the one caveat being that it is not about robots, but rather the automation of a (business) process. The robots aspect would fall under physical automation – which essentially is anything that interacts with the real/physical world.

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.
  • Downloads the relevant presentation (if any)
  • Downloads a jpg which shows the image session – sometimes it is easier just to see the title slide. I thought better to have it and not use it, than the other way.
  • And finally downloads the high-quality video of that session.

In the script, you can change the following (and if you understand Build then this should be easy):

  • Change the path where to download this to (default is d:\build)
  • Choose a lower quality video if you prefer (which of course takes less space and might not be bad depending on which device you are seeing). Of course this also uses less bandwidth.
  • Of course. And if you want only the decks, then you can comment out parts of the script where it doesn’t download the video.

The script will spit out some basic errors and will ‘eat’ some of the exceptions that are expected (e.g. every session doesn’t have a pptx or a video). That won’t break the script, it will just move to the next session.

And finally here is the script:

# First setup the folder where to download using the parameters outlined below.
# Second, loop through and get the decks first
# Third. loop through and get the videos last
# Note: IF you don't want to download the videos, and want only the pptx then comment the section later in the script

# parameters
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath 
$rss = (new-object net.webclient)

#Filenames might get long, so keep this short!
$downloadlocation = "D:\build"

	if (-not (Test-Path $downloadlocation)) { 
		Write-Host "Folder $fpath dosen't exist. Creating it..."  
		New-Item $downloadlocation -type directory 
set-location $downloadlocation

# Grab the RSS feed - Build 2017
$a = ($rss.downloadstring("")) 
$b = ($rss.downloadstring("")) 

# Video quality default is high; you can select regular (mp4) or lower quality (mp3)
#$a = ($rss.downloadstring("")) 
#$a = ($rss.downloadstring("")) 

# ********** download the decks **********
try { 

    foreach($item in $ {   
	    $code = $item.comments.split("/") | select -last 1	   
	    # Get the url for the pptx file
	    $urlpptx = New-Object System.Uri($item.enclosure.url)  
        $urljpg = New-Object System.Uri($item.thumbnail.url)

        # make the filename readable
        $filepptx = $code + "-" + $item.creator + " - " + $item.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","").Replace("’","'").Replace("â€","")
	    $filepptx = $filepptx.substring(0, [System.Math]::Min(120, $filepptx.Length))
	    $filepptx = $filepptx.trim()
        $filejpg = $filepptx

	    $filepptx = $filepptx + ".pptx" 
        $filejpg = $filejpg + "_960.jpg"

	    if ($code -ne "") {
		     $folder = $code + " - " + $item.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","").Replace("’","'").Replace("â€","")
		     $folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
		     $folder = $folder.trim()
	    else {
		    $folder = "NoCodeSessions"
	    if (-not (Test-Path $folder)) { 
		    Write-Host "Folder $folder dosen't exist. Creating it..."  
		    New-Item $folder -type directory 
	    # Make sure the PowerPoint file doesn't already exist
	    if (!(test-path "$downloadlocation\$folder\$filepptx")) { 	
		    # Echo out the file that's being downloaded
		    $wc = (New-Object System.Net.WebClient)  

		    # Download the pptx file
		    Invoke-WebRequest $urlpptx -OutFile $downloadlocation\$filepptx

            # download the jpg but don't want to break if this doesn't exist; hence the nested try blocks
            try {
                if (!(test-path "$downloadlocation\$filejpg")) { 	
                    $wc.DownloadFile($urljpg, "$downloadlocation\$filejpg")
            catch {
                Write-Host "Jpeg $filejpg doesn't exist ... eating the exception and moving on ..."
		    mv $filepptx $folder 
            mv $filejpg $folder 
	    } #endif
        else {
            Write-Host "PPTX: $filepptx exist; skipping download."  
	} #end-loop foreach

    Write-host "*************** Downloading all the decks complete ***************"
    Write-host "Oops, could not find any slides."
    $ErrorMessage = $_.Exception.Message
    $FailedItem = $_.Exception.ItemName
    Write-host "\t" $ErrorMessage + "\n" + $FailedItem

# ********** download the videos **********
# if you don't want the video but only the slides just comment all the code below in the foreach loop
try { 
    foreach($item in $ {
	    $code = $item.comments.split("/") | select -last 1	   
	    # Grab the URL for the MP4 file
	    $url = New-Object System.Uri($item.enclosure.url)  
	    # Create the local file name for the MP4 download
	    $file = $code + "-" + $item.creator + "-" + $item.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","").Replace("’","'").Replace("â€","")
	    $file = $file.substring(0, [System.Math]::Min(120, $file.Length))
	    $file = $file.trim()
	    $file = $file + ".mp4"  
	    if ($code -ne "")
		     $folder = $code + " - " + $item.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","").Replace("’","'").Replace("â€","")
		     $folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
		     $folder = $folder.trim()
		    $folder = "NoCodeSessions"
	    if (-not (Test-Path $folder)) { 
		    Write-Host "Folder $folder doesn't exist. Creating it..."  
		    New-Item $folder -type directory 
	    # Make sure the MP4 file doesn't already exist
	    if (!(test-path "$folder\$file"))     
		    # Echo out the  file that's being downloaded
		    # Download the MP4 file
				if (!(test-path "$downloadlocation\$file"))
					Invoke-WebRequest $url -OutFile $downloadlocation\$file
					#move it from the current working folder to the target
					mv $file $folder
				else {
					Write-Host "Video: $file - anoter process possibly working on this; skipping download."
			catch {
				$ErrorMessage = $_.Exception.Message
				$FailedItem = $_.Exception.ItemName
				Write-host "\t" $ErrorMessage + "\n" + $FailedItem
        else {
            Write-Host "Video: $file exist; skipping download."  

        #Try and get the Sessions text description
        try {
	        $OutFile = New-Item -type file "$($downloadlocation)\$($Folder)\$($Code.trim()).txt" -Force  
            $Content = ""
            $Content = $item.title.ToString().trim() + "`r`n" + $item.creator + "`r`n" + $item.summary.ToString().trim() + "`r`n" + "`r`n" + $item.description.ToString().trim() + "`r`n" + "`r`n" + $item.comments.ToString().trim() 
            add-content $OutFile $Content
        catch {
            $ErrorMessage = $_.Exception.Message
            $FailedItem = $_.Exception.ItemName
            Write-host "\t" $ErrorMessage + "\n" + $FailedItem
    } #end-loop foreach
    Write-host "Oops, could not find any videos or some other error happened."
    $ErrorMessage = $_.Exception.Message
    $FailedItem = $_.Exception.ItemName
    Write-host "\t" $ErrorMessage + "\n" + $FailedItem
} # ********** End - download the videos section **********

Write-host "*************** All Done! ***************"

If you read through the script it is pretty self explanatory.

My Story Remix from Build 2017

In case you did not see Story Remix demos from Build, it is awesome. And here is my first take on it just using the photos that I took at Build 2017. Some of the things you saw at the keynote are not in the RS3 build I am running but interesting possibilities nevertheless.

Core principle of Machine Learning 

There of course are many, but for someone coming from computer science, and, software engineering, where the environment is relatively clean and certain (deterministic), it usually is a leap to understand that Machine Learning (and other elements of #AI) are not. 

Machine learning, is based on probability theory and deals with stochastic (non-deterministic) elements all the time. Nearly all activities in machine learning, require the ability to factor and more importantly, represent and reason with uncertainty. 

To that end, when designing a system, it is recommended to use a simple but uncertain (with some non-deterministic aspects)  rule, rather than a complex but certain rule. 

For example, having a simple but uncertain  rule saying “most birds fly”, is easier and more effective than a certain rule such as “Birds can fly, except flightless species, or those who are sick, or babies, etc.”

As one starts getting deeper in Machine Learning, a trip down memory lane around Probability distribution, expectation, variance, and covariance won’t hurt. 

Protecting your Data from being slurped up!

How to protect your data from what the The Guardian calls as ‘US border agents are doing ‘digital strip searches’?

The only way I think this is possible in a fool-proof way in the near future is that every has to absolutely implement a two-factor-DDA-authentication. There is not better #security today – period! There ain’t no stinking #AI, #RNN, #DNN, or Boltzmann machine in the world, or #Quantum computer worth its #quibits which can crack this – at least not in the near future.

And of course, when you have friends and family involved, the group authentication is a sure-fire way to stop anyone snooping in. #security

HoloPortation – Limits of Human Kind

When it comes to AI and the limits of human kind, what better example that shows the art of the possible than what Microsoft is doing with special awareness and HoloLens and other sensors.

And not only can this replay time and allow you to have a ‘living memory’ but it also is mobile.

I do believe we are living in the great time ever! 🙂

Neural Networks

Of course you heard of Neural Networks! In the context of #AI they are all the buzz of course.

You might have heard of some such as DFF (Deep Feed Forward) or RNN (Recurrent neural networks)? Or perhaps you meant Recursive neural networks? Irrespective, it can be quite messy as you can see below and it would be somewhat important to have some understanding of the differences.


And in case you are thinking, well what good or use is all this? Here is one example ( MarI/O – Machine Learning for Video Games) that shows how a computer learned to play Mario using DeepMind and a Neural network.

MarI/O uses something called NEAT (neural evolution of augmenting topologies) and is written in Lua (which is very similar to .NET) and runs in BizHalk which is a emulator for games and their various platforms (and not to be confused with BizTalk). You can checkout the code for this here.

Fjodor also has outlined a (very) brief outline on what some of these are and what they mean. If you just want to get a quick basic understand it is a great read, with of course links back to original research papers (and deeper reads) if that is your cup of tea.

Happy reading! 🙂

On Culture

I have said in the past, Culture eats strategy for breakfast. One cannot fix culture – but rather lead with example and have others follow.

This article on how Satya at Microsoft is expecting a culture shock to drive growth at Microsoft is a great example of this. Quite exciting days for Microsoft ahead.

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? 🙂

HoloLens – Spectator view – allowing others to see what you are seeing

Microsoft just announced an update around the HoloLens that allows you to share on what you are seeing (from a first-person perspective) with others to make to more interactive. This is a combination of MRC (Mixed Reality Capture) which already exists and some new updates that address some of the short coming of the MRC – especially when working with a audience.

The main use case on the spectator view – as the name suggests is to allow those in the room not wearing a device to see the holograms but also the interactions that the folks wearing HoloLens with their mixed reality experience.

You can use this to capture a mixed-reality scene, live stream the content (say in a meeting / conference), and, shoot/record the video. This essentially is the ‘cheap’ version of the special camera rig that Microsoft uses for keynote presentations.

It is not as straight forward as you might imagine; but at the same time if you are doing this ‘properly’ it isn’t as complex as well. You need some special equipment, and need to change some configuration, and add details to your apps to account for this.


You do need some special DSLR cameras (with HDMI output), and some other hardware – details can be found here. You can also 3D print the mount (STP can be found here).

And in addition there are a bunch of other steps that you need to do – from calibrating  (to get the offset from the camera), to the Compositor (which is a unity extension)  and allows you to record the video and change the hologram opacity, spatial mapping data details, etc.

All the detailed steps can be found here. And if this is all new, then I highly recommend to check out the Holograms 240 course. And below is an example on what this all can look like.


Us vs some of our friends. You know who you are. 

Mouse without borders issue – Only one usage of each socket address

I have been using Mouse without Borders, a program that allows you to make a virtual KVM between machines for some time at home and it is awesome. You can use one set of keybard and mouse among various (windows) machines including clipboard and copy and paste. If you haven’t tried it, I would highly recommend it.

However lately I could not connect between two machines and kept getting the error: “Only one usage of each socket address“. To the point where it was unusable and was pretty annoying. I looked online at their site but nothing jumped out. BTW, I was seeing this only on one machine (running Windows 10) and not the other one (also running Windows 10 but an inner ring of the Creators Update – essentially the next version of Windows).

What I understand the issue to be is that Windows is running out of ports and where programs that use a port for a short time, it won’t matter much, in this case the port is always going to be used.

The solution that seems to be working for me is quite simple – we increase the number of ports available to Windows. This is quite simple and to do this if you run an elevated command prompt and copy and paste the following command:

netsh int ipv4 set dynamicport tcp start=1025 num=64511

And if you are not sure on how to get the elevated command prompt – easiest way to do that is press WinKey + X, and from the menu select Command Prompt (Admin) as shown below.

Elevated command prompt menu
Elevated command prompt

How does the Netherlands welcome the new US President?

Bing Blues

It isn’t often that one see’s issues with Bing – I can’t recall when I last saw it, but then when it does it sure is cute. We love Pandas so this can only be good. 🙂