November 7, 2009 by Nima Zandi
For my recent project, I needed to draw some diagrams in Microsoft Visio and then import the graphics into my LaTeX document. It actually took me some while to figure out the most optimal way of doing this. So, if you ever want to include graphics made ind Visio into your LaTeX document, while keeping the wonders of scalable vector graphics, take a look at this :
- When you are ready to export your graphics from MS Visio, go to “File” -> “Page Setup”
- Select the “Page Size” tab, hit the “Size to fit drawing contents” radio button -> press “Ok” or “Apply”.
- Now the canvas fits your content. Go to “File” -> “Publish as PDF or XPS” and save the file. (If you don’t have this menu option, look here.)
- Open the PDF file, zoom in and see how nice the content scales in the document. If you have any text in your content, you can actually select and copy the text.
- Import the file in LaTeX with ‘\includegraphics[width=1.00\textwidth]{pdfdiagram.pdf}’
- Compile you document, and view the nice result
I have attached an example of a diagram made in MS Visio 2007 and importet into LaTex Click to see a SAMPLE
If you have any comments to this post, don’t hesitate to drop me a comment.
Tags: LaTex, LaTeX import graphics, LaTex tools, MS Visio, Vector graphics, Visio 2007
Posted in Uncategorized | Leave a Comment »
October 14, 2009 by Nima Zandi
If you are familiar with LaTex and really like the principles of a GUI based approach to get things done, the following tools might help you along the way. I use them on a daily basis, and couldn’t live without them
TexnicCenter: Of course you use TexnicCenter! I won’t post a screenshot.
JabRef: A nice way to manage your references.

JabRef - A tool to manage references.
Read the rest of this entry »
Tags: JabRef, LaTable, LaTex, LaTex create tables, LaTex gui, LaTex tables gui, LaTex tools
Posted in LaTex | 2 Comments »
October 8, 2009 by Nima Zandi
Here’s a simple example of how to set the device/system time programmatically with PyS60. Remember, that your Python script shell has to be signed, in order to do so.
I will use a time service from my previous post, which simply returns the current time in UNIX time format (the number of seconds elapsed since January 1, 1970.) To get a description of how the service is called, please look at my previous post entry JSON on PyS60. In this example, I will only show how you set the device time, according to the UNIX time format.
import e32
#My current time in seconds, but you could use the timeservice
timeInSeconds = 1254991598
#Set system time on the device
e32.set_home_time(timeInSeconds)
As simple as that. I use it for synchronizing the time of the device with the server it communicates with.
Tags: PyS60, N95, Nokia, s60 3rd edition, Set device time, System time, Programmatically set time, Set time with PyS60
Posted in PyS60, S60 | Leave a Comment »
October 4, 2009 by Nima Zandi
So, today I wanted my python script to programmaticaly open the native browser with a specified url. I must admit, that it took me some time to actually find a snippet on the internet, which worked with my Nokia N95 device (3rd Edition).
A quick summary: There is a difference between the way you execute external applications from 1st + 2nd edition and 3′rd edition. (Click for a nice overview of the different editions and devices)
So here you go:
1st and 2nd Edition:
import e32
apprun = 'z:\system\programs\apprun.exe'
browser = 'z:\System\Apps\Browser\</span>Browser.app'
url = 'http://www.google.com'
e32.start_exe(apprun, browser + ' "%s"'%url , 1)
3rd Edition:
import e32
browserApp ='BrowserNG.exe'
url = 'www.google.com'
e32.start_exe(browserApp, ' "4 %s"' %url, 1)
In the latter example above ( 3rd edition devices), the number 4 means to “Start/Continue” the browser with the specified url. Furthermore, the space between the ‘ and the number is actually needed, in order for the browser to run. Don’t ask me why
I have actually found an overview of the parameters here!
If you want to specify an access point to use when opening the browser, you can do the following:
e32.start_exe(browserApp, ' "4 %s 3"' %url, 1)
Where the number 3 above indicates the AP to use.
Start another browser (e.g. Opera)
In addition, if you need to start another browser than the native Nokia browser (e.g. Opera), then Nick Burch has implemented the webbrowser.py module which allows you to do so. Please keep in mind, that this module is ONLY for 1st and 2nd edition, but it doesn’t require much efford to extend it for 3rd edition as well.
Here are the links I have used for writing this post: Thisismobility, Nokia forum1, Nokia forum2.
Tags: 1st edition, 3rd edition, Launch browser, N95, Nokia, open browser from python, PyS60, Python for S60, s60 3rd, s60 3rd edition
Posted in PyS60, S60 | Leave a Comment »
October 1, 2009 by Nima Zandi
If you are developing, consuming, utilizing or doing anything that has to do with JSON documents, I can strongly recommend a nice add-on for Mozilla Firefox called JSONView. It simply shows your JSON structure in the browser with syntax highlighting, giving a quick and nice overview of the JSON document.
A snippet from a simple JSON structure in the browser with JSONView :

Snippet, showing a JSON document in Firefox with the JSONView add-on.
Here’s another nice tool which I also use for debugging and validating JSON documents: JSON formatter.
I hope you find the tools as useful as I do
Tags: debugging JSON, Firefox, Firefox add-on, JSON, JSON debugging, JSON document, JSON validatator, JSONView, Validating JSON
Posted in JSON | Leave a Comment »
September 27, 2009 by Nima Zandi
Hi,
I’m currently working on a project for a Nokia N95 8Gb device, using Python for S60 (PyS60). My application needs to communicate with a REST service using JSON (JavaScript Object Notation) as the data-interchange format. I found Simplejson, which is an encoder and decoder for Python 2.4+, but NOT for PyS60!
To my big surprise, I found a version of Simplejson ported to PyS60 (made by Aaron), which I found very useful
Simplejson makes it very easy to encode and decode python objects into JSON and vice versa. Furthermore, the extension makes it very easy to save your entire JSON structure in a file, and read it later on. For my simple example, I will utilize a basic service which provides the current time in a JSON format (source – Mobile Python).
Try the time service here.
The example below shows the following:
- Call the service and deserialize the JSON response to a Python Object/Structure using “loads“
- Then serialize the Python object into JSON format, and “dump” the result in a file.
Then, its simple enough to load the JSON structure from the file again.
import urllib, simplejson
def write():
#Paste in the url of the time service
url = "[url of time service]"
#Call the service, and decode the JSON into python dict object
output = simplejson.loads(urllib.urlopen(url).read())
print output
#Extract the timestamp value
value = output['Result']['Timestamp']
print "The value is: %d" %(value)
#If you need/want to store the retrieved JSON in a file
f = open(filename, "w+")
simplejson.dump(output, f)
f.close()
Hope that this was a bit useful, leave a comment if you like.
Tags: Decoder, Encoder, JSON, PyS60, pys60 simplejson, Python for S60, REST, S60, simplejson
Posted in PyS60, S60 | 1 Comment »
September 22, 2009 by Nima Zandi
Hi, and welcome to my new blog.
For my first post, I will simply outline how great the MobileHCI2009 conference in Bonn was. This was my first (real) conference regarding Mobile HCI, which will be one of the main topics of my future blog posts.
The reason for attending the conference was to get inspiration and ideas for my ongoing master’s thesis. The main topic of my thesis is “Context aware mobile application/service”, where I mainly focus on using music listening data as an extra sensor information. The music, will hopefully tell us something interesting about a users context. Does it make sense? Well, I am at the early stages of my thesis, so I will guess that the motivation and objectives will change during the project cycle.
So, the first day of the conference started with a workshop called “Context-Aware Mobile Media and Mobile Social Networks”, exactly the topic I’m interested in! Many research projects deal with the phrase Context-awareness in terms of location based services, but very few look into utilizing the users music listening data. A very interesting subject.
Besides all the technical and nerdy stuff, I got to know many cool people working in the same area as me. I will definitely attend next year!
Tags: Conference, Context, Context-Awareness, MobileHCI2009, Mobility
Posted in Mobility, Uncategorized | Leave a Comment »