<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2706097008076931316</id><updated>2011-07-07T14:39:24.070-07:00</updated><category term='problem'/><title type='text'>Maori.Geek</title><subtitle type='html'>PhD Student</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-1045520711075308739</id><published>2010-07-11T19:32:00.000-07:00</published><updated>2010-07-11T19:34:24.189-07:00</updated><title type='text'>CBSE 2010 Report</title><content type='html'>&lt;span style="font-weight:bold;"&gt;This is from a report for BuildIT&lt;/span&gt;&lt;br /&gt;This year’s Component Based Software Engineering (CBSE) conference was held in Prague, at Charles University, in conjunction with the other CompArch conferences, Quality of Software Architectures (QoSA), International Symposium on Architecting Critical Systems (ISARCS) and the Workshop on Component-Oriented Programming (WOCOP).&lt;br /&gt; I arrived in Prague early so registered to attend the WOCOP headed by Ralf Reussner and Ivica Crnkovic. At this workshop I was able to see many presentations about continuing work from other Ph.D. students and discuss it with them in the question sessions and breaks.&lt;br /&gt; After the presentations we broke into groups to discuss topics of interest, our topic was discussing Services vs. Components. Our group, consisting of people from various fields (including embedded, performance prediction, security and software engineering) all saw these two concepts very differently. Therefore instead of presenting conclusions from our discussion, we enumerated the fundamental questions that we encountered when discussing these topics. I was elected to present our questions to the group which elicited much discussion, culminating in a great quote from Ralf, paraphrased as “If you ask a professor what a component is, they can answer. However each professor gives a different answer.”&lt;br /&gt;The next few days CBSE, QoSA and ISARCS were held, and I attended relevant talks on my Ph.D. project, these included “Reliable Dynamic Reconfigurations in a Reflexive Component Model” by Leger et al. ,“Component Composition Using Feature Models” presented by Ralf Mitschke and “Automated Creation and Assessment of Component Adapters with Test Cases” presented by Oliver Hummel. &lt;br /&gt;Opportunities where taken to discuss work and research outside the conference setting. I talked to the presenters Ralf Mitschke, Claas Wilke and Kerstin Falkowski at length about their work and how it relates to mine, and progress and problems they have encountered, as well as many other presenters.&lt;br /&gt;I presented second to last on the last day. I spoke for about 18 minutes and had 12 minutes of questions. Many questions came from Kung-Kiu Lau, who presented on “(Behavioural) Design Patterns as Composition Operators”, and Kiev Gama who presented “A self-healing Component Sandbox for Untrustworthy Third Party Code execution”, both of whom I had discussed their work with earlier in the conference. The presentation went well and the feedback and questions where thoughtful and useful for future research.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-1045520711075308739?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/1045520711075308739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2010/07/cbse-2010-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1045520711075308739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1045520711075308739'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2010/07/cbse-2010-report.html' title='CBSE 2010 Report'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-7458010459395491374</id><published>2009-12-03T19:06:00.000-08:00</published><updated>2009-12-03T19:13:27.943-08:00</updated><title type='text'>Submitted first Patch To Felix</title><content type='html'>First submitted issue and patch to Felix, it was just a bug I found in the framework package while I was using it in an embedded manner.  &lt;br /&gt;&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;In OSGi Require-Bundle manifest header, never mix up "version" and "bundle-version". &lt;br /&gt;I discovered some bundles do this, and Felix does not like it, here is what happens...&lt;br /&gt;&lt;br /&gt;Require-Bundle: org.w3c.dom.smil;version="[1.0.0,1.1.0)";&lt;br /&gt;This means 2 things, A) that the version range wont work, and B) that the bundle must have a property version which equals "[1.0.0,1.1.0)".&lt;br /&gt;&lt;br /&gt;This means that bundles will not resolve with really weird errors, and nothing will work.&lt;br /&gt;&lt;br /&gt;The better idea of course is never to use Require-Bundle, which is of course a static dependency and one that breaks all that modularity that OSGi gives you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-7458010459395491374?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/7458010459395491374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/12/submitted-first-patch-to-felix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7458010459395491374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7458010459395491374'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/12/submitted-first-patch-to-felix.html' title='Submitted first Patch To Felix'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-4519341982759359858</id><published>2009-10-21T14:48:00.001-07:00</published><updated>2009-10-21T14:50:45.587-07:00</updated><title type='text'>Software Engineering Lessons (1)</title><content type='html'>A lacking team member is not only a hindrance to progress, but is also a detriment. Not only are they unproductive, but what they produce must be more carefully analysed by better programmers consuming time and resources which could be better used.&lt;br /&gt;--Joel on Software&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-4519341982759359858?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/4519341982759359858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/10/software-engineering-lessons-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4519341982759359858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4519341982759359858'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/10/software-engineering-lessons-1.html' title='Software Engineering Lessons (1)'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-5914911508592981488</id><published>2009-09-13T15:36:00.000-07:00</published><updated>2009-09-13T15:45:01.022-07:00</updated><title type='text'>Azureus Logging Replaced</title><content type='html'>Azureus was using a FEW custom logging frameworks mixed in with some Log4J, which was really annoying when trying to separate the project into bundles. So what did I do, I moved it over to the JDK logging package. Took me all weekend but I am finished.&lt;br /&gt;&lt;br /&gt;To make it OSGi-y I also wrote a package that implements a service that inserts itself as a handler into the JDK logging service and then passes those LogRecords onto the OSGi logging service, so that any bundle wanting to listen to the Torrent bundles logs can listen to either the JDK logger, or the OSGi Logger service.&lt;br /&gt;&lt;br /&gt;Next is removing the custom plugin framework, and all the ad-hoc stuff that is implemented around it to make it modular.&lt;br /&gt;&lt;br /&gt;All the internal stuff that goes on inside Azureus can be greatly simplified with the use of OSGi. But the process of moving is difficult, and the tools from going from legacy to OSGi code is arduous. Refactoring tools need to be developed to help this process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-5914911508592981488?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/5914911508592981488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/09/azureus-logging-replaced.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/5914911508592981488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/5914911508592981488'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/09/azureus-logging-replaced.html' title='Azureus Logging Replaced'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-2895927169681390700</id><published>2009-09-10T17:13:00.000-07:00</published><updated>2009-09-10T17:38:53.462-07:00</updated><title type='text'>OSGi + Azureus Torrent Bundle</title><content type='html'>TLDR) I have been pulling apart the code of the Azureus Torrent Client to create a Torrent Bundle and Service in OSGi. It is more difficult than I first though it would be.&lt;br /&gt;If you would like to see such a bundle, please let me know, this would encourage my efforts.&lt;br /&gt;&lt;br /&gt;I have been working on it for a while now, and this is the first post that is describing my process, and the problems I faced.&lt;br /&gt;&lt;br /&gt;I chose Azureus because it was my old client, it has alot of functionality that basic torrent clients dont, like selecting files within the torrent to download and others not to. And because I assumed moving it from the Azureus plugin model to OSGi would be trivial.&lt;br /&gt;&lt;br /&gt;Here is what I learnt&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;First 1)&lt;/span&gt; No matter how modular you think your code is, forcing it into OSGi shows you all the dependencies errors caused by hacks.&lt;br /&gt;&lt;br /&gt;This was obvious for Azureus when pulling out the SWT packages. I wanted a core package that depended on no external UI bundles, like SWT, or Apcahe CLI.&lt;br /&gt;The problem is that some of Azureus's Table classes, that are abstract UI classes organizing information and handling the internationalization, depended on SWT listeners by using instance of a UI util to check weather it is SWT then adding the correct listener. This then caused a core dependency on SWT interface, SE 101 bad.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Second 2)&lt;/span&gt; Before OSGi people solved the problems it addresses in a custom manner, making it difficult to learn and build extensions for those models.&lt;br /&gt;&lt;br /&gt;Azureus uses its own plugin model to create and deploy plugins, for this it then creates its own class loader, its own life cycle handlers, update managers, version comparitors, a way of creating and inserting plugins, and a whole lot of code that replicates functionality.&lt;br /&gt;&lt;br /&gt;This model does not easily break down into OSGi modules which I thought it would.&lt;br /&gt;It is not an easy process taking legacy code and moving it to OSGi bundles.&lt;br /&gt;Dependencies on the plugin model is tight.&lt;br /&gt;&lt;br /&gt;A side project that I would like to see is a set of refactoring tools to break legacy java code into OSGi bundles. If they exist please contact me, anything that would help. One such project I tried was Barrio plugin for Eclipse, this is beta and did not work, for unknown reasons.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-2895927169681390700?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/2895927169681390700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/09/osgi-azureus-torrent-bundle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2895927169681390700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2895927169681390700'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/09/osgi-azureus-torrent-bundle.html' title='OSGi + Azureus Torrent Bundle'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-4625331227446736135</id><published>2009-08-12T21:15:00.000-07:00</published><updated>2009-08-12T21:18:26.969-07:00</updated><title type='text'>EMF EObject dynamic toString() method</title><content type='html'>&lt;pre class="brush: java"&gt;&lt;br /&gt; public static String toString(EObject eobject)&lt;br /&gt; {&lt;br /&gt;  StringBuffer sb = new StringBuffer();&lt;br /&gt;  EClass eClass = eobject.eClass();&lt;br /&gt;&lt;br /&gt;  for (int i = 0, size = eClass.getFeatureCount(); i &lt; size; ++i)&lt;br /&gt;  {&lt;br /&gt;   // Ignore derived features.&lt;br /&gt;   //&lt;br /&gt;   EStructuralFeature feature = eClass.getEStructuralFeature(i);&lt;br /&gt;   if (!feature.isDerived())&lt;br /&gt;   {&lt;br /&gt;    sb.append(feature.getName() + ": ");&lt;br /&gt;    Object obj = eobject.eGet(feature);&lt;br /&gt;    if(obj == null) {&lt;br /&gt;     sb.append("null"); &lt;br /&gt;    }&lt;br /&gt;    else if(obj instanceof EObject)&lt;br /&gt;    {&lt;br /&gt;     sb.append(toString((EObject)obj));&lt;br /&gt;    }&lt;br /&gt;    else if(obj instanceof List&lt;?&gt;)&lt;br /&gt;    {&lt;br /&gt;     List&lt;?&gt; list = (List&lt;?&gt;)obj;&lt;br /&gt;     for(Object object : list)&lt;br /&gt;     {&lt;br /&gt;      if(object instanceof EObject)&lt;br /&gt;      {&lt;br /&gt;       sb.append(toString((EObject)object));&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;       sb.append(object.toString());&lt;br /&gt;      }&lt;br /&gt;      sb.append(", ");&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     sb.append(obj.toString());&lt;br /&gt;    }&lt;br /&gt;    sb.append("; ");&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  return sb.toString();&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-4625331227446736135?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/4625331227446736135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/08/emf-eobject-dynamic-tostring-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4625331227446736135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4625331227446736135'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/08/emf-eobject-dynamic-tostring-method.html' title='EMF EObject dynamic toString() method'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-8835938224756206487</id><published>2009-07-28T14:40:00.001-07:00</published><updated>2009-07-28T15:34:44.763-07:00</updated><title type='text'>Laptop LCD + PS3 Eye Cam = Multitouch</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem&lt;/span&gt;: Want a multitouch for fun!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt; I started to build one a while back trying to use a wiimote for the camera. This seemed like a good idea as the wiimote does all its computation on the device, meaning that the computer would have more free CPU as it has to do no image processing. However the wiimote is far to insensitive for FTIR, it responds best to direct light from a IR source.&lt;br /&gt;This setback made me rethink the problem. For a few months.&lt;br /&gt;Some PhD students, from &lt;a href="http://www.flipmu.com/"&gt;FlipMu&lt;/a&gt; and studying at the music school in Victoria University (Wellington, New Zealand), came and gave a talk on their uses of multitouch surfaces creating musical instruments. These guys inspired me to finish the project, and I had a little money that was doing nothing so I started the project back up.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;: Build it!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Step 1)&lt;/span&gt; The first step is to get the necessary parts together.&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Camera:&lt;/span&gt; I am going to use the PS3 Eye Cam because it can do 120 frames per second, and that is impressive. I am using a 950nm filter that has been taxed from another project.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Display:&lt;/span&gt; I am using an old laptop that I ripped apart and  turned (which I had a lot of help with) the LCD display into a flat unit.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Touch: &lt;/span&gt;1cm thick Plexiglas that I bought as an off cut very cheap. This is backed by 2 layers of 3mm Plexiglas to hold the LCD in place.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Light:&lt;/span&gt; 8 950nm IR 1.5V at 100mA LED's.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Method:&lt;/span&gt; FTIR seems to be the only way for an LCD multitouch screen to work.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Unit:&lt;/span&gt; Initially I am building a testing rig, this way I can test different methods and find the optimum method and strategy before putting all the work into a proper case.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 2)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Unit:&lt;/span&gt;  Build experimental unit, cut grind and make Plexiglas layers. This step took significantly longer than it took you to read that sentence.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Step 3)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Electronics:&lt;/span&gt; Solder up LED's, extract laptop LCD and parts, remove IR filter from PS3 eye (the best instruction videos are &lt;a href="http://www.youtube.com/watch?v=7jJfuP7YgPA"&gt;here&lt;/a&gt;). This is another step that took longer than it seems.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 4)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Put Together:&lt;/span&gt; So put the unit together and experiment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 576px; height: 384px;" src="http://lh6.ggpht.com/_zihM7kQlHfs/Sm9iC7mrh4I/AAAAAAAAGSk/SHkalILMA34/s720/IMG_4000.JPG" alt="" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 576px; height: 384px;" src="http://lh6.ggpht.com/_zihM7kQlHfs/Sm9h1zcrtwI/AAAAAAAAGSc/msVeJJT1Ca8/s576/IMG_4007.JPG" alt="" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Experimentation)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Increase LED Count:&lt;/span&gt; Initial Experiments show that I need more LEDs. At high frame rates in the Eye Cam the exposure is not enough to see the blobs. So the first step is to increase the LED amount, I am thinking of increasing it to 30.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;LED Efficacy: &lt;/span&gt;Maximising the effect of the LEDs by placeing them inside the surface, correct angle, liberal use of reflective tape, all to hopefully greatly increasing the efficacy of the LEDs.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Complaint Surface:&lt;/span&gt; I have no surface over the Plexiglas for prtection or increasing the FTIR effect. I am going to experiment with different layers of silicone. I have read it is difficult to keep the surface see though with a coat of silicone.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Future) &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Programming:&lt;/span&gt; What I really want is a nice interface between a multitouch screen and the OS. I do not want a custom multitouch OS, because then the technology will always stay niche. I want an interface that can replace the keyboard and mouse while staying fully functional.&lt;br /&gt;The end goal of which is a full media center, probably XBMC, fully interactive with a multitouch display, for selecting movies and music.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Links:&lt;/span&gt; &lt;a href="http://cs.nyu.edu/%7Ejhan/ftirtouch/"&gt;Jeff Han&lt;/a&gt;: for Multitouch renasonce&lt;br /&gt;       &lt;a href="http://johnnylee.net/projects/wii/"&gt;Jonny Chung Lee&lt;/a&gt;: for Wiimote experiments&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-8835938224756206487?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/8835938224756206487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/07/laptop-lcd-ps3-eye-cam-multitouch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/8835938224756206487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/8835938224756206487'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/07/laptop-lcd-ps3-eye-cam-multitouch.html' title='Laptop LCD + PS3 Eye Cam = Multitouch'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_zihM7kQlHfs/Sm9iC7mrh4I/AAAAAAAAGSk/SHkalILMA34/s72-c/IMG_4000.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-3447510174826100869</id><published>2009-07-16T00:00:00.000-07:00</published><updated>2009-07-16T00:09:01.397-07:00</updated><title type='text'>EMF + Map = EMap</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; Using and EMF Model to model data, I need a way of retrieving objects quickly, via a key.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; Use an EMF Map.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 1)&lt;/span&gt; Create a Element Class, "Instance Type Name" set to "java.util.Map$Entry"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 2)&lt;/span&gt; In this class you need a Attributes or References called "key" and "value". Don't forget containment.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 3)&lt;/span&gt; Set this type as the reference, with UpperBound set to "-1".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 4)&lt;/span&gt; The keys "hashcode" and "equals" methods should be implemented. Neither the Key nor the Element class can be dynamic (annoying I know).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More (but not much) at &lt;a href="http://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF.3F"&gt;http://wiki.eclipse.org EMF/FAQ#How_do_I_create_a_Map_in_EMF.3F&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-3447510174826100869?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/3447510174826100869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/07/emf-map-emap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/3447510174826100869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/3447510174826100869'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/07/emf-map-emap.html' title='EMF + Map = EMap'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-7402281706625368949</id><published>2009-06-30T16:48:00.000-07:00</published><updated>2009-06-30T16:57:29.626-07:00</updated><title type='text'>Heap Dump, With OverFlow</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem: &lt;/span&gt;A Heap Stack Overflow caused by something unknown in the code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution: &lt;/span&gt;Dump the stack when it crashes and then analyze using a Memory Analyzer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1: &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Dump Stack with crash:&lt;/span&gt; Add "-XX:+HeapDumpOnOutOfMemoryError" this to the VM arguments in the Run Configuration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;(Note: the size of the stack can be adjusted with this "-Xmx300m" argument. Lowering the heap size to reduce the dump size can speed up analysis but may remove the actual cause of the problem.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2: &lt;/span&gt;Run program get dump in the projects' directory (you will have to refresh to see it in Eclipse).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3:&lt;/span&gt; Install Analyzer plugin site &lt;a href="http://www.eclipse.org/mat/"&gt;http://www.eclipse.org/mat/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4: &lt;/span&gt;Double click heap dump, should analyze and present information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-7402281706625368949?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/7402281706625368949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/heap-dump-with-overflow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7402281706625368949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7402281706625368949'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/heap-dump-with-overflow.html' title='Heap Dump, With OverFlow'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-1019177798101133122</id><published>2009-06-22T16:50:00.000-07:00</published><updated>2009-06-30T16:48:01.632-07:00</updated><title type='text'>Setting up a JUnit Benchmark</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; I want a way of testing multiple algorithms, with the same repeatable tests, and generate a report from the outcomes, to then generate conclusions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; JUnit 4 Benchmark with Parametrized Tests, and a Report Writer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Precondition:&lt;/span&gt; Must have the same interface to each algorithm, treating each test class as the same may require as large adapter class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1&lt;/span&gt;: Write the base classes:&lt;br /&gt;    &lt;span style="font-weight: bold;"&gt;Step 1.1:&lt;/span&gt; First we must create our own Parameterized Test Runner, as the default one from JUnit defines the name of the test as a the paramter number, which does not mean much. It is far more readable if the test name where specified by the users. So copy the contents of the org.junit.runners.Parameterized class into a CustomParameterizedTestRunner (Note: you can use the JUnit inner parametrized annotation class that to define your own). Then change the getName method in the inner TestClassRunnerForParameters class to look like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt; @Override&lt;br /&gt; protected String getName() {&lt;br /&gt;  return fParameterList.get(fParameterSetNumber)[0].getClass().getSimpleName();&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight: bold;"&gt;Step 1.2:&lt;/span&gt; Write the base Test Class: This class should be extended by all your tests, it defines what classes to run, it inserts the class through the constructer.&lt;br /&gt;First create a JUnit Test, @RunWith annotation should be towards your customized test runner just created. Add a public static method that returns a Collection (a 2D array) and annotate with @Parameters, Then create a constructer that takes the parameters defined in. The class should look like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt;@RunWith(CustomParameterizedTestRunner.class)&lt;br /&gt;public abstract class AbstractAlgorithmTest{&lt;br /&gt;&lt;br /&gt;@Parameters&lt;br /&gt;public static Collection data()&lt;br /&gt;{&lt;br /&gt; Object[][] data = new Object[][] {{ new Algorithm1()}, { new Algorithm2() },{new Algorithm3()}};&lt;br /&gt; return Arrays.asList(data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public AbstractAlgorithmTest(Algorithm a)&lt;br /&gt;{&lt;br /&gt; this.algorithm = a;&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2:&lt;/span&gt; Write the tests that extend the base class. Include static attributes to be accessed by the reporter for results analysis.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3:&lt;/span&gt; Write the reporter class, it should have a static main method. It should create a JUnitCore instance, add a RunListener and then call the run method on the classes that should be tested.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;&lt;br /&gt; public static void main(String[] args)&lt;br /&gt;{&lt;br /&gt; JUnitCore juc = new JUnitCore();&lt;br /&gt; juc.addListener(new RunListener(){&lt;br /&gt;  public void testFinished(Description description) throws Exception {&lt;br /&gt;   System.out.println(AbstractAlgorithmTest.attribute1);&lt;br /&gt;   System.out.println(AbstractAlgorithmTest.information);&lt;br /&gt;  &lt;br /&gt;  }&lt;br /&gt; });&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; juc.run(new Class[] {&lt;br /&gt;   AlgorithmTest1.class,&lt;br /&gt;   AlgorithmTest2.class,&lt;br /&gt;  });&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-1019177798101133122?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/1019177798101133122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/setting-up-junit-benchmark.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1019177798101133122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1019177798101133122'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/setting-up-junit-benchmark.html' title='Setting up a JUnit Benchmark'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-7570119921035797850</id><published>2009-06-14T16:01:00.000-07:00</published><updated>2009-06-14T16:13:27.672-07:00</updated><title type='text'>Scala/Java Mixed Bundle</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; Creating an OSGi Bundle with both Scala and Java code inside the Eclipse Framework.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Result:&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Currently too difficult to bother.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Issue:&lt;/span&gt; &lt;span style="font-style: italic;"&gt;Classpath and Builder&lt;/span&gt; : After editing the .project file like said in both  &lt;a href="http://wiki.eclipse.org/Scala_Bundle"&gt;this&lt;/a&gt; and &lt;a href="http://www.scala-lang.org/node/94"&gt;this&lt;/a&gt; articles, the main issue is that the building of the code into a single bin folder, seems to have some issues. If you have a package nz.maori.geek, like me, and you have the Scala class in nz.maori.geek, references in Scala to nz.maori.geek say that classes in this package are not found.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Solution: &lt;/span&gt;More time mucking round, or research into the problem, which I dont have as this is a spike.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Workaround:&lt;/span&gt; in the two articles discussed above give a good guide into creating a Scala bundle, this is not mixed, but at least there is decent support for it, I have not come across any major problems yet. From the Scala bundle just expose some code that implements a Java interface (because the Java editor still doesnt like Scala methods), as a exported package and use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-7570119921035797850?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/7570119921035797850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/scalajava-mixed-bundle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7570119921035797850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7570119921035797850'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/scalajava-mixed-bundle.html' title='Scala/Java Mixed Bundle'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-2727988238037776785</id><published>2009-06-03T18:58:00.000-07:00</published><updated>2009-06-06T19:02:04.298-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><title type='text'>Building and Running Eclipse P2</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; Building and Running the Head of Eclipse P2, with SAT4J.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PreConditions:&lt;/span&gt; Have Subclipse and Maven plugins installed and setup as described in &lt;a style="font-weight: bold;" href="http://maorigeek.blogspot.com/2009/06/building-and-running-apache-felix-in.html"&gt;this blog entry&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 1) Setup Network:&lt;/span&gt; Using pserver on some networks (for some reason) does not require going through the proxy. If this is so add the P2 &lt;a style="font-weight: bold;" href="http://www.blogger.com/dev.eclipse.org"&gt;CVS Server&lt;/a&gt; to the "Windows--&gt;Preferences--&gt;General--&gt;Network Connections--&gt;No Proxy" list.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 2) Get Eclipse: &lt;/span&gt;Get the most recent stable build of &lt;a style="font-weight: bold;" href="http://download.eclipse.org/eclipse/downloads/"&gt;Eclipse&lt;/a&gt; and use this as the Development Environment.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 3) CVS Checkout: &lt;/span&gt;Add CVS repository ":pserver:anonymous@dev.eclipse.org:/cvsroot/rt"&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Step 3.1) &lt;/span&gt;Checkout "HEAD --&gt; org.eclipse.equinox --&gt; p2 --&gt; org.eclipse.equinox.p2.releng"&lt;br /&gt;   &lt;span style="font-style: italic;"&gt;Step 3.2) &lt;/span&gt;Select org.eclipse.equinox.p2.releng project and "Right-Click --&gt;Import Project Set"&lt;br /&gt;&lt;br /&gt;(Note: Select the quoted text, open the &lt;b&gt;CVS Repositories&lt;/b&gt; view, and select &lt;b&gt;Paste Connection&lt;/b&gt; or hit Ctrl+V to add the connection)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 4)&lt;/span&gt; Get SAT4J: Add the &lt;a href="svn://svn.forge.objectweb.org/svnroot/sat4j"&gt;&lt;span style="font-weight: bold;"&gt;SAT4J&lt;/span&gt;&lt;/a&gt; and &lt;a style="font-weight: bold;" href="http://svn.apache.org/repos/asf"&gt;Apache &lt;/a&gt;SVN repositories.&lt;br /&gt;Check out the "SAT4J--&gt;maven--&gt;trunk" project as a maven project.&lt;br /&gt;Check out the Apache "commons--&gt;proper--&gt;beanutils &amp;amp;&amp;amp; cli --&gt; trunk"&lt;br /&gt;(&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; Dont forget to Update Project Configuration)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 5)&lt;/span&gt; Validate Tests: Run some tests over P2 with "Run-As Junit Plugin Test". Go to the test "Run Configuration--&gt;Main--&gt;Run an Application--&gt;[No Application] - Headless Mode", if this is not set some tests will fail or freeze.&lt;br /&gt;Also to speed things up restrict the test environment by deselecting all the unessesary plugins in "Run Configuration--&gt;Plugins".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Useful Links &lt;/span&gt;(where I plagiarized most of this from)&lt;span style="font-weight: bold;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wiki.eclipse.org/Equinox_p2_Getting_Started_for_Developers"&gt;http://wiki.eclipse.org/Equinox_p2_Getting_Started_for_Developers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.eclipse.org/Equinox_p2_tests"&gt;http://wiki.eclipse.org/Equinox_p2_tests&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-2727988238037776785?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/2727988238037776785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/building-and-running-eclipse-p2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2727988238037776785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2727988238037776785'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/building-and-running-eclipse-p2.html' title='Building and Running Eclipse P2'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-5910406309639323178</id><published>2009-06-02T23:22:00.000-07:00</published><updated>2009-09-02T18:37:33.270-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><title type='text'>Building and Running Apache Felix in Eclipse</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem: &lt;/span&gt;Getting Apache Felix into Eclipse for Development and Testing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 1) Intaling the Plugins into Eclipse:&lt;br /&gt;&lt;/span&gt;The Plugins we will need for this are (Links are to the plugin site)&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://subclipse.tigris.org/update_1.6.x"&gt;Subclipse&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://m2eclipse.sonatype.or&lt;br /&gt;g/update/"&gt;Maven&lt;/a&gt; (note make sure to install SCM for SVN)&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-style: italic;"&gt;Step 2) Setup Maven:&lt;/span&gt;&lt;br /&gt;First you need to change Eclipse default run time to the JDK. This is done in  "Windows--&gt;Preferences--&gt;Installed JRE's". Add the file path to your JDK and untick the default JRE, this will force all things to run in the JDK.&lt;br /&gt;&lt;br /&gt;Also is may be necessary (it has not been determined to be, but is reccommended) to run in Eclipse itself in the JDK, so alter the eclipse.ini file found in the Eclipse.exe folder to include the arguments with a link to the jdk virtual machine i.e.&lt;br /&gt;"-vm&lt;br /&gt;C:\Program Files\Java\jdk1.6.0_13\bin\javaw.exe"&lt;br /&gt;(&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; The end line character is not a typo, it is a must)&lt;br /&gt;&lt;br /&gt;Next you need to setup the Proxy for Maven to download through this is done by editing (or creating) the ~/.m2/settings.xml file to include the proxy information&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xsi="http://www.w3.org/2001/XMLSchema-instance" schemalocation="http://maven.apache.org/SETTINGS/1.0.0; http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;&lt;br /&gt;&lt;proxies&gt;&lt;br /&gt;&lt;proxy&gt;&lt;br /&gt;&lt;id&gt;myproxy&lt;/id&gt;&lt;br /&gt;&lt;active&gt;true&lt;/active&gt;&lt;br /&gt;&lt;protocol&gt;http&lt;/protocol&gt;&lt;br /&gt;&lt;host&gt;tur-cache.massey.ac.nz&lt;/host&gt;&lt;br /&gt;&lt;port&gt;8080&lt;/port&gt;&lt;br /&gt;&lt;username&gt;User&lt;/username&gt;&lt;br /&gt;&lt;password&gt;1111&lt;/password&gt;&lt;br /&gt;&lt;/proxy&gt;&lt;br /&gt;&lt;/proxies&gt;&lt;br /&gt;&lt;/settings&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 3) Setup Subclipse: &lt;/span&gt;&lt;br /&gt;Setting up the Subversion Proxy in ~/Application Data/Subversion/servers file. It is pretty straight forward, just do all the editing under the "[global]" tag.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 4) Get Felix:&lt;/span&gt;&lt;br /&gt;Adding the &lt;a href="http://svn.apache.org/repos/asf/felix"&gt;Felix SVN repository&lt;/a&gt; (&lt;-----) to your subclipse.  Right click Felix--&gt;trunk, and select checkout as Maven Project.&lt;br /&gt;&lt;br /&gt;(Note: This will build all the projects (a lot of them) and add them to your workspace. Go get a coffee, this is going to take a while!)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;     Step 4.1) &lt;/span&gt;Once the projects have been downloaded to setup the sources folders "Right-Click--&gt;Maven--&gt;Update Project Configuration"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 5) Check it is Working: &lt;/span&gt;To check that you have a working copy of Felix, open up a few of the Maven Projects created and right click --&gt; Run As --&gt; Maven :: Test. This will run their test suits and hopefully you will get the all green passes from JUnit that I like to see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-5910406309639323178?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/5910406309639323178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/building-and-running-apache-felix-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/5910406309639323178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/5910406309639323178'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/building-and-running-apache-felix-in.html' title='Building and Running Apache Felix in Eclipse'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-4453342375158587382</id><published>2009-06-02T22:26:00.001-07:00</published><updated>2009-06-02T22:39:21.044-07:00</updated><title type='text'>Google Gadget Customization Exercise</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem: &lt;/span&gt;Gadget had a border I didn't like and I wanted to remove it to use on my blog.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 1)&lt;/span&gt; Find the code: The source code, a basic XML file, is located in the html source of the "Configure Gadget" in a hidden input tag called "gadgetUrl". Go to this link, and copy the source.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 2) &lt;/span&gt;Replicate Functionality: Go to the &lt;a href="http://code.google.com/apis/gadgets/docs/tools.html#GGE"&gt;Google Gadgets Editor&lt;/a&gt; and paste the copied source, save, and at the top left there is a link to the XML file you just created.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note)&lt;/span&gt; The Google Gadgets Editor allows the editing and upload an publication of an XML files. This would be a great place to upload loads of small RDF descriptions for publication.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Step 3)&lt;/span&gt; Edit and Test: open up "Add a Gadget" in blogger layout, and select "Add your own", in the text field add the URL to the recently created document. As you change it click update, and it will update the gadget for you!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-4453342375158587382?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/4453342375158587382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/google-gadget-customization-exercise.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4453342375158587382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/4453342375158587382'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/google-gadget-customization-exercise.html' title='Google Gadget Customization Exercise'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-707104833526002441</id><published>2009-06-02T20:00:00.000-07:00</published><updated>2009-06-02T22:39:44.957-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><title type='text'>Proxy Problem with Eclipse 3.5 RC2</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt; Eclipse 3.5 RC2 was intermittently throwing errors at different times when trying to access the outside world (SVN, CVS and update sites).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tried (Unsuccessfully):&lt;/span&gt; Setting the proxy in different places, "netstat 100 -b" shows network connections listing the programs that created them. This showed that Eclipse was using the proxy but it was not working.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; The Socks Proxy takes authority over the HTTP proxy, so that if it is set it uses this one. Unsetting the Socks Proxy solved all of the problems except CVS connection.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem 2:&lt;/span&gt; CVS not connecting when everything else does.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; The CVS protocol pserver which I was using to access Eclipse P2 Source, is not needed to be proxied on my network. This means that adding it to the proxy ignored sites let me access it over CVS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-707104833526002441?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/707104833526002441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/06/proxy-problem-with-eclipse-35-rc2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/707104833526002441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/707104833526002441'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/06/proxy-problem-with-eclipse-35-rc2.html' title='Proxy Problem with Eclipse 3.5 RC2'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-813582507085198569</id><published>2009-05-28T01:47:00.000-07:00</published><updated>2009-05-28T03:32:07.339-07:00</updated><title type='text'>Why did noone tell me about HashSets Before</title><content type='html'>So I have some massive calculations to do while looking into Component Repositories. I am trying tor  work out the total amount of possible solutions that a OSGi Bundle can have in a repository, currently testing OSGi Bundle Repository. The maximum number of solutions a query could have is the numbeof depended on bundles (D(b)) (2^D(b))-1. This is pretty big, if you have 10 you could have 1023 combinations installed in OSGI, and this is a small number, when it gets into the hundred I worry.&lt;br /&gt;&lt;br /&gt;So I have to query over a large space. I was using linkedLists and ArrayLists till I discovered the HashSet. Unbelievable the LinkedList's removeAll function is O(n^2) why is this, because for every item, it must check contains, and it checks contains by going through each element, this is O(n) so O(n) * n ... HashSet is O(1), it is a lockup. &lt;br /&gt;&lt;br /&gt;It changed my running time on small sets from 30 seconds to 3. I love HashSets&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-813582507085198569?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/813582507085198569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/05/why-did-noone-tell-me-about-hashsets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/813582507085198569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/813582507085198569'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/05/why-did-noone-tell-me-about-hashsets.html' title='Why did noone tell me about HashSets Before'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-7305594050994240379</id><published>2009-05-27T17:29:00.000-07:00</published><updated>2009-05-27T18:17:11.673-07:00</updated><title type='text'>OSGi Package Classpath Problem</title><content type='html'>So after looking into KnopflerFish OSGi packages on the OSGi Bundle Repository I realized something strange. Bundles import a package they export! I.E.&lt;br /&gt;&lt;br /&gt;Bundle-SymbolicName: org.knopflerfish.bundle.console&lt;br /&gt;Import-Package: org.knopflerfish.service.console,org.osgi.framework,org.osgi.service.log&lt;br /&gt;Export-Package: org.knopflerfish.service.console;uses:=org.osgi.framework;specification version=1.0.0&lt;br /&gt;&lt;br /&gt;I wondered if this was superfluous, but apparently it is not. Stupid me! I thought that the first place on the classpath would be packages in the bundle, but it is the resolved imported packages.&lt;br /&gt;&lt;br /&gt;To test this out I created two simple bundles, A and B, each exported a package "nz" and impor&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_zihM7kQlHfs/Sh3lWvDeU_I/AAAAAAAAGD8/GpZUokC-qEI/s1600-h/test.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 56px; height: 237px;" src="http://4.bp.blogspot.com/_zihM7kQlHfs/Sh3lWvDeU_I/AAAAAAAAGD8/GpZUokC-qEI/s320/test.png" alt="" id="BLOGGER_PHOTO_ID_5340676911882195954" border="0" /&gt;&lt;/a&gt;ted it as well, this package had a class A that in its constructor sysouted different lines. Both had activators that simply created A();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Each time it was run both activators wrote the same message on the console, until you explicitly stated versions and version ranges to exclude each others package. Without the version range the package selected is always the greater version.&lt;br /&gt;&lt;br /&gt;What this means is that I need to read more of the OSGi Sevice Platform Spec to get a better understanding of resolving issues.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-7305594050994240379?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/7305594050994240379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/05/osgi-package-classpath-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7305594050994240379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/7305594050994240379'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/05/osgi-package-classpath-problem.html' title='OSGi Package Classpath Problem'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_zihM7kQlHfs/Sh3lWvDeU_I/AAAAAAAAGD8/GpZUokC-qEI/s72-c/test.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-1617437087090528300</id><published>2009-05-26T14:42:00.001-07:00</published><updated>2009-05-26T14:53:40.958-07:00</updated><title type='text'>Reasons for Going back from Ubuntu</title><content type='html'>I installed Ubuntu 8 months ago, since this I have loved and hated it.&lt;br /&gt;Here is a list of reasons why I am going back to Vista, in an attempt to let Ubuntu developers in on my perspective.&lt;br /&gt;&lt;br /&gt;I was running Ubuntu on my Laptop, it has an &lt;span style="font-weight: bold;"&gt;Intel Graphics chipset&lt;/span&gt;, this means that I cannot run compiz when running an external monitor as well, which I always do. I cannot use any programs that depend on compiz to run, so it makes my desktop ugly, annoying and slow.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Unstable wifi connection&lt;/span&gt;, dont know why but when using vista it doesnt constinaly drop my connection to my university network. I attpempted to fix the problem and got no where.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;A large part of my day is dedicated to procrastonation, and a &lt;span style="font-weight: bold;"&gt;Slow Firefox&lt;/span&gt; is incredibly painful, each time I get on a windows machine and use firefox, it pisses me off that it seems so much faster!&lt;br /&gt;&lt;br /&gt;What I liked are basically all the nice programming stuff, like bash, python libs, Graphviz, apt-get, not having to restart for updates, and loads of other really nice things.&lt;br /&gt;&lt;br /&gt;So instead of losing these, I am Virtualizing my Ubuntu using VMWare under windows.&lt;br /&gt;&lt;br /&gt;I will writeup later about how this goes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-1617437087090528300?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/1617437087090528300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/05/reasons-for-going-back-from-ubuntu.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1617437087090528300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/1617437087090528300'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/05/reasons-for-going-back-from-ubuntu.html' title='Reasons for Going back from Ubuntu'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2706097008076931316.post-2356634638190516414</id><published>2009-05-21T20:34:00.000-07:00</published><updated>2009-05-21T20:45:55.574-07:00</updated><title type='text'>EMF Contains Problems</title><content type='html'>I had this problem where I would add an object to a EObject, and then later in the code it would not be there. This became a large puzzle to me, I am not an expert in EMF, but after much trial and error, I have found the problem.&lt;br /&gt;&lt;br /&gt;Containment!! This is a greatly annoying problem. EMF is smart, it sets an owner for an object. If you add it to a EList where .isContainment() returns true, it will remove its self from its previous container and put it in the new one. This is also how the serialization works out if an object is not contained anywhere.&lt;br /&gt;&lt;br /&gt;My solution to this, was pretty hacky, though turning out to be extremely useful. I set up a tree of clone() methods where it would clone an object down to its primary information. This is a little expencive, but it is sometimes necessary. For instance I have an object that is a container, I want to generate another container from that with a slightly different state, this is where the clone method is necessary.&lt;br /&gt;&lt;br /&gt;The implications from this are that the standard containment list, EObjectContainmentEList, doenst use .equals() when checking for containment, so I had to override this, it is easy, but a bit of a hack. It requires some duplicate code to a super super class, because of some optimazation code in the super class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2706097008076931316-2356634638190516414?l=maorigeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maorigeek.blogspot.com/feeds/2356634638190516414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maorigeek.blogspot.com/2009/05/emf-contains-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2356634638190516414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2706097008076931316/posts/default/2356634638190516414'/><link rel='alternate' type='text/html' href='http://maorigeek.blogspot.com/2009/05/emf-contains-problems.html' title='EMF Contains Problems'/><author><name>Graham Jenson</name><uri>http://www.blogger.com/profile/01428697663179525631</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://lh3.ggpht.com/_zihM7kQlHfs/Sg6x9Co02HI/AAAAAAAAGAU/8q0uSTGtg1g/3374009317_69428b64ee_o.jpg'/></author><thr:total>0</thr:total></entry></feed>
