Bradley Handziuk's blog

DateType in the Access Import Spec

If you want to inspect the details of the datatypes of some import specs you made
, C.DataType
, C.FieldName
ON S.SpecID = C.SpecID;
but are confused about when the numbers in the DataType column mean this can help.

I just went through made a spec with each of the data type options in the Data Type drop down then looked at how the numbers matched to the names in MSysIMEXColumns table.

From that I made this function:

Public Function SpecDataType(asNumber) As String
    Select Case asNumber
        Case 1:     SpecDataType = "Yes/No"
        Case 2:     SpecDataType = "Byte"
        Case 3:     SpecDataType = "Integer"
        Case 4:     SpecDataType = "Long"
        Case 5:     SpecDataType = "Currency"
        Case 6:     SpecDataType = "Single"
        Case 7:     SpecDataType = "Double"
        Case 8:     SpecDataType = "Date/Time"
        Case 10:    SpecDataType = "Text"
        Case 11:    SpecDataType = "OLE Object"
        Case 12:    SpecDataType = "Hyperlink"
        Case 12:    SpecDataType = "Memo"
        Case Else:  SpecDataType = "Undefined data type"
    End Select
End Function
Now if you can see the name with the data type number.
, SpecDataType(C.DataType) as DataTypeName
, C.DataType
, C.FieldName
ON S.SpecID = C.SpecID;


These are the mappings for the DateOrder numbers, too.

Public Function SpecDateOrder(asNumber) As String
    Select Case asNumber
        Case 0: SpecDateOrder = "DMY"
        Case 1: SpecDateOrder = "DYM"
        Case 2: SpecDateOrder = "MDY"
        Case 3: SpecDateOrder = "MYD"
        Case 4: SpecDateOrder = "YDM"
        Case 5: SpecDateOrder = "YMD"
        Case Else: SpecDateOrder = "Undefined DateOrder"
    End Select
End Function
Which can be used in the same way as the DataTypes
 , S.DateOrder
 , SpecDateOrder(S.DateOrder) as DateOrderName

Western Digital WDMC folders

The Western Digital EX2 has been great so far except one big snag are all these .wmdc folders. The drive seems to automatically create a hidden folder called .wdmc which is not owned by the user (me) who created the content of that folder. These hidden folders create all sorts of problems when copying files (folder path's too long) or when deleting folders (I don't own that folder so I can't delete it).

Fixing this on the EX2 cannot be done through the web interface. You need to SSH into the computer itself to make the necessary changes. You need to make sure you have some SSH client installed. I'm on Windows 8.1 here so I used PuTTY. I also had to turn SSH on on my EX2.

Now you can get the right access. Back to business.
This is all caused by two services running in the background, regardless of whether or not you have DLNA streaming going.
They show up in the running services (ps) as
 3940 root     32640 S    /usr/local/wdmcserver/bin/wdmcserver -v /tmp/Volumes.xml 3960 root     41312 S    /usr/local/wdmcserver/bin/wdphotodbmerger
They can be stopped (an disabled by)
/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop

update-rc.d wdphotodbmergerd disable
update-rc.d wdmcserverd disable
However, when I try to disable the service I get
-sh: update-rc.d: not found
So the other way to stop them from restarting after a reboot is to remove their right to execute (-rwxr-xr-x --> -rw-r--r--). You can inspect the services status with ls -l /etc/init.d before you change anything if you want.
chmod 644 /etc/init.d/wdmcserverd
chmod 644 /etc/init.d/wdphotodbmergerd
Now to remove all those ridiculous .wdmc folders. I only want those ones gone which are not related to media streaming at first. There are hundreds of these.
find / -name .wdmc | wc -l
They are all located where you'd expect: in the "shares" folders, /mnt/HD/HD_a2/*.
find /mnt/HD/HD_a2/Files/ -name .wdmc | wc -l
find /mnt/HD/HD_a2/Files/ -name .wdmc -exec rm -rf {} \;
find /mnt/HD/HD_a2/Files/ -name .wdmc | wc -l
With the services stopped and .wdmc folders deleted looking at pictures in Windows Live Photo Gallery is A LOT faster. I watch videos over DLNA on my PS3 and this does not seem to have affected anything on that front. All wins.

Undoing all of this (except deleting the files) can be accomplished by:
/etc/init.d/wdmcserverd start
/etc/init.d/wdphotodbmergerd start
chmod 755 /etc/init.d/wdmcserverd
chmod 755 /etc/init.d/wdphotodbmergerd

I'm confused about the status of Google messaging services

So as far as I can tell there is no way to receive SMS and MMS on my computer and phone and use Firefox for messaging. My current setup is that I am able to receive SMS through Google Voice (which is on my phone and my computer), I can chat with other Google contacts in Hangouts, and and I can receive MMS through the default messaging app on my phone.

Lately, if people MMS me a picture, I will get a text message in Google Voice telling me I received an MMS and the picture is sent to my email. I'm fine with that but it is not consistent. Some people's MMSs just never come through and I'm never told that they failed to reach me.

I could receive everything through Hangouts (by to setting the Show SMS & voicemail in Hangouts check box) but then I lose the ability to text from my computer because SMS only works for Hangouts in Chrome and not Firefox. I'm not switching from Firefox as my daily browser. Way too much invested there.

And the new version of Android 4.4 the direct messaging Widget seems to be broken. It defaults to using the built in messaging service or Hangouts so I lose the ability to have only click texting via Google Voice like in previous versions.

I don't know what the answer is. There is not one service (from Google at least, maybe I need to branch out) which will do SMS and MMS from my phone and computer equally.

Stop publishing Access to Sharepoint

Can figure out how to make your Access DB stop trying to publish to Sharepoint?

Did you publish to Sharepoint and now you don't want to anymore?

Removing this setting is way more hidden then it needs to be. It is the PublishURL property on the CurrentDb. Delete it and you'll no longer have the save to SP bar.
CurrentDb.Properties.Delete ("PublishURL")

Getting the location data out of jpeg Exif data

Getting the location data from a jpeg that has been geotagged is pretty simple. You can use the wonderful tool ExifTool.
exiftool.exe -all -T -r -csv . > tags.csv
to get the list of all the available tags for all the pictures in your current directory. The tags are output as the headers in the table. The advantage to using the -T tag to turn it into a table is that if not all the pictures have the same tags you'll still basically get a "select distinct". For a geotagged jpeg from my phone I got a list of 225 tags.

I landed a command like this:
exiftool.exe -filename -GPSAltitude  -GPSImgDirection  -GPSLatitude  -GPSLongitude -GPSMapDatum -GPSPosition -GPSTimeStamp  -n -T -r -ext jpg -csv C:\Users\Bradley_handziuk\Downloads\exif\ > cords.txt
where the following tags were discovered from the -all technique.
-n -T -r -ext jpg
are defined as
-T          (-table)             Output in tabular format
-r (-recurse) Recursively process subdirectories
-n (--printConv) Disable print conversion ("This print formatting may be disabled with the -n option to extract coordinates as signed decimal degrees")
-ext EXT (-extension) Process files with specified extension
and I've chosen to limit the processing to files which are .JPGs.
C:\Users\Bradley_handziuk\Downloads\exif\ > cords.txt
searches my C:\Users\Bradley_handziuk\Downloads\exif\ directory for files and outputs everything I told exiftool to do to cords.txt.
There's a way to filter out only .jpg files too using some other flag (which I should l
(for reference this was a helpful forum post from years ago)

GPS Tracking on the Olympus TG-3

I bought a new Olympus Stylus TG-3 camera last week with. It has lots of nice features (water proof, shock proof, small, good macro photos, not terribly expensive) but possibly most interesting is the ability to track my location with GPS. It seems to embed the GPS (or other location data like "Quasi-Zenith Satellites System and GLONASS" (pdf page 70)) data in the jpeg exif data (which I wrote about as well but for the pictures from my cell phone) but also has the ability to track your location continuously regardless of taking pictures or even being powered on.

Before using the GPS I needed to update the A-GPS information using the Olympus Apps (there are two) and turn on the GPS and tracking info from the camera's menu. After riding to work and taking a few pictures I connected the camera to my computer and grabbed the GPS log files. They are stored in a GPSLOG folder on the SD card and have a .LOG file extension.

The data are stored in an NMEA file format which looks like this
Those are the only two "sentences" that come down from my camera: $GPGGA and $GPRMC. The $GPGGA is the "Global Positioning System Fix Data" and the $GPRMC is "Recommended Minimum Specific GPS/TRANSIT Data". I'm not sure why there are both but there are.

There is a part in the intro in the gpsinformation.org site that describes how you determine the datum of that data in your file. Apparently, Magellan and Garmin will commonly use another datum and will specify what is being used by including one sentence at the top like

Most other units always output NMEA messages in the WGS84 datum. Be sure and check the user documentation to be sure.
In general, I guess this is a great format for recording but doesn't import well into other programs[citation needed] so I started looking at how to convert to something else.

Open Street Map has a great page about converting NMEA to GPX which says to use GPS Babel (which I had seen from a few other pages already). I downloaded, installed, and even though there are commandline tools the GUI opened right up and I had already converted my file to KML (I changed my mind about GPX though it actually worked exactly the same).

I'll just include the command for completeness
"C:\Program Files (x86)\GPSBabel\gpsbabel.exe" -i nmea -f "14100801.LOG" -o kml -F "14100801.KML"
Now this KML file imported into Arc and I know I can plot KML files into Google Earth and Google Maps.

Keeping in mind this is super inaccurate and really only cool for recreational use like taking pictures while hiking. There is not enough info included in the downloaded file to correct the GPS data or to sufficiently describe it's quality if you are really wanting to use it. I.e. the file from my camera does not specify the number of satellites in view, how good the lock is on them, the error associated with each data point. On a better GPS file there would be one line per reading per satellite. Here the camera has mashed it all up into one line.

Setting up FTP access to Windows 2008 R2 through Amazon EC2

I had a really hard time getting this to work. In the end it was my lack of understanding of how passive versus active FTP and FTP connection ports versus data ports. The general process for getting this to work is:

  • Setting up an FTP site in IIS in your Windows instance
  • Knowing your external IP address and telling it to the FTP service in Windows
  • Opening the appropriate port in your EC2's instance's security group and have those open ports match the open ports for the Data Channel in the FTP Firewall in IIS


Converting raw (ORF) photos to something else (jpg/png)

Last time I needed to convert a bunch of raw pictures from a friend's camera to something more usable I used a program called UFRaw. It was an easy command line tool to quickly convert them all. Well sort of quickly. Once I got the command I needed nailed out I let it chug on a couple hundred pictures, it might have taken 15 minutes or so. Not terrible. The command was something like
cd "C:\Program Files (x86)\UFRaw\bin"
ufraw-batch.exe "..directory with my pictures\Raw\*.ORF"  --out-type=jpeg --size=2000
But now I have another problem. The lens that took these raw pictures this time was a different lens and, for whatever reason, embedded some information about itself into the ORF file indicating it was a panoramic lens.

When I open up the raw picture in the UFRaw GUI and save out an ID file (a .ufraw extension) there is a part in there that looks like this:
<Distortion Index='PanoTools lens model'>
  <Model Label='PanoTools lens model'>
When I change, The settings in the GUI I can save the file to be normal looking.

And this makes a normal looking picture

And the configuration for that looks like
<Distortion Index='None'>
    <Model Label='PanoTools lens model'>
Super. Looks great. It looks like one of the commands for using the command line ufraw-batch.exe is
--conf=<ID-filename>. I made my ID file, fed it into my existing command, and nothing happened. It didn't work. What a I doing wrong?

I tried all sorts of different configurations of that config file. Supplying the ID file to the command line differently. Nothing worked. Then I see this
The lensfun parameters are not written to UFRaw ID files. This means that if you create an ID file and use it to convert a batch of photos, no lensfun corrections will be applied.
That's valid for UFRaw 0.15 and I'm using 0.19.2 but the page hasn't been updated (accessed July 27, 2014) and it's not working so I assume it up to date (?). And the lenfun.dll was installed with my UFRaw install. The dll is form Feb 19, 2011 though. I have not looke dup if there is a newer version.

If I were the camera owner I think I could use the official Olympus software for this but the download page required you to enter a serial number which I do not have.

Picasa reluctantly to the rescue

Picasa has the ability to convert raw pictures to JPEG and this is ultimately what I used. It is very simplified and certainly not for doing any sort of actual image processing. If you want to do anything special with your picturess you probably have other software anyway but this route will crank through a bunch of conversions of ORF to jpeg and will do a simple resize. But, for whatever reason Picasa does not read the information from the lense in the same way and has no distortion when reading the pictures. Maybe because it is so much less capable it just doesn't even try? I don't know.

All you have to do is bring all the images into an album. I did this by ctrl+A'ing the pictures I wanted to convert in Windows Explorer and dragging them into a new Picasa album. Then you need to select all of the pictures you brought in and go File > Export to Folder. I chose to export all my pictures at 2200 max width.

I'm disappointed in UFRaw not being able to handle this yet (really their lensfun plugin) but happy something free can do it.