This blog has a new home at http://www.aloshbennett.in/weblog/. While the domain is a work in progress, all future posts will be at the new address.
Your feedback/suggestions are welcome.
~Alosh
This blog has a new home at http://www.aloshbennett.in/weblog/. While the domain is a work in progress, all future posts will be at the new address.
Your feedback/suggestions are welcome.
~Alosh
Here’s a concise white paper on what’s new with the latest release of Java Enterprise Edition. I recommend reading it.
And here’s a jist of things:
- Web Profiles – For the light weight web apps where you don’t need a full blown container.
- Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
- JAX -RS – Restful web services are here.
When it comes to web pages, I like them plain and simple. Earlier associations of flash and other embedded content with irritating ads and browser crashes makes me cringe when I hear “rich media”. Ajax was refreshing with its unleashing of the hidden powers of CSS and javascript.
But you got to face it. You cannot ignore RIA anymore. If you are going the RIA route, what options do you have?
Flex has been the industry favourite. But again, here’s reasons why (from Adam Bein’s blog) JavaFX is a good option too.
Take a deep dive!
This being the first tech days post Sun’s acquisition by Oracle,the event started with a keynote from Oracle underlining their commitment to the development of java technologies. Lets jump into the highlights of the last 2 days!
You can find more about the Tech Days 2010, Hyderabad edition on Arun Gupta’s blog.
I guess many people were asking for something akin to Windows Skydrive. Ubuntu recently rolled out ubuntu one, an OS integrated online storage space.
And the first impression – its annoyingly simple to use. Once you are through with the two-click installation, you are left with just a “Congratulations” message.
First thing any linux user does is, right click the taskbar applet to check for Preferences. Well? Sorry folks, nothing to tweak around with. Disappointing
Next thing, you click on the taskbar icon and it opens up an Ubuntu One folder on your home drive. With some relief, you then proceed to examine the folder for some sort of Nautilus extension to synchronize the drive. Nothing!
With mounting suspecion, you copy some files into it. Bloody hell! Ubuntu One kicks into action staring synchronizing your drive.
Good stuff: It optimizes on the bandwidth idle times to ulpoad the content in a very transparent way (means, over a slow connection you will not feel much of a drop in your surfing speed)
Bad stuff: It keeps spinning my hard drive like crazy. I hope they read blocks into memory, work off that and leave my hard drive alone! And we need a Preferences menu, to specify the location of the synchronized drive and tweak around with bandwidth shaping.
Verdict: The product is in its beta. If you are one Jaunty or Karmic (God bless you), what are you waiting for? And oh, the free version gives you 2 GB.
Update: What I thought to be heavy harddisk read was a bug in the 2.6.28 kernel around cpu fan speed control, causing the temperature to rise.
Of late, there isn’t much going on at ubuntuforums. For a second there, I thought Ubuntu was losing steam. But then it occured to me how mature the OS have become from the ‘warty’ days. Not many creases to be ironed-out.
If you haven’t tried Jaunty Jackalope yet, give it a shot! The boot time is damn impressive!
We’ve been learning since we first printed “hello world” that
i += 1
expands to
i = i + 1
Well, here’s a little problem to shake the faith.
byte i = 1;
i = i + 1;
System.out.println(i);
Being java programmers worth our salt, it wouldnt take much to identify the compilation error.
Error: Possible loss of precision
So how do we explain that the next code snippet prints the value 2?
byte i =1;
i += 1;
System.out.println(i);
Here’s the secret: i += 1 is not same as i = i + 1
When you do an assignment (the first code snippet), java enforces type checking because the LHS and RHS may very well be independent of each other.
But the compound-operator is more like an incremental operator. The += modifies the value of the variable involved, rather than assigning a new value to the variable. When you modify a byte, you expect a byte as the result. To make life easier, java does an implicit type conversion for compound-operators because they are modifiers.
Have fun!
I hate Flash. Any day I would suggest to use AJAX to give your web application that extra pep.
Having said that, lets look at what Flex could do for you. Flex is flashy, Flex is fast to develop. Above all, Adobe has come up with a decent framework for application development.
1. Flex is a complete SDK. Flex is a combination of Action Script (an EMEA Script supporting OOPS) and MXML (XML based UI definition). That good news! But then, they combine to produce SWF files and use the much hated Flash Player to render.
2. A complete IDE in FlexBuilder. Based on Eclipse, this wouldnt let you down.
3. Integration to call REST, SOAP web services. Making REST calls and modifying dom on the fly is a must for any web 2.0 framework. But SOAP? Looks like Adobe is serious about the whole Flex business.
4. Localization support using Resource Bundles. Remember SVG and the NLS support pains? Flex is meant for serious application development.
If you want to develop jazzy looking web 2.0 components for your application in a short time, Flex is worth your time. Remember to use it very judiciously.
Cisco VPN client most often requires to be compiled for the linux header you are running. And with the subtle changes in the header versions, its likely that you would run into this error while installing the vpn client:
/usr/src/vpnclient/GenDefs.h:113: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
In case you didnt notice this error while installing, you will surely notice this error when you try to start the VPN daemon:
‘/lib/modules/2.6.24-19-generic/CiscoVPN/cisco_ipsec.ko’: -1 Invalid module format
Like HHGG says, dont panic. The VPN client should be patched with the delta from http://projects.tuxx-home.at/ciscovpn/patches that corresponds to your linux header. Patch your vpnclient as mentioned below and you are good to install!
cd vpnclientfolder
wget http://projects.tuxx-home.at/ciscovpn/patches/vpnclient-linux-2.6.24-final.diff
patch < ./vpnclient-linux-2.6.24-final.diff
Its not that theres a dearth of information on the web on this topic, I still end up wasting time everytime I install vpn. So here I go underlining whats been already said.
Few days back, I came across this nice idea on ubuntu forums. If you want to print a file, why do have to open it and then print? What if you wanted to print multiple files?
Its the small things like these that reminds you the usefulness of scripting. So how do I do it?
cupsdoprint -P PrinterName file1 file2 file3
cupsdoprint is a command line tool to print via CUPS.
So we have our little script around CUPS to print. How do we add it to the mouse context menu? As simple as creating an executable script and dropping into the nautilus script folder. Nautilus passes the context information to the script as variables.
The script file would look like this:
#!/bin/bsh
files=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
cupsdoprint -P MyPrinter $files
exit 0
Name the script “Print”, make it an executable and drop it to your ~/.gnome2/nautilus-scripts folder and happy printing!