The ramblings of a yorkshire tyke

Life, Rants and Programming In A Blog

Browsing Posts in Tips

As a MacBook user who has used Virtualisation on the mac for sometime now but only usually with Linux based OS, I was forced to use it with Windows recently and I quickly found out how badly it handles UK Macbook keyboards.

The default UK keyboard mapping on a MacBook are pretty much useless when using Virtual PC emulators such VirtualBox or VMWARE.

With this in mind, have produced a custom keyboard layout which maps all the keys to right place.

The only two exceptions are the two OPT keys, which I could only managed to map them to ALT-n keys, so the alternative mapping for these are:

€ aka left OPT 2 is mapped to right ALT 2

# aka left OPT 3 is mapped to right ALT 3

To use the customer keyboard mapping, download the .zip, unzip it.. and click on mbkbd\setup.exe and it will install the custom keyboard called “United Kindom – MacBook – Custom“.

And this me using it… boy did this make more productive!

This a screen shot me trying it out… :-)

(link fixed)

One of the first things I wanted to read on my iriver story was the montly msdn subscription magazine which is available as a .chm. Which unfortunately the iriver story does not support, so I needed to convert it into either .pdf or .epub format.

As I am both a Mac and Windows user my choices were various from using a pdf printer on Windows to using various .chm readers on the Mac.

I first tried to use a .pdf printer on Windows but this not work due me using a 64bit version of Windows 7 and all the free pdf printers failed to either install or just simply did not work… much to my own frustration, so I turned to the Mac as this has native pdf support but did not have native .chm support! Don’t you just love computers…

On my mac I tried out various, these being:

  • Chmox
  • xchm
  • Chmosx
  • iChm
  • Again, I was meet with disappointment all of them either failed to display the embedded html in the .chm magazine (complaining about a nbsp entity) or just not displaying anything. So decided to raise a bug against the most the one I thought had the most chance of being fixed, which was the iChm application.

    So to my joy and delight the developer fixed it in version 1.4.2 and I was then able to load up the .chm, select Unicode encoding (as without this the pages did not display correctly) and then use the iChm function to export the .chm as a .pdf, copy it to the iriver story and I could then get back to reading all the years issues I had failed to read!

    So my tip for converting .chm to .pdf on the Mac is to use iChm as it works and the developer is very responsive to issues raised or was at least was for me! :-)

    12 Tips for using Micro Focus COBOL

    As it is close to Christmas and I wanted to do something with 12 in the title, I’ve thrown together some useful if not un-ordered list of 12 things tips using Micro Focus COBOL.

    Remember I am just a developer and just want to help fellow developers out :-) so…

    Merry Christmas!

    and here is my list…

    1. Use DLLs/Shared objects rather than .int code
    2. DLLs/Shared objects can be preloaded using:
      01 my-ptr procedure-pointer.
      set my-ptr to entry "sodllname"

      Note; sodllname does not have the extension… let the runtime choose it for you!

    3. Use a good development environment such as Visual Studio or on Unix use Eclipse offering if you have a workstation, otherwise I personally use vim/gvim if terminal access is the only choce.
    4. Remember you have a great choice of platforms from Windows to Linux to a load Unix platforms, so choice is king. (did I say that…)
    5. Try using managed code (.Net) if you want to create WPF/WinForms or use WCF
    6. Interopability is great, so if you see a Java Class, .Net Class, COM object, ‘C’ function or a Web Service… use it! You can even mix unmanaged and managed applications..
    7. Avoid using the following if performance is key, as this really does help our code generator:
      alter
      perform thru
      next sentence
      segments
      go to section-name
      go to paragraph outside the current section
    8. Try to end your routine with a “stop run [returning..]” or “exit program [returning..]” or “goback [returning..]” as this gives our code generators a defined end to the routine, which really does help our code analysis/generator
    9. Use comp-5, integers for speed in calculations or native .Net types in managed
    10. Use comp-x for portability (file formats etc..)
    11. Make your application more robust, use tracing in production systems, either our own CTF tracing or your own or third party… it will save your life one day! Use runtime routines to catch error and log them (CBL_ERROR_PROC), ensure your programs shutdown cleanly always use CBL_EXIT_PROC.
    12. Use the generator directive nocheck if you are happy your code is solid and want to a little more performance. ie: it turns off runtime bounds checking

    Further reading:

  • Coding for speed, size and portability
  • Eclipse/COBOL on Unix
  • Newsletter about CTF
  • For CTF_ APIs see CBL_CTF_ see library routines
  • Yes.. its a bit of a mixed list.. but hey it may be of help!

    Today my collegues Robert and Alex have finally :-) decided to publish a document that compares Visual Basic, C# and COBOL for .Net under The Creative Commons Attribution-ShareAlike 2.5 License.

    Rather than doing a cut-paste job, here is a quote from alex, along with a link to the “real” article itself.

    Enjoy.

    Alex Turner said:

    A Comparison Of .Net COBOL, Visual Basic and C#

    Introduction

    If you are a COBOL programmer wanting to learn C# or a VB programmer wanting to learn COBOL as a .net language (or any other combination of VB.net, C# and COBOL) then this is a good place to start.

    Background

    If you are a COBOL programmer wanting to learn C# or a VB programmer wanting to learn COBOL as a .net language (or any other combination of VB.net, C# and COBOL) then this is a good place to start.

    It has often been noted that the richness of the COBOL language in its Micro Focus .net implementation is not well known. Robert Sales and I have worked on this document to help bring the language to peoples’ attention and to help people who need to work with COBOL on the .net platform.

    Click here to continue reading the rest of the article…

    While working on a project recently I need to find out the current process of the active running Java process (for tracing/auditing), however I never found a 100% perfect solution but did come across an acceptable solution to use the management classes to query its name, which happens to have encoding in it, so here is the quick solution:

    import java.lang.management.ManagementFactory;

    public class getpid
    {
      public static void main(String args[]) throws Exception
      {
          System.out.println("Process id : "+getProcessId());
      }

      public static long getProcessId()
      {
        String name = ManagementFactory.getRuntimeMXBean().getName();
        String[] nameBits = name.split("@");
       
        return nameBits == null ? -1 :  Long.valueOf(nameBits[0]);
      }
    }
    $ java getpid
    Process id : 377

    Powered by WordPress Web Design by SRS Solutions © 2010 The ramblings of a yorkshire tyke Design by SRS Solutions
    AWSOM Powered