JS Ext

Friday, August 31, 2012

Wifi tethering

In July, I rooted my phone so that I could tether over WiFi.  I was traveling and I knew. Wouldn't have access to the internet.  I installed a WiFi tethering app on my phone but it had some issues.  After I was done with the internet, I disabled tethering.  At that point, my phone couldn't connect to any WiFi networks.  I had to restart the phone t use the WiFi.  The experience made me hesitant to root my current phone to do tethering.

The other day, I discovered the FoxFi app.  This app allows you to do WiFi tethering without root or a tethering data plan!  Although available on Google Play, some carriers block the app from being listed.  It was convenient enough to go to the app's home page and download the .apk file.  After installing the .apk file, I was ready to go.  I set a WPA password and turned on the hotspot.  I had my coworker connect to my hotspot.  After he verified that it the tethering was working he installed the app, and I connected to his hotspot from my phone.  It was that easy!  The user interface was pretty simplistic.  It didn't support some of the features that other tethering apps supported, like Mac filtering. Working without rooting your phone makes it well worth it, though!

Thursday, August 30, 2012

The Joys of Xen Snapshots

One of the Windows VM's that I have is for hardware drivers.  I don't like installing custom drivers because they never see to go away.  This is where the snapshot feature of qcow2 comes in handy.  I just take a snapshot before installing the drivers.  If the hardware doesn't work out, I just apply the old snapshot and no more messy drivers!

This also works well when trying out new software.  Lots of software comes with adware.  Adware is sometimes hard to remove.  By making periodic snapshots, you can rollback the adware, instead of trying some poorly written anti-virus program.

mycomputer disks # qemu-img snapshot -l vm1.img 
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         fresh_install             0 2012-08-21 19:06:12   00:00:00.000
mycomputer disks # 

The qemu-img command allows you to create, apply and delete snapshots.  As mentioned in a previous post, it is highly advised to shutdown your vm before taking/applying a snapshot.  The -c option is used to create a snapshot.  The -a option is used to apply a snapshot.  The -d option is used to delete a snapshot.  

More and more filesystems are starting to support copy-on-write features.

Wednesday, August 29, 2012

Sharing pictures and home movies with Retroshare

File sharing (and I don't mean illegal file sharing) can be tough in today's world.  I have a collection of pictures and home movies that I would like to share with friends and family.  Sure, there are websites like Facebook, and Dropbox that will allow you to share pictures/files, but Dropbox only gives you so much space.  Facebook downsizes your pictures.  I have 13GB's of family photos.   My brother has a really nice camera, and I would like to download some of his photos of family functions.

While searching for an answer, I stumbled upon Retroshare.  Retroshare is a peer-to-peer social media platform.  What does it mean to be peer-to-peer?  It means there is no central server.  Since there is no central server, then there is no body that can snoop on you.  There is no limit on how much can be shared.  Retroshare supports messaging, chat rooms and file sharing.  All communication is encrypted.  This is far more secure than I needed, but I'm not one to turn down extra security if its built in.

The extra security does have some drawbacks, however.  Encryption is built around GPG keys.  Every person generates their own public/private key pair.  To "friend" someone, you give them your public key, and they give you their public key.  Once keys are exchanged, you can connect to each other.  That part is what is a little confusing for many people.  Retroshare does a good job of walking you through the process, but it still uses the technical terms that make it very intimidating.  Only 1/3 of my friends and family that I tried to get connect actually set it up.  All of that 1/3 were technical people.  By technical, I don't mean software engineers.  By technical I mean they can install Windows from scratch.

File sharing is really easy.  You select what folders to share, and then all those files are available for your friends to download.  Retroshare also makes use of distributed technology.  If two people in my circle have the same exact file, and a third starts downloading it, then that person will download it from both people who have that file.  With such a small circle, we aren't talking about a big performance boost, but it is a novel feature.

The UPnp functionality to automatically set up port forwarding was a bit spotty.  My Gentoo server did not self-configure but my Gentoo laptop did.  One of the people in my circle uses the Windows client, and that did not set up port forwarding correctly.  This is another hurdle for non-technical people who fear the router.
The software does lack some features that would be pretty nice.  I want the ability to remotely control Retroshare.  If I'm on the road, and I am exchanging keys with a family member (most likely because I'm setting up Retroshare for them), I want to be able to import the keys remotely.  I want to be able to test the connectivity while I'm there.  The encrypted messaging and chat room feature is nice, but I tend to use my phone for that type of communication.  There currently isn't a mobile app available for the iPhone or Android.  Retroshare doesn't currently have classifications of friends.  Everyone you exchange keys with can see every file you have shared.  It would be nice to classify people into groups, then allow certain groups access to certain folders.

Overall, I am really excited about Retroshare.  It does have a long road ahead of it before the masses can start using it, but I think its good enough for my friends and family to share photos and home movies.  Once the software is set up, it is pretty user friendly.  If you don't mind configuring it on all your friends computers, then you might want to consider being an early adopter.



Tuesday, August 28, 2012

Maven is for building, not deploying

Writing software doesn't help you if you can't install it.  In a simple web environment, Maven works great.  It produced a war file (with every dependency in WEB-INF/lib).  Just drop that war into Tomcat and you are done.  What happens when you have a more complex setup?  Maybe Websphere with an aggregator pom for the jars that go into the Shared lib class loader level?  What about a batch application that is just a bag of jars?  Maven has a copy-dependencies goal that copies the dependencies of the pom file into a directory.  When you call that goal, you may notice something weird.  Why is junit.jar in the extract?  Oh, that's right.  Copy-dependencies ignores the scope tag of your dependencies.  All of your test and provided scoped dependencies are in your extract folder.

The next problem we notice is the lack of context with regards to your scope tags.  Why do you need a context?  Say we have a war file destined for Websphere.  To reduce our memory footprint, we exclude some jars that will be shared among the war files.  To exclude them, we declare the dependencies as 'provided' scoped.  From the context of the war file, those jars are provided by Websphere.  Let's assume we fixed the copy-dependencies problem from above.  Now, we extract the jars that are destined for Sharedlib.  Oh no!  All our jars are missing.  All the jars are marked as 'provided' so nothing was extracted.  From the context of the sharedlib pom, the jars are not 'provided'!  Now we start messing around with the extraction process and duplication of data in pom files.

All of these problems occur because Maven was designed as a build tool.  It has no concept of how to extract and deploy your code (other than a simple war or ear setup).

Monday, August 27, 2012

Complaints About Maven

The whole Java world seems to have embraced Maven as the future of building code.  I find this troubling.  I am not a fan of Maven.  I am not saying there is something out there right now that is better than Maven.  That doesn't mean I have to like it, though.  My hope is that what ever replaces Maven will solve some of my gripes with the technology.  I will be going further into my complaints in future blog posts.

Sunday, August 26, 2012

Glad to have a Samsung phone again

My Samsung Galaxy S had an unfortunate run in with the washing machine.  I had to borrow my friend's old iPhone for two weeks.  I was not happy.  I, unlike some Apple designers, can tell the difference between an Apple phone and a Samsung phone.

For starters, I like having a back button.  Androids have back buttons.  Windows phones have back buttons.  Non-smart phones have back buttons.  The B button of my N64 acted as a back button.  Is Apple so forward thinking that they don't need back buttons?  Just like they don't need a right-click on their mouse.
I like open standards.  Open standards make things cheaper and more flexible.  I like the fact that 5 of the last 7 phones that my wife and I have owned use the same charger.  Who would have thought that Motorola, Samsung and Research in Motion can invent the same exact technology.  O wait.  They didn't.  They used the USB standard.  What an interesting innovation.

Why does Apple have its own "data plan?". I am on AT&T.  I pay for a data plan.  Why is it that when I put my Sim card into an iPhone, I get a popup every once in a while complaining that I don't have a data plan.  Data is data.  Why is Apple special?  We are transmitting 1's and 0's.  Do they use 2's as well?
I am now a proud owner of a Samsung Galaxy S 2.  Yes, I know, the S 3 is out.  I tend to wait for the latest technology to come out so that I can by the older generation for much less.

Saturday, August 25, 2012

Gmail and a Home SMTP server

All of my computers have ssmtp installed.  This allows any program that uses the 'sendmail' command to send mail via the Gmail SMTP server to work.  I just have to put my Gmail credentials in the /etc/ssmtp/ssmtp.conf file.  Not all software uses the 'sendmail' command, however.  Some programs prefer to talk directly to an SMTP server.  This means I have to configure each program with my Gmail credentials.  I would prefer only having a single location to maintain those credentials, because I do change my Gmail password.  I decided to set up Postfix as my home SMTP server.

With Gentoo, I just run 'emerge postfix'.  Postfix gets installed and ssmtp gets uninstalled (since you can only have one sendmail command).  There is a handy Ubuntu guide on configuring Postfix to forward to Gmail.  There are a few differences in the guide between Ubuntu and Gentoo.  The sasl password file is /etc/postfix/saslpass, not /etc/postfix/sasl_passwd.  The Gentoo Postfix package does not contain a CA certs file.  In Gentoo, there is an app-misc/ca-certificates package that contains the CA certs for every application.  The certs file can be found at /etc/ssl/certs/cacert.org.pem.

From here on out, I can configure ssmtp on all my other computers to forward to my Postfix server.  I can also take my Gmail credentials out of my Jenkins server.

Friday, August 24, 2012

Bad Singleton

I inherited a program the other day.  I was given a maintenance ticket.  I downloaded the program to my desktop and tried to start it.  I immediately got a bunch of NullPointerExceptions.  Endless NullPointerExceptions.  The NPEs were were emanating from any calls to a singleton.  I looked at the singleton's getInstance() method and found some interesting code:

public static XmlParser getInstance()
{
    if ( _instance == null )
    {
        try
        {
            _instance = new XmlParser();
        }
        catch ( Exception e )
        {
            log.error( e );
        }
    }
    return _instance;
}

First of all, exceptions were created for a reason.  We shouldn't just ignore them.  Ignoring exceptions makes it harder to debug problems.  To combat that, the developer added the log message.  That person didn't fully understand the Log4j api.  Instead of logging the exception, it logged the type of exception being thrown.  That isn't exactly helpful when you are trying to debug a problem.  Second, since this is a singleton getInstance, the null return caused the NPE to be thrown all over the place.  It would have been better to initialize the singleton at program startup so that we can fail it upfront, instead of allowing all the threads to start up.

Although this is a multi threaded program, I agree with the initial developer that it didn't need to be synchronized.  The class parses XML files.  It does not cache the parsed object.  Therefore, it doesn't matter too much if there are two instances in memory at the same time.

This was an interesting "gift".  Christmas did not come early.

Thursday, August 23, 2012

Amazing Alex demo


I was a huge fan of The Incredible Machine (TIM) growing up.  Imagine my delight when I first played Amazing Alex.  I have not purchased the game (yet), but I played the free 16 levels on my Android tablet.  I have been waiting for an updated version of TIM for years.  I don't use Apple products, so I haven't tried the latest iOS version, but I think Amazing Alex is a great replacement.  Amazing Alex is based on Casey's Contraptions, a game I have never heard of.  For those of you not familiar with TIM, it is a puzzle game where you must rearrange a Rube-Goldberg machine to perform a task.  The task is usually something simple like popping a balloon, or putting a ball in a basket.

The Amazing Alex demo featured simple machines just to get you used to the concept (and get you addicted).  The first few levels actually told you where to put the missing pieces to solve the puzzle.  The level selection and post-level screens should look familiar to Angry Birds fans.  Amazing Alex features the 3-start concept that Angry Birds has, but instead of being point based, it is based on you hitting 3 starts that are floating around the machine.  So far, only baskets, balloons, scissors, boxes, shelves and books have featured in the first 16 levels.  TIM had some great odd devices, like gears, rope, rockets, trampolines and hamster wheels.  I can't wait to see devices we are in store for.

Rovio is famous for simple physics based games with excellent levels.  In fact, most of what Rovio has done has already been done before.  Rovio really shines in the level design.  It is hard to tell where they will go with Alex's levels, but I do have high hopes for the future of this new franchise.

Wednesday, August 22, 2012

Ruining a virtual hard disk

Mental note: don't pause a Windows vm, take a snapshot of its hard disk, the unpause it.  The vm does not like that.  It runs fine until you reboot, at which point you no longer have a hard disk.  Oops.

Tuesday, August 21, 2012

The personal cloud

The word "cloud" is all over the place these days.  It doesn't matter that there are very few services out there that are actual cloud services.  Somehow, the word 'server' got replaced with the word "cloud".  At the end of the day, though, you are still giving some other company complete access to your personal data.  A few places have started to talk about personal clouds, or personal servers.

The first "cloud" service that many people have is music.  You have a music collection on your iPod, but you want to be able to access that music from anywhere.  You can use a "cloud" service, but why not just share your music collection over your home internet connection?  With the upload speed of home internet services getting faster and faster, you can just run a home "cloud" server.  There is software out there for sharing music, pictures and home movies.  I will go further into detail for some of these software packages.

Monday, August 20, 2012

Waze Traffic

I have been using Waze for a few weeks now but I never used it for navigation until now.  A friend of mine had a house warming party, so I didn't exactly know how to get there.  To make matters worse, it was raining out.  I was planning on taking 476N to 76W into North Philly.  Imagine my surprise when Waze wanted me to take 476S to 95N.  Before I get to 476, Waze starts listing all the traffic reports.  It lists moderate traffic on 476S.  Why would Waze want me to go that way?  The traffic reports kept coming.  There were disabled vehicles and slow traffic all over.  Then, one report caught my ear.  There was an accident on 76.  Anyone from the Philly area knows what that means.  At that point, I decided to follow Waze's advice.  Although it still took me a while to get to the party, Waze made sure I didn't miss the party.

Sunday, August 19, 2012

Google Nexus 7 tablet

I got a Google Nexus 7 8gb for my birthday.  This is a great device.  This is my second tablet.  The first one was one of those unofficial tablets that comes free when you buy furniture.  There is a world of difference between the two tablets.  All the apps that I downloaded and purchased on my phone were auto-downloaded once I logged in.  The battery life is impeccable.  The main reason for I wanted a tablet was to watch videos while travelling.  I previously used my cell phone.  I had to carry a usb battery pack just to power the phone during the long flights.  I won't have this problem with the tablet, although I haven't had a chance to travel with it yet.

I was able to use ES File Explorer to copy some tv shows down to my tablet to test the video quality.  This is where I found a lack of video players.  I have a Samsung phone (Galaxy S and Galaxy S 2) so I tend to use the Samsung music and video players.  After installing MX Player, I was able to test out the video quality.  It was perfect for my travelling needs.

I still have not found an e-Book reader that I am happy with.  I installed a few of the top ones.  The big thing that annoys me is the method for scrolling.  My wife's Nook allows you to swipe to the side and the page flips.  Many of the apps scroll up/down instead of left/right.  The left-right swipe feels more nature, but this isn't a limitation of the Nexus 7....more of the apps that I can use now that I have a good tablet.

The Blogger app on the tablet works pretty well.  I can type pretty fast with the on screen keyboard.  I don't find myself making many spelling mistakes (from mistyping, I still can't spell on my own).  I have written a few posts using the tablet.  The Blogger app has a habit of putting the generated html in the edit window, corrupting my draft blog entry, though.

Games are a great plus on this tablet.  The games are lightning fast.  Many of the games that I wasn't able to play due to the smaller screen of a phone or the slow speed of my other tablet are running great now.  The Facebook app is a lot easier to use on a bigger screen.

The Nexus 7 does seem to lack the sleep feature of the iPad.  I tend to shut down the tablet if I know I'm done with it for the day.  When not being used, the battery usage is lower, but it still draws more than I would have liked.  I have not had a chance to use Skype yet.  The YouTube app is much better than the versions I have used on my phones.  AndroidVNC works a lot better on a tablet.  ConnectBot still isn't as usable as a laptop.  I tend to use the arrow keys and tab a lot when I ssh.  It is still hard to type out commands.

Overall, the Nexus 7 is a fabulous tablet.  It is not a complete replacement for my laptop, but I have reduced my dependency on the laptop.  So far, ssh, web browsing and blogging are the main reasons I reach for my laptop.  Web browsing and blogging is split between the tablet and the laptop.  Some webpages are still mouse-oriented.  Other webpages are too javascript heavy, so I reach for Firefox/NoScript on my laptop.  For blogging, I try to use the tablet, but the html corruption problem forces me to reach for the latop.

Friday, August 17, 2012

Genealogy Software - Part 3

In the last two posts, I talked about genealogy software and the GEDCOM spec.  In this post, I'm going to talk more about the GEDCOM spec.  This time I want to talk about the external media support for GEDCOM files.
In the GEDCOM spec, there exists support for external media files.  The most common use of this feature is pictures.  An INDI record can point to an external file that contains a picture of that person.  This works great for software that uses GEDCOM files as the database.  This part of the specification breaks down when you use GEDCOM files as a way to exchange family trees.
First, lets talk about the export/import process.  When you export a GEDCOM file, you get a single file.  Some software will allow you to export a zip file that contains the GEDCOM file as well as the media that goes along with it.  Then, you take your GEDCOM file and import it.  Just the GEDCOM file, not the zip file.  This begs the question, how do I import the media?  I'm sure some software allows this.  If any software does allow this, will they run into the same problem that I discussed in Part 2?  References to external files are stored as OBJE records.  You can do a search and replace of FAM with OBJE in Part 2 and you will see the dilemma.  This goes back to the root of the problem I discussed in Part 1.  The genealogy software today assumes that they are the single master copy of the family tree.

Wednesday, August 15, 2012

Genealogy Software - Part 2

In my last blog entry, I talked about the pros and cons of various genealogy software.  I even had a developer of one of the programs comment on the post, saying he will take my comments under advisement (+1 to HuMo-gen for good customer service!)  For this blog entry, we dive into the GEDCOM specification.  A GEDCOM file is a text file.  In it, you declare various records with a few different types.  Two important record types are INDI and FAM records.  An INDI record designates an "individual" while a FAM record designates a "family".  A family record represents an immediate family: two parents and their children.  When you add an individual or a family into your tree, each one is given a number.  The first individual is I1.  The second is I2.  The first family is F1 while the second family is F2.  INDI records contain the family id of the family they are a member of.  FAM records list the individual ids of the mother, father and children of that family.  This creates a doubly-linked-tree of individuals and families.

From a format point of view, having the doubly-linked structure can be helpful.  Especially since some genealogy software actually uses the GEDCOM file as its database.  That software doesn't have to traverse entire trees to navigate up and down a family tree.  This does pose a question when it comes to merging GEDCOM files.  This type of problem happens with specifications.  Lots of specifications are open to interpretation, which leaves different software implementing the same operation in two different ways.  This can be illustrated with an example family.

Imagine in tree 1, you have I20 married to I21 in F2.  Now, in tree 2, you have I30 married to I31 in F2.  When you merge tree 2 into tree 1, all the INDI id's get reassigned so that there are no id conflicts.  The problem is the FAM id's are not always reassigned.  After the merge, something interesting happened to I20 and I21.  You will notice that there are more children!  All of I30 and I31's children are listed under I20 an I21.  This is because all of I30 and I31's children have a pointer to F2 in them.  In tree 2, F2 is the marriage between I20 and I21.

Webtrees and Family Tree Maker both exhibit this behaviour.  With Webtrees, you can only merge one record at a time, so I only had one record to fix.  In Family Tree Maker, you can append an entire GEDCOM file and corrupt many of your records!  Luckily my father-in-law made a backup before trying the merge.  HuMo-gen doesn't suffer from this problem.  With HuMo-gen, you can append a GEDCOM file into your database.  When looking in the Webtrees forum, Webtrees doesn't allow appending a GEDCOM file into an existing family tree specifically because of this problem.  Their opinion is that merging GEDCOM files is a bad idea (which isn't far from the truth).  HuMo-gen has a duplicate search that you can run after the append that will let you merge entries together.  The duplicate search doesn't find every duplicate (which would be impossible to do), but HuMo-gen also provides an interface for manually merging two entries.  This is why HuMo-gen is currently my preferred software.

In my next blog post, I will dive into the problem of external media and the GEDCOM specification.

Sunday, August 12, 2012

Genealogy Software - Part 1

I haven't been able to find genealogy software that I really like.  Most software assumes that there is only one master copy.  Web-based software allows multiple people to maintain the single master copy, but different people like different software.  For me, this has been the main problem with genealogy software.

So far, I like the data entry of Webtrees.  I have been able to manually enter lots of records in a relatively short amount of time.  As an example, when you are on the edit screen for a male, there is a "Add Wife" link.  If you click that link, a popup opens that allows you to enter in First Name, Last Name, birth date/place, and death date/place.  After you enter that information, the person is added and linked to the male.  I can type in that basic information in a minute.  On top of that, the admin interface allows you to customize what items show up in the new person popup.  Who would have thought customization can be a handy feature!

My father-in-law has an ancestry.com subscription.  He also owns a copy of Family Tree Maker, from ancestry.com.  He has 172 people in his family tree.  The nice thing about that software is that it integrates with the website.  If you have an entry for a person, the software automatically does searches for any records online.  This allows you to easily import records and find more ancestors.  When you are searching, this really comes in handy.  I am not currently searching for records.  My wife's maternal grandmother mailed us a few hundred pages of a family tree.  This family tree contained 445 people that I have to manually type in.  So far, I have typed in 143 records.  The problem now, is that we have two "master" copies.  How do we cooperate?

Webtrees supports merging two records that both represent a single person.  It does not allow you to append a GEDCOM file into your tree.  You can import a GEDCOM file into a new tree, since Webtrees supports maintaining multiple trees.  My first attempt to merge was to import my father-in-laws exported GEDCOM file as a new tree in Webtrees.  Then, I tried out the single record merge feature.  When it came to merging facts, it worked great.  It had a nasty side effect that I will get into more detail in my next blog entry.  My next attempt was for my father-in-law to append/merge my exported GEDCOM file into Family Tree Maker.  It had the same issue as Webtrees.

This led me to HuMo-gen.  HuMo-gen is also web based.  I was able to import my Webtrees GEDCOM file, then append my father-in-law's GEDCOM file.  I then ran the duplicate search and it identified about 1/2 of the duplicates and merged them.  It merged them without the problems that Webtrees and Family Tree Maker had!  So, I now have a 380 people in my HuMo-gen database!  I was happy....until I had to add a new person.

The HuMo-gen interface is not as user friendly as Webtrees.  It takes me a few minutes to add a new person to the tree.  Each 'operation' is its own flow.  So, to add a wife, I have to go through the add person flow.  Then, I have to add a marriage.  The marriage brings up a dropdown for you to pick the person.  The dropdown gets big.  It also doesn't give a whole lot of information to figure out the exact right person.  This would be fine if there weren't so many Jr's and Sr's in the family.  In Webtrees, when you click on a person, it lists all the "wives" that man has had.  Under each wife, there is an add child to this family link.  In HuMo-gen, you have to go through the add person flow.  Then, you click on add parents in that person.  A dropdown shows up, listing every marriage in the system, plus every person in the event that they had a child with someone not in the family tree.  That dropdown is not sorted very well.  That is why it takes a while to add a person.  Adding parents and children can take a while since you have to search through multiple large dropdowns.

At this point, I'm not happy with any software available.  I have to choose between the ability to merge with my family tree with my father-in-laws family tree, or the ability to enter in new people.