2009-05-28

Ruby log file management

I have been looking for a ruby log file management.  I looked at log4r but not sure it does what I want.  I am assuming a program that is run regularly to carry out a job. I would like the following:

1) for log files to be created for each run.  These to be stored in a log file directory

2) For the log files to be managed eg stored in log\2009\2009-04 and then a log file per day and a method of multiple log files per day.

3) The log files to have a format so that they are quite happy to crash in the middle, computer turned off and still be well formed and to have written everything that has been done out safely.  IE they can’t use regular XML format as can’t rely on closing brackets

4) Ideally have a graphical hierarchical tool to show you what happened.  Eg how long does something take over time, how often has it gone wrong.  A task would log start and end events. How many have happened per month etc  Looking at graphical environements this seems more suited to a rubyfx than shoes as rubyfx has support for a tree list.  Ideally the top levels of the tree would be the file directory structure.

5) The structure to cope with hierarchical logging eg

Start A
  Start B
  End B
  Start B
End A

Shows two B inside an A, on of the B’s was unsuccessful

6) Automatic log control eg ability to have only n Months of logs, to keep only say end of month logs after 1 year and even log thinnning where old logs are first thinned by getting rid of sub levels to take up less space.  Fixed space could also be used.

I think this is as far as I have got so far now back to some real work.

Later:  I have looked at YAML and think it is going to be helpful.

List of UK pottery suppliers

I have been trying to find a source of pottery supplies in the UK and wanted to list the main suppliers and some information about price.  I want to get some colour for the children to use, some clay, some slip for making bone china mugs in a mould and perhaps some plates.

I used ctm and they worked well.  Just need to get the kiln running now.

So in no particular order here they are:

Name Website Comments Price of colours Supplies clay,slip
http://www.ctmpotterssupplies.co.uk/ Complete supplier – good for larger quantities, based in Exeter. Delivery £10 per 25kg
Bit basic but functional web site
Scarva Erthenware glaze £5-£13 per kg powder, £6-£10 per 230ml/325g pot mixed.
Underglaze colour £2 to £4 per 100g pot. Pencils £3.20 each
porcelain 14.70 a gallon 8.64 for 12.5kg white earthenware
http://www.potterycrafts.co.uk/ Good website, Staffordshire
Duncan Covercoat
  Bone china and porcelain 5lt £21 £10 for 10KG for white earthenware
http://www.claymansupplies.co.uk/ Chichester    
http://www.dornhillpotterysupplies.co.uk/ Gloucestershire    
http://www.hobbyceramicraft.co.uk/ Focused on Ceramic cafe.    

2009-05-23

Playing with Ruby on rails on Windows

I have been playing with Rubymine which is a lovely development environment for Ruby.  I have a new web site development project so decided to learn Ruby on rails.

I have been reading Simply Rails 2 by Patrick Lenz and have now decided to actually try it out.  However the installation on Windows didn’t seem as straightforward as I thought it was going to be.  firstly the Instant rails seemed the wrong way to go as I already had ruby. So I did it by hand.

So I did gem install rails which worked fine.  Then downloaded rubymine and a 30 day free evaluation.  This then created my project for me.  So far so good.  I downloaded SQLite3 and put the .exe,.dll and .def in the Windows/ system32 directory, or rather I thought I did.   When I looked later Vista had prevented them.  So then I put them in c:\ruby\bin.

Had a bit of a problem with the SQL lite and I haven't been alone in this.  I created a data base with the SQL addin manager for Firefox.  Apart from using a .sqlite rather .sqlite3 that seemed ok. 

I had problems with installing the gem sqlite3-ruby and then I found this great post http://blog.emson.co.uk/2008/06/installing-sqlite3-on-windows-for-rails/

and it worked with gem install gem install sqlite3-ruby --version=1.2.3  and that seemed to work.

However ruby script/server still wouldn’t start up rails.  Time for supper.  The problem was I had corrupted the database.yaml file by adding a single character.  Once that was sorted it worked fine.

2009-04-30

Excel 2007 slow to open

Just a quick note I have both Excel 2003 and Excel 2007 and Excel 2007 was very slow to open.  A search of the web came up with the invaluable and crazy suggestion to create a blank .XLAM and add it.  Hey presto Excel 2007 responds as quickly as 2003.  Weird.

Starting a TortoiseSVN project

SVN is a great version control system and TortoiseSVN a great tool to access it.  I currently run the SVN server on a Windows desktop running as a serivce and each night back taking a rolling backup of it.

However I find one thing slightly confusing and that is how to move an existing project into SVN.  Typically you start something off and then decide it is worth a little more effort so add it to version control.  However the Tortoise SVN import tool is annoying in that when you import a folder it does not become the working copy.  So the help manual recommends you use Section 4.2.2, “Import in Place”.  This is then copied from the manual with some extra graphics:

  1. Use the repository browser to create a new project folder directly in the repository. (right click in File Explorer to get pp up menu then choose TortoiseSVN->Repo-Browserimage

  2. Checkout the new folder over the top of the folder you want to import. You will get a warning that the local folder is not empty. Now you have a versioned top level folder with unversioned content. (Make sure the URL of the repository contains the sub directory you have just added):image

  3. Use TortoiseSVN → Add... on this versioned folder to add some or all of the content. You can add and remove files, set svn:ignore properties on folders and make any other changes you need to.

  4. Commit the top level folder, and you have a new versioned tree, and a local working copy, created from your existing folder.

This is actually very easy but I remember getting confused before.

2009-02-13

Google logo for Darwin’s 200th birthday

I just liked it and was sad to be back to the regular logo so here it is:

image

2009-02-02

Wiring my phone system over Ethernet cabling

In our house i have run a number of Ethernet cables around for future expansion and for easy access.  However I had not quite finished all the wiring.  Anyway I need to move the phone (UK) from one room to another and was going to do it via the Ethernet cabling.  However I have forgotten the wiring for the phone.

So I have just summarised here the various connections:

Ethernet comes in two standard wiring patterns T568A (US govt standard and T568B AT&T standard).  I was going to choose the A version until I check some of my patch cables which were T-568B.  See incentre links:

image

From Zytrax I got an example wiring pattern for telephone links:

Pin number   Strand colour Name
1 Tip white & orange LAN (TX_D1+)
2 Ring orange LAN (TX_D1-)
3 Tip white & green LAN (RX_D2+)
4 Ring blue Telephone 1
5 Tip white & blue Telephone 1
6 Ring green LAN (RX_D2-)
7 Tip white & brown Telephone 2
8 Ring brown Telephone 2

(Tip and Ring comes from TRS Tip Ring Sleeve eg old telephone jacks) and I just need some standard BT wiring pattern for the UK standard 6 pin connector with 5 and 2 the normal for the wiring (but not master extension):

image