You can find my presentation from yesterday here.
I plan to publish the speaker notes soon, after I clean them up some.
The session schedule for MWLUG in Atlanta is now online. The conference is less than 4 weeks, and there is a very strong lineup of speakers. Many have been presenting in the Best Practices track at Lotussphere fo years, and this conference is well worth attending. The cost is only $50, and there are still inexpensive flights left. Registration is still open, as I write this.
I will present my session AD102 Break out of the box – Integrate existing Domino data with modern websites on Wednesday afternoon, starting at 4.30pm. Hope to see you in Atlanta!
Microsoft today released the latest version of their development environment Visual Studio. There are even free versions, including the complete IDE Visual Studio Community and the code editor Visual Studio Code (available for Widnows, Linux and OSX).
Visual Studio now includes even more tools for cross platform mobile development for iOS and Android. There is even an Android emulator included. The web development part supports tools and frameworks like Angular, Bootstrap, jQuery, Backbone and Django.
And naturally the IDE also supports Windows, including Windows 10 (expected to be released at the end of the month).
I have been using tools in the Visual Studio family for many years, I started with a beta of Visual Basic 1.0 a long time ago, and used all version up to and including VB 6.0. I also played around some with Visual C++ and even Visual J++. After that I focused mainly on Lotus Notes development, but recently I have started some C#/.NET projects at work using Visual Studio Community 2013.
David Leedy from Notes-in-9 just posted a video where he talks about the upcoming MWLUG conference in Atlanta in just over a month. As I wrote the other day, I will be speaking there. David is actually mentioning me and my session, and I am humbled by his nice words.
Hope to see you in Atlanta!
It is less than 7 weeks left until MWLUG, the Midwest Lotus User Group conference. This year the conference takes place in Atlanta, between August 19 and 21. During the three days there will be over 40 technical session and workshops on collaboration, receptions and networking opportunities, as well as access to experts of IBM solutions, both from IBM and other companies. The topics includes application development, system administration, best practices, customer buisness cases and innovation/future plans by IBM. Breakfast and lunch is included for two days as well. And all this for the cost of only $50 per person! The event takes place at Ritz-Carlton in downtown Atlanta. There is a block of rooms reserved at a special conference rate of $149.00 per night.
One of the sessions will also mark my personal debute as a speaker at a conference. I will present “Break out of the box – Integrate existing Domino data with modern websites” where I will talk about how to integrate websites built either within Domino or on other platforms with backend data that resides in a Domino database. I will talk about how you can build a modern looking website using tools like jQuery and Bootstrap and seamlessly integrate them with existing data on your trusty Domino server using JSON and Ajax. I will also provide plenty of example code ready for you to bring home and start playing with.
A number of IBM Champions will be presenting, as well as IBMers and other industry experts. So no matter your interest, I am sure you will find plenty of good sessions. I am sure I will have a hard time picking which sessions to attend!
So what are you waiting for? Go to http://www.mwlug.com and register! See you there!
There is a question in the IBM DeveloperWorks forum for Notes/Domino 8 about how to calculate the number of years, months and days between two dates. Then the poster wanted to calculate the sum of two such date ranges and return that as years, months and days as well.
Since the lack of formatting in the forum makes it hard to read the code, I decided to simply post it here on my blog. As always, there are several ways to write the code. One could for example use Mod (a very under-used function that many developers don’t even know about) to help calculate the number of years, months and days.
I also include a function I use to calculate the number of business days between two dates. This could be used to calculate how long a ticket has been open in a help desk system, where you usually don’t want to include Saturday and Sunday in the count.
Simply change diffOne = Days(startDate,endDate) to diffOne = BusinessDays(startDate,endDate).
Option Public Option Declare Type Components yearCount As Integer monthCount As Integer dayCount As Integer End Type Sub Initialize '*** Declare variable for componentized date Dim compOne As Components Dim compTwo As Components Dim compSum As Components '*** Declare variables for day difference count Dim diffOne As Integer Dim diffTwo As Integer '*** Declare start and end date variables Dim startDate As String Dim endDate As String '*** First date range startDate = "01/01/2011" endDate = "03/02/2013" diffOne = Days(startDate,endDate) Call DayCountToComponents(diffOne, compOne) MsgBox compOne.yearCount & " years " & _ compOne.monthCount & " months " & compOne.dayCount & " days" '*** Second date range startDate = "04/03/2012" endDate = "08/17/2015" diffTwo = Days(startDate,endDate) Call DayCountToComponents(diffTwo, compTwo) MsgBox compTwo.yearCount & " years " & _ compTwo.monthCount & " months " & compTwo.dayCount & " days" '*** Sum of first and second date range Call DayCountToComponents(diffOne + diffTwo, compSum) MsgBox compSum.yearCount & " years " & _ compSum.monthCount & " months " & compSum.dayCount & " days" End Sub %REM Function DayCountToComponents Description: Convert day count to years, month and days %END REM Function DayCountToComponents(dayCount As Integer,components As Components) As Boolean Dim daysLeft As Integer On Error GoTo errHandler components.yearCount = Int(dayCount/365) daysLeft = dayCount - components.yearCount * 365 components.monthCount = Int(daysLeft/30) daysLeft = dayCount - (components.yearCount * 365) - (components.monthCount * 30) components.dayCount = daysLeft '*** Return DayCountToComponents = True exitFunction: Exit Function errHandler: DayCountToComponents = True Resume exitFunction End Function %REM Function Days Description: Get the number of days between two dates %END REM Function Days(startDate As Variant,endDate As Variant) As Integer Days = Int(CDbl(CDat(endDate))-CDbl(CDat(startDate))) End Function %REM Function BusinessDays Description: Get the number of business days (Monday-Friday) between two dates %END REM Function BusinessDays(startDate As Variant,endDate As Variant) As Integer Dim startDT As NotesDateTime Dim endDT As NotesDateTime Dim cnt As Integer On Error GoTo errHandler Set startDT = New NotesDateTime(startDate) Set endDT = New NotesDateTime(endDate) cnt = 0 Do Until CDbl(startDT.Lslocaltime) > CDbl(endDT.Lslocaltime) If Weekday(startDT.Lslocaltime)<7 Then If Weekday(startDT.Lslocaltime)>1 Then cnt = cnt + 1 End If End If Call startDT.Adjustday(1, True) Loop BusinessDays = cnt exitFunction: Exit Function errHandler: BusinessDays = 0 Resume exitFunction End Function
A question was posted in the IBM DeveloperWorks forum for Notes/Domino 8 about the possibility to detect from within Notes if a computer is equipped with a touch screen. The answer was that you have to check if a specific DLL is installed, which is done though the registry.
The original posted then asked how to do that in Lotusscript, so I deceded to simply post some code I am using. I did not write this code, and I don’t know who originally did. I think I may have taken some VB code and simply adapted it for Lotusscript. I plan to rewrite this a s a class when I have some time. In the mean time, here is the code.
Option Public Option Declare Dim REG_NONE As Long Dim REG_SZ As Long Dim REG_EXPAND_SZ As Long Dim REG_BINARY As Long Dim REG_DWORD As Long Dim REG_DWORD_LITTLE_ENDIAN As Long Dim REG_DWORD_BIG_ENDIAN As Long Dim REG_LINK As Long Dim REG_MULTI_SZ As Long Dim REG_RESOURCE_LIST As Long Dim REG_FULL_RESOURCE_DESCRIPTOR As Long Declare Function RegCloseKey Lib "advapi32.dll" (Byval hKey As Long) As Long Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (Byval hKey As Long, _ Byval lpSubKey As String, Byval Reserved As Long, Byval lpClass As String, _ Byval dwOptions As Long, Byval samDesired As Long, Byval lpSecurityAttributes As Long, _ phkResult As Long, lpdwDisposition As Long) As Long Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (Byval hKey As Long, _ Byval lpSubKey As String, Byval ulOptions As Long, Byval samDesired As Long, _ phkResult As Long) As Long Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (Byval hKey As Long, _ Byval lpValueName As String, Byval Reserved As Long, Byval dwType As Long, Byval lpValue As String, _ Byval cbData As Long) As Long Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (Byval hKey As Long, _ Byval lpValueName As String, Byval Reserved As Long, Byval dwType As Long, lpValue As Long, _ Byval cbData As Long) As Long Declare Function RegQueryValueExString Lib "advapi32.dll" Alias "RegQueryValueExA" _ (Byval hKey As Long, Byval lpValueName As String, Byval lpReserved As Long, lpType As Long, _ Byval lpData As String, lpcbData As Long) As Long Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias "RegQueryValueExA" _ (Byval hKey As Long, Byval lpValueName As String, Byval lpReserved As Long, lpType As Long, _ lpData As Long, lpcbData As Long) As Long Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias "RegQueryValueExA" _ (Byval hKey As Long, Byval lpValueName As String, Byval lpReserved As Long, lpType As Long, _ Byval lpData As Long, lpcbData As Long) As Long ' --- Registry key values Const HKEY_CLASSES_ROOT = &H80000000 Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 Const HKEY_CURRENT_CONFIG = &H80000005 ' --- Registry return values Const ERROR_NONE = 0 Const ERROR_BADDB = 1 Const ERROR_BADKEY = 2 Const ERROR_CANTOPEN = 3 Const ERROR_CANTREAD = 4 Const ERROR_CANTWRITE = 5 Const ERROR_OUTOFMEMORY = 6 Const ERROR_INVALID_PARAMETER = 7 Const ERROR_ACCESS_DENIED = 8 Const ERROR_INVALID_PARAMETERS = 87 Const ERROR_NO_MORE_ITEMS = 259 ' --- Registry access key Const KEY_ALL_ACCESS = &H3F Const REG_OPTION_NON_VOLATILE = 0 Sub Initialize REG_NONE = 0 REG_SZ = 1 REG_EXPAND_SZ = 2 REG_BINARY = 3 REG_DWORD = 4 REG_DWORD_LITTLE_ENDIAN = 4 REG_DWORD_BIG_ENDIAN = 5 REG_LINK = 6 REG_MULTI_SZ = 7 REG_RESOURCE_LIST = 8 REG_FULL_RESOURCE_DESCRIPTOR = 9 End Sub Function SetValueEx(Byval lngHKey As Long, strValueName As String, lngType As Long, varValue As Variant) As Long Dim lngValue As Long Dim strValue As String Select Case lngType Case REG_SZ strValue = varValue & Chr(0) SetValueEx = RegSetValueExString(lngHKey, _ strValueName, _ 0&, _ lngType, _ strValue, _ Len(strValue)) Case REG_DWORD lngValue = varValue SetValueEx = RegSetValueExLong(lngHKey, _ strValueName, _ 0&, _ lngType, _ lngValue, _ 4) End Select End Function Sub RegistryCreateKey(dblHiveID As Double, strBaseKey As String, strKey As String, strData As String) Dim lngResult As Long Dim lngDisplay As Long Dim intReturn As Integer lngResult = 0 lngDisplay = 0 intReturn = RegCreateKeyEx(Byval dblHiveID, _ Byval strBaseKey, _ Byval 0&, _ Byval "REG_SZ", _ Byval 0&, _ Byval KEY_ALL_ACCESS, _ Byval 0&, _ lngResult, _ lngDisplay) intReturn = RegSetValueExString(Byval lngResult, _ Byval strKey, _ Byval 0&, _ Byval 1&, _ Byval strData, _ Byval Len(strData)) End Sub Function RegistryGetValue(dblHiveID As Double, strKeyName As String, strValueName As String, _ strDefaultValue As Variant) As Variant Dim lngReturn As Long ' result of the API functions Dim lngHKey As Long ' handle of opened key Dim varValue As Variant ' setting of queried value On Error Goto RegistryGetValueError lngReturn = RegOpenKeyEx(dblHiveID, strKeyName, 0, _ KEY_ALL_ACCESS, lngHKey) lngReturn = RegistryQueryValueEx(lngHKey, strValueName, varValue) RegCloseKey (lngHKey) If (varValue = "") Then RegistryGetValue = strDefaultValue Else RegistryGetValue = varValue End If Exit Function RegistryGetValueError: RegistryGetValue = strDefaultValue End Function Function RegistryQueryValueEx(Byval lngHKey As Long, Byval strValueName As String, _ varValue As Variant) As Long Dim lngDataPntr As Long Dim lngReturn As Long Dim lngType As Long Dim lngValue As Long Dim strValue As String On Error Goto RegistryQueryValueExError ' Determine the size and type of data to be read lngReturn = RegQueryValueExNULL(lngHKey, strValueName, 0&, _ lngType, 0&, lngDataPntr) If (lngReturn <> ERROR_NONE) Then Error 5 End If Select Case lngType ' For strings Case REG_SZ: strValue = String(lngDataPntr, 0) lngReturn = RegQueryValueExString(lngHKey, _ strValueName, 0&, _ lngType, strValue, lngDataPntr) If (lngReturn = ERROR_NONE) Then varValue = Trim(Left(strValue, lngDataPntr - 1)) Else varValue = FullTrim("") 'returns empty End If ' For DWORDS Case REG_DWORD: lngReturn = RegQueryValueExLong(lngHKey, _ strValueName, 0&, _ lngType, lngValue, lngDataPntr) If (lngReturn = ERROR_NONE) Then varValue = lngValue End If Case Else ' all other data types not supported lngReturn = -1 End Select RegistryQueryValueExExit: RegistryQueryValueEx = lngReturn Exit Function RegistryQueryValueExError: Resume RegistryQueryValueExExit End Function
IBM just published information about the future of the conference known as Lotusphere/IBM Connect/IBM ConnectED. To the contrary of what probably everyone thought, the conference will be back in Orlando in January 2016, reverting back to the name IBM Connect.
It’s long run at Walt Disney Dolphin and Swan (affectionate known as Swolphin) will however be over. In 2016 the conference will take place at The Hilton Orlando, between January 31 and February 3. So the length of the conference will be the same as IBM ConnectED earlier this year.
The rate (on the hotel website) is currently $219/night plus a $22/night resort fee (which includes free in-room wifi). A bit less expensive than Dolphin and Swan.
The Notes training company TLCC has two very interesting webinars coming up, especially for anyone that were not able to attende ConnectED in January. On May 14 the IBM development team will talk about the Domino development landscape, including new features for Domino on-premises as well as for the cloud through IBM Bluemix. IBM:ers Pete Janzen, Martin Donnelly and Brian Gleeson will be featured.
Then on June 16 the IBM product team will be featured. Scott Vrusho and Scott Souder is going to talk about where Notes, Domino and Verse are heading, while Dave Kern and Kevin Lynch will talk about recent security related changes to the Domino server.
You can find out more at http://www.tlcc.com/admin/tlccsite.nsf/pages/xpages-webinar
In the morning of April 9, 1940 Germany invaded Denmark and Norway in a surprise attack. Denmark had virtually no chance at all and was quickly overrun by the well-trained and experienced Wehrmacht. After six hours Denmark had no choice but to surrender. The quick surrender is thought to have resulted in a more lenient treatment of the country, and also delayed deportation of jews until late in the war, when most had already been able to escape.
Norway fought longer, and managed to sink the heavy cruiser Blücher just outside Oslo during the initial phase of the invasion. The southern part of the country fell fairly quickly, but it took 62 days before Germany had full control of the country, making Norway the nation that withstood a German invasion for the second longest period of time, after the Soviet Union.
Growing up in neighboring Sweden the events of April 9 were well-known to me, and since I have always been very interested in history (and especially conflict history like WWII) I did read a lot about this. I remember reading stories about Norwegian bus drivers who had their busses confiscated and loaded with German soldiers and then promptly driving themselves off the steep mountain roads, taking dozens of enemy soldiers with them in death. They were as brave as the soldiers fighting the invading forces on the different battle fields.
Sweden was never invaded or directly attacked during WWII, and that was probably very good. Despite starting to rebuild the (by then almost non-existing) military in the late 30’s when the threat from Hitler could no longer be ignored it would have taken until around 1950 until Sweden had a military force that could stop an invasion. It takes time to build up a military force, aquire equipment and teach the soldiers to use it, train officers in sufficient numbers and give them enough experience to lead troops.
The time when I grew up was at the tail end of the Cold War (even if we did not know it then). I remember the Soviet submarine U137 (actual designation S-363) running aground in southern Sweden in 1981, causing a tense stand-off between Swedish and Soviet military forces. Swedish fighter pilots had young eastern european men visiting them at home, posing as Polish students wanting to sell paintings or books in order to finance their studies. But strangely enough they only visited pilots, not their neighbors… They were most probably mapping out where the pilots were living, for Soviet special operations units to be able to assassinate them right before an attack on Sweden and thereby cripple the Swedish air defenses.
We also had the Soviet invasion of Afghanistan in 1979, as well as numerous other conflicts all over the world. Not to mention the threat/fear of nuclear war. So in short, it was an interesting and somewhat scary period to grow up, especially living so close to the “Russian Bear”. Sweden have a long history of war with Russia.
This was of course reflected in some of the music at that time:
In 1984 I joined the Swedish Home Guard at age 15. At that age I needed my parents to sign a consent form, but they did. They realized that it would be good for me. The training took place about every third weekend during the school year, with a break during the summers. It was fun and I did learn a lot of things, everything from first aid, survival skills, shooting, using map and compass with great precision, operating radio systems and of course to get along with and work side by side with people/kids from other backgrounds than my own.
At one point I even considered a career in the military, but I quickly decided that computers and programming was more interesting and fun. But I continued as a member of the Home Guard for 13 years, until I moved to the United States. By that time the Cold War was over and the politicians had started to dismantle the military as they did not expect any threats or invasions anymore. That was of course the same way as most of Europe had dismantled their military after World War I, also known as “the war to end all wars”. We now in retrospect know what a bad idea that was.
Sweden is today in the same situation, with a almost non-existant military. The politicians finally realized late last year that perhaps Putin was not such a nice and peaceful guy and decided to increase the military spending, but with very small amounts and over many years. And just like in the 30’s and 40′ it still takes a long time to build up an efficient military force. You don’t hire a major or colonel from your local temp agency… Hopefully there will not be a large scale war in Europe but there is a war going on in Ukraine right now and Putin have been eying the Baltic states lately. If you haven’t read Command Authority, the last book Tom Clancy wrote before he passed away in 2013, I suggest that you do. It is scaringly accurate, and it was written before Russia invaded Ukraine.
So time after time history have shown that the old saying is true: “Every country has an army, either their own or somebody else’s”.