Wednesday, November 04, 2009

Managing Asthma and Other Illnesses Through Breathing Exercises

Today, my mom, who is a doctor, sent me an interesting New York Times article about Buteyko breathing exercises being used to control Asthma and other illnesses while reducing or eliminating medications. While I don't believe that hyperventilation, breathing too deeply and/or rapidly increasing loss of carbon dioxide, is responsible for all of the supposedly curable diseases, it does appear to be helpful for many people with asthma and other breathing problems. Here are some interesting web sites I found on the topic:

Sphere: Related Content

Wednesday, April 01, 2009

Gmail April Fools

If you logged into Gmail today, you may not have noticed the new feature at the top of the screen, Gmail Autopilot.

Gmail April Fools

If you click the link, you'll find a description of a new Gmail service to automatically answer all of your email from business proposals to personal correspondence for you.

GMail Autopilot

Of course, this is just an April Fool's joke. The confirmation is that there is no Autopilot tab under settings to adjust the service as described. Enjoy!

Sphere: Related Content

Thursday, March 05, 2009

PowerPoint 2007 VBA Picture from URL Workaround

An obscure, but annoying, feature of Microsoft Office PowerPoint 2007 is that one cannot programmatically load a picture from an URL using VBA, unlike previous version. For example, the following will fail to load the image at the URL to the Image control:
Dim pic As IPictureDisp
'Load good image
Set pic = stdole.StdFunctions.LoadPicture("http://tinyurl.com/d85tgr")
Image1.Picture = pic
In order to get an image from the web into a PowerPoint 2007 presentation, one must first save the image locally as a file, then reference the file. The Module code is adapted from Workaround for Powerpoint 2007 VBA AddPicture web image problem. The URLs referenced below are sample images that I created for a good image and an image not available error. Replace them with your own images.

In a Module, enter the following:
Option Explicit

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000

Public Function DownloadFile(sSourceURL As String, _
sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, _
sSourceURL, _
sLocalFile, _
BINDF_GETNEWESTVERSION, _
0&) = ERROR_SUCCESS
End Function

Sub ImportPictureFromWeb(Optional SourceFile As String _
, Optional DestinationFile As String)
Dim sSourceURL As String
Dim sLocalFile As String
Dim x As Variant
If Len(SourceFile) > 0 Then
sSourceURL = SourceFile
Else
'Load image not available error image
sSourceURL = "http://tinyurl.com/d8home"
End If
If Len(DestinationFile) > 0 Then
sLocalFile = DestinationFile
Else
'Default file
sLocalFile = "C:\PowerPointImage.gif"
End If
x = DownloadFile(sSourceURL, sLocalFile)
End Sub
In the presentation code, for example, use the following code to load the good image from the default file to an Image control:
Dim pic As IPictureDisp
Module1.ImportPictureFromWeb ("http://tinyurl.com/d85tgr")
Set pic = stdole.StdFunctions.LoadPicture("C:\PowerPointImage.gif")
Image1.Picture = pic

Sphere: Related Content

Saturday, February 14, 2009

Select a Random Record from a Microsoft Access 2007 Table

Here's a tidbit I figured out today, how to select a random record from table in Microsoft Access 2007. If you don't know how to create a function in Microsoft Access 2007, see Creating Custom Access Functions.

Assume "MyTable" is the table from which you want to select a record, and that the table has a identifier field, "ID", which is a number that is unique, but not necessarily sequential. Here is the code for a function which returns the identifier for a random row in the table:

Public Function RandomRow() As Integer

'Get access to the database
Dim db As DAO.Database
Set db = CurrentDb()

'Get access to the table
Dim tdf As DAO.TableDef
Set tdf = db.TableDefs("MyTable")

'Get the number of records in the table
Dim total As Integer
total = tdf.RecordCount

'Get the records in the table
Dim rst As DAO.Recordset
Set rst = tdf.OpenRecordset

'Select a random record in the table
Dim randomRecord As Integer
randomRecord = Int(Rnd() * total)+1

'Move to the random record
Dim currentRecord As Integer
currentRecord = 1
rst.MoveFirst
Do While (currentRecord <> randomRecord)
currentRecord = currentRecord + 1
rst.MoveNext
Loop

'Return the unique identifier of the random record
Dim recordID as Integer
recordID = rst.Fields("ID").Value

'Clean up pointers
Set rst = Nothing
Set tdf = Nothing
Set db = Nothing

'Return value
RandomRow = recordID

End Function

I found another solution for this at VBA Tips, but my solution is simpler, not requiring the creation of a temporary table.

Sphere: Related Content

Sunday, February 08, 2009

This is Not an Abortion Rights Issue

According to CNN, Dr. Pierre Jean-Jacques Renelique lost his medical license in Florida when his staff aborted an 18 year old's pregnancy in it's 23rd week. The young woman gave birth after being given two pills and saw her baby breathe then be thrown away with the other products of conception. The decomposing baby was later found by the police in a cardboard box in a closet when the police executed a search warrant.

This situation provides a gruesome example of group psychology gone wrong. Several people worked together and abdicated responsibility as medical professionals for this to have occurred. The procedure itself, late-term abortion, is rare. That an 18 year old accepted the choice to terminate her pregnancy in the 23 week, apparently without health reasons to do so, highlights her lack of responsibility and the staff's callousness and lack of empathy in directing her to alternative resources to, at the very least, carry the baby to term in a few weeks and have the baby paced by adoption. The staff then initiated the procedure without the doctor present and panicked when the young woman delivered the baby. The doctor apparently had abdicated all responsibility in his practice because they were willing to proceed. There was obviously some remorse about what happened because the doctor and his staff did not dispose of the baby completely.

This incident highlights failures from conception through medical practice. The young woman and her partner did not properly use contraception to avoid pregnancy. The young woman did not seek medical services and counseling early in the pregnancy. Her family did not support her in this difficult decision. The medical staff acted recklessly and the doctor did not properly supervise his practice. This situation could have been prevented and mitigated many times and is not just a matter of whether or not a woman should have an abortion.

Sphere: Related Content

Thursday, January 01, 2009

Happy New Year 2009!

Happy New Year 2009

Sphere: Related Content

Tuesday, December 23, 2008

Keys Fitness Out of Business

Today I finally figured out why I can't my Ironman treadmill fixed. A technician came out a couple of months ago to adjust the treadmill, but after using it a couple of times it was having the same problems. When I called Keys Fitness to have it serviced again under warranty, they said that a technician would be calling to set up an appointment. After waiting a couple of weeks and not getting a call, I tried to call Key Fitness again and got a recording that they were moving offices and would be available December 15. Another week passed after December 15 and they still weren't answering the phone and had the same recording. I went to the Keys Fitness web site and clicked on their Contact Us link. That took me to a page for Maverick Service and Assembly, which provides parts and service for Keys Fitness products. When I called Maverick, they told me that Keys Fitness is out of business and warranty service is not available. Keys Fitness is particularly disreputable in that they have no notice on their web site that they are no longer in operation. The only indication, if you know that they are bankrupt, is that the dealers link returns a MySQL database error. Keys Fitness is probably not paying their hosting fees either. If you have Keys Fitness equipment, download your service manuals while you can. I just emailed my treadmill manual to myself so that I know that I have it available. Now, we have to decide what to do with the treadmill. I'm still looking into whether or not I have any options for support through DirectBuy, but I doubt they will replace the manufacturer's warranty in any capacity, or maybe my credit card issuer. It's probably not worth putting several hundred dollars personally into a machine that has been a lemon since we got it and that much money will pay for a lot of sneakers to go walk outside or on the treadmills at the gym at work.

Sphere: Related Content