From Java to C# and back to Java again

Recently i had to manage with a big rewrite project. The system i’m working on is not ”rocket science”, but it has it’s history and it’s quirks (plenty). Some of the things missing were AuditTrail’s, multiplatformsupport, and easy handling of adding new sources of information.
The system is written half in C#/Java. Why?
Because there never was an long-term strategy toolchoice, different developers have been using their favourite tools at different points in time, or in different parts of the architecture. The positive thing about the project i’m in, is that the people doesn’t seem particulary cemented in any of the enviroments, which is good for avoiding ”religionwars”

So, this would be a major rewrite.Yes.
I havn’t myself been doing Java-development since somewhere around JDK 1.4 a couple of years ago. Since then i’ve been mostly working in .NET/C#/ASP.NET.(I even took the certifications MCPD for Enterprise Application Developers – Amen).

But, now we needed among other things, a stable ORM and a good AuditTrail to cope with.
First we looked at LINQ for SQL,, but it’s a bit too lightweight, and it’s future seems to be unsure. So, we headed for the EF. framework… well. NO.. Maybe the next version… but we couldn’t wait for the next version.
That lead us too Hibernate/nHibernate… and look and behold. JPA was what we been looking for..
Now all we needed was a AuditTrail… and again, there it WERE in eNvers.Does C# have an eqvivalent? I found this so far.

Ok, so EJB 3 and JPA is a major, major lift from the old complicated models. Good!

But what about the working-enviroments,,,, one thing i like about .Net is that it’s soooo easy to get started in VS. Last time i tried Eclipse and Netbeans, they sadly needed a bit more effort to get into.(Altough very good when they were configured)
So i downloaded the latest NetBeans — *wow*
They HAVE been inspired by the ”bundle it” approach from Visual studio.

For me, it’s a strength knowing ”both” worlds of Java and .Net, and using them were it seems appropiate. As of now, i tend to use Java for backbone-functionality and were longterm architecture is important, and .Net for GUI/lightweight/RAD development.
This may change, i looking forward to next version of JSF etc.

I will follow up this blogpost.

Use the tool that’s right for you, don’t stagnate in any special tool, and have an open mind. If you’re a .Net developer, try out some stuff from the Java-world, and if you’re into Java, try some .Net. It gives you better credit if you can be neutral and know how to use the right tool for the right job

Right now,I’m quite a Java-fan again:) – altough missing some of the syntactic sugar from C#.

Top things to do after installing Karmic (x64)

After doing some installs of Karmic, Ubuntu for friends, i started to get bored by adding stuff manually after the default install. A good guide for setting up some basic missing things is Silent number’s top things to after installing Karmic /. Read that!

Well, i added most of the stuff he recommends and some other things too, like Flash for x64 , (thanks) in a very basic setupscript, which maybe handy for new installs of Karmic. It installs a lot of tools and utillites too.

To use:
1. Copy the text to a new textfile, put it in your homefolder, rename to something fitting – eg.
”installscript.sh”
2. Open a Terminal: Program->Accesories->Terminal
3. write: sudo chmod 755 whatever you named your script. This is to make it executable
4. Before your run the script, remove any stuff that you dont want. eg: maybe you dont want OneSwarm, then remove the section, and so on.
5. run the script, in terminal: sudo sh whatever you named your script
6. have fun with your new apps.

#! /bin/bash

#RUN THIS SCRIPT FROM YOUR HOME DIR
#Get a good start, update and fix any inconsistences
sudo apt-get update
sudo apt-get upgrade
#sudo apt-get dist-upgrade

#REPO add##################################################################

sudo add-apt-repository ppa:ubuntu-tweak-testing/ppa #ubuntu tweak
#sudo add-apt-repository ppa:team-xbmc/karmic-ppa #xmbc
#sudo add-apt-repository ppa:sportman1280/ppa No karmic ppa for synkron yet
sudo add-apt-repository ppa:dylanmccall/ppa #day of ubuntu
sudo add-apt-repository ppa:hydr0g3n/ppa #qbittorrent 2
sudo add-apt-repository ppa:~songbird-daily/+archive/ppa
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa #thunderbird 3, mozilla upd

echo ‘deb http://archive.getdeb.net/ubuntu karmic-getdeb apps’ >> /etc/apt/sources.list.d/deb.getdeb.sources.list #getdeb repo
wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add –

echo ‘deb http://deb.torproject.org/torproject.org karmic main’ >> /etc/apt/sources.list.d/deb.torproject.sources.list #Tor repo
gpg –keyserver keys.gnupg.net –recv 886DDD89
gpg –export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add –

#Add playdeb repo
wget -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add –

#add mediabuntu repo
sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list –output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get –yes -q –allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update
#REPO add END#############################################################

#install some stuff ———————————————————————————
sudo apt-get install libdvdcss2 w32codecs mkvtoolnix samba ntp libdvdread4 ubuntu-restricted-extras miro
sudo apt-get install electricsheep simple-ccsm arc-colors community-themes gdm-themes gnome-backgrounds gnome-colors
sudo apt-get install gnome-themes gnome-themes-extras gnome-themes-more metacity-themes shiki-colors avant-window-navigator
sudo apt-get install pitivi pidgin pidgin-otr pidgin-themes pidgin-facebookchat istanbul jokosher gufw cheese
sudo apt-get install mnemosyne anki solang inkscape gimp gwibber clamtk unetbootin rcconf
sudo apt-get install backintime-gnome jedit bluefish gmountiso likewise-open
#truecrypt skype
sudo apt-get install gparted virtualbox-ose ubuntu-tweak lirc xbmc flashplugin-nonfree
sudo apt-get install comix cbrpager dia thunderbird filezilla googleearth sun-java6-jre wireshark bleachbit
sudo apt-get install wine dosbox mame e-uae day-of-ubuntu-wallpaper songbird

#Cool games!
sudo apt-get install freecol playonlinux liquidwar gbrainy warzone2100 frozen-bubble pingus
#sudo apt-get install smokinguns warsow astromenace hedgewars eternallands ufoai nexuiz fretsonfire

#Anonymous, filesharing,vpn etc——————————————-
sudo apt-get install qbittorrent tor tor-geoipdb vidalia network-manager-pptp
#gnunet-gtk
#i2p
sudo wget http://mirror.i2p2.de/i2pinstall_0.7.8.exe
java -jar i2pinstall-0.7.8.exe
#——————————————————

#oneswarm install
wget http://oneswarm.cs.washington.edu/builds/OneSwarm_0_6_9_linux_x86_64.tar.gz
tar -xvzf OneSwarm_0_6_9_linux_x86_64.tar.gz
gksudo ”rm -r /usr/bin/OneSwarm”
gksudo ”mv OneSwarm /usr/bin/OneSwarm”
rm OneSwarm*.tar.gz
gksudo echo ‘[Desktop Entry]’ > ./oneswarm.desktop
gksudo echo ‘Encoding=UTF-8’ >> ./oneswarm.desktop
gksudo echo ‘Version=1.0’ >> ./oneswarm.desktop
gksudo echo ‘Exec=/usr/bin/OneSwarm/OneSwarm’ >> ./oneswarm.desktop
gksudo echo ‘Icon=/usr/share/pixmaps/songbird.png’ >> ./oneswarm.desktop #Fix a real icon some day
gksudo echo ‘Terminal=false’ >> ./oneswarm.desktop
gksudo echo ‘Name=OneSwarm’ >> ./oneswarm.desktop
gksudo echo ‘Comment=OneSvarm’ >> ./oneswarm.desktop
gksudo echo ‘Categories=Network’ >> ./oneswarm.desktop
gksudo echo ‘Type=Application’ >> ./oneswarm.desktop
gksudo ”mv oneswarm.desktop /usr/share/applications/oneswarm.desktop”

anw=`zenity –question –text ”Do you want install the alpha of FLASH 64? WARNING – this willl wipe earlier flash, gnash and related wrapper ”; echo $?`
if [ $anw = 0 ] ; then
gksudo ”echo 0”

# Script created by
# Romeo-Adrian Cioaba romeo.cioaba@spotonearth.com

echo ”Stopping any Firefox that might be running”
sudo killall -9 firefox

echo ”Removing any other flash plugin previously installed:”
sudo apt-get remove -y –purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper

echo ”Installing Flash Player 10”
cd ~
wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz
tar zxvf libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz
sudo cp libflashplayer.so /usr/lib/mozilla/plugins/

echo ”Linking the libraries so Firefox and apps depending on XULRunner (vuze, liferea, rsswol) can find it.”
sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox-addons/plugins/
sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/xulrunner-addons/plugins/

# now doing some cleaning up:
sudo rm -rf libflashplayer.so
sudo rm -rf libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz

else
zenity –info –text=”Installation of FLASH 64 cancelled.”
fi

EDIT:Updated

This is version 0.02 of the installscript, so please, suggestions are welcome.
If something breaks, don’t blame me:)
Use it anyway you want!