Sunday, November 28, 2010

Check the version of numpy

NumPy is the fundamental package needed for scientific computing with Python, see link for more information. To get the version of the installed numpy package, in a Python shell (e.g., IPython), do:

import numpy numpy.version.version

~ts

Saturday, November 27, 2010

Keep getting "Enter your password to perform administrative task" in Ubuntu Maverick Meerkat custom install

I have a custom Ubuntu Maverick Meerkat install using alternate install. Part of the minimal install was a lean GNOME configuration with only the bare minimum applications installed.

I have added synaptic and update-manager to keep the system up to date using GUI application. The issue was that when I open up Synaptic, I keep getting:
Enter your password to perform administrative task

To fix this, add desktop-base, thus say:
sudo aptitude install desktop-base

Enjoy!

~ts

Load langs.xml failed! in Notepad++

I got Notepad++ 5.7 installed in Windows 7 Professional, used to work nicely but lately I am getting the following error:

Load langs.xml failed!

One reason could be that lang.xml got corrupted. This is not unexpected as Windows 7 I am using tends to hang-up and I need to force a hard reboot.

One way to fix this is to:
1) Navigate to C:\Program Files\Notepad++.
2) Rename lang.xml to lang.xml.1.
3) Copy lang.model.xml to lang.xml

Enjoy!

References:
http://superuser.com/questions/67128/notepad-load-langs-xml-failed

~ts

Sunday, November 21, 2010

How to provide MSAA Name for MFC edit controls

Microsoft Active Accessibility (MSAA) can be used in GUI test automation or for accessibility. For test automation purposes, IAccessible::get_accName can be used to retrieve name of an edit box. To make this to work for MFC based applications, the tab order sequence should be modified such that the static label at the left of the edit box is one number lower. For example, if the edit box's tab order number is 5, the static label on the left should have tab order of 4. For MFC based application created using VS2010, menu Format | Tab Order (Ctrl + D) should show the order sequence graphically.

Note that this is applicable to the following test automation tools/frameworks:
- Test Partner
- Rational Robot
- UI Automation

Just to stress this out again, you need to have a static label to the left of the edit box for this work.

Enjoy!

References:
http://msdn.microsoft.com/en-us/library/dd373597(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/dd318483(VS.85).aspx

~ts

Monday, November 08, 2010

Ubuntu 10.10 Maverick Meerkat in VirtualBox

Ubuntu 10.10 was released 10/10/10 (October 10, 2010) what an amazing date. The new version was praised with the latest packages (kernel 2.6.35, gcc 4.4.5, Firefox 3.6.12, GNOME 2.32.0 and many more). The fanfare was heavily geared towards the new Ununtu font that was purported to be crisp and clear.

Since everyone is busy and I have time to mock around with the new distro, I made a series of screen captures that shows the installation sequence and a peek at how the desktop looks like.

I have done this using Virtualbox 3.2.10, see below for my configuration:
General Name: ubu1010 OS Type: Ubuntu System Base Memory: 1024 MB Processor(s): 1 Boot Order: CD/DVD-ROM, Hard Disk VT-x/AMD-V: Enabled Nested Paging: Enabled Display Video Memory: 12 MB 3D Acceleration: Disabled 2D Video Acceleration: Disabled Remote Display Server: Disabled Storage IDE Controller IDE Secondary Master (CD/DVD): Empty SATA Controller SATA Port 0: ubu1010.vdi (Normal, 120.00 GB) Audio Host Driver: Windows DirectSound Controller: ICH AC97 Network Adapter 1: Intel PRO/1000 MT Desktop (Bridged adapter, Microsoft Loopback Adapter) Serial Ports Disabled USB Device Filters: 0 (0 active) Shared Folders None

With VirtualBox guest ready, it is time to load ISO image(ubuntu-10.10-desktop-i386.iso). Below are the series of screen captures as the OS is being installed.

Figure 1. Boot-up screen

Figure 2. Preparing to install

Figure 3. Allocate drive space

Figure 4. Confirm allocation of drive space

Figure 5. Your current location, this will be used for calculating your local time.

Figure 6. Select your keyboard layout, defaults are normally okay.

Figure 7. This would be the first user of this computer

Figure 8. Welcom to Ubuntu 10.10

Figure 9. Installation complete, now reboot!!!

Figure 10. Login screen

Figure 11. GNOME desktop, system now ready.

Comparing with OpenSUSE 11.3, the installation experience, personally, is more polished in Ubuntu 10.10 but it is just me...

I have been enjoying Maverick Meerkat so far, though I admit I am only using it to surf the web. For good reason, I feel safer using *nix based OS wondering around the net.

Enjoy!!!

Sunday, November 07, 2010

QNX Momentics TFTP server is not running

I have QNX Momentics 4.6.0 running in Cent OS 5.4 and I was trying to load QNX board support package using TFTP server but I couldn't make it to work.

Looking at the Momentics TFTP server view shows:

Cannot start server: error: Unable to bind to server port.

This go me thinking about xinetd super service deamon but it was not running. Then I came to realize that of course the IDE was not running as root. So, to upload data to the tftp client, Momentics should be run as root user.

~ts

Loading Freescale P1020 board support package via tftp in Momentics

Relevant information:
  Development System: Windows XP Sp3 with QNX SDP 6.5.0 (this is only to demonstrate loading via tftp. BSP for P1020 in QNX foundry was documented as targeted for QNX 6.4.1)
  Target: P1020RDB

Host machine preparation:
Step 1. Download Freescale P1020 board support package, see this link. As of this writing, we only have support for QNX 6.4.1. I have it saved in D:\tmp\bsp-nto641-freescale-p1020-rdb-trunk-201009282107.zip. Take note that they continually update this package so the name may change.

Step 2. Extract the zip file, it should look like this: D:\tmp\bsp-nto641-freescale-p1020-rdb-trunk-201009282107.

Step 3. Open QNX Momentics (assuming you have this installed already).

Step 4. Open Resource Perspective (Window -> Open Perspective -> Other..., then select Resource).

Step 5. In Resource Perspective, create new project, i.e.:
  a) File -> New -> Project...
  b) Select General -> Project
  c) For project name type data, leave the  rest as default values.
  d) From Project Explorer, select data then do New -> Folder.
  e) Click Advanced >>.
  f) Click Link to folder in the file system.
  g) Browse to D:\tmp\bsp-nto641-freescale-p1020-rdb-trunk-201009282107\images. (Change folder structure as appropriate).
  h) Click Finish.

Step 6. Open Preferences ( Window -> Preferences) and navigate to QNX -> Tftp Server -> User Search Paths.

Step 7. Do click on New...

Step 8. Click on Browse Workspace... select data -> images then click on OK.

Step 9. Close Preferences dialog box.

Step 10. Change to QNX System Builder Perspective.

Step 11. From TFTP Server view (located in lower left in default layout or do Window -> Show View -> TFTP Server). Select Tftp Server Input -> User Search Path. Now we are ready for the host development machine.

Step 12. Install Tera Term or something similar. Set serial port (baud rate = 115200, data = 8bit, parity = none, stop = 1bit, flow control = none).

Target machine preparation:
Step 1. Connect P1020 (UART0) to your development machine.

Step 2. Connect CAT-5 (ethernet) cable to the same switch as your development machine. You can use the port closest to the first USB connector.

Step 3. Power on P1020, wait for the uboot prompt (note that you may have to press ESC to prevent it from booting into the default boot media).

Step 4.  Type setevn ipaddr 192.168.0.254 (where 192.168.0.254 is an available address in your network, this should also be reachable by your development machine).

Step 5. Save changes, type saveenv.

Step 6. Load QNX image, type tftpboot 0x100000 192.168.0.108:ifs-p1020rdb.raw. Where 192.168.0.108 is the IP address of the development machine.

Step 7: Jump to QNX OS, type go 0x100000.

You should now have QNX running in your P1020RDB board.

Enjoy

~ts