Nov 252009
 

Dear Webblog Diary

Last friday night we spent the night in London and we found a really good little Spanish Tapas restaurant and I thought I would share it… just because we enjoyed it soo much..

The place is called : El Parador – 245 Eversholt Street, London NW1 1BA.

The next day we headed for Brugge via the Eurostar and true to form Maria (my partner) found the the best Chocolate shop in the country, which we believe is ‘The Chocolate Line‘.

foodies enjoy!

Nov 172009
 

While developing something that could be used on Mono on Windows, Mono on Unix and on Windows with Microsoft’s CLR, I needed to be sensitive to the environment but didn’t want to conditionally compile my code different. So I put together a quick class to help.. Below is the C# code with pics of it running on Windows/Mac…


using System;
using System.Reflection;

namespace Gennard.Net
{
public class CLRUtils
{
private static readonly bool isMono= Type.GetType("Mono.Runtime") == null ? false : true;

private static readonly int eOSp = (int)Environment.OSVersion.Platform;
private static readonly bool isUnix = (eOSp == 4) || (eOSp == 128);

/* Class Properties */
public static bool IsMono { get { return isMono; } }
public static bool IsUnix { get { return isUnix; } }

public static void Main()
{
Console.WriteLine("Are we using Mono? : "+IsMono);
Console.WriteLine("Are we using Unix? : "+IsUnix);
}
}
}

The taste of the pudding mix.. is in the eating.. so lets see it working…

On Windows....

On the Mac, we get....

 

Carrying on from the previous blog, the user of iterators in .Net and especially .Net on COBOL can be very useful.

When CLR v2.0 was introduced a few new methods in System.IO.File for block reading/writing files were introduced, these works on arrays aka “OCCURS ANY” fields. Using these APIs instead of using traditional line sequentials is a breath of fresh air, especially if you just want to do some code something quickly without the need of records/group items.

So lets.. have a little play around, lets read a “MonthNames” from the CLR, write them to disk, read them back, reverse and sort it, while display them…


01 Months-Array type "System.Array".

01 Months string occurs 12.
01 Month string.

*> Note: the MonthsNames has 13 elements and the last element is ""
*> and I'm not interested it it so I'll drop it by doing a "ConstrainedCopy"
*> with just elements I'm interested in.
*> http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.monthnames.aspx
set Months-Array to type "System.Globalization.DateTimeFormatInfo"::"CurrentInfo"::"MonthNames"
invoke type "System.Array"::"ConstrainedCopy"(Months-Array, 0, Months, 0, Months::"Length")

display Months::"Length"
perform varying Month through Months
display "Normal -> " Month
end-perform

*> Write the array to disk
invoke type "System.IO.File"::"WriteAllLines"("MyMonths.txt", Months)

set Months to null

*> Read it back
set Months to type "System.IO.File"::"ReadAllLines"("MyMonths.txt")

*> Reverse it
invoke type "System.Array"::"Reverse"(Months as Type "System.Array")

*> Display it
perform varying Month through Months
display "Reverse -> " Month
end-perform

*> Sort it
invoke type "System.Array"::"Sort"(Months as type "System.Array")

*> Display it
perform varying Month through Months
display "Sorted -> " Month
end-perform

Which when executed gives us:


12
Normal -> January
Normal -> February
Normal -> March
Normal -> April
Normal -> May
Normal -> June
Normal -> July
Normal -> August
Normal -> September
Normal -> October
Normal -> November
Normal -> December
Reverse -> December
Reverse -> November
Reverse -> October
Reverse -> September
Reverse -> August
Reverse -> July
Reverse -> June
Reverse -> May
Reverse -> April
Reverse -> March
Reverse -> February
Reverse -> January
Sorted -> April
Sorted -> August
Sorted -> December
Sorted -> February
Sorted -> January
Sorted -> July
Sorted -> June
Sorted -> March
Sorted -> May
Sorted -> November
Sorted -> October
Sorted -> September

That was pretty easy… and the code looks okay too… can’t be bad…

References : System.Globalization.DatetimeFormat

Too Iterate or not…

 CLR, COBOL, Tips  Comments Off
Nov 102009
 

Over the next couple of weeks, I will explore some of the reasons why I think managed environments are good for COBOL.

So.. lets the show on the road…

Setting up arrays/occurs items in COBOL and manipulating them can be painful. Lets look at some traditional code for playing around with a “months” table.


01 month-val.
05 FILLER PIC X(10) value "January".
05 FILLER PIC X(10) value "February".
05 FILLER PIC X(10) value "March".
05 FILLER PIC X(10) value "April".
05 FILLER PIC X(10) value "May".
05 FILLER PIC X(10) value "June".
05 FILLER PIC X(10) value "July".
05 FILLER PIC X(10) value "August".
05 FILLER PIC X(10) value "September".
05 FILLER PIC X(10) value "October".
05 FILLER PIC X(10) value "November".
05 FILLER PIC X(10) value "December".

01 month-tab redefines month-val.
05 months occurs 12 times.
10 month-NAME PIC X(10).

01 month PIC 99.

01 secondQuarterMonths pic x(70).

display "The months are:"
perform varying month from 1 by 1 until month equals 12
display " " months(month)
end-perform

display " "
display "The second quarter months are: "

string months(4) delimited by space
"/" delimited by size
months(5) delimited by space
"/" delimited by size
months(6) delimited by space
into secondQuarterMonths
on overflow
display "FATAL Error - secondQuarterMonths is too small"
stop run
end-string

display " " secondQuarterMonths

Now, imagine we can use one or two of the .Net’s base class libraries combined with some nifty natural extensions to COBOL to do some of the heavy lifting.

Defining the month item as a native .Net type ie: a string combined with using the base class libraries Split methods allows us to setup a array quickly.


01 commaDelimited string value
"January,February,March,April,May,June,July,August," &
"September,October,November,December".

01 months string occurs any.
01 month string.

01 secondQuarterMonths string.

set months to commaDelimited::"Split"(',')

display "The months are: "
perform varying month through months
display " " month
end-perform

display " "
display "The second quarter months are: "

set secondQuarterMonths to type "System.String"::"Join"('/', months, 3, 3)

display " " secondQuarterMonths

The .Net version, besides being smaller feels much easier to read, especially if you have any exposure to the .Net base class library from other languages such as C# or VB.Net.

Of course in a real world example, we don’t need to use the split method to setup an array, we could just use the “values” clause… for example:


01 months string occurs 12 values
"January" "February" "March" "April" "May" "June"
"July" "August" "September" "October" "November" "December".

01 month string.

perform varying month through months
display month
end-perform

If however you don’t want to hardcode the months, you can always use: CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName() in the System.Globalization namespace. :-)

So… lets just do it…


01 Months string occurs any.
01 Month string.

set Months to type "System.Globalization.DateTimeFormatInfo"::
"CurrentInfo"::"MonthNames"

perform varying Month through Months
display Month
end-perform

Now, I hope you feel like I do that COBOL and .Net are indeed perfect partners to each other.


The above COBOL .Net code will execute on Micro Focus Net Express and I suspect it will also work on Fujitsu’s netCobol too.

Fiddling with the JVM

 Java, JVM, Tips  Comments Off
Nov 092009
 

Java is a very safe language if used in a normal way, however just like the CLR it can be used in an unsafe manor.

The main reason for using Java in a unsafe manor is performance, some unsafe operations are optimised by the JVM itself.

The boot class loader grants enough permissions to access a key undocumented class sun.misc.Unsafe. As I will state, this is an undocumented class and as the name implies it’s unsafe.

This class provides methods that allows you to manipulate objects and the memory of the objects directly.

For example, you could use it to access the object itself, lets look at an example to manipulate a String object.. not nice I hear you say…. and boy are you are so right. The purpose of this example is to demonstrate the power of the JVM if used to the extreme but not to demonstrate how to destroy the JVM.


import sun.misc.Unsafe;
import java.lang.reflect.Field;

// To Compile: javac BadBoy.java
// To Run: java -Xbootclasspath/p:. BadBoy

public class BadBoy
{
private final static Unsafe unsafe = Unsafe.getUnsafe();

public static void main(String args[]) throws Exception
{
// Find the field "count" inside java.lang.String
Field field = String.class.getDeclaredField("count");

// Find the memory offset within the field...
long countOffset = unsafe.objectFieldOffset(field);

field = String.class.getDeclaredField("offset");
long offset4Offset = unsafe.objectFieldOffset(field);

// Lets read the memory directory...
Object object = "Hello World from Java, the ultra safe language... or is it..";

int length = unsafe.getInt(object, countOffset);
System.out.println("The original Length is length: " + length);

System.out.println("1- The 'object' contains : ");
System.out.println(" -> "+object);
System.out.println(" hashCode is : " + object.hashCode());

unsafe.putInt(object, offset4Offset, 17);
unsafe.putInt(object, countOffset, 32);
System.out.println("2- The 'object' contains : ");
System.out.println(" -> "+object);
System.out.println(" hashCode is : " + object.hashCode());
}
}

Then, the output of the example on my little macbook is:


stephen-gennards-macbook:blob spg$ java -Xbootclasspath/p:. BadBoy
The original Length is length: 60
1- The 'object' contains :
-> Hello World from Java, the ultra safe language... or is it..
hashCode is : 573430574
2- The 'object' contains :
-> Java, the ultra safe language...
hashCode is : 573430574

As you can see the String object is changed but the hashCode remains the same. :-)

Even if the above example seems weird to the extreme and it is, I offer you one take home from this blog…

Be very careful what you place on your “bootclasspath!”

 

A while back, I spent a afternoon converting some C# NUnit documentation into COBOL .Net, so I thought I would share the document with the world, with the hope that it will help any one interested in using NUnit and COBOL.

Enjoy!


Let’s start with a simple example. Suppose we are writing a bank application and we have a basic domain class – Account. Account supports operations to deposit, withdraw, and transfer funds. The Account class may look like this:

class-id. Account as "Account".
environment division.
configuration section.
repository.
object.
data division.
working-storage section.
01 balance comp-2 value 0 property as "Balance".

method-id. "Deposit".
local-storage section.
linkage section.
01 lnk-amount comp-2.
procedure division using by value lnk-amount.
add lnk-amount to balance
exit method.
end method "Deposit".

method-id. "Withdraw".
local-storage section.
linkage section.
01 lnk-amount comp-2.
procedure division using by value lnk-amount.
subtract lnk-amount from balance
exit method.
end method "Withdraw".

method-id. "TransferFunds".
local-storage section.
linkage section.
01 lnk-Account object reference Account.
01 lnk-amount comp-2.
procedure division using by value lnk-Account,
by value lnk-amount.
exit method.
end method "TransferFunds".
end object.
end class Account.

Now let’s write a test for this class – AccountTest. The first method we will test is TransferFunds.

$set preservecase
class-id. AccountTest as "AccountTest".

environment division.
configuration section.
repository.
class sys-single as "System.Single"
class cls-TestFixture as "NUnit.Framework.TestFixtureAttribute"
class cls-Test as "NUnit.Framework.TestAttribute"
class Assert as "NUnit.Framework.Assert"

class cls-Account as "Account"
.

class-attributes.
custom-attribute is cls-TestFixture.

static.
data division.
working-storage section.
end static.

object.
method-id. "TransferFunds" custom-attribute is cls-Test.
local-storage section.
01 src object reference cls-Account.
01 dest object reference cls-Account.
procedure division.
set src to cls-Account::"New"
invoke src::"Deposit"(200)

set dest to cls-Account::"New"
invoke dest::"Deposit"(150)

invoke src::"TransferFunds"(dest, 100);

invoke Assert::"AreEqual"(250 as sys-single,dest::"Balance")
invoke Assert::"AreEqual"(100 as sys-single,src::"Balance")
exit method.
end method "TransferFunds".
end object.
end program AccountTest.

The first thing to notice about this class is that it has a TestFixture attribute associated with it – this is the way to indicate that the class contains test code (this attribute can be inherited). The class has to be public and there are no restrictions on its superclass. The class also has to have a default constructor.

The only method in the class – TransferFunds, has a Test attribute associated with it – this is an indication that it is a test method. Test methods have to return void and take no parameters. In our test method we do the usual initialization of the required test objects, execute the tested business method and check the state of the business objects. The Assert class defines a collection of methods used to check the post-conditions and in our example we use the AreEqual method to make sure that after the transfer both accounts have the correct balances (there are several overloadings of this method, the version that was used in this example has the following parameters : the first parameter is an expected value and the second parameter is the actual value).

Compile and run this example. Assume that you have compiled your test code into a Example1.dll. Start the NUnit Gui (the installer will have created a shortcut on your desktop and in the “Program Files” folder), after the GUI starts, select the File->Open menu item, navigate to the location of your bank.dll and select it in the “Open” dialog box. When the bank.dll is loaded you will see a test tree structure in the left panel and a collection of status panels on the right. Click the Run button, the status bar and the TransferFunds node in the test tree turn red – our test has failed. The “Errors and Failures” panel displayed the following message – “TransferFunds : expected <250> but was <150>” and the stack trace panel right below it reported where in the test code the failure has occurred “at AccountTest.TransferFunds() in xxxxExample1Example1AccountTest.cbl:line 42”

That is expected behavior; the test has failed because we have not implemented the TransferFunds method yet. Now let’s get it to work. Don’t close the GUI and go back to your IDE and fix the code, make your TransferFunds method look like this:

method-id. "TransferFunds".
local-storage section.
linkage section.
01 lnk-Account object reference Account.
01 lnk-amount comp-2.
procedure division using by value lnk-Account,
by value lnk-amount.
invoke lnk-Account::"Deposit"(lnk-amount)
invoke self::"Withdraw"(lnk-amount)
exit method.
end method "TransferFunds".

Now recompile your code and click the run button in GUI again – the status bar and the test tree turn green. (Note how the GUI has reloaded the assembly automatically for you; we will keep the GUI open all the time and continue working with our code in IDE and write more tests).

Let’s add some error checking to our Account code. We are adding the minimum balance requirement for the account to make sure that banks continue to make their money by charging your minimal overdraft protection fee. Let’s add the minimum balance property to our Account class:


01 minimumBalance comp-2 value 10
property as "MinimumBalance".

We will use an exception to indicate an overdraft:


class-id. InsufficientFundsException
as "InsufficientFundsException"
inherits cls-exception.

repository.
class cls-exception as "System.ApplicationException".
object.
object-storage section.
end object.

end class InsufficientFundsException.

Add two new classes reference to the repository:


class ExpectedException
as "NUnit.Framework.ExpectedExceptionAttribute"
class InsufficientFundsException
as "InsufficientFundsException"

Add a new test method to our AccountTest class:


method-id. "TransferWithInsufficientFunds"
custom-attribute is cls-Test
custom-attribute is ExpectedException(
type of InsufficientFundsException)
.
local-storage section.
01 src object reference cls-Account.
01 dest object reference cls-Account.
procedure division.
set src to cls-Account::"New"
invoke src::"Deposit"(200)

set dest to cls-Account::"New"
invoke dest::"Deposit"(150)

invoke src::"TransferFunds"(dest, 300);
exit method.
end method "TransferWithInsufficientFunds".

This test method in addition to Test attribute has an ExpectedException attribute associated with it – this is the way to indicate that the test code is expecting an exception of a certain type; if such an exception is not thrown during the execution – the test will fail.

Compile your code and go back to the GUI. As you compiled your test code, the GUI has grayed out and collapsed the test tree as if the tests were not run yet (GUI watches for the changes made to the test assemblies and updates itself when the structure of the test tree has changed – e.g. new test is added). Click the “Run” button – we have a red status bar again. We got the following Failure : “TransferWithInsufficentFunds : InsufficientFundsException was expected”. Let’s fix our Account code again, modify the TransferFunds method this way:


method-id. "TransferFunds".
local-storage section.
linkage section.
01 lnk-Account object reference Account.
01 lnk-amount comp-2.
procedure division using by value lnk-Account,
by value lnk-amount.

invoke lnk-Account::"Deposit"(lnk-amount)
if balance - lnk-amount < minimumBalance
raise InsufficientFundsException::"New"()
end-if

invoke self::"Withdraw"(lnk-amount)
exit method.
end method "TransferFunds".

Compile and run the tests – green bar. Success! But wait, looking at the code we’ve just written we can see that the bank may be loosing money on every unsuccessful funds Transfer operation. Let’s write a test to confirm our suspicions. Add this test method:


method-id. "TransferWithInsufficientFundsAtomicity"
custom-attribute is cls-Test
.
local-storage section.
01 src object reference cls-Account.
01 dest object reference cls-Account.
01 obj-InsufficientFundsException
object reference InsufficientFundsException.
procedure division.
set src to cls-Account::"New"
invoke src::"Deposit"(200)

set dest to cls-Account::"New"
invoke dest::"Deposit"(150)

try
invoke src::"TransferFunds"(dest, 300)
catch obj-InsufficientFundsException
continue
end-try

invoke Assert::"AreEqual"(200 as sys-single,src::"Balance")
invoke Assert::"AreEqual"(150 as sys-single,dest::"Balance")

exit method.
end method "TransferWithInsufficientFundsAtomicity".

We are testing the transactional property of our business method – all operations are successful or none. Compile and run – red bar. OK, we’ve made $300.00 out of a thin air (1999.com déjà vu?) – the source account has the correct balance of 150.00 but the destination account shows : $450.00. How do we fix this? Can we just move the minimum balance check call in front of the updates:


method-id. "TransferFunds".
local-storage section.
linkage section.
01 lnk-Account object reference Account.
01 lnk-amount comp-2.
procedure division using by value lnk-Account,
by value lnk-amount.

if balance - lnk-amount < minimumBalance
raise InsufficientFundsException::"New"()
end-if

invoke lnk-Account::"Deposit"(lnk-amount)

invoke self::"Withdraw"(lnk-amount)
exit method.
end method "TransferFunds".

What if the Withdraw() method throws another exception? Should we execute a compensating transaction in the catch block or rely on our transaction manager to restore the state of the objects? We need to answer those questions at some point, but not now; but what do we do with the failing test in the meantime – remove it? A better way is to temporarily ignore it, add the following attribute to your test method


method-id. "TransferWithInsufficientFundsAtomicity"
custom-attribute is cls-Test
custom-attribute is
IgnoreTest("Need to decide how to implement transaction management in the application")

Compile and run – yellow bar. Click on “Tests Not Run” tab and you will see AccountTest.TransferWithInsufficientFundsAtomicity() in the list along with the Reason this test is ignored.

Looking at our test code we can see that some refactoring is in order. All test methods share a common set of test objects. Let’s extract this initialization code into a setup method and reuse it in all of our tests. The refactored version of our test class looks like this:


$set preservecase sourceformat"free"
class-id. AccountTest as "AccountTest".

environment division.
configuration section.
repository.
class sys-single as "System.Single"
class NUnit-TestFixture as
"NUnit.Framework.TestFixtureAttribute"
class NUnit-Test as
"NUnit.Framework.TestAttribute"
class NUnit-Setup as
"NUnit.Framework.SetUpAttribute"
class NUnit-Assert as
"NUnit.Framework.Assert"
class NUnit-IgnoreTest as
"NUnit.Framework.IgnoreAttribute"
class NUnit-ExpectedException as
"NUnit.Framework.ExpectedExceptionAttribute"

class cls-Account as
"Account"
class InsufficientFundsException as
"InsufficientFundsException"
.

class-attributes.
custom-attribute is NUnit-TestFixture.

object.
working-storage section.
01 src object reference cls-Account.
01 dest object reference cls-Account.

method-id. "Init"
custom-attribute is NUnit-Setup.
procedure division.
set src to cls-Account::"New"
set dest to cls-Account::"New"

invoke src::"Deposit"(200)
invoke dest::"Deposit"(150)
exit method.
end method "Init".

method-id. "TransferFunds"
custom-attribute is NUnit-Test.
procedure division.
invoke src::"TransferFunds"(dest, 100);
invoke NUnit-Assert::"AreEqual"(250,dest::"Balance")
invoke NUnit-Assert::"AreEqual"(100,src::"Balance")
exit method.
end method "TransferFunds".

method-id. "TransferWithInsufficientFunds"
custom-attribute is NUnit-Test
custom-attribute is
NUnit-ExpectedException(
type of InsufficientFundsException).
procedure division.
invoke src::"TransferFunds"(dest, 300)
exit method.
end method "TransferWithInsufficientFunds".

method-id. "TransferWithInsufficientFundsAtomicity"
custom-attribute is NUnit-Test
custom-attribute is NUnit-IgnoreTest(
"Need to decide how to implement transaction management in the application").
local-storage section.
01 obj-InsufficientFundsException
object reference InsufficientFundsException.
procedure division.
try
invoke src::"TransferFunds"(dest, 300)
catch obj-InsufficientFundsException
continue
end-try

invoke NUnit-Assert::"AreEqual"(
200 as sys-single,src::"Balance")
invoke NUnit-Assert::"AreEqual"(
150 as sys-single,dest::"Balance")
exit method.
end method "TransferWithInsufficientFundsAtomicity".

end object.
end program AccountTest.

Note that Init method has the common initialization code, it has void return type, no parameters, and it is marked with SetUp attribute. Compile and run – same yellow bar!

 

While working on some support recently for our compiler (Micro Focus COBOL compiler that is), I became annoyed with the lack of a reasonable error messages/stack trace output from our Java/COBOL Object support.

I have no idea why our default exception handler for Java exceptions just displays a such a simple message with little or no information.

For those who have not seen it, display something similar to:

Exception 65537 not trapped by the class javaexceptionmanager.
Description: "Java exception"
Test error
Hit T to terminate program. Hit any other key to continue.
instantiated - test

Exception 65537 not trapped by the class javaexceptionmanager.
Description: "Java exception"
Test error
Hit T to terminate program. Hit any other key to continue.

Luckily for me and you, we do expose a mechanism for replacing the default exception handler.

Anyway, with very little effort I created a different “default” system exception handler that display this instead:

instantiated - test 1
java.lang.Exception: Test error
at SimpleClass.TestException(SimpleClass.java:10)

WARNING: JavaException: Test error
instantiated - test 2
java.lang.Exception: Test error
at SimpleClass.TestException(SimpleClass.java:10)
WARNING: JavaException: Test error

The key difference being that a Java stack trace is included, boy did this help me.

The program below is the code that implements the exception handler. I am sure someone else can take this example and make it much nicer and provide more features but for this blog I will keep it simple.


$set ooctrl (+p-f) case
program-id. ExceptionCatcher.

class-control.
EntryCallback is class "entrycll"
JavaExceptionManager is class "javaexpt"
ExceptionManager is class "exptnmgr"
Javasup is class "javasup"
.

working-storage section.
01 wsCallback object reference.
01 wsIterator object reference.
01 theJavaException object reference.
local-storage section.
01 filler pic x. *> dummy storage item to allow recursion
linkage section.
01 lnkException object reference.
01 lnkErrorObject object reference.
01 lnkErrorTextCollection object reference.
01 lnkErrorNumber pic x(4) comp-5.
01 anElement object reference.
procedure division.
*>---Set up system level Exception handler
invoke EntryCallback "new" using
z"JException"
returning wsCallback
end-invoke

invoke ExceptionManager "register" using
javaexceptionmanager
wsCallback
end-invoke

invoke EntryCallback "new" using z"DispError"
returning wsIterator
end-invoke

goback.

entry "Jexception" using
lnkException
lnkErrorNumber
lnkErrorTextcollection
.

invoke javasup "exceptionOccurred"
returning theJavaException
end-invoke

if theJavaException not equal null
invoke theJavaException "printStackTrace"
end-if

invoke lnkErrorTextCollection "do" using wsIterator
goback.
.

entry "DispError" using anElement
display "WARNING: JavaException: " with no advancing
invoke anElement "display"
display " "
goback.
.

To use the above code, you just have to first cut-paste to code into a file called ExceptionCatcher.cbl and include this in your project, and then add the directive INITCALL”ExceptionCatcher”, then away you go.

My test programs for the above example are:


$set ooctrl (+p-f) case
program-id. jtest.

class-control.
SimpleClass is class "$JAVA$SimpleClass"
.

working-storage section.
01 theInstance object reference.
local-storage section.
01 filler pic x. *> dummy storage to allow the local entry
procedure division.
*>---Instantiate the class
invoke SimpleClass "new" returning theInstance

display "instantiated - test 1"
invoke theInstance "TestException"

display "instantiated - test 2"
invoke theInstance "TestException"
stop run.

and the Java class itself:


import java.lang.* ;

public class SimpleClass {
public SimpleClass() { }

public void TestException() throws Exception {
throw new Exception ("Test error" );
}
}

References: Studio Enterprise 6.0 Document for COBOL/Java Interop

Oct 302009
 

While visiting Spain/Madrid my partner finally managed to get a pay-as-you mobile that she could charge without requiring a spanish credit card, which never of us have, as we live in the UK.

Anyway, the mobile just cost €20 from Vodafone at El Corte Ingles and the phone can be topped up at ATM’s and shops.. This should hopefully cut down on our roaming charges..

Remember, you need to show a passport or the number will not be registered and you could lose it.

Oct 282009
 

We recently move from our trust TomTom One to the wizzy TomTom XL Live. Unfortunately some where in the update process, the TomTom live was only part activated…. basically the TomTom traffic update kept complaining the account did not have a valid subscription.

After a couple of frustrating conversations with their support the issue was identified.

The map update process had managed to zero out two important files, these being traffic.dat and tmccodes.dat. The support person said they would email the two files but I needed a quicker solution rather than waiting for the email (which so far has taken 1hr… as opposed to the 15mins that was promised).

Any the solution to is to extract these files from your downloaded maps, which will be in the TomTom Downloads area… on my mac these are found in the file “Western_Europe.zip”.

So I just extracted the files with:

mkdir tmp
cd tmp
unzip -x ../Western_Europe.zip traffic.dat tmccodes.dat

and then replaced the files in the maps/Western_Europe directory on the TomTom itself, safely unmounted the TomTom drive, reboot it… and it worked…

© 2012 The ramblings of a yorkshire tyke Suffusion theme by Sayontan Sinha