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?

 

Advertisements

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 komplettbank.no and komplettbank.fi 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 komplettbank.no 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…

 

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

MS CRM list user access via SQL

During my CRM Solution import debugging yesterday, I also wanted to see which user had been logged in to CRM the last few days. After some googling og trying I came up with this SQL statement for listing all users and last time they accessed CRM during the last 3 days.

NB! You have to change the “OrgName” to get this working on you CRM database server. It is tested for CRM 2011 and CRM 2016.

USE MSCRM_Config
SELECT O.FriendlyName, SU.FullName as Name, SUO.LastAccessTime
FROM SystemUserOrganizations SUO
       LEFT JOIN SystemUserAuthentication SUA ON SUO.UserId = SUA.UserId 
                                    AND LEFT(AuthInfo, 1)='C'
       LEFT JOIN Organization O ON SUO.OrganizationId=O.Id
       INNER JOIN OrgName_MSCRM.dbo.SystemUser SU ON SUO.CrmUserId = SU.systemuserid
WHERE LastAccessTime IS NOT NULL 
  AND O.FriendlyName = 'OrgName' 
  AND datediff(DAY,Lastaccesstime, getutcdate()) < 3
ORDER BY lastaccesstime

Enable Dynamics CRM Tracing with powershell

If you have some problems with Dynamics CRM On-premise you are able to enable tracing with PowerShell. In my case, I needed to get debug information on why my solution import is failing when I’m going to move it to a new organization.

Open the powershell prompt and use the Add-PSSnapin command shown in 1). Thereby, You can list the trace setting with the command shown in 2). Before you start the tracing, you show determine the timeline for when the error occurs and just enble it as close as the error as possible. Run the command in 3) to start the tracing. You should stop the tracing immediately after the error has occured. Use command in 4) to stop the tracing.

# 1) add
Add-PSSnapin Microsoft.Crm.PowerShell 

# 2) get crm trace settings
Get-CrmSetting TraceSettings 

# 3) enable tracing
$Setting = Get-CrmSetting TraceSettings
$Setting.Enabled = $True 
$Setting.CallStack=$True
$Setting.Categories="*:Verbose"
$Setting.Directory="C:\temp\crmtrace"
Set-CrmSetting $setting

# 4) disbale tracing
$Setting = Get-CrmSetting TraceSettings
$setting.Enabled = $False
Set-CrmSetting $setting

When you have tons of log file, the trace tool CRM Trace reader is nice to use for searing and filtering.

WPF watermark/hint in TextBox control

After we found out that SOTI Enterprise Mobility Management system didn’t fully support Windows 10 Store Apps in “Kiosk Mode”, we had to rewrite out latest app using WPF technologi instead.

In this process. I wanted a kind of watermark in my TextBox Controls. After some googling, I found a pretty nice library called “Extended WPF Toolkit” on codeplex (and Nuget).

How to create a watermark input textbox

  1. Add “Extended.Wpf.Toolkit” via Nuget
  2. Add XML Namespace at the top of the XAML file
       xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  1. Add “xctk:WatermarkTextBox” instead of “TextBox” Control With the Watermark attribute set to the help text
       <xctk:WatermarkTextBox x:Name="txtSearch" Watermark="type search pattern" />

Happy coding