JS Ext

Friday, September 28, 2012

Statistics in programming

A lot of companies like to gather metrics on what they do.  One of the common metrics that computer programs capture is the average time a process takes, but they rarely calculate the standard deviation.

For those of you who don't know what a standard deviation (SD) is, it is a measure of how much your data deviates from the expected value (average value).  Standard deviation and expected value are the statistical terms for describing the bell curve that represents your data.  A low expected value means your sample data is very close to the center.  A high expected value means your data varies heavily.  In the context of process runtime, it could mean your process is not very repeatable or reliable.  One way to improve a process is to reduce the standard deviation of the process.  By knowing the standard deviation, it can be easier to identify the process exeuctions that deviate heavily from the expected value.  These outliers tend to be the executions that cause the most problems.  The Standard deviation Wikipedia page has some graphs that explain it farther and more background information.

The most common method of calculating the SD is: $$\sqrt{E(x^2)-E(x)^2}$$.  E(y) is the average value of y.  Since you need to calculate the $$E(x^2)$$, I have heard people say that you need to know every value of x to calculate the SD of x.  For the $$E(x)^2$$ term, you can keep a running sumation of x and the count, then divide the summed x by the counter to get the average.  I actually had a developer use that as an excuse on why he couldn't calculate the SD in real time.  The begs the question, why can't you do the same trick with x^2.  In reality, you can keep a running summation of your count, your value and the square of your value.  With these three pieces of information, you can calculate the SD and average of your dataset.


// example SD calculation
// we have an Enumeration.  We don't know all
// the values at once
final Enumeration< Double > e = getEnumeration();

// declare our 3 sumation variables
double sum_value = 0.0;
double sum_value_2 = 0.0;
int count = 0;

// iterate, only knowing a single 'value' at one time
while ( e.hasMoreElements() )
{
    final double value = e.nextElement();

    // sumate
    count++;
    sum_value += value;
    sum_value_2 += value * value;
}

// calculate the standard deviation
final double avg = sum_value / count;
final double avg_2 = sum_value_2 / count;
final double variance = avg_2 - avg;
final double sd = Math.pow( variance, 0.5 );

Thursday, September 27, 2012

Google groups performance

I have been researching running Android x86 in Xen.  The Android x86 mailing lists are hosted on Google Groups.  This has been driving me crazy.   The web page performance is terrible.   I have tried in Firefox and Chrome.   The performance on my tablet is bad as well. On top of the, the arrow keys don't work.  I had to use the mouse to scroll down.  I found the website to be a very inefficient method for giving out information.

Wednesday, September 26, 2012

Simplexmlrpc

Simplexmlrpc is a c library I wrote for my multimedia frontend.  It is a simple Xmlrpc client and server.  I wrote it because I was unhappy with the various Xmlrpc c/c++ implementations.  Most were pretty complex and didn't make it really easy to wrap within a SpiderMonkey Javascript object.  I wanted a library that had simple reference counting garbage collection.  I also wanted to override the transport mechanism.  I didn't want to be tied down to the http client and server that the library used.

Simplexmlrpc is written as a single c++ file, but it exposes a c interface.  This allows the library to be directly embedded into another project, or to be packaged up as an external .so or .dll file.  I declare a public abstract type of simplexmlrpc_value that is reference counted.  Under the hood, the type points to a class.  The simplexmlrpc_create* functions create the appropriate instance of the class.  This structure closely matches Spidermonkey's jsval structure.  In my multimedia frontend, I was able to write xmlrpc2jsval and jsval2xmlrpc functions that recursively translate between the two libraries.  This allowed me to write javascript client code that calls javascript server code (on another computer) without having to manually translate every argument.  The serialization of the json arguments are automatic.

Another feature that I needed was the ability to use a custom transport.  In my multimedia frontend, I have a master server and multiple slave servers.  The communication between the servers is xmlrpc.  A lot of the code is shared between the implementations, though.  In many ways, the master also operates as a slave.  Any communication between a slave and the master also happens between the master and itself.  What is the point of making an http call out and back into itself?  The simplexmlrpc_generateCall() function allows you to get the xmlrpc client xml and pass it directly to the simplexmlrpc_processMessageFree() function.  I created a wrapper function inside of the multimedia software code.  That wrapper allows for url aliases.  One of the aliases is master://.  Any xmlrpc calls going to that url will automatically go to the master server.  If the client is currently running on a slave or the user interface, then the url gets rewritten to the url of the master server.  If the client is currentl running inside of the master, then the http transport is completely bypassed.

Simplexmlrpc also supports security levels.  The idea with security levels is you can have a different set of methods show up based on authorizations and authorization.  You can have a set of public methods.  Then you can have a set of methods for regular users.  Then you can have per methods for admin users.
The library also provides direct integrations with curl and the Mongoose HTTP server.  The Mongoose api that is used is for an older version, however.  A few features of the xmlrpc spec have not been implemented yet.  Simplexmlrpc is missing support for the date/time and base64 types.

Overall, my biased opinion is that Simplexmlrpc is a simple yet powerful implementation of the xmlrpc standard.

Tuesday, September 25, 2012

Waiting for the iPhone 5 noise to settle

There have been lots of reports with problems with the iPhone 5.  Apple touted this phone as a new revolution in mobile computing.  With so many Apple fans buying the new phone, it is obvious that some of what Apple is saying is true.  If the phone is so revolutionary, then why are there so many issues with it?  Because it is new and revolutionary.  Any big change is going to have issues.  The tech media will blast the new technology relentlessly for a period of time.  Then, something new will come out.  Everyone will forget about the problems that were being reported.

What Apple really needs is time.  They will continue to fix the issues as fast as they can.  Apple will fix the maps.  There will be a software update to fix the static on the keyboard.  WiFi will get better.  Eventually, the problems will go away and the iPhone 5 will be a great product.  The most prototypical example of this media pattern is Windows XP.  When Windows XP first came out, it was heavily blasted.  We complained about the look and feel.  People complained about compatibility.  Eventually, things calmed down and Windows XP turned into one of the best versions of the Windows platform.

Ubuntu Unity Interface

Nobody likes change.  Especially with user interfaces.  Facebook suffers this every few months when they make a change.  Ubuntu's Unity interface has been making waves for a while, but I had very little exposure to it, since my Linux distro of choice is still Gentoo.  First, I'll start off with a little background on why I had a late start with Unity.  The recent hard disk crash of my desktop has caused me to revisit the distro I use on my desktop.  I use my laptop far more than my desktop at this point.  I have a server in my living room that provides all of my services.  The desktop is really for a few special tasks that require a larger screen.  Those of you familiar with Gentoo will know that you have to keep your install up to date.  If you don't, then the next upgrade you do will be very painful.  Since I don't use the desktop as much as I used to, I don't want to worry about the Gentoo upgrade maintenance.  Also, I don't need the horsepower or bleeding edge software of Gentoo.

Now on to Unity.  I understand the desire to optimize for smaller screens, but this computer has a 19" screen.  My first thought (like everyone else) was "Where is the start menu!"  The launcher reminded me of a rotated OS X launcher.  I never really liked the OS X launcher, but its usable.  I don't mind having to type in a program name to start it, since I'm a terminal guy.  People who know me know that I tend to have dozens of xterms open.  Typing in a program name to search for it feels kind of natural to me.  Since there is only a handful of apps that I use from a day to day basis on that computer, I don't mind the limited space for pinning on the launcher.  Like I said before, I like xterms!  Having the ability to click on the Xterm pin to see all my xterms to figure out the one I want to switch to was a nice feature.

Overall, Unity is a nice look.  I still prefer the more traditional start menu and lanucher in IceWM and XFCE.  Given the fact that I don't use that computer very much, I think I will keep Unity around.

Monday, September 24, 2012

Firefox 15 is really slow

I use both Firefox and Chrome on my Linux laptop.  Some websites are so poorly written, that even on Chrome they run really slow.  That is where the NoScript Add-On for Firefox comes in handy.  I use Firefox for most webpages, since NoScript blocks tons of crap.  I go to Chrome for watching Flash video or when I want a more responsive interface.

I noticed something when I upgraded to Firefox 15, however.  The entire browser started running really slow.  There is a significant lag between when I tell it to perform an action and when the action actually gets performed.  As an example, opening a new tab takes about 3/4 of a second now.  Page up/Page down can take up to a second.  Switching between tabs seems to take over a second.  I did a quick search and there is a support ticket that seems to match my issue.  The Mozilla people seem to think it is operating system related.  They said check things like Windows Firewall and see what anti-virus programs are running.  Really?  That sounds similar to "did you turn it off and back on again".  I know its not the operating system since Chrome didn't suffer a performance problem when Firefox upgraded.  Firefox has been my favorite browser for years.  What is going on with Firefox these days?

Friday, September 21, 2012

Maven snapshots vs milestones

Maven versions come in two flavors: snapshots and milestones.  Snapshots have a version but end in -SNAPSHOT or -LATEST.  Everything else falls into the milestone category.  Milestones are unmodifiable.  Snapshots can be changed.

When a new snapshot is created, the -SNAPSHOT gets replaced with a unique timestamp with a counter.  Parts of maven support depending directly on the "locked snapshot" version, but some maven mojos don't support that.  Pom files that depend on snapshots do not get updated to the locked snapshot.  This has a major disadvantage that artifacts that contain snapshots are not reproduceable.  Pom files that only depend on milestones are reproduceable but converting a pom file from a snapshot to a milestone can be quite painful.

Let's assume you have a large dependency tree of pom files.  Let's say 5 pom files deep.  If the bottom of the tree needs to be updated, then you have to update 4 pom files to point to the snapshot versions of the dependencies.  Once you perform all the builds, you can test your code.  Let's assume everything tested correctly.  Its time to install the code into production.  Hold on a second!  You can't install an artifact into production that isn't reproducable!  You have to milestone the bottom artifact.  Then you have to update the pom file that depends on it to use the milestones version of the dependency.  Then you have to milestone that pom.  You have to continually do this all the way up the dependency tree.  That is kind of a pain when your code has already been tested!

In my opinion, milestones should also be pointers.  These pointers should be immutable.  Pom files should be updated to point to the version that any symlinks point to during the deploy process to the remote repository.  Maven also needs better support for locked snapshots.  These changes should make every snapshot build reproduceable.

Thursday, September 20, 2012

The iPhone 5

The iPhone 5 seems like it will be a great incremental improvement over the iPhone 4S.  It is thinner and more powerful.  The big new feature is the 4G LTE support.  4G will unleash the full power of the iPhone.  The iPhone 5 is just an incremental improvement.  It is not a revolutionary new device.

One big different (I'm not calling it a feature, because its not) is the connector.  This is a big deal but not in a good way.  I have been reading a lot about this lately.  I hear a lot from the Apple camp that "its about time" that Apple changed the connector.  They have been saying things like how you can't expect Apple to keep using the same connector forever.  That is kind of missing the point.  USB has gone through multiple flavors causing people to re-buy power chargers, as well.  There is a big difference there.

The main point is being an open versus a closed platform.  Apple is a closed platform in many aspects.  One aspect is the power charger.  The first iPod came out in October 2001.  The Mini USB standard came out in October 2000.  Apple had the option to use a standard (open) connector.  Apple chose to create a new proprietary (closed) connector.  This caused everyone to buy connectors from Apple.  The Apple camp will go on and on about how the Apple connector is better.

Since then, Micro USB has come out.  Most Android phones use this connector.  With the iPhone 5, Apple has chosen to repeat their favoritism towards closed platforms.  The big deal with Apple changing connectors is that they didn't choose Micro USB as the connector.  By not choosing a standard, consumers will be forced to buy overpriced connectors instead of connectors available on the open market.

Eventually, non-Apple smartphones will stop using Micro USB.  They will start using some new standard connector.  When that happens, the market will be filled with vendors, keeping the price down.  The non-Apple smartphone users will not revolt.  Apple smartphones will also eventually change connectors.  Apple will probably create a new proprietary connector.  This will cause Apple customers to buy expensive connectors again.  They will not revolt, just like the Apple camp is not revolting now.  What will happen is the non-Apple smartphone customers will make fun of the Apple customers (again), while the Apple customers will still not understand why they are being made fun of.

Wednesday, September 19, 2012

Sharing uncut video over Retroshare

I mentioned previously that I have been converting my family's old VHS tapes to DVD.  As part of the capture process, I have been capturing directly to a Samba share.  The network and Samba have been able to handle the streaming mpeg2.  These files are big, too.  One of my captures is over 8gb.  The very first thing I do is open up the mpeg2 files with Avidemux and cut up the 8gb file into multiple smaller files, that total back up to the 8gb.  These files become the DVD titles inside of a single DVD.  My brother wanted access to the original files, just in case he wanted recut the DVD.  How do I share the 72gb of mpeg2?

This is exactly why I started using Retroshare.  The Samba share I was capturing to is also exported via Retroshare.  As soon as I'm done capturing a single video, he is able to download the video from me.  I tend to keep the big original capture, the cut up smaller mpeg2 files, and XVID encoded versions.  My dad will download the XVID encoded versions over Retroshare.

Tuesday, September 18, 2012

DRM and watching TV on the internet

The pilot of the new NBC show Go On was made available online.  I saw a short preview and it looked like a good show, so I decided to watch the pilot.  I fired up my web browser on the Windows machine connected to the TV.  The browser froze for a we seconds, then the video started.  Yay Flash!  After a few minutes, the video froze.  I had to hit refresh and try to skip to the location where we left off.  After a few more minutes, the video froze again.  I was getting pretty frustrated when my phone grabbed the FiOS remote and found the show On Demand.  The On Demand video had a restriction.  We couldn't fast forward through the parts we saw already.  Kudos to NBC for making online TV so terrible that we have to back to the old broadcast TV.

Monday, September 17, 2012

Hauppage PVR-250

I have been slowly converting my family's old VHS tapes to DVD.  I purchased a USB capture card that came with Roxio software for Windows.  The software wasn't the best, but it was easy to use.  I was able to capture mpeg2, which makes it easy to cut into DVD titles.  After capturing two videos, something weird started to occur.  A green line started appearing in the video.  It wasn't solid.  It was a green tint to whatever was behind the line.  It was in the center, was about 5% of the screen height, and it took up the entire width of the video.  I didn't have another VHS player available, so I tried various techniques to diagnose the problem.  The VHS player was also a DVD player, so I popped in a DVD and the green line was still there. I couldn't be 100% sure it was the capture card, but it was a good guess.

I decided to put my old Hauppage PVR-250 card into the computer.  I purchased this card in 2004 for my home-built MythTV DVR.  Putting that card into the computer was a long shot.  I stopped using the card 3 years ago when I got FiOS, since it was no longer usable.  The card has been sitting in my damp basement out in the open.  No static bag or any sort of cover.  I was very happy to learn that it still worked!

The fun thing about the PVR-250 is the /dev/video* device nodes dump raw mpeg2.  This means I could use the cat command to record video.  Cat is so much better than the Windows software.  People who tell me that the command line is useless will never know the joys of:

#!/bin/sh
cat /dev/video24 > "$1" &
pid=$!
sleep "$2"
kill $pid


Nothing beats using simple software with great hardware.

Friday, September 14, 2012

Spongycastle

I love geek humor.  When researching encryption technologies for Android, I cam across an interesting project.  There are similar projects out there, but this one takes top prize, purely due to its name: SpongyCastle.  For those of you who don't get the joke, BouncyCastle is a famous cryptography library for Java and .NET.  Android comes with a stripped version of BouncyCastle, but many Android developers prefer to use an updated version.  Bundling BouncyCastle with your Android app can be problematic.  Enter SpongyCastle.  SpongyCastle is a namespace-translated jar of BounceCastle.  This allows for easy inclusion in your Android app.

Thursday, September 13, 2012

Autocorrect and touchtyping

I am not a fan of autocorrect.  I agree that people should proofread what they write, but that doesn't mean autocorrect isn't frustrating.  When typing with a real keyboard, I can touch type.  Although I can't touch type on a tablet (sine there is no tactile sensation) I can type pretty fast when I stare directly at the keyboard.  This means I don't proofread as I type.  That isn't a big deal with a computer since what you type is what you get.  On a touch screen, what you type is not what you get.  Just because a word isn't in a dictionary doesn't mean it isn't a valid word.  In the modern culture, new words are created every day.  When I type fast on a tablet, I find myself having to go back and edit a lot more.  This becomes problematic since it is a lot harder to position the edit cursor on a tablet.  Many of my posts are composed on the tablet but edited on the laptop.

Wednesday, September 12, 2012

SMS on my Tablet

Sometimes I leave my phone in one location in my house to charge while I wander from room to room.  It would be nice if I could stay connected no matter where I am.  I can communicate via email and voice from multiple devices but I can only send/receive text messages from my cell phone.

 I have a cordless phone for the land line that is Bluetooth mated with my cell.  It is a 3 phone system so I an answer my phone from almost any room.  My tablet and laptop support email, so I can get email from multiple places.

I have been looking for a good way to communicate over SMS from my tablet.  A buddy of mine uses Google Voice, so he can text from multiple devices, but he had to give everyone a different number to use.

I was able to install some SMS gateways on my cell phone, but I haven't found any good clients for my tablet.  I have settled on Mysms.  Mysms is a cloud-based service for sending/receiving text messages.  Mysms gets installed on your phone and any other devices that you want to text on.  It replaces the default SMS app on your phone.

I can see why people are drawn the custom app.  I would prefer t have the stock SMS app back.  Also, I don't like the idea of my private texts being stored on the cloud.  Overall, it is a good service and the app hasn't crashed.  I recommend it for anyone that wants to text from your tablet.  I will continue to keep an eye out for any alternatives.

Tuesday, September 11, 2012

From Dropbox to Facebook to Retroshare

I went to the Philadelphia Zoo this past weekend.  I took a bunch of pictures on my phone.  After I got home, Smart WiFi detected that I got home and reenabled my WiFi.  Dropbox detected the WiFi and automatically uploaded my pictures.  I got on my laptop and all my pictures were already there.  I uploaded all the photos to a new album on Facebook.  I then moved the photos from the Dropbox folder to the NFS server that is shared on Retroshare.  If anyone I'm friends sees the pictures on Facebook, they can grab the hires versions on Retroshare.

In the future, it would be nice to specify what photo album the photo should be in before you take a photo.  The assumption is sequential photos would likely be in the same album.  Then, I could auto-upload to Facebook and Retroshare when I get home.

Monday, September 10, 2012

Ditching the Blogger app

I have decided to ditch the Blogger app.  I have had issues writing blog posts with the app.  The app doesn't support as many features that I would like it to.  The app does not have a WYSIWYG editor.  It contains a text editor.  When I put multiple spaces or enters, they disappear when I view the posts.  You may have noticed that in a few of my posts.  It also makes switching between the web page and the app problematic.  If your post contains any HTML entities, which can be created in the WYSIWYG, then the Blogger app shows you the HTML source code.  I have decided to use the website in Chrome on my tablet.

Friday, September 7, 2012

OpenVPN setup

OpenVPN is a great VPN technology.  Although it can be a little confusing to set up, its a lot easier than other VPN technologies.  It is also more secure that some of the more common ones.  When I decided to set up OpenVPN on my home network and my cell phone, I wanted to record the steps that I did to get it up and running.  My Linux distro of choice is Gentoo, so these steps are a bit Gentoo-specific.  Here is a quick run down of what I did.

cd /etc/openvpn
rsync -av /usr/share/openvpn/easy-rsa ./
vi vars
     Put in your own values for KEY_*
     EASY_RSA=/etc/openvpn/easy-rsa
cd /etc/openvpn/easy-rsa
. ./vars
mkdir -p $KEY_DIR
./clean-all
./pkitool --initca
./build-key-server server
./build-dh
./build-key client1

Use the default server config file and save it to /etc/openvpn/openvpn.conf
/etc/init.d/openvpn start


Import your ca.crt, client1.crt and client1.key files onto your client.  Configure your client and try out the connection.  With Android 4's new VPNService, I was able to configure my phone to VPN into my home network.  The Android app was a little confusing to set up, and it was pretty verbose.  I used ES Explorer to download my client keys off of my Samba home directory.  I imported the keys into OpenVPN and was able to make a connection.  It look me a little while to find out how to disconnect.  You have to click the VPN entry in the notification drawer.

I was able to use AndroidVNC to connect to my VNC server.  I had latency issues with ConnectBot ssh'ing to the VPN server.  I have not tried Samba via the VPN, but I'll post a blog entry about that when I do try it out.  In standby mode, the VPN still uses a lot of data.  The VPN works great if you are connected to a Wifi network, but I wouldn't recommend leaving it connected for an extended period of time over a cellular network.  If you need to VPN in over cellular, I would connect, download any files you need, then disconnect.  My VPN connection used about 90mb of data over a 4 hour period while idle.  I have no idea what it was doing.

Thursday, September 6, 2012

Dolphin Wii emulator

A buddy and I tried to get the Dolphin Wii emulator working on my Windows XP VM.  I wanted to see what the games would look like in HD.  I had a USB Bluetooth adapter plugged in.  Mating my Wiimotes to the Windows PC was really easy.  Most of the set up was really easy.  Getting a game to run was a bit of a journey.

I popped in my New Super Mario Brothers disc and tried to run it.  Everything started to freeze.  It got to the point that the host Linux operating system started to have i/o errors.  I had to reboot the computer.  The computer wouldn't come back up.  It wouldn't start!  I couldn't get into the bios.  At this point, I thought I had a hardware failure.  I decided to take the Wii game out of the DVD drive.  That is when I noticed the blinking light on the DVD drive.  I hit the eject button and the disk ejected.  The computer started to boot.  The joys of DRM.

After getting passed the DRM problem, I was able to start Mario Kart Wii.  I had the resolution and quality set to the lowest settings. The menu's rendered between 57 and 60 fps.  When trying to start the game, the game rendered at 2 fps.  It was obvious that my current setup is not powerful enough.  I may end up upgrading to a 64bit Windows 7 install.  I may have to upgrade my AMD Radeon HD6570 to something with more horsepower.  I might invest in an HD7870, but I haven't decided yet.

Wednesday, September 5, 2012

Android x86 on Xen

I currently use a custom gui application for accessing my media files.  It uses lirc to browse and select what video you want to watch.  Every TV has a computer with this software installed on in.  Since the software was custom written by me, adding screens for other services might not be possible.  Specifically, my wife wants to access our Pandora and Netflix subscriptions.  At this point, I think the better move is to migrate to Android.  I could write a new frontend as an Android app and install it on Android x86.

The frontend computer in the living room is also my Xen server.  I downloaded the 2.2, 2.3, 3.2 and 4.0 versions of the eeepc iso.  Each version started just fine in Xen.  After booting, I wasn't able to use the mouse to unlock some of the versions.  I figured out that the usbdevice='tablet' entry in the xen config file didn't work on older versions of Android-x86.  After commenting out that entry, I was able to use the mouse again.  The DomU mouse cursor doesn't match the position of the VNC mouse cursor (the exact reason you use usbdevice='tablet').

Although the operating system seems to support an Ethernet configuration, no device shows up in the dropdown.  Ethernet support is essential inside of a VM.  The Google group says there is a patch.  It has not been merged into the mainline because there is a bigger effort to make the patch better.  As a programmer, I have complete respect for that.


The gui performance was pretty good in comparison to what I expected.  Xen doesn't support a virtualized 3d card and I am streaming the output over WiFi to my laptop using VNC.  I was expecting the speed to be unusable.  The gui wasn't fast enough for everyday use, bit it was good enough to do your configuration without too much frustration.  I gave a quick attempt at VGA passthrough but nothing came up.  I know one person has reported VGA passthrough working with Android x86.

At this point, it seems like replacing my current frontend with an Android 86 VM is not an option, but I am very hopeful for the future.  The Android x86 people have made great progress.  I am looking forward to the 4.0 release.

Tuesday, September 4, 2012

Xvnc and Retroshare

Retroshare is a great program for sharing videos with friends and family.  The command line version leaves a little to be desired.  What Retroshare really needs is a client/server architecture so that you can remotely connect to it.  In the absents of that change, I have found that xvnc makes for a suitable stopgap.

Xvnc/Tightvnc is a vnc server that exports a virtual x server over the vnc protocol.  It is a kind of virtual framebuffer.  Think of it like GNU Screen for x windows.  You can disconnect then reconnect from a different location.  Any running processes continue to run.

I have set up xvnc on my home server.  Xvnc is in the Gentoo portage tree so it was easy to install and configure.  After installing xvnc, I created a filesharing user.  I added the user to /etc/conf.d/xvnc and created a vnc password for the user.  After starting xvnc, I was able to connect to the xserver with tigervnc on my laptop.  Once connected, the first thing you notice is an open xterm with no window manager.  You may want to start a window manager.  For xvnc, I recommend icewm since it is pretty lightweight.  3d transitions and compositing may not work well over the vnc protocol.

The next thing to do is configure xvnc to start your window manager of choice and any other software you want started.  My xvnc starts icewm and Retroshare on first login.  With the vnc init script, all your users auto-login.  This means Retroshare starts up when the computer boots up.  Retroshare requires a password to log in, but you can opt for Retroshare to remember your password.

At this point, you can disconnect from xvnc.  After you disconnect, Retroshare is still running!  You can reconnect later from another computer, a tablet, or even your cell phone.  It is not recommended to open up your firewall to allow vnc connections from the internet.  To remotely access your xvnc server, you should probably set up a good home VPN, like OpenVPN.

Saturday, September 1, 2012

The battle of the Maven local repository

Java does not natively support having multiple jvms modify the same file/folder.  Many Java programs will try to do it, but a lot of times they will run into random problems.  This is similar to race conditions inside of a single JVM.

What does this have to do with Maven?  Maven uses a local repository.  Before building your code, Maven will download your project's dependencies into your local repository.  This works great when building your project on a desktop.  It does not work well when you have multiple copy-dependency goals running at the same time.  Why would you do that?  You need to extract your artifacts when you deploy to your Tomcat or Webshere JVM.  In a large organization, you will probably have multiple extracts occur in at the same time.  Welcome to random local repository corruption!

How do we prevent this corruption?  The first thing you can do is use a different local repository for each extraction JVM.  Your mileage may vary but I noticed other problems with that.  I may go further into detail of those problems in a future post.  The only foolproof way I found was to create a new temporary local repository at the start of every extract.  Yes this does make the extract much longer because Maven has to redownload the world at the start of every extract.  That was the best I could do, though.