Thursday, 11 March 2010

index

Keywords

WikiBlogger, WallpaperChanger, Latin, Ensymble, Symbian, Phatch, Doug the Eagle, Jamendo, Python, Nokia, N73, OBEX,Gnome,vfs, Singularity, cartoons, EmacsWiki

2010-02-12 WikiBlogger

Blogging is not for me. However, I do have things to say and notes to make. For that I use EmacsWiki. For a while I posted it to a free web host but it was hard to find one that would stay alive, didn't cost money, and actually worked; some versions are probably out there, poor orphans. Then I saw Google's Python interface to Blogger and it occurred to me that I could continue using my local wiki and post it to Blogger. A little experimentation shows that the basic idea works, a web page can simply be posted to Blogger using just a few lines of Python. Notes on the process will be found on WikiBlogger.

2008-07-18 Trondheim Airport

Writing notes on my WallpaperChanger.

2008-05-23 Lucretius: De Rerum Naturae

I've just started re-reading Lucretius. Or at least reading another translation, metrical this time. And on my mobile too.

I was struck by these lines:

...
Throughout the lands lay miserably crushed
Before all eyes beneath Religion--who
Would show her her head along the region skies,
Glowering on mortals with her hideous face--
A Greek it was who first opposing dared
Raise mortal eyes that terror to withstabd,
Whom nor the fame of Gods nor lightning's stroke
Nor threatening thunder of the ominous sky
Abashed; but rather chafed to angry zest
His dauntless heart to be the first to rend
The crossbars at the gates of Nature old.
And thus his will and hardy wisdom won;
And forward thus he fared afar, beyond
The flaming ramparts of the world, until
He wandered the unmeasurable All.
Whence he to us, a conqueror, reports
What things can rise to being, what cannot,
And by what law to each its scope prescribed,
Its boundary stone that clings so deep in Time.
Wherefore Religion now is under foot,
And us his victory now exalts to heaven.
...

2008-05-14 Walking Barefoot

I really don't like wearing shoes. So last timeI was in Raleigh, NC, I went barefoot as often as I could.

The result is that I have another item for my no NoBuyList but this time it isn't a product or a single company but an entire shopping centre.

I was walking through the Capitol Boulevard Fleamarket toward the shop that sells secondaand laptops, seriously considering spending about 250USD when I was confronted by a short, rather plump woman followed by two equally short but tough looking security guards and told that they required me to wear shoes.

Oh, well. I don't really need the laptop. But the store that was selling them has lost a sale and the Fleamarket has permanently lost a customer.

Some related links:

2008-03-25

Bluetooth Console

It is tedious to type on a numeric keypad so when experimenting with Python my Nokia mobile I use a terminal emulator on my Linux box connected to the mobile via Bluetooth.

The pyS60 shell includes an option for connecting to a Bluetooth console. Here is a potted description of how to do it on Linux (ubuntu 7.04):

  • Open two terminal windows or better still a terminal window and an Emacs buffer with a shell (M-x shell).
  • In one terminal add an emulated serial port by typing these commands:
    sdptool add --channel=2 SP
    rfcomm listen rfcomm2 2
    
  • On the mobile start the Python shell,
  • go to the options menu and choose Bluetooth console,
  • Choose or search for the device representing your computer,
  • In the other terminal (or Emacs shell buffer) start a serial terminal emulator:
     
    cu -l /dev/rfcomm2
    
  • press enter

Now you should see the Python prompt: >>>

You can type whatever you like now and it will be sent to the mobile for execution. This includes commands that display user interface elements (see this blog entry).

See the Nokia wiki for the source of these notes and links to pages that might help if it doesn't work.

Using Emacs makes redoing and editing commands much easier than using the emulator in an ordinary terminal window.

2008-03-24

Save your work

Copies of some posts to some public fora will be found on PublicPosts in case they get deleted. Mostly rants!

On a related topic. here is my NoBuyList (Sony, Nokia, Symbian).

Cell Tracking

Now that I can create a Python application for my N73 that can record the cell identifier it is time to start thinking about how to use it.

the basic idea is to tag photographs automatically so that in years to come I can at least be reminded of roughly where they were taken.

See CellTracking.

2008-03-24T00:55

Long past time for bed but before I go I must mention that I have finally found a testing range version of the Python shell for S60 3rd ed. on Ville Tuulos' site: http://www.cs.helsinki.fi/u/tuulos/PythonScriptShell_1_4_2_TestRange_UID.sis Many thanks to Croozeus for tracking it down. See the Developer Discussion Boards > Programming Languages > Python > open signing shell thread on ForumNOKIA.

2008-03-23

How to sign a Python script so that it can use gsm_location()

Here is a recipe and example for using gsm_location() to get the cell id in a Symbian S60 3rd edition mobile.

Prerequisites

PyS60 3rd ed
You must have the full capability Python interpreter installed. Get it from Sourceforge. Nokia's page says that 1.3.8 is the latest version but in fact the latest, and the one you should download, is 1.4.2: PythonForS60_1_4_2_3rdEd.SIS. For the purpose of this tutorial you do not need the shell (PythonScriptShell_1_4_2_3rdEd.SIS) but get it anyway because it is useful for experimenting with and in fact there are many applications that can be executed without the Location capability.
Ensymble
A Python program to package a Python script as a SIS file. Get it from http://www.nbi.fi/%7Enbi928/ensymble.html
S60 3rd ed. mobile
These instructions apply only 3rd edition mobiles like the N73, N95, etc. Previous editions did not have the capabilities based security model.

Example code

The code is quite simple. If it would run in the Python shell supplied by Nokia with the PyS60 package it would simply be these three lines:

import location
(mcc, mnc, lac) = location.gsm_location()
print u"MCC: ", mcc, u", MNC: ", mnc, u", LAC: ", lac

This won't work because the shell does not have the location capability, you will simply get an error because location.gsm_location() will return None.

What you have to do is create a standalone program packaged in an SIS file and mark it with the necessary flags. You then sign it (explained below) and install it on thr mobile.

Unfortunately the print expression will not work in a standalone application, or rather it will run but you will not see any output and nor will you see an error message. This means that you need a slightly more sophisticated program that uses the appuifw module to display the answers and that you must prevent errors from occurring.

Here is a version of Jurgen Scheible's example modified to trap the condition that occurs when the script does not have the necessary capabilities.

The relevant changes are in the gsm_location procedure:

def gsm_location() :

    s = u"getting location: "
    appuifw.app.body = appuifw.Text(s)
    
    loc = location.gsm_location()
    if loc == None:
        s += u"No cap"
    else:
        (mcc, mnc, lac, cellid) = loc
        s += u"MCC: " + unicode(mcc) + u", MNC: " + unicode(mnc) + u", LAC: " + unicode(lac) + u", Cell id: " + unicode(cellid)

    appuifw.app.body = appuifw.Text(s)

If location.gsm_location() returns None we display "No caps", otherwise we display the three valuse returned.

Procedure

Install Python on the mobile
On a Windows PC you can use the Nokia PC suite, just double click the SIS file and the Nokia installer should pop up, just follow the instructions. I use Ubuntu Linux with the KDE Bluetooth file transfer application (Bluetooth OBEX Client, kbtobexclient); if you have Bluetooth correctly set up it should see your mobile, just select it and send the file.
Install Ensymble on your computer
follow the instructions on the Ensymble site.
Package the application
at the command line issue this command:
  ensymble.py py2sis -v --caps=location+readuserdata+readdevicedata --version=0.0.1 location.py 
Sign the application
In your web browser visit the Symbian Signed Open Signed Online page and enter the serial number (IMEI) of your mobile, your email address and the path to the SIS file generated in the previous step (or use the browse button). Tick the Location, ReadUserData, and ReadDevicedata check boxes. Agree with the legalities, type in the Security Code and click the Send button.
Check your email
The Symbian server wants to shake hands with you so it will send a confirmation email to you. In this email will be a link to a web page; you must follow the link to complete the request.
Check your email again
I don't know why but Symbian won't give you the link to the signed copy of your application straightaway, they send it in another email instead. This time the link points at the signed copy of your application so just follow it and save it to your disk.
Install the signed application
Send the signed file to your mobile and install in the usual way. It will show warnings about it being untrusted and so on but just keep saying continue until it is installed.
Run the application
Open the applications menu. Your new application will probably be at the end of the list. Run it, press the options key and select get location. You should get something like this:
  getting location: MCC: 242. MNC: 2, 
  LAC: 771, Cell id: 6323

2008-3-22

More Symbian

An alternative to pyS60 is mShell but it suffers from exactly the same signing problems.

Bluetooth file system

On Linux you can use obexftp to browse the file systemin a Bluetooth mobile but it isn't very convenient and isn't easy to script. Obexfs should solve these problems but how can one use it?

Actually it is ever so easy:

First create a diectory to be the mount point:

  mkdir ~/mnt
  mkdir ~/mnt/nameofmobile

Instead of nameofmobile use whatever you like.

Now find the MAC address of your mobile. Make sure it is switched on and paired with your PC. Now in a terminal window type:

  hcitool scan

You should get something like this:

Scanning ...
        00:12:34:56:89:AB       yourmobilename

Now you can mount the mobile by typing this command:

  obexfs -b 00:12:34:56:89:AB -B 11 ~/mnt/nameofmobile

Now you can navigate to ~/mnt/nameofmobile using any program (file manager, command line, image editor, script,etc.)

2008-03-20

Python on N73/Symbian 3rd edition (pyS60) is as frustrating as it is interesting. Why has Symbian/Nokia made it so awkward to use certain capabilities? All I want to do is to retrieve the cell location information but it seems that I must register for a developer certificate. Why isn't it enough for the owner of the mobile to simply grant those privileges to the application?

Assuming that non-Symbian smartphones do not have these restrictions my next phon will not be Symbian or Nokia. These restrictions are simply protectionist.

Now that Symbian has made it impossible to obtain a development certificate without paying for a publisher ID they have simply ensured that no one will develop applications for private use which means that no one woh wants to experiment is going to bother buying such a phone.

If Nokia is a willing accomplice in this then they can wistle for my custom. In fact as Nokia is probably Symbian's only significant customer they should have stopped this anyway, in which case they are on my list of never to be bought from again companies along with Sony (for the rootkit).

2008-03-14

Phatch is a very interesting program. I wonder where Stani wants to take it?

2008-03-11

Favourite music of the moment

Doug the Eagle's Pancake Ferret and A Day at the People Factory. (http://www.jamendo.com/)

Project of the moment

Python code to generate Phatch actions for command line transformations.

2008-03-10

Fight Spam

Does this work:

Fight Spam! Click Here!

Nokia and Linux

Well, gnome-vfs-obexftp does work; but only for a while then the PC locks up. Actually I don't know if the PC locks up or just Gnome and X. At least it stops responding to the mouse and keyboard

2008-03-09

Bought a Nokia N73. After much trial and error I finally figured out that what I needed to install was the 'Obex FTP GnomeVFS module': gnome-vfs-obexftp.

Now I can just open Nautilus go to location obex:// and find the mobile in the list. Then I can copy, move and delete files to my heart's content.

2008-02-19

On Singularity is Near is made the strong claim that Ray Kurzweil has:

a twenty-year track record of accurate predictions.

Does anyone have a list?

2008-02-17

I am a citizen of planet Earth who is rather concerned at the behaviour of some of my fellow citizens. Right now some in the neighbouring country of Denmark seem to think that arson is an appropriate response to a cartoon that they don't like the look of. How come it is always the violent and oppressive who seem to think their feelings should count for more than those of someone who draws a picture and harms no one and nothing (Kurt Westergaard)? How come they feel justified in trampling on the feelings, properties and persons of the state that gave them and their parents succour and a home.

I'm glad Anders Fogh Rasmussen places the blame firmly in the hand of those burning schools and cars and their parents.

See: http://jp.dk/

For now I'll omit the cartoon itself. I wish I could honestly say that I omit it because it is not relevant; but, I must admit to a little fear.

We all must speak out against violence and injustice lest we end like Pastor Martin Niemoller:

Als die Nazis die Kommunisten holten, habe ich geschwiegen;
   Ich war ja kein Kommunist.
Als sie die Sozialdemokraten einsperrten, habe ich geschwiegen; 
   Ich war ja kein Sozialdemokrat.
Als sie die Gewerkschafter holten, habe ich geschwiegen; 
   Ich war ja kein Gewerkschafter.
Als sie die Juden holten, habe ich geschwiegen, 
   Ich war ja kein Jude.
Als sie mich holten, 
   gab es keinen mehr, der protestieren konnte
First they came for the communists, and I did not speak out--
    because I was not a communist;
Then they came for the socialists, and I did not speak out--
    because I was not a socialist;
Then they came for the trade unionists, and I did not speak out--
    because I was not a trade unionist;
Then they came for the Jews, and I did not speak out--
    because I was not a Jew;
Then they came for me--
    and there was no one left to speak out for me. 
-- Pastor Martin Niemoller, 1945 

The German version is from Manfred Schindler's blog, the English from age-of-the-sage.org. Why do sites that provide translations not provide at least a link to the original?

On a not entirely unrelated topic, here is a book about but not of nonsense: The natural History of Nonsense, Bergen Evans, 1946 (copied from the Cape Cod History Page).

2008

This a sort of combination blog and website. At the moment my principal spare time interest is learning Latin. To this end I am listening to Evan Millner's Latinum podcasts.

See LatinIndex

Another interest is live mathematical documents: LiveMaths.

2007 and Older Stuff

Here is the index page as it used to be a couple of years ago: PreTwoZeroZeroSeven.

License

Software found on this site is covered by a wide variety of licenses, ranging from public domain to very restrictive, please refer to the code files themselves for details. Unless noted otherwise any code bearing my name, Kevin Whitefoot, is covered by the Gnu Public License; a copy of Version 2, 1999 is to be found here for reference but please refer to the Free Software Foundation website for the latest version.

Browser Compatibility

Best viewed with a browser and an open mind.

Links

OtherLinks is a grab bag of links that I have found useful or interesting at one time. Things that might have been interesting or useful in other circumstances find their way there. It's also the place for links that I thought were worth looking at but haven't had time to investigate as well as just a place where I note them down for later use.

MissingPages contains an apology for bad links and my email address.

Notes

Ragbag of notes about anything that doesn't fit elsewhere: RagBag.

Acknowledgments

gcolor2 colour picker: http://gcolor2.sourceforge.net

Contents

No comments:

Post a Comment

Blog Archive

Followers