Posts

Showing posts from August, 2008

How to change the default http port of Oracle's administration webinterface

The default port in Oracle's Database Express Edition (oracle-xe) is set to 8080 . You can change the default port value to e.g. 1080 by issuing the following command: begin dbms_xdb.sethttpport('1080'); end; A convenient way to commit this alteration to the database, is to enter this command into the textarea, you can find under Home > SQL > SQL Commands in Oracle's administrative webinterface. Afterwards you can reach the administration interface under http://localhost:1080/apex .

Integration of GWT into an Appengine Eclipse project

First: Yes, it is possible to develop GWT code (Java) and Appengine code (Python) in one single Eclipse project if you have installed the corresponding Eclipse plugins :) Thanks to RPC it is also possible to combine both technologies using Appengine to display GWT's AJAX filled with dynamic GAE content. Execute ./applicationCreator -eclipse yourGAEproject -out yourGAEproject com.yourGAEproject.client.Ajax in your GAE directory . Add the " .classpath " file to the root of your GAE project filled with the following content: <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="test"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path=" /opt/gwt/gwt-user.jar "/> <classpathentry kind="output&quo

How to integrate robots.txt and favicon.ico in Appengine

To avoid nasty warnings regarding missing favicon.ico and robots.txt , you can try to modify your app.yaml as followed: application: sol version: 1 runtime: python api_version: 1 handlers: - url: /robots.txt static_files: static/robots.txt upload: static/robots.txt - url: /favicon.ico static_files: static/favicon.ico upload: static/favicon.ico - url: .* script: main.py Afterwards you have to create a "static" folder in your application root and put favicon.ico and robots.txt into this directory. The sequence of the entries in app.yaml is important and the example above would not work if you change this sequence.

HowTo retrieve URL content using Python

With the following code you can fetch any content from web using http or ftp : def fetchContent(self, url): try: fetchResult = urlfetch.fetch(url) except: return 'Exception: Not an URL' if fetchResult.status_code == 200: encTypeRaw = fetchResult.headers['content-type'] encStartIdx = encTypeRaw.find('=') encType = encTypeRaw[encStartIdx + 1:] fetchResultContent = fetchResult.content return fetchResultContent.decode(encType) return 'Warning: URL could not be retrieved successfully'

[HowTo] Python's substring of a string workaround

In Python there is no dedicated function like " substring " (there is such a function in C#). In the following I have marked a workaround that retrieves the substring (the encoding in this particular case) of a super string that comes after "=" (equal sign) : def fetchContent(self, url): try: fetchResult = urlfetch.fetch(url) except: return 'Exception: Not an URL' if fetchResult.status_code == 200: encTypeRaw = fetchResult.headers['content-type'] encStartIdx = encTypeRaw.find('=') encType = encTypeRaw[encStartIdx + 1:] fetchResultContent = fetchResult.content return fetchResultContent.decode(encType) return 'Warning: URL could not be retrieved successfully'

[Solution] Python: Get rid of errors like: TypeError: takes exactly 1 argument (2 given)

If you get exceptions like TypeError : myFunction() takes exactly 1 argument (2 given) in Python, they probably result from code parts like class myClass: def myFunction(myParameter): that cause the interpreter to fire this strange error message into your debugging console. To solve this problem you simply have to add a further parameter to your function: class myClass: def myFunction( self, myParameter):

How to fix "no WLAN after resume" problem in Ubuntu/Hardy

I have experienced problems using WLAN after resume from suspend in Ubuntu/Hardy . More precisely the wlan0 link came up and was usable for a couple of minutes. Then the wlan0 link was still available but no data came through and not even a simple ping ICMP request was possible. I assume the same problem occurs not only with wireless networks but also with wired networks (ethernet/eth0). My investigations revealed that the problem came up because I use a custom network configuration which is described in /etc/network/interfaces . Apparently such configurations conflict with pre-installed (KDE's/GNOME's GUI based) graphical network configuration tools which I do not use. Removing these tools solved the problem for me: aptitude purge network-manager network-manager network-manager-gnome network-manager-kde network-manager-openvpn network-manager-pptp network-manager-vpnc networkstatus Probably you do not have to remove all of these packages but only a few of them.

Google Gears for Firefox@Linux x86_64/x64

Currently Google Gears is only available as an 32-bit implementation for Firefox under Linux. But an x64 implementation is coming soon and an unofficial x64 version is already available . This version was published in a corresponding Google groups thread . Google Gears is also OSS which goal is to make web applications available also when you are offline .