February 28th, 2009
Today I had the problem that i needed to create a Flex element by hand and apply to it a width of 100%.
This goes as easy with MXML as this
<mx:VBox id="wrapperBox"><mx:UIComponent width="100%" height="100%" id="elementXYZ"></mx:VBox>
But you cannot code this to achieve the adding programatically with Actionscript:
var elementXYZ:UIComponent = new UIComponent();
elementXYZ.width = "100%";
elementXYZ.height = "100%";
wrapperBox.addChild(elementXYZ);
Instead, you have to use this:
var elementXYZ:UIComponent = new UIComponent();
elementXYZ.percentWidth = 100;
elementXYZ.percentHeight = 100;
wrapperBox.addChild(elementXYZ);
No Comments » |
Actionscript, Uncategorized, flex |
Permalink
Posted by johannes
February 27th, 2009
I’ve got a list of points in my database, which I want to show neatly in a Google Maps Flash Map.
Thus, I …
- calculate the bounding box around these points
- calculate the center of this bounding box
- set the zoom level of the map in a way that the zoomed cutout contains all points
- set the center of the map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| //1.
var bounds:LatLngBounds = new LatLngBounds();
for each(var mapObject in tripMessages){
var currentLatLon:LatLng = new LatLng(mapObject.latitude,
mapObject.longitude);
bounds.extend(currentLatLon);
}
//2.
var center:LatLng = bounds.getCenter();
//3.
map.setZoom(map.getBoundsZoomLevel(bounds));
//4.
map.setCenter(center); |
3 Comments |
Actionscript, Adobe Air, Flash, flex |
Permalink
Posted by johannes
February 23rd, 2009
Today I came across the problem that I needed to use a MacBook with our multi-touch table the Virttable.
Therefore, the screen of the MacBook must be enhanced onto a video projector that has been attached to the DVI port and this projector must be the primary screen. Anyway, Windows did not offer to me to select this projector as the primary screen. The only option was to extend the MacBook’s desktop to it. As I need to run the Touchlib’s config app on the Virttable this demands the video projector to be the primary screen.
It seems like the NVIDIA chip built into the MacBook does support this feature but somehow it is not mentioned in the driver’s inf file and because of that it is not possible to set an external monitor as primary screen in the display properties under Windows XP with this NVIDIA mobile GPU chip.
However, there is a project called laptopvideo2go, which aims to solve this problem with NVIDIA mobile GPU chips.
I needed to download this modded inf file and this driver archive.
Finally, I followed this illustrated installation process.
No Comments » |
Multi-touch, apple |
Permalink
Posted by johannes
February 17th, 2009
I had some struggles when installing django on my OpenSUSE virtual server. It started with the problem, that I have not found a django rpm via yast in the OpenSUSE repositories. Thus, I decided to install django manually and to keep the footprint as small as possible. Luckily, Python 2.5.1 and the appropriate mod_python module for Apache have been installed already.
These are the steps that worked for me:
- I installed subversion, the MySQL Python lib and python-devel via yast.
- I checked out the up to date django version via svn into /opt.
- I ran “sudo python setup.py install” from the trunk directory.
- I added “PYTHONPATH = djangoProjectDirectory” to my bash configuration (exchange djangoProjectDirectory with the path to your project directory).
- For the integration of django into Apache I needed to enable mod_env.
- According to the django mod_python site, I created a snippet I need for the integration into Apache. This snippet looks like this:
#Map global URL /media to media folder of django's admin page
Alias /media /opt/trunk/django/contrib/admin/media
<Directory /opt/trunk/django/contrib/admin/media>
Order allow,deny
Allow from all
</Directory>
#add django project itself (repeat so for each additional django project)
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
</Location>
- I stored this snippet in a separate config file called django.conf into the folder /etc/apache2/conf.d/ from which all files are automatically loaded whenever Apache starts.
- Restart Apache.
- Go to http://your-domain.com/mysite or http://your-domain.com/mysite/admin (as you might have guessed already, exchange your-domain.com with your domain)
Done.
No Comments » |
django, opensuse, python |
Permalink
Posted by johannes
February 17th, 2009
Today I came upon a problem when I wanted to integrate a Django project into my Apache via mod_python on my OpenSUSE virtual server.
I put the snippet I need for Django into a separate config file called django.conf into the folder /etc/apache2/conf.d/ from which all files are automatically loaded whenever Apache starts.
Everytime I wanted to start my Apache it said
Syntax error on line 6 of /etc/apache2/conf.d/django.conf:
Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
This seems to be a problem with the Apache configuration of OpenSUSE as mod_env which provides the SetEnv directive is installed but disabled.
Solution:
- Start yast (from the command line)
- Select “Network Services”
- Select “HTTP Server”
- Select “Server Modules”
- Select “Network Services”
- Scroll to “env”
- Select “Toggle Status”
- Select “Finish”
Done.
2 Comments |
apache, django, opensuse, python |
Permalink
Posted by johannes
February 17th, 2009
Yesterday, I struggled with a problem on my virtual server that Plesk automatically sets /srv/www/vhosts/default/htdocs as the htdocs directory of the Apache.
Anyway, the greatest advantage of the Apache configuration of opensuse is its biggest problem: everything is set up very modularly. There are many things you can edit and install with yast and there are many that you can not. The point is that you will have to decide at one point if you tweak a setting manually and give up searching on Google for the appropriate solution with yast or some rpm manager or whatever the best solution should be.
Then you will haveto start searching in the VERY modularly set up apache config directory /etc/apache2/.
I could solve my problem by deleting the file /etc/apache2/conf.d/zz010_psa_httpd.conf. Files from this directory are included automatically in the file /etc/apache2/default-server.conf into the Apache configuration by the directive
Include /etc/apache2/conf.d/*.conf
/etc/apache2/default-server.conf itself is included into the main config file httpd.conf of Apache by the directive
Include /etc/apache2/default-server.conf
Phew…
No Comments » |
Plesk, Uncategorized, apache |
Permalink
Posted by johannes
February 16th, 2009
Today I have made an interesting discovery: my 2008 2.4 GHz MacBook Pro is using frustrated total internal reflection (FTIR) for the illumination of its keyboard.
The background to this discovery is that I spilled a bit of salad dressing into my keyboard and since then some of my keys are not working reliable anymore. To be more precise: Some keys I must push two or three times until they produce the letter. Thus, I wanted to look if I could clean the keyboard and what kind of keyboard I would need if I wanted to replace it. I used the MBP iFixit guide to achieve the disassembly (and as I have been a lucky guy also the reassembly).
Anyway, when I removed the keyboard compartment from the MBP’s body I discovered that it consisted of four parts:

MacBook Pro Keyboard Parts
Read the rest of this entry »
9 Comments |
Mac, Multi-touch, apple |
Permalink
Posted by johannes
February 12th, 2009
When I started to develop some software for my Nokia Navigator 6110 I repeatedly ran into the problem that my apps worked fine with the Symbian SDK S60Emulator but when I tried to install them on my device via Nokia Application Installer everything went fine until finally the device would say ‘Ungültige Jar Datei’ or ‘Invalid Jar file’ in English.

Nokia Navigator 6110
I updated my Navigator to the latest firmware version but the jars still would not run.
My fault was to use the wrong Symbian S60 SDK. And there are lots of SDKs.
At first I downloaded the S60 5th Edition SDK from the Symbian S60 SDK download site and the Jars would not work. Afterwards, I downloaded S60 3rd Edition F3 SDK and the Jars still would not work. Finally, I checked the edition and the feature pack of the Nokia Navigator 6110 and found out the correct ones: 3rd Edition Feature Pack 1. I downloaded the appropriate SDK and it worked. Thank goodness. Those SDKs are several hundred MBs big. You definitely need to be patient when you have such problems.
Thus, if you run into the same problems: check five times whether you picked the appropriate SDK for your Edition and Feature Pack.
And do not forget to add your midlet to the Application Descriptor.
No Comments » |
J2ME, Java ME, Nokia |
Permalink
Posted by johannes
February 12th, 2009
This is a bit off-topic for this blog but recently I’ve needed to cope with Java ME and my Nokia S60 device Nokia Navigator 6110.
The problem: If you are doing what I have done and want to run an old midlet project with the Symbian SDK then do not forget to add all your old midlets to the ‘Application Descriptor’ file you will find in your project’s directory in the eclipse workspace folder.
Otherwise the Symbian SDK emulator will tell you something about an ‘IllegalStateException: No application specified in Jad or command line’.
Therefore, add a line like this to the ‘Application Descriptor’ file for each midlet, save it and run Create Package once more:
MIDlet-1: YourMIDlet,,your.package.name.YourMIDlet
Done.
1 Comment |
J2ME, Java ME, Nokia, Uncategorized |
Permalink
Posted by johannes