AI Assistants – commuters with kids scenario

EDIT: March 2018. an unpublished blog from winter 2016/217 where I was working for EVRY, and had a blast brain strorming around AI and chatbots.

After being interested in BOT technology for the past few years, I found a perfect pretty perfect scenario for an application. I’m commuting between Fredrikstad and Oslo most weekdays and some days I’m depending on the train to on time for me to pick up my daughter at school/SFO (After-school activities) in time before they close. So, when I’m required to pick up my daughter I need the train to be on time, otherwise I need to make a lot of phone calls to avoid unpleasant moments when I arrive Fredrikstad 🙂

A few weeks back, my train was pretty delayed, but luckily I was not responsible for picking up my daughter at school. But as  a developer at mind, I asked myself: “What if?”. What could go wrong if your train or other transportation is delayed?

  • You would probably get a fine for being late to pick up your child
  • You might have to reschedule deliveries at your home
  • You have to notify family about late arrival
  • I want to order a taxi on the-fly if needed to pick up my daughter if my wife/ex is at work as well
  • You have to reschedule or cancel other activities due to late arrival
  • What about dinner?
  • Errands that you HAVE to make?

As a “automate-it-all”  developer, one of my questions was: “How can I solve this with as less interaction as possible?” This problem has buzzed in head the past few months. And when I was asked to suggest a project for summer interns, I found this as the perfect scenario.

For several BOTs communicating with each other when certain situation occurs. The technology is ready to solve this kind of problem, but there should be some but there should be defined an application communication between

EDIT: Match 2018. If I had implemented this BOT protocol it would have saved alot. Maybe someone will take up the challange?



New year and employer

Due to my daughter didn’t like me commuting from Sarpsborg to Oslo almost every day. It has become worse the past few months on the train (NSB). Fully packed with people and not good to work, and with 2.5 hours one-way I needed to work on the train. Therefore I decided to get a job back home in Sarpsborg/Fredrikstad area again.

Good luck to my former collegues at and the modernation of the platform for Kompis, CustomerDirect and PosFinans. It has been a fast pace journey, but unfortunatly it’s ending here for me.

I now work for CGI Norway that has one office location in Sarpsborg. World-wide, CGI Group Inc has not less than 70,000 employees at over 400 locations and registered at New York (NYSE) on $74/share and Toronto (TSX) on Stock Exchanges. I will work in a department that has it’s focus on the energy business with network and power supplies and their customers. It is a business in fast change and regulations and potential to use new technology for automation the relationship between companies and their end-users.

I will have to refresh my Oracle knowledge from Oracle 8.1.7 from back to 2002, and proudly remembered the foldername of tnsnames 🙂

Now, I just need to get the MSDN Enterprise Subscription and have chat with IT to get rid of some stupid AD Policies. Yesterday, I had to supply my username and password 17 times. Today the number was 12 times while installing and upgrading the laptop with proper sofwtare and configuration.

New learning project – Currency loans

Since I have begun working in banking industry, I will start a new learning project. I will rewrite my previous currency collector to use the OpenExchangeRate API for real-time data for a given set of currencies like Bitcoin, ethereum, USD, NOK and EUR. The OER API supports the following currencies. At the current time, the developer plan only cost 12$/month with 10K calls to the API – a good deal, if you as me.

My new employer offers consumer loans and credit cards at the moment. But in my learning project, I will expand this to involve currency loans and maybe blockchain with bitcoins and ethereum.

I will create entities for customer, account, loan and currency, in addition to supporting entities for calculating risk and corralation. My goal will also include to add some machine learning into this for a starter. In addition, i will create a BOT for asking for currency rates and currency conversions.

My goals will be to use Azure SQL, Web Apps and Azure Functions and/or Azure App Fabric for a Microservice application architecture.

Happy coding and designing…


Developing Chat bots in Azure

There have been a lot of blog articles about chat bots and robots that will invade our daily life. Don’t worry, they are already here. Microsoft Azure has a lot of services that can be used to create Bots of different kinds.
The Azure Bot Service helps developer to accelerate the development and testing of their bots. It offer a set of predefined templates for Basic, LUIS, Form, and Proactive bots. The bot can be developed and tested in the Azure portal, or set up environment for Continuous Integration and delivery in Azure Team Services.
Azure has some powerful cognitive services like LUIS that enable chat bot to accept user input categorized as utterance – either as voice or written text. Azure has Speech APIs and Translation APIs to convert back and forward between speech to text, in addition to translate between different languages.
By using LUIS the bot can define a language model for Natural Language Processing (NLP) to translate utterance (user input) into intents (commands). An intent indicate a task to execute with a set of parameters. These tasks can be executes as Azure functions and use a wide range of APIs and Azure services like Azure cognitive services, Azure storage and Azure compute resources.
The past years, Microsoft Azure has released a lot of services around analytics and data management. Many of them is centered around what is called Cortana Intelligence Suite (CIS) shown in the picture below:
This suite connect many services together and shows the way how Microsoft is defining Analytics for the future. On the right bottom side the chat bots are resides with mobile and web applications. In short, CIS collect on-premise and cloud data from a different of sources like IoT devices, external apps, APIs and similar. These data can be stored in Data Lake Store or SQL DW that is the basis for analytical services as Azure Machine Learning, Data Lake Analytics, HDInsight and Stream Analytics.  The data from the storage or result of analytics tools can be visualized with PowerBI, and queried with web/web/bot applications.
But this will be the topic of future blog posts – over and out!
Happy coding…

Coffee Machine Bot Project

In mid-February, I was discussing with some colleagues in EVRY to hold a hackathon soon. Immediately, I started to think of what I wanted to create independently of the Hackathon discussions. After a while I was fascinated by the idea of creating a coffee machine bot using Microsoft technologies to its full extent. The plan is to use this project to learn new things, and put everything together around the “Coffee Machine Bot” idea.

I have multiple inspirational sources for this Project

  • The fact that software developers consume huge amount of coffee all day (and nights)
  • The great GitHub project “hacker-scripts” (separate commands in the bot)
  • Homer’s fantastic kitchen machines

Basic requirements

  • Using cognitive APIs for voice and face recognition to identify persons
  • Bot should understand multiple languages, such as English, Norwegian and Swedish
  • Using advanced machine learning, analytics and cognitive services to suggest the drink based on drinking habits, time of day, weather, humour and emotion.
  • Commands
    • Rate drink
    • As usual
    • Add to favourites
    • Recommend New
    • Hacker-scripts
  • Back-Office
    • Automatically order new ingredients based on consumption, number of forthcoming workdays.
    • Schedule planned and predictive maintenance
    • Using HR, IFS, SM9 systems to look scheduled overtime and evening/night/weekend. Make sure participating employees had their drinks covered

This weekend I will do some research for the Face API and Emotion API available in Microsoft Azure.

Create SQL service accounts fast

The past few months I had a few reinstalls of my local development environment due to hardware failure and a new work laptop. And I have installed a local SQL Server instance at least 4-5 times. Luckily, I created a silent install for SQL Server 2016 earlier this year, but I didn’t create a script for pre-install tasks, like creating SQL Server service accounts. Today, I took the time to create the script for creating these quickly.

In my local development environment, I normally install database engine, SSIS and agent. It is not completely necessary with these accounts locally, but it is a good practice. Change the password “XXX” to your own, and run the script from command-line.

NET USER svc-sql-db "XXX" /ADD /passwordchg:no /fullname:"SQL Engine service account"
NET LOCALGROUP "Administrators" "svc-sql-db" /add

NET USER svc-sql-ag "XXX" /ADD /passwordchg:no /fullname:"SQL Agent service account"
NET LOCALGROUP "Administrators" "svc-sql-ag" /add

NET USER svc-sql-is "XXX" /ADD /passwordchg:no /fullname:"SQL Integration service account"
NET LOCALGROUP "Administrators" "svc-sql-is" /add

The only thing I need to improve is to fix the “Password never expires” check box. NET USER have a “/expires:never» switch, but doesn’t seem to work. This could be written in Powershell, but found these command very easy.

Delete your old logfiles

In most cases where you have developed a on-premise applikasjon (console, service) these generates logfiles. Either for  debugging purpose, or for validating the day-to-day execution wether there are errors or warning.

I tend to use text files, where I keep them for at least 14 days. The following command will delete all files older than 14 days from the c:\temp\logging folder. I have this at the top of my startup.cmd script.

rem delete files older than 14 days
forfiles /p "C:\temp\Logging" /m "*.*" /c "cmd /c del @path" /D -14