« March 2006 | Main | July 2006 »

June 28, 2006

More on BSB's

Ever since I started posting about Australian Payment Systems, I've been getting lots of hits on the site from people searching for a list of BSB numbers.

This list can be purchased, but lots of people are searching for a free copy on the net and I'm not sure why.

If you have a deposit showing up on your bank statement and you can't work out who it's from,  try this site which lets you lookup the details for a given BSB)

If you're after the BSB of your own account, don't assume you can get the right one from looking up a list - you really need to check with your bank!

If you are building an application and you want to validate BSB's that people enter, then you don't just need the list now, you also need to keep up to date with changes to the list, so you really should go buy a subscription. On the other hand, if you don't mind annoying people by rejecting their BSBs if someone opens an account at a new branch, then there's a copy of the list (dated 22 Nov, 2002) on the go software download page (look for bank.exe)

And if you're just curious about what banks there are, this table might be what you're after:

Bank NumberBank CodeBank NameBSB's
01ANZANZ Banking Group1097
03WBCWestpac Banking Corporation1434
06CBACommonwealth Bank1692
08NABNational Australia Bank2151
09RBAReserve Bank of Australia7
10BSABank of South Australia198
11STGSt. George Bank88
12BQLBank of Queensland120
14PIBPrimary Industry Bank1
15T&CTown & Country Bank7
18MBLMacquarie Bank20
19ADVAdvance Bank (Now St George)11
21CMBChase Manhattan Bank44
23BALBank of America4
24CTICitibank11
26BTABankers Trust Australia20
29BOTBank of Tokyo - Mitsubishi (Australia)2
30BWABankWest137
33STGSt. George Bank106
34HBAHSBC Bank Australia38
35BOCBank of China2
36IBJIBJ Australia Bank2
40CSTColonial State Bank535
41DBADeutsche Bank AG2
42TBTTrust Bank30
45OCBOversea-Chinese Banking Corporation4
46ADVAdvance Bank (Now St George)14
48METSuncorp-Metway407
52TBTTrust Bank122
55BMLBank Of Melbourne157
57ASLAustralian Settlements Limited25
63BAEBass & Equitable Building Society1
63BBLBendigo Bank25
63GBSGreater Building Society Ltd5
63HBSHeritage Building Society999
64AUBAustralian Unity Building Soc Ltd1
64IMBIllawarra Mutual Building Soc Ltd2
64IOFIOOF Building Society Ltd1
64MBSGreater Building Society Ltd1
64MMBMaitland Mutual Building Soc Ltd1
64MPBMackay Permanent Building Soc Ltd1
65BAYWide Bay Capricorn Building Society53
65PPBPioneer Permanent Building Soc Ltd2
65ROKThe Rock Building Society Limited1
66SUNSuncorp1
70CUSCreditLink36
73WBCWestpac Banking Corporation1232
76CBACommonwealth Bank1585
80CRUCredit Union Services Corporation (Cuscal)234
90APOAustralia Post60
91ARAArab Bank Australia12
91FNCBank One11
91MCBMizuho Corporate Bank1
91SSBState Street Bank and Trust Company1
92INGING Bank (Australia) Limited1
92MIDHSBC Bank plc4
92UOBUnited Overseas Bank1
93AMPAMP Bank9
93ICBInternational Commercial Bank of China2
94BCYBank of Cyprus9
94LBALaiki Bank7
94MEBMembers Equity Bank2
94TBBTaiwan Business Bank1

 

June 26, 2006

rendering html in firefox from irb

Here's a Firefox version of yesterday's script to render html from irb.

For best results, go to about:config and set browser.link.open_external to 1 (or from the menu, go to tools->options->tab, and set "open links from other applications in:" to "the most recent tab/window")

here's the script:

require 'base64' 
class Firefox

 #edit to suit
 @@firefox_path='C:\Program Files\Mozilla Firefox\firefox.exe'

 def Firefox.html_as_data_uri(html)
      'data:text/html;base64,'+ Base64.encode64(html).gsub("\n", '')
 end

 def Firefox.show_html(html)
  #can't use fork on windows
  IO.popen("#{@@firefox_path} #{Firefox.html_as_data_uri(html)}")
 end
 
end

June 25, 2006

rendering html from irb

for the last few weeks I've been doing some fairly tedious documentation stuff, e.g. pulling together 'requirements' from out of different word docs into a single list, categorising them (e.g. into 'functional', 'non-functional', 'future') and then creating a new table for each group that lists each requirement with an ID, a description, and a link back to the original source document.

I'm not going to explain why I need to do all that, it's just The Way Things Are Done Around Here.

So I've been using word automation to extract the source docs as html, like this:

def get_html_from_doc(docname)
 	winword = WIN32OLE.new('word.application')
doc=winword.Documents.Open(docname,nil,true)
tempfile=Tempfile.new("tmp")
tempfile.close #word reopens it
doc.SaveAs(tempfile.path,10)
doc.Close
winword.Quit unless winword.nil?
tempfile.open
html=tempfile.read
tempfile.close
html
end
then Rubyful Soup to pull the data from html tables into some linked hashes, which were saved as yaml. Once the data was a collection of ruby objects, I could modify it interactively with irb, then turn it into html. However while irb would happily print out the html source, if I wanted to see how that html would display I needed to first save it to a file, then load that file into IE. That got boring pretty quickly, so I put together this little routine to pipe a html string straight into a MSHTML control.
require 'win32ole'

class ShowHTML

private
def ShowHTML.create_new_window
@@ie=WIN32OLE.new('InternetExplorer.Application')
@@ie.menubar=0
@@ie.toolbar=0
@@ie.statusbar=0
end
ShowHTML.create_new_window
public
def ShowHTML.show(html)
#check our window is still around
begin
@@ie.navigate('about:blank')
rescue WIN32OLERuntimeError
create_new_window
@@ie.navigate('about:blank')
end
@@ie.document.open
@@ie.document.write(html.to_s)
@@ie.document.close
@@ie.visible=true
end

def ShowHTML.show_hash(hash)
html="<html><table>"<<hash.map{|v|"<tr><td>#{v[0]}</td><td>#{v[1]}</td></tr>\n"}.to_s<<"</table>"
ShowHTML.show(html)
end
end

Here's a screenshot of how this looks:
displaying html from irb
irb (foreground) displaying the ENV hash in a html window (background)