Monday, September 17, 2007

Wireless sharing of dial-up connection

In my case the dial-up device is a usb CDMA modem (using the Norwegian ICE network). My setup consists of a laptop running winxp, a modem (Anydata), and a wireless router. If your dial-up is installed and working correctly, you may skip the first two steps.

  • Install the usb modem driver on the laptop (don't bother installing the dialer software).
  • Setup a new dial-up connection (from Control Panel/Internet Connections/add) using the configuration data found here.
  • Enable Internet Connection Sharing (ICS) on the dial-up and bind it to the wired network interface. (Note that ICS turns the laptop into a DHCP server, however this is not of much use in this case since we will use the wireless router.)
  • Connect the wired interface to the wireless router.
  • Configure the router to use static ip (not sure if this is a requirement but other guides recommended this setting). Use 192.168.0.2 as the IP and 192.168.0.1 as the default gateway and use the same DNS settings as the dial-up found issuing a "ipconfig /all" on the laptop.
  • Make sure to adjust the the power settings on the laptop so that it won't go into stand-by mode.

Tuesday, April 11, 2006

Running jython scripts from Ant

Using the Script task it is possible to run jython, groovy, javascript etc. from Ant, either embedded within the script task or by reference to a source file.

In python/jython it is common to identify by whom the script is invoked and to behave accordingly e.g. depending if the code is imported as a module or invoked directly by python/jython. This is done by inspecting the __name__ property which is set to "__main__" if invoked directly and to the name of the invoker if invoked e.g. by a module import.

I am not sure if it is Ant or Bean Scripting Framework (BSF) which is responsible but the __name__ property is set to "main" and not "__main__" if invoked using the Ant script task. This is actually quite usefull because it is possible to identify if the script is invoked from the command prompt or if it is invoked by ant. However to avoid confusion I believe that Ant/BSF should set the __name__ property to something other than main, perhaps "__ant__".

Sunday, March 19, 2006

OSGi from embedded to Rich Server Platform (RSP)

Although I am not very familiar with the 8 years old history of OSGi, my impression is that it has its roots in embedded, targeting mobile, consumer and network appliances. It is backed by major companies like Motorola, Ericsson, IBM and more.

The BoF at JavaOne2006 confirms the move of OSGi from embedded to enterprise. OSGi is positioned to fit inbetween heavyweight J2EE servers and ligtweight containers such as Excalibur, Spring or Pico.

Is OSGi able to unify the different component architectures out there such as Portlets, Weblets, JSF components etc.? Another important question is how OSGi relates to the Java Module system (JSR-277). I guess there are more questions than answers at this point in time and even more questions are raised in this article.

Personally I think that it is a strength and a strong signal that OSGi is used in the Eclipse platform. I would really like to learn more about OSGi and how it could be used to develope modularized web applications.

Sunday, February 19, 2006

Safari and Darwin

Not being an experienced web designer myself, I still know that testing web applications on the Safari browser is increasingly important. One might argue that it should not be necessary at all to test applications in browser. This would be true in the ideal world where every renderer adheres to and interpret the standards (html+css and javascript) in the same way. Since we do not live in an ideal world, the next best thing, in my opinion, would be sticking strictly to the standards while developing and use some type of glue to compensate, correct and mimics the behavior of the different browser. The IE7 project seem to be an example of such "glue".

At some point integration testing and testing from a users perspective in unavoidable so access to a Safari or Safari based browser is a must. The straight forward way of running Safari would be to get a Mac. The next best thing would be to run Mac OS X in a virtual machine e.g. VMWare or Qemu, however I acknowledge that Apple is not very keen on that. I know that there have been some successfully attempts to hack OS X to run on an ordinary Intel x86 PC but there attempts are not embraced by Apple.

Darwin and OpenDarwin which is the OS that powers Mac OS X is able to run on x86 hardware however as of writing this post, the binaries are not available for download (the links are broken). It is important to note that Darwin is just the OS and the GUI part (Cocoa, Aqua, Quartz) is not Open Source. Safari only runs on OS X, but the main component of Safari is WebKit which is OpenSource. WebKit consists of JavaScriptCore and WebCore which is a fork of KHTML, the rendering engine that powers the Konquorer browser. The WebKit team encourages people to port WebKit to Windows and other platforms but one hurdle to overcome seems to be Xcode which is required to build WebKit. Xcode is not Open Source so there you are... you still need a Mac.

In retrospect, digging into Darwin and OS X seems like a waste of time, but a good waste of time since along the way I learned more about things that I usually wouldn't read up on.

Monday, January 02, 2006

Invoking jython with ant script task

Try "import re" and it will return with a "ImportError: no module named re". The reason is that jython.jar is only bundled with a few of the standard modules. So we need to find the modules elsewhere. The magic is to pass python.path with the location of the python modules to Ant, however the only way to do this seems to be via the ANT_OPTS environment variable (e.g. export ANT_OPTS="-Dpython.path=c:/tmp/"). Be sure to link to python modules with the same version as Jython.jar (e.g. jython-2.1 should link to python2.1 modules and jython-2.2a should link to python2.2 modules).

Saturday, December 17, 2005

First post

My first post