It aint about the tech…

I usually keep personal observations on my blog to a minimum, keeping it more about the code and apps. But off late I have been feeling this a lot and so I feel I must speak at least once if only for cathartic release ;).

There has been a lot of new activity in the UI world: Apollo, Silverlight, JavaFX, WPF and now Ted Patrick’s sneak peeks on the new features of Flex 3, and a lot of people have very strong sentiments about it. However it seems like we have all set camps around technologies rather than what they mean for the end user.

Silverlight was the perfect example of course. While blogs on mxna screamed how it was utter crap, people I know who attended the Microsoft MIX conference proclaimed it to be the undoubted Flash killer. As a UI developer who moved from Java to Flash to Flex to now-eyeing-the-3D-capabilities-of-WPF, I couldnt care less about what I write my code in. If there is something in Silverlight that I cant do in Flash (and my target audience has the plugin), I will code in it.

But the Silverlight conversation is over so lets continue…

The latest thing is the Flex 3 sneak peeks. I have read quite a few blogs about the lack of any earth-shattering new component in the framework. I am not surprised. Now that I have been with Flex for about a year, I am truly loving it. I dont care about the List, Datagrid or the Tree component, heck I could them all easily in Flash. Flex gave me a framework to work within. When I work with another developer or look through a component’s source code, I KNOW what I am dealing with: I know the measure function is where the measurement is happening, and updateDisplaylist is where the component is drawing itself out, etc. Now its up to ME to code my cool app. I will write a component to suit my application’s need rather than look at the new component set and try to fit those into an application. Adobe cannot write a component set for every app out there. Flex 3 gives me exactly what I want: A better way to write code (Refactoting, Code assist, etc), a way to make sure I am not killing a user’s computer (with the profiler stuff) and a better way to deploy it (using the flash player’s caching mechanism): after that I almost want it to leave me alone and let me build my app to work the way I want it to.

I dont want to sound harsh. Heck I would love to have some cool components that I may use once in a while, but its not something I expect to get from the SDK. For that I look at the broader community out there.

Lets make cool things….

Webby nominees are out !

The nominees for the webby awards are out. Check them all out here. Almost every site is amazing to look at and learn from. The one thing that tickled me a bit was the nominees for the “Best Navigation/Structure” are predominantly Flash and/or multimedia based. I love seeing that and then reading the “Flash breaks navigation” paragraphs on Jakob Nielsen’s ‘Flash=99% bad‘ article.

Recommendation Systems

Of late, I have started reading quite a bit on Recommendation Systems and I came accross this interesting paper on the topic. The cool thing is that it talks about virtual co.mmunities based on recommendation systems (I am sure Amazon uses a similar algorithm, since this seems pretty common sense).

On a side note, the paper did lead me to finding out what a Pearson’s Correlation is. Pretty neat. Further links on this entry as I come across ’em

Links:
Content-Boosted Collaborative Filtering
Bunch o’ papers

Aurora and Sol

Those are the names people: mark em down. Flexamp is on its way out :). I kinda want the player name to be independent of the technology behind it (I am following an industry norm here. There arent and C++MediaPlayers or JavaAmp 😛 ). While these names may or may not stick, these are the package names of the Flex Project and the J2EE Project on my Eclipse application so they will always be reflected in the source files.
I am fairly far ahead on the clientside implementation of the player but am just about starting the J2EE part. I havent mucked around with J2EE as much although I do come from a Java background as such. Desktop Java has much fewer rules to adehere to. The first step in J2EE is the biggest one and understanding the structure of a J2EE app does take some serious reading.
Of course there is a leap from the book to the server ;).
So here is the story of day 1 of Sol development.

Step 0 – Choose Eclipse:
I do all my programming on Eclipse and love it. Ever since the ASDT plugin came out, Eclipse has been my standard development environment. Its well integraded with CVS and SVN and allows quick text searches which makes life a lot easier. And developing Flash and Java on the same IDE is veeeery convinient. The web tools project is something I am just getting used to and while I have heard seasoned Java developers complain about certain features, my own experience has been fairly good. So armed with Google, I created the Sol project.

Step 1 – Get your J2EE app container + MySQL database:
My www host runs Tomcat 5.0.27 so thats what I run as well. I also downloaded the appropriate MySQL version

Step-2 – Create the Dynamic Web Application Project:
This is a project template that I think came with the web tools plugin on Eclipse. Once you create a new Dynamic Web Project, Eclipse will create the WEB-INF, META-INF, classes and lib directories as per the J2EE spec(A typical j2ee webapp should look like this) in a folder called WebContent. That folder can go as is as a webapp in a container (although typically you would deploy it as a web archive (war) file).

Step 3 – Include the jstl taglibs in your container:
Since I will be using the Java Standard Taglibs, I downloaded the jars from the Apache site. Include these taglibs in either your application’s lib folder or, preferably, in your container’s common lib directory (TOMCAT_HOME/ROOT/common/lib/) which would make them visible to all the webapps.

Step 4 – Create your basic JSP
Since the goal of this pass is to verify that my installation is correct, I wrote the simplest JSP file. You can download it from here.

Step 5 – Run the JSP from within Eclipse:
Make sure that the Tomcat Engine isnt running and then right click on the project and choose Run As … > Run on the server. Update the files if prompted and point to the installation directory of the Tomcat server when prompted to choose the local server. As the server starts up, the server logs appear in the Console window. Eclipse will then launch the built in browser and point it to the application root. Click on the JSP page and ensure that it works.

Possible issue: I have no idea why this was happening but even though my JAVA_HOME environment variable was pointed correctly to the JDK, Tomcat could still not find the javac tool to compile my JSP. On a thread I found the solution to put the tools.jar into the TOMCAT_HOME/common/lib directory. That worked.

Cheers.

Https on Apache Tomcat 5.5

I tried to play around with Flex Data Services today. So I downloaded the package and went through the install. Now since I already have an instance of Apache Tomcat 5.5 running on my laptop I was less than inclined to install JRun. So I installed the non-JRun package and deployed the FDS WARs. I ran the the collaborative dashboard example and things looked good. The other application I had been eyeing for a while was the NoteTag example application written by Adobe. For the uninitiated, NoteTag is a collaborative note taking application. The coolest part of NoteTag is that it doesnt have a backend database but rather uses Blogger, TypePad and Del.icio.us to store the data. However since these services require authentication over SSL, I had to install a security certificate on my Tomcat instance.

So here is how I went about it. First of all, the SSL key generator is part of the core JDK as of Java 1.4. The keytool is available at %JAVA_HOME%binkeytool.exe. Run it as specified at the Apache Tomcat tutorial site:

keytool -genkey -alias tomcat -keyalg RSA

The tool asks a series of questions like name, address etc to write the keystore. Once the key is written, move it to where tomcat can access it in the Catalina directory. Lastly uncomment the HTTPS connector and add the following attributes:

keystoreFile=”tomcat.keystore”
keystorePass=””

Ta..daaa…https!!

I still havent managed to run NoteTag (I am getting connection errors) but thats a battle for tomorrow. Right now I need to go to sleep.

..and a cupful of serverside configuration goodness…

Debugging isnt fun….
But it does have its moments, when you feel you have learnt something new.Like today….

First let me step back a bit and explain ip-domain mapping using host files on Windows. The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory (cache) at startup, then Windows checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS.[1] The host file is located at ‘C:WINDOWSsystem32driversetchosts’.

Typically, during development, I use host files to map urls for applications under development to the sub-domain of my main site. This allows me to access cookies etc while still running the web-app on my laptop.

While setting up an web-app today I mapped a domain to an ip using my host file, but could not bring the page up no matter how I hard tried. At my wit’s end I called upon our sys-admin and resident Solaris proponent to help me fix this problem. A couple of hours later I was on my way and had a much deeper understanding of server configuration stuff. Before I forget what I learned I figured I may as well save it for posterity by publishing it here.

The problem arose because I was trying to map my domain to an ip of a virtual server. While this is not a big deal (click here to see how Apache does it), there was something weird happening on my machine.
Typically servers, like regular computers, have physical interfaces that connect them to the network. However you can have multiple virtual interfaces each with individually assigned IP addresses on a single physical interface. Within the webserver software, listening sockets were defined and mapped to the IP addresses on our virtual interfaces.
Each of the virtual interfaces are associated with a listening socket and every virtual server instance is bound to that listening socket. Virtual servers themselves can be name based or ip based. IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve whereas name based ones use DNS mappings of IPs to decide which host to serve

The behavior I was seeing turned out to be because while the server’s virtual server instances were bound to individual IP addresses, there were also names that identified what was allowed in the host request field sent by a browser. Since I defined a name in my local hosts file that didn’t match a name defined on the server to be associated with the virtual server instance that I tried to reach, the web server sent my browser’s request to its default, or primary instance.

…I am glad its a Friday !

Contextual aggregated pages on Google

This is interesting. After seeing a trailer for the movie “Lady in the Water” I was intrigued enough to do a google search for it. The first result I was taken to was an aggregated page of all online reviews for the movie, its avarage rating and google search pages to top words used in the movie. There was also a textfield on the original result page to search for tickets for the movie by entering my zip code. [link]

I had seen such pages for music artists [link]already on google but this was the first time I saw anything for movies.