Archive for the Category Mindshare



Not a very productive day but its the first real work i have done in about a week.


  • Work on BEEP connections between peers.
  • Peers decide who is the ‘client’ and the ‘server’ by comparing the URI’s of their respective JXTA PeerID’s. The lesser PeerID is the client and thus responsible for making the connection.


  • All the old logging code is now replaced with Log4J.


  • Fixed a subtle bug in Presence that happened when peers went offline and came back rapidly. The per record would be replaced and a timer task would remove a different but ‘equal()’ record.
  • Fixed a synchronization bug in Presence shutdown where concurrent modification could occur in the peer list.
  • Found a subtle bug in the buddy list display. If the list is interacted before all peers appear online it will not display new peers. Most curious.
  • Also the buddy list is not being saved as it was before. This is actually a cool feature at this phase of testing so it may be made optional with the default being true.


MediaWiki MediaWiki looks cool.I’m a big fan of Wiki’s in general and I want to use one here. I like the idea of using a Wiki for things like a manual, quick start guide etc. MediaWiki could handle this blog by the looks of it. JXTA has a wiki, however the primary resource for JXTA information and discussion is the dev mailing list. The problem with mailing lists and forums in general is information loss. Users must be clever enough to search for the right information. Wiki’s encourage knowledge hoarding. Wiki pages snowball to cover all knowledge of that area. The Wiki’s problem is page rot. You have to maintain and refactor the pages as things change or they become obsolete and misguiding. Forums and mailing lists are best for discussion transient topics where information loss is inconsequential.

Overall I like the Wiki over the mailing list or a forum so installing one is on my todo list probably in late February.

Unique Unique ID’s

Mindshare being the unique thing that it is needs a unique ID format. Each group member generates their own member ID. These ID’s need to be unique, which is the usual requirement. Because the number of ID’s create s small and scoped within a group the size of the ID’s does not need to be that large. The 128 bit UUID format is probably overkill and Java cant generate true UUID’s anyway because the JVM lacks access to several components of that format (MAC address and a high resolution timer). My initial response to this requirement was to Base64 encode some random bits.

The other requirements are more subtle. Mindshare save everyones files to disk and cares about who owns those files, something no other P2P program cares about. The user ID may be called upon to disambiguate files in cases where two files have the same name or to store each users files in a separate directory. This puts severe restrictions on the characters that can be used as ID’s. For starters using Base64 encoding cant be used for file/directory names because it includes the ‘/’ character which is either illegal or delineates directories on Unix platforms and in URI’s.

Then there are the case-preserving, case-insensitive filesystems of the two popular desktop OS’s. Base64 is case sensitive so raw Base64 cant be reliable used because two different Base64 strings might be the same thing as a file name.

Finally Base64 uses the ‘+’ and ‘=’characters. The = is easy to avoid by packing the base 64 such that no filler is needed. The ‘+’ character falls into the punctuation group and is thusly not suitable for use in the authority section of a URI.

So for now Mindshare ID’s will be 15 bytes of secure random data, encoded with Base64, resulting in a 20 byte ID. All capitol letters will be replaced with their common equivalent (id.toLowerCase()). The characters ‘+’ and ‘/’ will be replaced with the more URI friendly ‘-’ and ‘_’ respectively. There is still the possibility of collision in this scheme by virtue of the loss of capitalisation. I consider this to be unlikely or at least as nebulous as the possibility of generating identical random bits because Java doesn’t have access to accurate spatial or chronological information. At some future time an encoder can be built that encodes raw bytes in the alphabet [a-z][0-9][-_] without changes to the protocol.

Basically this is a post to say I have thought about this issue but I am too busy/lazy to do the right thing at this point in time. This gets put off for 0.2 when we do crypto & security.

Current Work

My thesis is slated to be handed in sometime in mid February. This puts a closed time-frame on work remaining before the alpha release when real people (users) will get to squeeze the software in their greedy little hands :-).

Give the time constraints the main priority is to get tree and file swapping implemented. Events have, however, conspired to make this not so easy. I lost some important code (formatted it into oblivion) that was not too trivial to write. To save time I am cutting XML as the back end data format. Right now much of the core already works on XML. The alternate encoding will be BEncoding much less stressful to work with. It solves many problems associated with sending binary hashes inside XML that cant contain binary characters. Right now I want to strip out all the XML code and replace it with BEncoded messages instead. The work needed to do this may be too much to be worth while for the alpha.

Presence support was rewritten to be more general. Integrating this back into the Mindshare client is a bit of a pain but the result should be a more responsive presence service.

All point to point links will use BEEP for transport. Before the code loss I had BEEP working over a JxtaSocket quite well. This uncovered a bug with closing JxtaSockets and BidiPipes that is now fixed. JxtaSocket still does not support keepalives so the protocol will include a keepalive packet. In the future a second BEEP channel could be used for one to one chat.

Heading up to the release I will try to post more often so check back.