" /> Teaching CS in Dallas: May 2008 Archives

« April 2008 | Main | June 2008 »

May 28, 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!

May 26, 2008

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.

May 24, 2008

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.

May 23, 2008

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.

May 20, 2008

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
otask.Update()
End If
Next

 

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
Else
otask.ReminderSet = False
End If
End If
' Save to Tasks
polApp.Tasks.Items.Add(otask)
' 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: 

http://msdn.microsoft.com/en-us/library/cy6azwf7(VS.80).aspx.  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 http://twitter.com/kathweaver (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()
oItem.Save()
Next

 

' 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)
Else
oTask.ReminderSet = False
End If

 

' Save to Tasks
oTask.Save()
' Logoff.
oNS.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 http://msdn.microsoft.com/en-us/library/cy6azwf7(VS.80).aspx 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.

May 16, 2008

Create Setup Files for your Windows Mobile Applications Using Visual Studio 2005

I'm going to need this in a few days. 

Link to Create Setup Files for your Windows Mobile Applications Using Visual Studio 2005

May 15, 2008

Status

I have a Window Application (runs on the desktop).  It does the following:

  • Allows the user to input number of days to change set
  • Allows the user to input optional information about insulin usage
    • Total Units
    • Average Unit
  • Allows the user to chose if they want to be reminded at a particular time (do not have to have a reminder)
  • Marks all existing tasks with the same time as Completed
  • Creates a new task

 

I need to make sure the reminder part works.

 

Next step -- create the SmartPhone Today plugin

 

I have lots of ideas for the future.  This could be set up for any type of irregularly reoccuring tasks.

May 14, 2008

My best design thinking is in the shower

I came up with this idea in the shower, and just realized while in the shower this morning that saving the Entry ID is silly -- would work find if this was desktop only or mobile phone only application, but since both can write Tasks in the end, I need to do a search on the subject line.

Using ID with Microsoft Objects

Just a quick note to remind me where this article is.  I've been looking at http://support.microsoft.com/kb/293152/ which I think will help me mark my tasks complete.

Update on my project

Didn't get to spend much time on the project, today.  I got appointments to create on my older Gateway tablet, but couldn't get them to work on my new Lenovo, which is where I have working on this.  The weird part is that I couldn't Add an Reference to the Microsoft Office PIAs, but when I transferred the program to the other computer using my network, added the code to create a task, and then moved it back, the PIA reference was there. Weirdness.

 

I've decided to add a "reminder time" to the project, and with a little research found I can use the DateTimePicker to get my time. 

 

And now I'm fighting with the notebook again.  The district installed Groupwise which is getting into the way.  I am deleting the Groupwise account now, but am probably going to have to uninstall Groupwise.

May 13, 2008

Documentation can be SO irritating!

I decided I wanted to do the regular Windows to Outlook side of the project first.  It makes sense having both, as I often change my sets in the morning, in front of my desktop computers.

 

So I wanted to figure out how to create an Outlook item.  I started with this article:

 

http://support.microsoft.com/kb/313787

 

Lovely article but I couldn't get it to compile.  I started doing research on the error message and kept running into references to PIA's.  I found them, and I had to install them.

 

http://www.microsoft.com/downloads/thankyou.aspx?familyId=59daebaa-bed4-4282-a28c-b864d8bfa513&displayLang=en

 

I also found this article which was helpful too:

 

http://msdn.microsoft.com/en-us/library/bb226711.aspx#officeoutlook2007whatsnewdeveloperspart1__intro

 

So here is what I had to do to create an Outlook Calendar entry (which does work).

 

I had to add an reference to the PIAs:

 

Add a reference to the PIAs. To do this, follow these steps:

a. On the Project menu, click Add Reference.
b. Click the NET tab, locate Microsoft.Outlook.Interop.Outlook, and then click Select.
c. In the Add References dialog box, click OK

 

The next thing I had to do was to add the following statement to the top of the program:

 

It now looks like:

 

Imports System.Reflection
Imports outlook = Microsoft.Office.Interop.Outlook

 

Module Module1

 

Sub Main()
' 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:

 

' Create a new AppointmentItem.
Dim oAppt As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
'oAppt.Display(true) 'Modal

 

' Set some common properties.
oAppt.Subject = "Created using OOM in C#"
oAppt.Body = "Hello World"
oAppt.Location = "Samm E"

 

oAppt.Start = Convert.ToDateTime("11/30/2001 9:00:00 AM")
oAppt.End = Convert.ToDateTime("11/30/2001 1:00:00 PM")

 

oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy ' olBusy
oAppt.IsOnlineMeeting = False

 

' Save to Calendar.
oAppt.Save()

 

' Display.
'oAppt.Display(true)

 

' Logoff.
oNS.Logoff()

 

' Clean up.
oApp = Nothing
oNS = Nothing
oAppt = Nothing
End Sub

 

End Module

 

 

 

 


May 12, 2008

First permutation of the project

I've created a simple Windows -- not Windows Mobile yet -- application that shows the date of the next infusion change if the user has put in the number of days, or has put in the Total number of units and the average daily total. The application does several things I haven't done before:

  1. Add days to the current date value -- super easy -- Date.Today.AddDays(intTDDDays) where the arguments is the number of days to add.
  2. Set values in the registry -- again easy -- SaveSetting("InfusionSetHelper", "Settings", "TDD", strTDD)
  3. Retrieve values in the registry -- again easy -- Me.txtTotal.Text = GetSetting("InfusionSetHelper", "Settings", "Total", "")

 

So the next decision to be made, is do I make this a Windows program that updates outlook, so should I got straight to the Windows Mobile application.  I think having it both places might be useful.

AP Computer Science -- 2008 Free Response

The actual questions are at: http://www.collegeboard.com/student/testing/ap/compsci_a/samp.html

The Litvin's have answers at: http://www.skylit.com/beprepared/fr2008.html

May 11, 2008

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.

How To Access Pocket Outlook Objects from VBCE

Here's the bloody details, so the research end is going well.

How To Access Pocket Outlook Objects from VBCE

How To Access Pocket Outlook Objects from VBCE

Pocket Outlook Object Model (POOM)

This looks like the main part of my program.  It handles all the outlook data.

The Pocket Outlook Object Model (POOM) mirrors the Microsoft Office Outlook Object Model, but its scope of functionality is reduced to accommodate the practical constraints of mobile devices.

Pocket Outlook Object Model (POOM)

More on the potential Windows Mobile Application

I'm researching how to write the Windows Mobile application, and it dawned on me, that the application would be even more useful if it were a Today Screen plugin.  Options can be set and changed from there, and the user could just click on the plug-in to tell the program they had changed sets, so I've downloaded a Today Screen plug-in.

May 10, 2008

Finally -- A useful application to write

I have been trying to come up with an "after AP Exam" activity that will motivate all my students to think about software development in a positive way.  I am going to have the AP students do some of the research for the cross platform.

I've finally figured it out. 

An infusion set alarm.  This is something that could be cross platform too.  It could be written for the Palm Pilot and generate ToDo items.

I want my ToDay screen to show me when I should change my infusion set.  This is a program that should run on my mobile phone since

a) it really should run on my pump, and alarm me on the pump, but since my pump doesn't do that, and since I don't have access to that software, the mobile phone is the next best thing, since it is almost always with me.

b) running it on the desktop isn't the greatest of options, because I something have to replace a set off schedule (comes off during dog agility, pull off accidently, etc.)

There are two factors that influence how often an infusion set should be changed.

1)  Days.  An infusion set should be changed at least everything 3 days, but this is a variable that the user should be able to change in the options menu.

2)  Amount of insulin.  Most Type 1's are not aware of this, but you can really only push about 300-400 units through a set before skin starts breaking down.  At least that's the way it works for me, and my CDE said "duh" when I mentioned it.  Again, the user should be able to change this in the options menu.

3)  When a user indicates they have changed their set, the current open task should be marked complete.  A new task should be generated using the first of the two above factors.

Tasks:

1)  Research how to create a Task from Visual Basic/WIndows Mobile

2) Create a user interface

3) Design algorithm.

I am going to document my progress on the log and make what I write available to the Diabetes community.

FYI:  This application has all the things of a good software project:

a) It satisfies a need

b) It does not already exist.  If it does, I haven't hear of it which is a bit amazing.  However, the Cozmo pump has this feature, I believe.

Best of Both Worlds

One of the repercussions of the STEM award from last year, was being urged by both the Dallas Foundation poeople and by the TI people to influence more students than my own.  Usually to do that, you have to leave the classroom.  In fact, at least two of the STEM award winners have.  Both have gone into administration.

I'm lucky, I don't have to go into administration to make that influence.  For the past 10 years at least, I've helped write our various district finals, and had a major role in writing curriculum.

This year, I've done even more.  I've been writing detailed curriculum for our Computer Science I (Visual Basic) class.  I've been detailed enough so that another teacher can do exactly what I do.  It's also detailed enough for someone to teach the course online (hopefully me).

I'll be writing our district final for the same subject, and probably do part of the staff development for my subject in June.

It feels good.  And I'm really glad I don't have to give up the daily contact of a class.  That's the most fun part about teaching.  Even better, once in a while the kids realize it.  I had a couple of kids arguing about it a few days ago.  One kid say -- yeah, Mrs. Weaver REALLY likes it here or she wouldn't be here. VERY nice to hear.

May 9, 2008

I'm busy this summer too

 Was reading:

I am looking over my schedule for summer… and guess what … its FULL! I don’t get summer’s off anymore but I want the world to know how busy summer is while the teachers are gone.

Source: Summer Vacation … not for me. at Snapshots of Technology Integration

So my summer:

I believe I am working on the Curriculum Guide for 2nd semester for Computer Science I (Visual Basic).

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

I am doing 21 hours of staff development with the district and probably teach 7 of them.

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.

The first two should be paying gigs, but we got technology for the first one when I did 1st semester, so that might be that way too.

It's a lot more traveling than I usually do too.  San Antonio and Austin -- I'm flying both of those, and I'm driving to Vegas.  My husband wants to do that and is going too.  We may vacation in San Diego after, depends on who I get to dog sit.

May 7, 2008

Need a Master's?

 This looks like an interesting program and the information was sent to me by Specialist.  I have one already (Master's in Computer Education and Cognititive Studies. 

Link to College of Education at Sam Houston State University

May 6, 2008

How to Write a Java MIDlet Program for Wireless Cellular Phones and Handheld PDAs Using J2ME

I used the following article to help me figure out -- finally -- how to get a Java program on a mobile phone.  I've done it several times with Visual Basic, but never with Java.

 

Quoted from http://www.codeguru.com/cpp/w-p/ce/networking/article.php/c7911/:

 

CodeGuru: How to Write a Java MIDlet Program for Wireless Cellular Phones and Handheld PDAs Using J2ME

 

How to Write a Java MIDlet Program for Wireless Cellular Phones and Handheld PDAs Using J2ME

 

1.  The first step was already done, I had Java on my computer already.

2.   Install Java 2 Platform, Micro Edition Wireless Tool Kit.  I did a search on that, and ended up at http://java.sun.com/products/sjwtoolkit/ and I read and followed the article until I got to Downloads, and ended up at http://java.sun.com/products/sjwtoolkit/download.html.  I downloaded the Windows version, since we run Windows XP and installed it per directions.

 

3.  Next, I copied his code into my own file, SampleMidlet.java.   A few of the lines were too long and did not paste right, so I had to fix them.

 

4.  I then ran the Wireless Toolkit as his directions show.

 

5.  Next I copied my SampleMidlet.java into the src file as he indicated.


6.  Then run the Wireless Toolkit again and Build your project (you can leave it open).

 

7.  Then run your project.  You'll get a phone emulator with your new project on it. 

 

8.  The last step of the CodeGuru's directions to use, is to build the package. Click on Project, Package, Create Package.

 

Here's where directions differ, since he is writing about the Palm.  I have a Cingular 8525 (or AT&T 8525), and want to use the Intent Midlet manager.

 

When you build your package, you get two files in your Bin file.  You really only need one, the SampleProject.java file.

 

9.  Get that file onto your phone, anyway you like.  You can either email it as a file attachment, or copy and paste it using ActiveSync. 

 

10.  Find the java file that you just saved on your mobile phone using File Explorer, and double click on it.  MidLet Manager will open and ask if you want to install the midlet. Click on Yes.   Then double click on SampleProject that you just installed, and the program will execute.