30 September 2013

Claiming Myki Reimbursement

Here is a procedure for quickly claiming a Myki reimbursement if you are clearly overcharged. Myki is the smartcard system used for public transport fares in Melbourne.

Assumptions: Your Myki card(s) is registered on the PTV site so that you can check your trip and charges, and you know your account PIN.

  1. Wait 48 hours after the overcharged trip before contacting the PTV service centre. (You can call the PTV earlier but the operators won't do anything until 48 hours have passed.)
  2. Ensure you know the trip details (route, time, date and stops).
  3. Ensure you know your Myki card number.
  4. Call PTV call centre on 1800 800 007 then press 1 and 6.
  5. When an operator responds, explain that you have been overcharged for some Myki trips.
  6. Give the operator your PIN to confirm your identity.
  7. Give the operator the relevant Myki card number and trip details.
  8. Let the operator confirm that your claim is valid. The operator has to check the route, stops and zones. After confirming your claim, the operator should give you a trouble ticket number for your record.
  9. PTV should send you a confirmation by e-mail within a day or two.
  10. Your Myki card should be credited when you touch on again.

27 September 2013

Vim configuration

My Vim configuration. Probably the only non-obvious thing is to use list to show whitespaces and listchars to display each tab as ">-". See Vim Wikia Highlight unwanted spaces for more information.

set guifont=Consolas:h10:cANSI
set ignorecase
set list
set listchars=tab:>-
set nobackup
set nowritebackup
set printfont=Courier:h8
set shiftwidth=2
set tabstop=2

20 September 2013

Concatenating two specific lines in sed

I wanted to concatenate specific rows of data so that I could analyse and chart them in Excel. My data had rows starting with a date and a keyword:

01/01/2013
12
46
79
xyz 0.1
02/01/2013
56
23
xyz 0.5

And the output I wanted is:

01/01/2013 xyz 0.1
02/01/2013 xyz 0.5

Below is a sed script to concatenate those two lines and ignore the others:

# Use: sed -n -f Concat.sed test.log
# H Hold <- Hold + \n + Pattern
# h Hold <- Pattern
# g Pattern = Hold
# First pattern
/..\/..\/..../ {
 h
}
# Second pattern
/xyz/ {
 H
 g
 s/\n/ /
 p
}

The "trick" is to collect the rows that I need into the hold space first then transfer it to the pattern space where the line break can be replaced by a space.

19 September 2013

Cannot read CHM file in Windows 7

If you can't read pages in a CHM (Compiled HTML) file on a Windows 7 computer, you might have to "unblock" the file. Seems to be a security feature to prevent scripts running.

  1. Show the CHM file properties.
  2. In the General tab, press the Unblock button. Note: After you do this, the button no longer appears for this file.

Thankfully, you only need to do this one time for the CHM file.

See longer write-up in StackOverflow.

13 September 2013

Portable GnuWin32

How to make GnuWin32 portable.

  1. Install all the GnuWin32 packages you require on a "build" computer. The packages are normally installed in a "GnuWin32" folder.
  2. Copy the GnuWin32 folder from your "build" computer to your portable drive or target computer.
  3. On your target computer, add the path to the GnuWin32\bin folder to your user (not system) PATH environment variable.

(Moving to portable applications to save time installing programming tools each time I have to work on another computer, especially when I don't have administrator rights.)