Previous month:
April 2008
Next month:
June 2008

May 2008

Infusion Set Helper

Yes, I am still working on this.  I have written a program that works quite well for me, but runs outside of Outlook.  However, it wants your user id, etc. and doing Outlook stuff outside of Outlook isn't that bright.


I've decided it has to be an Outlook Addin but I've run into lots of stumbling blocks. I've been reading how to do what I want to do, but not only is the learning curve steep, but the tools don't work. I've downloaded VSTO for Visual 2005, and I get part of what i want.  Then in my reading I'm told I need a COM shim, and I have to download that tool and it doesn't install correctly.  Then I get to a part where I want to add onto my form, and the form region templates don't work.


It finally dawned on me that Visual Studio 2008 was being referenced a lot and since I have the Academic MSDN, I decided to go ahead and install it on my programming machine and give it a try.  So far, it's working better.


Though I do wish the installers would work!

Revised Summer Schedule

Several weeks ago I posted my summer schedule.  Here is the revision:

I believe I am working on the Curriculum Guide for 2nd semester for Computer Science I (Visual Basic).  Confirmed but schedule not available.

I know I am working on the district finals (ACP's).  First meeting scheduled.

I am doing 21 hours of staff development with the district and probably teach 7 of them.  Confirmed and scheduled, right now in June.

I am going to CSTA Annual Conference on June 28 in San Antonio.

I'm going to a Microsoft sponsored workshop on Alice and Computational Media in July. 

Also going to First Bytes, for two days in Austin at University of Texas.

I will take a one week AP Workshop in August.

My dean sent me an email about a STEM workshop on June 10 thru June 12 (thankfully June 12th is a half day).  I figured that meant she wanted me to go, so I'm registered.

Rough Design of Windows Mobile Application

I've been giving this a lot of thought and at the moment, this is what I think I need:


  • It should be a Today PlugIn.
  • Store TDD (but make it optional since it is not an issue for everyone)
  • Store number of days, with a default of 3 - use a Combo box
  • Store information on the open task so it can be marked completed
  • When the user clicks on the plug give the option to chose day or use given date, or ignore.
    • When selected the current open task is marked complete (but stays so that it can be tracked or deleted manually -- though this could be an option.)
    • A new task is created based on TDD and number of days, which ever results in smallest day.  However, TDD may be ignored.

Idiot Network Engineers

I honestly don't know if I will make it through the school year or not.  The network has been driving us absolutely insane.   Especially me.


First, I teach webmastering.  Have the time the internet isn't up.  Oh, did I mention we don't have a textbook?  Everything we do, we got off an online site.  Well, that works really really well, when the internet is down.  Or, you have to push the F5 key 5 times to actually get a page.  Not exaggerated, I've counted.


Second, I teach computer science.  When you do a search on a computer science topic, half the results are blocked because the site is a blog or a forum.  I hate to tell the network engineers this, BUT all the good technical writing is done on forums and blogs.


The latest?  A little piece of work called squid that gives us a weird error message when we try to upload a zip file.  I did a searc on it this morning and this time, about 80% of the sites related to the error message were blocked.  So I dropped it in the hands of my server guys, who I've overworked on another problem earlier this week.


I have been having my students zip up their VB programs, and send me the whole directory, but we can't do that now.


Oh, and does it help network performance.  NOPE!  It's the worst it's ever been.


9 more days.

Pocket Outlook

So, Pocket Outlook is really easy.  You just add a reference to Microsoft.WindowsMobile and Microsoft.WindowsMobile.PocketOutlook. (Right click on your project, select Add Reference, and make sure you are at the .Net tab and click them.


Here's the code to get things started:


Dim polApp As Microsoft.WindowsMobile.PocketOutlook.OutlookSession = New outlook.OutlookSession


To go through each task, here is the code:

Dim oItems As outlook.TaskCollection
Dim otask As outlook.Task


oItems = polApp.Tasks.Items


Dim i As Integer
For i = 0 To oItems.Count - 1
oTask = oItems(i)
If oTask.Subject = "Change Infusion Set" Then
otask.Complete = True
End If


polApp.Dispose() 'not sure if it is needed


Note that you have to save both the Items collection and the item you are looking at. If you don't save the item you are looking at, you won't update the item itself.  Weird, but them's the rules.


Finally, the code to set up a task:


'Create a new outlook item
otask = New outlook.Task
otask.Subject = "Change Infusion Set"
otask.Body = "Change Infusion Set"
otask.StartDate = strDate
otask.DueDate = strDate
otask.Complete = False
otask.Categories = "Medical"


Dim StrTime As String
If Me.DateTimePicker1.Value <> Nothing Then
If reminder = True Then
Me.lblResults.Text = "In Reminder"
otask.ReminderSet = True
StrTime = Convert.ToString(Me.DateTimePicker1.Value.TimeOfDay)
otask.ReminderTime = Convert.ToDateTime(strDate & " " & StrTime)
otask.Complete = False
otask.ReminderSet = False
End If
End If
' Save to Tasks
' lblResults.Text = "Task has been created for " & strDate
End Sub



Windows Mobile Registry Code

I think I got most of what needed at this site:  Here's the code:


I defined the information for the key in section right after the form is defined:


Public Class Form1

Const userRoot As String = "HKEY_LOCAL_MACHINE"
Const subkey As String = "Software\KWeaver\InfusionSetHelper"
Const keyName As String = userRoot & "\" & subkey


To set a key value I used:

Registry.SetValue(keyName, "TDD", txtTDD.Text)


To retrieve a key value I used:


Me.txtTotal.Text = Registry.GetValue(keyName, "Total", Nothing)
Me.txtTDD.Text = Registry.GetValue(keyName, "TDD", Nothing)


To delete a key value I used:


Registry.CurrentUser.DeleteSubKey(keyName & "/Total")

Computer Science Teacher - Thoughts and Information from Alfred Thompson : Schools As Communication Free Zones

 This has SO been making me crazy.

Do we really  believe that students in school should be seen and not heard? Do we really believe that the only means of communication students should have with the world (or their friends) is voice communication in strictly supervised situations? Do we really believe that we are doing students favors by not letting them reach the social aspects of the Internet? Do we really believe that online chat and discussion sites are pure evil?

Source: Computer Science Teacher - Thoughts and Information from Alfred Thompson : Schools As Communication Free Zones

I'm one of the guilty twitters.  I'm at (I think, I'm new to twitter).  I've found Twirl isn't blocked by the service the district is using.

It's nice to be able to Twitter Alfred.  He's such a good resource.  I also like being able to Twitter and update Facebook at the same time.  I would never remember to do both.

However, I don't have a super lot of time for that.

What IS super frustrating is researching programming projects.  I've been working on a large project (see other posts), in front of my students, and seeing that half of the sites I need to read to even do the project is frustrating.  I'd say 1/3 to 1/2 are blocked by our district for various reasons.

XNA projects were even worse.  Over half of the XNA stuff was blocked.

Not only do my kids use the proxies that are out there, but one's even set up his own.  That fooled me even for a day or two.  The worst part, is that when I find a proxy and tell the district about it, they still don't block it.

I can however, and do block websites with Lanschool, especially at the beginning of the year, and there is no way around Lanschool.  If a kid COULD find the way, between Dana and I, we'd have it blocked. 

VB.NET - Windows - Outlook

Here's my code for marking a set of Tasks complete, based on the subject, and for creating a new Task:


The part that bugs me the most, is the oNS.Login.  I have to put in my exchange profile and my password and yet, Outlook still asks for my password.  This is why I think that the application should be an outlook plug in.


' Create an Outlook application.
Dim oApp As outlook.Application = New outlook.Application()


' Get NameSpace and Logon.
Dim oNS As outlook.NameSpace = oApp.GetNamespace("mapi")
' oNS.Logon("YourValidProfile", Missing.Value, False, True) ' TODO:


' mark any uncompleted tasks to complete
Dim oTasks As outlook.MAPIFolder = oNS.GetDefaultFolder(outlook.OlDefaultFolders.olFolderTasks)


' Get the first contact from the Contacts folder.
Dim oItems As outlook.Items = oTasks.Items
Dim oItem As outlook.TaskItem


oItems = oItems.Restrict("[Subject] = Change Infusion Set")
Dim i As Integer
For i = 1 To oItems.Count
oItem = oItems.Item(i)
If Not oItem.Complete Then oItem.MarkComplete()


' Create a new AppointmentItem.
Dim oTask As outlook.TaskItem = oApp.CreateItem(outlook.OlItemType.olTaskItem)

' Set some common properties.
oTask.Subject = "Change Infusion Set"
oTask.Body = "Change Infusion Set"


'Find number of days to add to task which is the smaller of the number of days or Total Insulin divided by TDD
Dim days As Integer = Val(txtDays.Text)
Dim StrDate As String
Dim insulinDays As Integer = Val(txtTotal.Text) / Val(txtTDD.Text)
If days > insulinDays Then
days = Int(insulinDays)
End If
StrDate = Convert.ToDateTime(Date.Today.AddDays(days))


'Creating the Task

oTask.StartDate = StrDate
oTask.DueDate = StrDate
oTask.Complete = False
oTask.DateCompleted = Nothing
oTask.Status = outlook.OlTaskStatus.olTaskNotStarted


If reminder = True Then
oTask.ReminderSet = True
Dim StrTime As String = Convert.ToString(Me.DateTimePicker1.Value.TimeOfDay)
oTask.ReminderTime = Convert.ToDateTime(StrDate & " " & StrTime)
oTask.ReminderSet = False
End If


' Save to Tasks
' Logoff.


' Clean up.
oApp = Nothing
oNS = Nothing
oTask = Nothing


'Note I've lost my formatting, but I think you can get the point.

VB.Net (2005) and using the Registry

One of the decision I made on my program was to use the registry to store my data.  Everyone else does and we are talking 4 small values.  Using the registry with Visual Basic is not hard, just calls.


Here's how I retrieve the registry settings:


Me.txtTDD.Text = GetSetting("InfusionSetHelper", "Settings", "TDD", "")
Me.txtDays.Text = GetSetting("InfusionSetHelper", "Settings", "Days", "")
Me.txtTotal.Text = GetSetting("InfusionSetHelper", "Settings", "Total", "")


And here's an example of setting them:


SaveSetting("InfusionSetHelper", "Settings", "Days", strDays)


Deleting a setting:


DeleteSetting("InfusionSetHelper", "Settings", "TDD")


While this works and does a nice job, the documentation at says to do it another way, and that way is more compatible with Windows Mobile.  I may change this code.

Windows Mobile Program done

I've got most of the logic complete on the Windows Mobile project and boy howdy, so far, I've learned a lot.  One of my goals today is to record all the things I've learned.


However, I've decided to make some changes.  I really think that the Infusion Set Helper ought to be an Outlook PlugIn, since you have to log into Outlook if you have an exchange server, or at least I have to.


I still want the Windows Mobile program to be a ToDay plugin, so there is still work to be done on that and learning curve.  But it IS coming along.