<?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-3876597699154512435</id><updated>2012-02-09T22:24:06.488+11:00</updated><category term='joint reaction force'/><category term='angle'/><category term='bundler'/><category term='list'/><category term='swing'/><category term='village'/><category term='sfm'/><category term='insight3d'/><category term='ticket'/><category term='os x'/><category term='pitcher plant'/><category term='penan'/><category term='creative commons'/><category term='open source'/><category term='javaposse'/><category term='speculation'/><category term='iphone'/><category term='leech'/><category term='rosette'/><category term='push'/><category term='photogrammetry'/><category term='cmvs'/><category term='soma'/><category term='journal'/><category term='door-to-door'/><category term='PhD'/><category term='equine distal forelimb'/><category term='linear'/><category term='brushed metal'/><category term='utility'/><category term='javafx'/><category term='connex'/><category term='horse'/><category term='malaysia'/><category term='scala'/><category term='iban'/><category term='semenggoh'/><category term='java'/><category term='orang utan'/><category term='activity monitor'/><category term='Mohr'/><category term='culture'/><category term='longhouse'/><category term='borneo'/><category term='toolbar'/><category term='principal strain'/><category term='strain'/><category term='chart'/><category term='orang ulu'/><category term='company'/><category term='melanau'/><category term='fit'/><category term='libmv'/><category term='matrix'/><category term='sarawak'/><category term='core location'/><category term='meshlab'/><category term='james brooke'/><category term='accelerometer'/><category term='pmvs'/><category term='mtu'/><category term='publication'/><category term='fail'/><category term='multiply'/><category term='bidayuh'/><category term='fitness'/><category term='pedometer'/><category term='wildlife'/><title type='text'>Jonathan Merritt's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-3357825459911059226</id><published>2012-01-31T14:08:00.020+11:00</published><updated>2012-01-31T14:44:33.052+11:00</updated><title type='text'>Observations, Hypotheses and Models: The importance (and lack of) model-based approaches in biology and the life sciences.</title><content type='html'>&lt;div&gt;&lt;span&gt;Recently, I've been thinking about how I view scientific literature and the process of doing science.  I have a particular view, but I have no idea whether my view is right or wrong, or if it matches the consensus.  Nobody really talks about these things, so I thought I'd blog about my ideas to see if there are (any) reactions.  I'd like to hear from my fellow scientists, especially from anyone who strongly disagrees with me.  I've written in terms of my own experiences, since they are my main point of reference, but hopefully people from other fields will understand me.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Broadly, I tend to think of scientific literature belonging in three, somewhat overlapping groups:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;Observational studies ("hypothesis-free" science)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Hypothesis-based studies&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Model-based studies&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;Observational studies don't tend to have strong hypotheses.  They are characterised by questions like: "Does X happen?", or "How much does X happen?"  Epidemiological studies fall into this category.  Hypothesis-based studies then tend to be looking for links between variables, but without strongly addressing a mechanism.  They ask questions like: "Does Y influence X?"  Finally, there are model-based studies, which wonder: "&lt;i&gt;How&lt;/i&gt; does Y influence X?"  Model-based studies posit a definite, formal mechanism, which then yields a relationship between variables or events that matches reality in some way.  I should add that many (most?) hypothesis-based studies do involve a mechanism that the authors have in mind.  However, the mechanism isn't formalised: it is a kind of background idea, which ends up in the Introduction and Discussion sections of published literature, rather than being part of the Methods or Results.  Also, when I write "model" here, the word could probably just as well be replaced by "theory".  I use "model" only because I have in mind some kind of formal description; a mathematical relationship or well-defined procedure, and not a hand-wavy explanation without a formal framework.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;a href="http://3.bp.blogspot.com/-iPuO-Gi5Qo0/Tydcxz2243I/AAAAAAAAAE0/8rirqDu9bGE/s1600/ob-hy-mo.png"&gt;&lt;img src="http://3.bp.blogspot.com/-iPuO-Gi5Qo0/Tydcxz2243I/AAAAAAAAAE0/8rirqDu9bGE/s400/ob-hy-mo.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5703629463891665778" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 500px; height: 118px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now it's time for an example.  Hang on to your seats, because this is quite involved.  I'll look at the sclerotic changes which occur in the equine carpal bones during fast exercise.  When horses undergo fast exercise training, the dorsal parts of their carpal bones increase in density much more than the palmar parts (Firth &lt;i&gt;et al.&lt;/i&gt; 2000, Firth and Rogers 2005).  Because bone typically responds to mechanical stimulus by increasing in density, this suggests that the dorsal parts experience higher stresses.  Indeed, under one type of simulated loading, the third carpal bone did experience higher contact pressures on the dorsal articular surfaces than the palmar ones (Palmer &lt;i&gt;et al.&lt;/i&gt; 1994).  It seems that there may be a pattern of higher dorsal stresses in these bones, which has been seen in both a simulated loading study and in the response of the bones themselves to exercise.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/-CQ6GSe3rjAU/TyddZJbje_I/AAAAAAAAAFA/A-F-53W0c70/s1600/carpus-dorsal.png"&gt;&lt;img src="http://1.bp.blogspot.com/-CQ6GSe3rjAU/TyddZJbje_I/AAAAAAAAAFA/A-F-53W0c70/s400/carpus-dorsal.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5703630139697626098" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 283px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If we run with this premise, then the next obvious question is: "&lt;i&gt;How&lt;/i&gt; does this higher dorsal load occur?"  Notice that this is framed as a model-type question: we're not asking whether it occurs, but by what possible mechanism.  If the carpus were loaded only in compression, as we might conclude from various equine limb models, then it would make sense that a fairly uniform load would exist across the bones within the carpus, modulated only by their anatomical details.  Instead, we see an apparent dorsal concentration of stress, which doesn't seem to be anatomically modulated: it's not as though we can explain this readily from the anatomy alone!   So, I proposed a mechanism for this effect: that the carpus as a unit supports not only compression, but also a type of loading called a "bending moment", which causes increased dorsal compression.  This is now a model: a mechanism by which we might have increased dorsal compression.  The model is based in something called beam theory, with straightforward connections to the overall mechanics of locomotion.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/-8igCFuN5J8A/Tydd-tHN8iI/AAAAAAAAAFM/a3HquFaO9b4/s1600/mc3-loading.png"&gt;&lt;img src="http://1.bp.blogspot.com/-8igCFuN5J8A/Tydd-tHN8iI/AAAAAAAAAFM/a3HquFaO9b4/s400/mc3-loading.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5703630784931164706" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 372px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;We now reach the main problem with any model-based study: validation.  There's a brilliant quote from physicist Richard Feynman from his Lectures in Physics:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;"There is also a more subtle problem. When you have put a lot of ideas together to make an elaborate theory, you want to make sure, when explaining what it fits, that those things it fits are not just the things that gave you the idea for the theory; but that the finished theory makes something else come out right, in addition."&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;In the case of my bending moment model, it fits the observations of bone loading and bone changes, but of course, those are the things which gave me the idea in the first place.  So what else can "come out right?"  Well, this is where we hit pay dirt with a formal model rather than an isolated hypothesis.  Mechanically, if the carpus is supporting a bending moment, then this load must also be transferred to (or "supported by") the metacarpus.  If this is happening, then the metacarpus must also have a particular pattern of loading, called a cantilever, which I could look for.  And that's precisely what I did: I went and looked at the bone changes which occur during Thoroughbred race training and found exactly the changes I would expect from a cantilever loading of the metacarpus (Merritt and Davies, 2010).  There are also other types of validation that are in-press at the moment, so I can't discuss them, but they follow a similar approach: using the formal nature of the model to make solid, required predictions which can then be tested.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Now; back to the broader discussion.  I think that model-based science is the way to go, because I think it provides the most insight.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;The first benefit of a model is that it often provides other predictions, which can then be tested in their own right (like the metacarpal loading described above).  This is superior to a stand-alone hypothesis, which can only be tested on larger and larger groups, and cannot be extended formally.  Of course, we can informally link hypotheses, via verbal reasoning or simple logic, and this is very common in biology.  However, such informal reasoning is limited by its scope to outcomes that are more straightforward than those which might arise from a more structured model.  For example, without a mechanical model that I could draw and discuss on paper, I don't think that the link between carpal and metacarpal loading is very obvious at all.  Certainly, you couldn't make numerical predictions about it or know the pattern of metacarpal bone changes that would confirm the model.  Importantly, model predictions can also be invalidated by experiment.  I would have had a good reason to doubt the model if its predictions were not seen in reality.  However, this kind of invalidation is less likely to occur with informally-linked hypotheses, where the invalidation of one may not be linked in a formal way to the invalidation of another.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;A second key benefit of a model is that, knowing the mechanism, we can intervene more intelligently.  For example, if we want to decrease dorsal carpal loading, we have only to decrease the magnitude of the bending moment.  We can easily predict methods for achieving that outcome (based - you guessed it - on other musculoskeletal models), which could then be tested.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;You may already have realised that what I'm describing here is broadly the way that the discipline of Physics works.  In Physics, there are people who specialise in experimental work, and people who specialise in theoretical work.  They both depend upon each other.  Without good solid theories to invalidate, the experimentalists would be stuck in the more observational end of the spectrum, unable to link their observations into a wider world view.  Without experimentalists, the theorists could invent anything they wanted.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;In biology and life sciences, however, it seems that we are dominated by the experimentalists.  Few people concentrate on formal theories.  Those that do tend to be "computer modelers" or "computational biologists", and seem largely to be shunned by the mainstream.  I can think of three major reasons for this, in my area at least:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;If you're working on theory, you'll publish less.  This is because you're doing twice the work: you need to develop both the formal framework of a theory and confirm it by experiment.  By contrast, if you're instead working from hypothesis to hypothesis, you don't need to develop your theories formally: you can focus primarily on experiments and publish more.  The life sciences publish at a frenetic rate, so anything that leads to slower publication is "full of fail", particularly in the case of an early-career researcher, even if it leads to greater insight.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;People in life sciences are not encouraged to develop skills that will help with formal models. In physics, for example, the skills for developing formal models are considered critical.  Most physicists have a solid undergraduate background in math and computation, simply because they couldn't proceed to graduate level without them.  What is it, then, that makes this so critical for physics but not for biology?  What possible reason could there be?  In reality, biological systems are, if anything, more complicated than most systems which are currently widely-studied in physics, so you would think that superior analytical skills would be essential.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Life-sciences literature does not currently provide many venues for theoretical development that will be read by experimentalists.  For example, if you read my paper on cantilever bending in the metacarpus (Merritt and Davies, 2010), you'll be doing extremely well if you realize that it has &lt;i&gt;anything whatsoever&lt;/i&gt; to do with the carpus!  The paper is full of the descriptions of assumptions and models used, forever qualifying itself at deeper and deeper levels, so that its main statement is justified.  There's nowhere I know of in which I could publish a purely theoretical paper which links all of this together (in the equine biomechanics field at least).  Consequently, theoretical developments in life-sciences literature are poorly described, and are often not apparent to people working in experimental areas.  This, in turn, means that the experimentalists cannot perform their main function, which is to design experiments to invalidate and reject the theoretical models.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;This is the point that I have reached in my ponderings.  I could continue to rant, but I think I'll stop here to see if anyone has any comments. :-)  I'll close by saying that I don't think I'm alone in my desire for more solid theory behind biology and the life sciences.  Places such as the &lt;a href="http://www.broadinstitute.org/"&gt;Broad Institute of MIT and Harvard&lt;/a&gt; and the &lt;a href="http://www.abi.auckland.ac.nz/uoa/"&gt;Auckland Bioengineering Institute&lt;/a&gt; are solidly based on the concept.  However, in my particular field (equine biomechanics), I don't know of a group who have taken this approach, and I don't see it happening.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div&gt;&lt;span&gt;Firth EC, Rogers CW and Jopson N (2000) Effects of racetrack exercise on third metacarpal and carpal bone of New Zealand Thoroughbred horses.  Journal of Musculoskeletal and Neuronal Interactions, 1(2):145-147.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Firth EC and Rogers CW (2005) Musculoskeletal response of 2-year-old Thoroughbred horses to early training. 7. Bone and articular cartilage response in the carpus.  New Zealand Veterinary Journal, 53(2):113-122.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Merritt JS and Davies HMS (2010) Metacarpal geometry changes during Thoroughbred race training are compatible with sagittal-plane cantilever bending.  Equine Veterinary Journal, Supplement 38:407-411.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Palmer JL, Bertone AL and Litsky AS (1994) Contact area and pressure distribution changes of the equine third carpal bone during loading.  Equine Veterinary Journal, 26(3):197-202.&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-3357825459911059226?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/3357825459911059226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=3357825459911059226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3357825459911059226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3357825459911059226'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2012/01/observations-hypotheses-and-models.html' title='Observations, Hypotheses and Models: The importance (and lack of) model-based approaches in biology and the life sciences.'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/04902380006444091507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-iPuO-Gi5Qo0/Tydcxz2243I/AAAAAAAAAE0/8rirqDu9bGE/s72-c/ob-hy-mo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-2046284021155491092</id><published>2011-12-23T12:42:00.000+11:00</published><updated>2011-12-23T12:53:39.747+11:00</updated><title type='text'>Universities: Research or Development?</title><content type='html'>&lt;span style="font-size: large;"&gt;Worrying Success...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're an Australian tax payer, you might be wondering how your hard-earned tax dollars are being spent in Australia's universities. As a post-graduate researcher, I wonder the same thing. I don't have any hard figures, but I do have a story behind one of my own projects which increasingly concerns me.&lt;br /&gt;&lt;br /&gt;I'm part of a group who are developing a sensor for use on horses. I won't tell you what the sensor is, because it's rather IP-encumbered, and I don't want to be accused of giving anything away (that's a big red flag, right there: you see me waving it?). As an “early career researcher”, this particular project has been a gold mine for grants. We currently have about $45,000 in direct funding---about half from the University of Melbourne, half from another Commonwealth Government agency---and about $150,000 from “in-kind” contributions. I wrote the grant applications myself, and not a single one was rejected.&lt;br /&gt;&lt;br /&gt;So, why does this success worry me? Well, because we're not doing any actual &lt;i&gt;science&lt;/i&gt;. What we're doing is &lt;i&gt;development&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;I'd better define those two uncertain terms before going any further. For the scope of this blog post, I'm defining “development” as “engineering”: the safe, pragmatic application of known scientific principles to solve a given problem. I'm definining “science” and “research” interchangably as: the generation and testing of falsifiable hypotheses, many of which may be wrong, but which will increase the body of human knowledge. In the case of this sensor project, we don't really have a hypothesis. Our hypothesis is that “the device will work as expected”, which will be upheld if we produce a “&lt;i&gt;successful&lt;/i&gt; development” as opposed to an unsuccessful one. (Trust me: it's going to be successful, it's a really safe bet.)&lt;br /&gt;&lt;br /&gt;This all bothers me because I personally think that a University should be a place in which research is conducted, not development. If development happens, it should be in support of research, and not the other way around. However, my recent grant-winning success makes me concerned that few in the decision-making nether-regions of The System agree. And mine is not a unique experience. It's well understood that projects with an “industrial focus”, solving “real world” problems are preferred, even if their actual science content is utterly negligible. Why do you think I spent the time on those grant applications in the first place?&lt;br /&gt;&lt;br /&gt;I should also mention at this point that I'm only interested in developing this particular sensor in order to do science with it &lt;i&gt;in the future&lt;/i&gt;. That was clearly described in the grant applications. However, no actual science is taking place as part of these grants themselves. Once the sensor has been developed and commercialised, I sincerely doubt that I will have much luck applying for grants which address the science I actually want to do. The things I'm really interested in are “basic science” questions, which definitely don't address any of the immediate needs of the equine industry. (Unlike the sensor: that will sell like hot-cakes!)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Why Bother with Abstract Science?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, if we have a lot of productive developments like mine happening in universities, addressing real-world issues, then where is the problem? Isn't that what the public want from a university anyway? Maybe the answer is yes, but it really shouldn't be. To explain why not, I can tell the story of the birth of microbiology. This is the story as far as I understand it; I'm very open to corrections from actual historians.&lt;br /&gt;&lt;br /&gt;Microbiology is a major area of modern science. It under-pins much of modern biology and medicine. It's probably connected with most of the science that is done today. However, the entire field seems to have arisen as a kind of accident, cropping up from chance discoveries made by people who were interested in other things (or at least: they weren't specifically biologists per se).&lt;br /&gt;&lt;br /&gt;Microbiology depended upon the microscope, without which scientists were unable to observe things like bacteria directly. The details of the invention of the microscope are uncertain, but it seems to have occurred circa 1590, and is attributed to both Hans Lippershey and Sacharias Jansen, who were Dutch spectacle makers. They also invented some early telescopes. These two inventors appear to have been driven by commercial interests, in that they left it to others to document what they saw by actually looking through these early instruments.&lt;br /&gt;&lt;br /&gt;Roughly 50 years after the invention of the microscope, we have records of the observations made by Robert Hooke in his 1665 book, &lt;i&gt;Micrographia&lt;/i&gt;. Despite its name, &lt;i&gt;Micrographia&lt;/i&gt; also contains illustrations of Hooke's observations through a telescope. Like many of his contemporaries, Hooke was a polymath who had an interest in many different areas of science. He gave us Hooke's Law of linear elasticity, and is one of three scientists (the others were Wren and Halley) that Isaac Newton credited as the originators of the inverse square law of gravity in his &lt;i&gt;Philosophiae Naturalis Principia Mathematica&lt;/i&gt;. Hooke observed plant cells, and even coined the term “cell”. One of the avid fans of Hooke's &lt;i&gt;Micrographia&lt;/i&gt; was Antonie van Leeuwenhoek, who developed his own microscope using a novel lens-making technique. van Leeuwenhoek's microscope was more powerful, and in 1676 he was the first to observe a bacterium.&lt;br /&gt;&lt;br /&gt;This story has always fascinated me, and I think it contains parallels to the modern world. There were the Dutch spectacle makers; business men, not scientists, who had a new invention to flog. It's scientific use wasn't at all obvious at the time, so it took 50 years before it became popular. Many more advances were made with the telescope in the intervening period. Hooke was the grumpy impoverished scientist (at least before &lt;i&gt;Micrographia&lt;/i&gt;), who had dozens of different interests, and popularised microscopy through his role at the Royal Society. Then van Leeuwenhoek took an interest, spurred on by his fascination with &lt;i&gt;Micrographia&lt;/i&gt;, to develop better equipment and make the key discoveries which founded microbiology.&lt;br /&gt;&lt;br /&gt;There's another part to the story though, which is important for my point: at the time of Hooke and van Leeuwenhoek, one of the prevailing theories for the source of disease was the “Miasma Theory”. This was a classic case of “correlation is not causation”. Basically, the miasma proponents, going way back to antiquity, saw that bad smells were associated with disease, and they made the jump to say that bad smells must therefore cause disease. It sounds like an amusing mistake in today's world, but it was taken very seriously. Famously, large amounts of money were spent in London on the quest to remove bad smells. As a side effect, those measures improved drainage, which actually did reduce the incidence and severity of outbreaks of several diseases!&lt;br /&gt;&lt;br /&gt;This is all quite interesting, but I often wonder: what would have happened if modern university funding practices applied at the time? We can imagine Hooke, without patronage or other assistance, sitting in his office wondering how he's going to raise any money to do research. The answer, for him and all his colleagues, would be the same as it is today: grant money! Clearly, abstract observations of planetary bodies are out of the question: what practical problems would that solve? Consequently, Hooke doesn't bother to investigate his telescope or microscope any further: they're just toys that he hopes he'll have some time for one day. We can imagine that, following the prevailing trends and the advice of his mentors, he would perhaps apply for a grant to study miasmas, since they were clearly the most promising avenue of research into epidemic diseases. Sadder still is the fact that he would almost certainly have been awarded such a grant! He might well have been thought successful by his colleagues!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;What's the Solution?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I try to make myself as much a polymath as possible. I've been involved with teaching in Veterinary Science and Mechanical Engineering: two faculties which have very little in common. I also like to think I have enough background to do a decent job teaching introductory subjects in Computer Science. However, my knowledge of different subject areas has been a personal quest: I've had no formal support, despite seeking it out as much as possible. I even investigated doing a second PhD in Physics following the completion of my PhD in Vet, but sadly there's no option of a Commonwealth Government scholarship to do a second PhD. Suffice to say that formal support for “polymath training” in Australia doesn't really exist. (No, a double undergraduate degree does not make you a polymath, at least not at the depth I'm talking about here. Yes, I do have a double undergraduate degree.)&lt;br /&gt;&lt;br /&gt;I see colleagues who have taken up positions as Lecturers at the University of Melbourne, and their job is not one I want. They seem to spend the vast majority of their time teaching undergraduates, and what little research they are able to conduct is supported no better than my own. I even have the advantage of enough spare time, and enough sleep, to actually think about a problem once in a while.&lt;br /&gt;&lt;br /&gt;As far as I can tell, my solution may well involve moving overseas (to the USA), to a better-supported post-doc position in which I can focus purely on research and not have to concern myself with grants that have no science content, or with teaching undergraduates. Having visited a US lab for several months, I know that that kind of environment suits me: I was many times more productive during that visit than I am in Australia. Focus really helps. In the longer term, I will try to join an established group which can support research activity at a high level with only minimal teaching work. I'm not sure how feasible that is, with grant money for &lt;i&gt;Real Science&lt;/i&gt; (TM) appearing to dry up everywhere, but it seems to be my best bet.&lt;br /&gt;&lt;br /&gt;Of course, I could just leave academia, enter the Engineering industry, and earn five times as much overnight. &amp;nbsp;(Yes, my current annual earnings are about $25,000. &amp;nbsp;Yes, that includes all my teaching work. &amp;nbsp;Yes, it is sad.). Industry is an ever-present option which takes some fortitude to decline.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-2046284021155491092?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/2046284021155491092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=2046284021155491092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/2046284021155491092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/2046284021155491092'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2011/12/universities-research-or-development.html' title='Universities: Research or Development?'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-3435446123243690905</id><published>2011-01-09T12:59:00.004+11:00</published><updated>2011-01-09T13:13:31.713+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='insight3d'/><category scheme='http://www.blogger.com/atom/ns#' term='libmv'/><category scheme='http://www.blogger.com/atom/ns#' term='cmvs'/><category scheme='http://www.blogger.com/atom/ns#' term='bundler'/><category scheme='http://www.blogger.com/atom/ns#' term='photogrammetry'/><category scheme='http://www.blogger.com/atom/ns#' term='pmvs'/><category scheme='http://www.blogger.com/atom/ns#' term='sfm'/><category scheme='http://www.blogger.com/atom/ns#' term='meshlab'/><title type='text'>Exciting photogrammetry developments</title><content type='html'>&lt;a href="http://photosynth.net/"&gt;Microsoft Photosynth&lt;/a&gt; made the news in March 2010 when it was released as a tool for 3D photo-tourism.  However, the recent proliferation in Open Source photogrammetry tools have slipped more-or-less under the radar.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, and most useful, I would like to draw your attention to the Bundler/CMVS/PMVS2 toolchain from the University of Washington:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://phototour.cs.washington.edu/bundler/"&gt;http://phototour.cs.washington.edu/bundler/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://grail.cs.washington.edu/software/cmvs/"&gt;http://grail.cs.washington.edu/software/cmvs/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://grail.cs.washington.edu/software/pmvs/"&gt;http://grail.cs.washington.edu/software/pmvs/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;In combination with &lt;a href="http://meshlab.sourceforge.net/"&gt;MeshLab's&lt;/a&gt; meshing tools, even a newbie like me can produce some fairly stunning results:&lt;/div&gt;&lt;div&gt;&lt;iframe title="YouTube video player" class="youtube-player" type="text/html" width="320" height="240" src="http://www.youtube.com/embed/ZZoJ9GSj_LI" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Here's a quick tutorial on meshing in MeshLab: &lt;a href="http://meshlabstuff.blogspot.com/2009/09/http://meshlabstuff.blogspot.com/2009/09/meshing-point-clouds.html"&gt;http://meshlabstuff.blogspot.com/2009/09/meshing-point-clouds.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also of interest are &lt;a href="http://insight3d.sourceforge.net/"&gt;Insight3D&lt;/a&gt; and the &lt;a href="http://code.google.com/p/libmv/"&gt;libmv library&lt;/a&gt;.  Although Insight3D can actually be used as of now (Jan 2011), it's not as immediately complete or useful as the Bundler toolchain.  libmv is still in development, but may be a good long-term open source solution (since it's not clear whether the Bundler software will continue to be developed).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-3435446123243690905?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/3435446123243690905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=3435446123243690905' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3435446123243690905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3435446123243690905'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2011/01/exciting-photogrammetry-developments.html' title='Exciting photogrammetry developments'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/ZZoJ9GSj_LI/default.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-6875764146840754986</id><published>2010-02-18T15:50:00.006+11:00</published><updated>2010-02-18T16:44:05.450+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='speculation'/><category scheme='http://www.blogger.com/atom/ns#' term='linear'/><category scheme='http://www.blogger.com/atom/ns#' term='soma'/><category scheme='http://www.blogger.com/atom/ns#' term='javafx'/><category scheme='http://www.blogger.com/atom/ns#' term='fit'/><category scheme='http://www.blogger.com/atom/ns#' term='chart'/><title type='text'>Charts, Linear Fits and SoMa!</title><content type='html'>&lt;div style="text-align: left;"&gt;Oracle seems to be reticent to say when JavaFX 1.3 (code-named "SoMa") will be released.  The most that we, the unwashed masses, can learn about it comes from the JavaFX &lt;a href="http://javafx-jira.kenai.com/"&gt;bug tracker&lt;/a&gt;.  I'm very eager for some of the proposed features in 1.3, so I've been keeping a watch over the issues list for the Runtime component of JavaFX, in the "SoMa (Fix For Version)" category.  I've been watching the number of outstanding issues, by subtracting the number of resolved issues from the total number of issues.  Naturally, this obsession became a prime candidate for some JavaFX plotting work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Here are the current results:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_S4SxpnrU6X8/S3zLvZpfb7I/AAAAAAAAABw/SncHc1FfbuI/s1600-h/soma-issues.png"&gt;&lt;img src="http://3.bp.blogspot.com/_S4SxpnrU6X8/S3zLvZpfb7I/AAAAAAAAABw/SncHc1FfbuI/s400/soma-issues.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5439446465155919794" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 323px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;It's difficult to host applets at blogger.com, so I've uploaded the applet here: &lt;a href="http://merrittmechanical.com/soma-issues/index.html"&gt;http://merrittmechanical.com/soma-issues/index.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;There's also a link to the source code on that page.  (I would appreciate hints about any better hosting options...)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To create the best-fit line and the data points, I overlaid a &lt;code&gt;&lt;a href="http://java.sun.com/javafx/1.2/docs/api/javafx.scene.chart/javafx.scene.chart.LineChart.html"&gt;LineChart&lt;/a&gt;&lt;/code&gt; on a &lt;code&gt;&lt;a href="http://java.sun.com/javafx/1.2/docs/api/javafx.scene.chart/javafx.scene.chart.ScatterChart.html"&gt;ScatterChart&lt;/a&gt;&lt;/code&gt;.  I didn't manage this very elegantly; I just set up both charts with the same axes and then made the axes of one chart completely transparent (relevant strokes and fills are &lt;code&gt;&lt;a href="http://java.sun.com/javafx/1.2/docs/api/javafx.scene.paint/javafx.scene.paint.Color.html"&gt;Color&lt;/a&gt;.TRANSPARENT&lt;/code&gt;).  This worked for the purpose of creating this chart, but definitely isn't ideal.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I also created a best-fit line, using a least squares method described in the &lt;a href="http://www.nr.com/"&gt;Numerical Recipes&lt;/a&gt; textbook.  The least-squares method is very simple and comes out as quite elegant FX script.  Because the more recent data points in the outstanding issues list are likely to have a greater effect on the release date than older data points, I created a linear confidence distribution in which the most recent observation has twice as much confidence attached to it as the oldest observation.  This is very arbitrary, of course.  The code for the linear best fit is included with the example above.  The linear fit was then projected to find the point at which the Outstanding Issues would reach zero; assuming this to coincide with the release date.  That date is then computed and displayed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Of course, all of this is a bit of a pointless exercise.  Not all issues are of the same magnitude, and developers don't work in a linear fashion anyway.  However, it is still fun to watch the issue list shrink over time and to guess about when this release will happen.  I hope it arrives quickly!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-6875764146840754986?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/6875764146840754986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=6875764146840754986' title='48 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6875764146840754986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6875764146840754986'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2010/02/charts-linear-fits-and-soma.html' title='Charts, Linear Fits and SoMa!'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_S4SxpnrU6X8/S3zLvZpfb7I/AAAAAAAAABw/SncHc1FfbuI/s72-c/soma-issues.png' height='72' width='72'/><thr:total>48</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-5091274459390288946</id><published>2010-02-08T08:57:00.005+11:00</published><updated>2010-02-08T10:07:34.190+11:00</updated><title type='text'>JavaFX Blogs and Links</title><content type='html'>Many years ago, I wrote an app for strain gauge data acquisition and real time display.  The app has been used for a number of published journal articles, but it's now getting very old.  Originally, it was written using the Microsoft Foundation Classes, but I've long since moved away from the Microsoft space.  Consequently, now that it's time to update the application, I'm doing a re-write in &lt;a href="http://javafx.com"&gt;JavaFX&lt;/a&gt; and &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've been a fan of Scala for the last two years, but my decision to use JavaFX was a more difficult one.  I'm a big fan of Swing, and Scala Swing in particular.  I also like Ingo Maier's work on &lt;a href="https://lampsvn.epfl.ch/trac/scala/browser/scala-experimental/trunk/scalafx"&gt;ScalaFX&lt;/a&gt;, and the way that his functional reactive core integrates so well with the rest of Scala.  So I was hoping to find a pure Scala solution for the graphical components I need.  These components draw things like scales and time-series data.  I looked at the existing plotting libraries, like &lt;a href="http://www.jfree.org/jfreechart/"&gt;JFreeChart&lt;/a&gt; (which I've also used for other projects), but none of those seem to fit my need for real-time, interactive display.  I have previously created custom components in Swing, but going down that road again for the 5 or 6 components I need was not appealing.  Although Maier is a genius, nobody seems to have been able to pin down his development and release schedule for ScalaFX.  Although I don't need a stable API, I at least look for a first release before using it on something that I'm expected to support for fellow academics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When I originally investigated JavaFX, I found that I had an instant hatred for JavaFX script, which was based primarily upon the monolithic examples on the JavaFX website.  I thought that the language simply wouldn't scale, and that Sun had abandoned key principles like data hiding and encapsulation.  However, my impression of the language has improved substantially with a little use.  I've come to realise that really nothing has been lost, and that it's possible to write components in JavaFX that are vastly superior to Swing components, while retaining everything I need: particularly a clear separation of model and view / controller.  My improved opinion of JavaFX arose primarily from two sources: the &lt;a href="http://jfxtras.org/"&gt;JFXtras&lt;/a&gt; code and the structure of the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;javafx.scene.control&lt;/span&gt; hierarchy.  Jonathan Giles gives a very good introduction to creating custom controls within that hierarchy &lt;a href="http://jonathangiles.net/blog/?p=478"&gt;here&lt;/a&gt;, but bear in mind that he only superficially addresses many of the problems of a "real" custom control.  I'll write up my custom control experiences once JavaFX 1.3 is released and I can address theming them properly for Caspian (which is the emerging L&amp;amp;F for JavaFX).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In summary, I've transitioned from hating JavaFX to becoming an advocate for it within the space of about two weeks.  Not knowing any better, I believed much of the scepticism that was initially expressed about it on the web: that it's hopeless for desktop work and far behind its competitors in the RIA space, and my own impression of the scripting language was far from positive.  However, I would now encourage anyone still holding those opinions to really spend a few days using the language and APIs.  They're better than you think (and I say that as someone who's done some projects in Scala, which is a &lt;b&gt;much&lt;/b&gt; richer language!).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I thought I'd leave some links for JavaFX blogs and projects that I've found useful...&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.javafx.com/"&gt;http://www.javafx.com/&lt;/a&gt; - The main website.&lt;/li&gt;&lt;li&gt;&lt;a href="http://learnjavafx.typepad.com/"&gt;http://learnjavafx.typepad.com/&lt;/a&gt; - James Weaver's blog.  You can't go two steps in the JavaFX world without bumping in to this guy!  He has the best resources for a beginner outside of the main website, but if you've done a lot of GUI work, you'll find that you already know (or expect) 95% of what he discusses.  However, his stuff is always worth checking out, since there are often new things in there, even if you're a veteran.&lt;/li&gt;&lt;li&gt;&lt;a href="http://jfxtras.org/"&gt;http://jfxtras.org/&lt;/a&gt; - Some extra stuff for JavaFX.  The source code is a far better resource than the website, btw.  They also host the MiGLayout component for JavaFX, which will Do What You Want (TM) when the built-in layouts get too clumsy (I find that happens real quick).&lt;/li&gt;&lt;li&gt;&lt;a href="http://fxexperience.com/"&gt;http://fxexperience.com/&lt;/a&gt; - The JavaFX Experience blog.   This is written by some Snoracle employees, but they also have weekly links articles.&lt;/li&gt;&lt;li&gt;&lt;a href="http://fxexperience.com/2010/01/amy-fowler-at-silicon-valley-javafx-users-group/"&gt;Amy Fowler's Talk on JavaFX Layouts&lt;/a&gt; - The content of this talk will become absolutely critical once you've done some layout work.  It really helps to confirm what you think you know and explain what you don't - brilliant resource in that respect.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.projectmaitai.org/"&gt;http://www.projectmaitai.org/&lt;/a&gt; - A larger JavaFX app written by Joshua Marinacci, who has recently &lt;a href="http://www.joshondesign.com/2010/02/03/leaving-sun-joining-palm/"&gt;left Snoracle for Palm&lt;/a&gt;.  It's very sad that he's leaving - I recognise his name from the &lt;a href="http://javaposse.com/"&gt;Java Posse&lt;/a&gt; podcast, even though I'm a JavaFX newbie.&lt;/li&gt;&lt;/ul&gt;That's all for now.  Back to the code...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-5091274459390288946?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/5091274459390288946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=5091274459390288946' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5091274459390288946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5091274459390288946'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2010/02/javafx-blogs-and-links.html' title='JavaFX Blogs and Links'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-6547877527169818380</id><published>2009-11-06T16:28:00.004+11:00</published><updated>2009-11-06T16:41:07.743+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='door-to-door'/><category scheme='http://www.blogger.com/atom/ns#' term='utility'/><category scheme='http://www.blogger.com/atom/ns#' term='company'/><title type='text'>Rant: Door-to-Door Utility Companies</title><content type='html'>I live in Werribee: the jewel of the Western Suburbs of Melbourne.  I live on a very quiet street, less than 1 km from a supermarket and the local train station.  The one complaint I have about where I live are the sheer number of people door-knocking on behalf of the utility companies (gas and electricity), trying to sell me things.  Just lately, it has become incessant: there has been at least one representative per month for the last 6 months!&lt;br /&gt;&lt;br /&gt;I don't mind people knocking on my door, but the problem is that they refuse to leave.  When you tell them: "I'm sorry; I'm not interested, and don't have time to listen to your offer..." they will respond with something like: "But it's not an offer; we're only trying to save you money..." or some other rubbish.  If I then ask for documentation regarding their offer: a letter, or a pamphlet, or a website, I get a response along the lines of: "well, that's what I'm here for: to explain it to you... look, here are the forms for you to fill out."  That kind of response and lack of material from which a person could make a rational decision is just not good enough.  The very worst is when you actually ask them to leave ("I'm sorry; can you please leave.") and they still refuse!!&lt;br /&gt;&lt;br /&gt;It's time for utility companies to stop this sales approach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-6547877527169818380?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/6547877527169818380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=6547877527169818380' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6547877527169818380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6547877527169818380'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/11/rant-door-to-door-utility-companies.html' title='Rant: Door-to-Door Utility Companies'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-5873996943890577687</id><published>2009-07-09T23:17:00.011+10:00</published><updated>2009-07-09T23:42:24.036+10:00</updated><title type='text'>Biologists: Vectorize Thyselves</title><content type='html'>&lt;div style="text-align: left;"&gt;I'm currently investigating strains recorded from equine hooves.  In this case, I wasn't directly involved with the experiment, but I'm helping out with the analysis.  The analysis itself fits a common pattern: lots of trials of a similar type that all need to be processed in the same way.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Biologists often tackle this kind of work using spreadsheet programs.  The advantages of a spreadsheet include the fact that your analysis is quite accessible, and it's computed in real-time.  The main disadvantage (in this case, but also in many others I've seen) is that there is a lot of book-keeping required to synchronize the analysis that is performed on each dataset.  The book-keeping introduces plenty of opportunity for error.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My solution to this problem is to take a "vectorized" approach.  A good solution is a single program that can process each dataset in turn, and perform the analysis automatically.  Thus, the amount of work required for the analysis is de-coupled from the sample size of the experiment.  There is no book-keeping work to keep the analysis from each spreadsheet in-sync.  It sounds simple enough, but few biologists either understand or implement this idea.  The main (only?) drawback of this approach is its somewhat greater complexity; you need a real program to perform the analysis, rather than using a spreadsheet.  That's really not much of a drawback though, once your experiment is sufficiently large.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.flickr.com/photos/28808691@N05/3703514905/sizes/l/"&gt;&lt;img src="http://farm3.static.flickr.com/2383/3703514905_cefbec45ed_m.jpg" border="0" alt="" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 240px; height: 69px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Thanks to this work, I've also had the pleasure of using the excellent &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; plotting library &lt;a href="http://matplotlib.sourceforge.net/"&gt;matplotlib&lt;/a&gt;.  Once you get used to the basics, this library makes plotting using a spreadsheet feel like a terrible kludge.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-5873996943890577687?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/5873996943890577687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=5873996943890577687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5873996943890577687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5873996943890577687'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/07/biologists-vectorize-thyselves.html' title='Biologists: Vectorize Thyselves'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2383/3703514905_cefbec45ed_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-9039275285102556607</id><published>2009-06-30T10:41:00.002+10:00</published><updated>2009-06-30T10:56:59.821+10:00</updated><title type='text'>Functional Programming</title><content type='html'>This post is mainly an excuse for me to link to a blog I came across:&lt;div&gt;    &lt;a href="http://biosimilarity.blogspot.com/"&gt;http://biosimilarity.blogspot.com/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have been starting to use &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; over the last year.  Initially I was drawn to the language purely by the functional programming experiences I had in &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt;: using &lt;a href="http://docs.python.org/3.1/library/functions.html?highlight=map#map"&gt;map&lt;/a&gt;, &lt;a href="http://docs.python.org/3.1/library/functions.html?highlight=filter#filter"&gt;filter&lt;/a&gt;, and &lt;a href="http://docs.python.org/3.1/tutorial/datastructures.html#list-comprehensions"&gt;list comprehensions&lt;/a&gt;.  Scala promised similar tools, but with much better performance, and objects that just "feel" more robust than those in Python.  In short, I began using it for very pragmatic reasons that had nothing to do with any underlying theory.  However, over the last year, I have started to become more interested in the more theoretical aspects of functional programming, to the point where I'm now starting to reach out and trying to read blogs like the one above.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All of this reminds me of the kind of mind-bending experience I had when I first started to learn about C++ templates... they were a level of abstraction that I couldn't immediately translate to "mental bytecode", but that promised a massive amount of power and versatility.  Admittedly, I was only about 13 when I started playing with C++ templates, but these new kinds of logic analyses are equally confusing now!  It's all very interesting, even if it's not exactly approachable.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-9039275285102556607?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/9039275285102556607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=9039275285102556607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/9039275285102556607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/9039275285102556607'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/06/functional-programming.html' title='Functional Programming'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-2012841434803096270</id><published>2009-06-21T17:35:00.005+10:00</published><updated>2009-06-21T17:56:57.609+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='angle'/><category scheme='http://www.blogger.com/atom/ns#' term='Mohr'/><category scheme='http://www.blogger.com/atom/ns#' term='rosette'/><category scheme='http://www.blogger.com/atom/ns#' term='principal strain'/><category scheme='http://www.blogger.com/atom/ns#' term='strain'/><title type='text'>Analysis of Strains from a 45-Degree Rosette</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.merrittmechanical.com/hosted/strain-gauge-120ohm-closeup.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 142px; height: 110px;" src="http://www.merrittmechanical.com/hosted/strain-gauge-120ohm-closeup.png" border="0" alt="" /&gt;&lt;/a&gt;45 degree &lt;a href="http://en.wikipedia.org/wiki/Strain_gauge"&gt;strain gauge&lt;/a&gt; rosettes are commonly used for measurement of strains.  These rosette arrangements measure &lt;a href="http://en.wikipedia.org/wiki/Normal_strain"&gt;normal strains&lt;/a&gt; in three separate directions.  From this data, the so-called "principal" strain state can be obtained.  The principal strain state is just the orientation in which the &lt;a href="http://en.wikipedia.org/wiki/Shear_strain"&gt;shear strain&lt;/a&gt; is zero.  At this orientation of zero shear strain, the two normal strains are called principal normal strains.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It can be quite tricky to obtain the principal strain state from the three gauge strains in a 45-degree rosette.  Numerous textbooks provide equations for the principal normal strains, and generally these "just work".  However, the angle of the principal strain state is often quite ambiguous.  It's often difficult to figure out whether the angle is clockwise or anti-clockwise, which gauge it is relative to, and to which of the two principal normal strains it refers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have recently done some work on this problem in the context of measuring strains on the equine hoof wall.  I have written a short description of the &lt;a href="http://www.merrittmechanical.com/hosted/45-deg-rosette.pdf"&gt;Analysis of Strains from a 45-Degree Rosette&lt;/a&gt; (PDF file; 47.9 KB).  Please feel free to use this document (with an appropriate link to my blog), and please contact me regarding any corrections.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-2012841434803096270?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/2012841434803096270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=2012841434803096270' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/2012841434803096270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/2012841434803096270'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/06/analysis-of-strains-from-45-degree.html' title='Analysis of Strains from a 45-Degree Rosette'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-8762203634821052904</id><published>2009-06-12T01:31:00.003+10:00</published><updated>2009-06-12T01:38:03.715+10:00</updated><title type='text'>Blog link!</title><content type='html'>I'd like to say thank you to Fran Jurga for publicizing a video that I created during my PhD.  She wrote about it on her &lt;a href="http://hoofcare.blogspot.com/2009/06/australian-anatomy-animation-tendons.html"&gt;HoofBlog&lt;/a&gt; website, and since that time it has received a lot of attention.&lt;br /&gt;&lt;br /&gt;It's great to see that something I worked on during my PhD has been so immediately useful for people.  My PhD involved a lot of "basic science" work, which rarely has immediate influence.  It helps a lot with motivation to find that people are so enthusiastic about it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-8762203634821052904?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/8762203634821052904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=8762203634821052904' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/8762203634821052904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/8762203634821052904'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/06/blog-link.html' title='Blog link!'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-1025878177106429831</id><published>2009-06-06T21:23:00.013+10:00</published><updated>2009-06-06T23:48:45.982+10:00</updated><title type='text'>Getting started with PIC microcontroller programming under Mac OS X</title><content type='html'>I recently started experimenting with &lt;a href="http://en.wikipedia.org/wiki/PIC_microcontroller"&gt;PIC microcontrollers&lt;/a&gt;.  Microcontrollers are small chips that contain all of the essential components of a whole computer.  They can function as the embedded "brains" of any electronics project.&lt;br /&gt;&lt;br /&gt;I found a lot of information online about programming PIC microcontrollers under both Microsoft Windows and various types of Linux.  However, the information relating directly to Mac OS X was quite sparse.  I began by working with both Linux and Windows under &lt;a href="http://www.vmware.com/products/fusion/"&gt;VMWare Fusion&lt;/a&gt;, but eventually migrated to OS X when the overhead of continually running VMWare just for PIC stuff became too much.&lt;br /&gt;&lt;br /&gt;In this blog post, I'll explain how I set up my toolchain under OS X.  My setup is still in its infancy, but I thought I'd share the information early.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;1. Obtain a programmer&lt;/h2&gt;The first step was to obtain the required hardware - a programming device that can upload your program to the microcontroller chip.  There are various programming kits available online and from electronics stores, but to be safe, I ordered a PICkit 2 programmer directly from Microchip Inc.  It connects to the computer via a standard USB cable:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3600472114/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 500px; height: 331px;" src="http://farm4.static.flickr.com/3601/3600472114_8da42c3811.jpg" alt="" border="0" /&gt;&lt;/a&gt;The PICkit 2 cost AU$54.70, which included shipping to Melbourne, Australia.  It also came with a demo board, which included a PIC PIC16F887:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3600536302/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 500px; height: 330px;" src="http://farm4.static.flickr.com/3406/3600536302_97280f6a66.jpg" alt="" border="0" /&gt;&lt;/a&gt;To get started, this was the only financial outlay (given that I already owned a modern Mac computer running OS X!).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;2. Download and compile GPUTILS&lt;/h2&gt;GPUTILS provides programs to deal with compiling PIC assembly code.  I used &lt;code&gt;gputils-0.13.7&lt;/code&gt; and compiled it using the standard commands:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;3. Download and compile SDCC&lt;/h2&gt;The next stage was to obtain a compiler.  The compiler takes human-readable programs and converts them to machine code.  I wanted to use the C programming language for my work, so I began using the &lt;a href="http://sdcc.sourceforge.net/"&gt;Small Device C Compiler (SDCC)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I downloaded the source code for SDCC and compiled it using gcc.  For this step, you need to have the &lt;a href="http://www.askdavetaylor.com/how_to_install_apple_developer_tools_cc_gcc_mac_os_x.html"&gt;OS X developer tools installed&lt;/a&gt;.  I obtained SDCC from their subversion directory (read their documentation to learn about this), and then compiled it from the command line using the standard commands:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;4. Compile the SDCC PIC libraries&lt;/h2&gt;Inside the SDCC source directory, we now have to compile libraries for SDCC on the PIC16 architecture.  This is done as follows:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ cd device/lib/pic&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;$ cd ../pic16&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;$ cd ../&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;5. Download and compile PK2CMD&lt;/h2&gt;Microchip Inc. have provided source code for a program called &lt;code&gt;pk2cmd&lt;/code&gt; which can be compiled under OS X and Linux.  This program communicates with the PICkit 2 programmer.  The idea is that once your code has been compiled by SDCC, &lt;code&gt;pk2cmd&lt;/code&gt; controls the PICkit 2 programmer to program the chip.&lt;br /&gt;&lt;br /&gt;I obtained the &lt;code&gt;pk2cmd&lt;/code&gt; source code from the &lt;a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023805"&gt;Microchip website&lt;/a&gt;.  The required package (at the time of writing) is listed about 3/4 of the way down the page and is called "PK2CMD V1.20 Linux &amp; Mac OS X Source Code with Makefile".  After extracting the package, I compiled it for OS X 10.5.7 and installed it as follows:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ make mac105&lt;br /&gt;$ sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Take note of the makefile target that had to be used for OS X 10.5 (&lt;code&gt;mac105&lt;/code&gt;).  There is more information in the makefile included with &lt;code&gt;pk2cmd&lt;/code&gt;.&lt;br /&gt;&lt;h2&gt;6. Try a test program&lt;/h2&gt;The final stage is to check that your toolchain is working.  The simplest way to do that is to try out a test program with the 44-pin demo board that comes with the PICkit 2 programmer.  The test program below works for me:&lt;br /&gt;&lt;textarea name="code" class="c" cols="80"&gt;&lt;br /&gt;#include &lt;pic16f887.h&gt;&lt;br /&gt;&lt;br /&gt;/* ------------------ */&lt;br /&gt;/* Configuration bits */&lt;br /&gt;typedef unsigned int word;&lt;br /&gt;word at _CONFIG1 CONFIG1 = _LVP_OFF &amp; _FCMEN_OFF &amp; _IESO_OFF &amp; &lt;br /&gt;                           _BOR_OFF &amp; _CPD_OFF &amp; _CP_OFF &amp; _MCLRE_OFF &amp; &lt;br /&gt;                           _PWRTE_ON &amp; _WDT_OFF &amp; _INTRC_OSC_NOCLKOUT;&lt;br /&gt;word at _CONFIG2 CONFIG2 = _WRT_OFF &amp; _BOR21V;&lt;br /&gt;&lt;br /&gt;void isr() interrupt 0 {&lt;br /&gt;    /* interrupt service routine */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main() {&lt;br /&gt;    long i;&lt;br /&gt;    word state = 0x01;&lt;br /&gt;&lt;br /&gt;    RP0 = 1;&lt;br /&gt;    TRISD = 0;      // set PORTD as all outputs&lt;br /&gt;    RP0 = 0; &lt;br /&gt;    PORTD = state;  // set bits on PORTD&lt;br /&gt;&lt;br /&gt;    // walking LED display&lt;br /&gt;    while (1) {&lt;br /&gt;        for (i=0; i&lt;1000; ++i) { }&lt;br /&gt;        if (state &lt;= 64) {&lt;br /&gt;            state = state &lt;&lt; 1;&lt;br /&gt;        } else {&lt;br /&gt;            state = 0x01;&lt;br /&gt;        }&lt;br /&gt;        PORTD = state;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;With this code in a file called &lt;code&gt;test.c&lt;/code&gt;, it can be compiled and uploaded to the demo board as follows:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ sdcc -mpic14 -p16f887 test.c&lt;br /&gt;$ pk2cmd -B/usr/share/pk2 -P -T -M -Ftest.hex&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;If everything is successful, you should see the LEDs on the board winking from left to right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-1025878177106429831?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/1025878177106429831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=1025878177106429831' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1025878177106429831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1025878177106429831'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/06/getting-started-with-pic.html' title='Getting started with PIC microcontroller programming under Mac OS X'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3601/3600472114_8da42c3811_t.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-7142363501062568490</id><published>2009-02-08T02:06:00.005+11:00</published><updated>2009-02-08T23:45:02.656+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='semenggoh'/><category scheme='http://www.blogger.com/atom/ns#' term='leech'/><category scheme='http://www.blogger.com/atom/ns#' term='sarawak'/><category scheme='http://www.blogger.com/atom/ns#' term='pitcher plant'/><category scheme='http://www.blogger.com/atom/ns#' term='wildlife'/><category scheme='http://www.blogger.com/atom/ns#' term='orang utan'/><category scheme='http://www.blogger.com/atom/ns#' term='malaysia'/><title type='text'>Semenggoh Wildlife Centre</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260345156/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3361/3260345156_21772a958f_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The Semenggoh Wildlife Centre was originally established to rehabilitate animals and birds who had been held in captivity by humans.  Often, these animals were kept as pets by the local population, and later confiscated by Sarawak Forestry.  Many of the animals at this centre were successfully prepared for life back in the wild, and subsequently released.  This original mission of rehabilitation has since been moved to the nearby Matang Wildlife Centre.  In present times, Semenggoh hosts a group of 24 &lt;a href="http://en.wikipedia.org/wiki/Orang_utan"&gt;Orang Utans&lt;/a&gt; (the Borneo species; &lt;a href="http://en.wikipedia.org/wiki/Bornean_Orangutan"&gt;&lt;span style="font-style: italic;"&gt;Pongo pygmaeus&lt;/span&gt;&lt;/a&gt;), who inhabit an area of 650 hectares of &lt;a href="http://en.wikipedia.org/wiki/Primary_Rainforest"&gt;primary rainforest&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;iframe width="450" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.au/maps/ms?ie=UTF8&amp;amp;t=h&amp;amp;hl=en&amp;amp;s=AARTsJq5y5spPEV9li0ONSTYK2TokvgAnw&amp;amp;msa=0&amp;amp;msid=103283086063694618477.0004626785a86ffd243e5&amp;amp;ll=1.496717,110.32608&amp;amp;spn=0.411846,0.617981&amp;amp;z=10&amp;amp;output=embed"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;Map of Semenggoh Wildlife Centre&lt;br/&gt;&lt;a href="http://maps.google.com.au/maps/ms?ie=UTF8&amp;amp;t=h&amp;amp;hl=en&amp;amp;msa=0&amp;amp;msid=103283086063694618477.0004626785a86ffd243e5&amp;amp;ll=1.496717,110.32608&amp;amp;spn=0.411846,0.617981&amp;amp;z=10&amp;amp;source=embed" style="color:#0000FF;text-align:left"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;&lt;/center&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260441244/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3400/3260441244_224eef3097_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The Orang Utans of Semenggoh are semi-wild.  They were introduced into the reserve after their rescue from humans.  Since that time, several of the female Orang Utans have given birth within Semenggoh itself.  Due to its relatively small size, the reserve is unable naturally to support the number of Orang Utans who live there, and so they are fed twice each day from wooden platforms.  These feeding times present an opportunity for visitors to see the primates first hand.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260431710/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3435/3260431710_280611029d_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;During feeding times, the keepers of the reserve call the Orang Utans, and they descend to their food platforms by &lt;a href="http://en.wikipedia.org/wiki/Brachiation"&gt;brachiation&lt;/a&gt; along a suspended network of ropes and cables.  At a morning feeding, we initially saw several young Orang Utans, and were warned to stay well clear of them because they are known to throw things at human visitors.  The young Orang Utans tended to stuff as much food as possible into their mouths before retreating higher into the trees to eat.  Later, we saw the dominant male Orang Utan, called Ritchie, who appeared to be more relaxed, and remained on the feeding platform to eat some bananas.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260394356/"&gt;&lt;img style="margin: 0px auto 10px; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3343/3260394356_fd0a72dfa2_m.jpg" alt="" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260433514/"&gt;&lt;img style="margin: 0px auto 10px; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3381/3260433514_13d3598bb4_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3259621189/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3504/3259621189_833b94ca46_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;After the feeding time, we paid to go on a hike around Semenggoh with one of the Orang Utan keepers, called Dominick.  Dominick led us on a trail which passed cages that were previously used to quarantine birds, Orang Utans and &lt;a href="http://en.wikipedia.org/wiki/Gibbon"&gt;gibbons&lt;/a&gt;, after their rescue from humans.  It was also on this trail that we saw our first &lt;a href="http://en.wikipedia.org/wiki/Pitcher_plant"&gt;pitcher plants&lt;/a&gt; in Borneo.  As usual, I sweated a lot in the high tropical humidity, and was quickly soaking from head to toe.  It was a fantastic experience, and the only down-side (if it can be called one) was being attacked by tremendously voracious &lt;a href="http://en.wikipedia.org/wiki/Leech"&gt;leeches&lt;/a&gt;.  The leeches found their way throughout my shoes and socks, but I was able to remove most of them safely (safe for both myself and the leeches).  The only leech to leave a mark was one that attached itself to the inside of my right upper arm.  Trying to remove this one was a mistake, since it had already started feeding.  The anti-coagulant it had released left the wound bleeding for a couple of hours, and produced a red circular mark which is still visible 3 days later!&lt;br /&gt;&lt;br /&gt;Orang Utans and humans share a long period of post-natal maternal care.  Orang Utan mothers take care of their young for a period of around 4 to 5 years after birth, and will only reproduce again when their offspring are independent.  Naturally, Orang Utans are semi-solitary animals, and the crowded state of the Semenggoh reserve is only maintained through human assistance.  Even with regular feeding times, the 650 hectares of the reserve is only enough room for a single dominant male; currently Ritchie.  I wondered how genetic diversity will be maintained in the successfully-breeding captive population, but haven’t yet found out what plans are in place to achieve this.  The only mention made of transporting Orang Utans was that Sarawak Forestry supplies them to the zoos in Western Malaysia.&lt;br /&gt;&lt;br /&gt;Overall, Semenggoh Wildlife Centre was a great place to visit.  We were lucky in seeing so many Orang Utans at the feeding platform.  Several guide books mention that sightings are not guaranteed, and that it is worth setting aside a whole day in order to see both morning and afternoon feeding times.  The keepers told us that the Orang Utans were more likely to attend feedings when the local plants were not fruiting, so it would be worth checking when this period occurs.&lt;br /&gt;&lt;br /&gt;Don’t forget that more pictures of my journey are available online at my Flickr Photostream: &lt;a href="http://www.flickr.com/photos/28808691@N05/"&gt;http://www.flickr.com/photos/28808691@N05/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-7142363501062568490?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/7142363501062568490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=7142363501062568490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7142363501062568490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7142363501062568490'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/02/semenggoh-wildlife-centre.html' title='Semenggoh Wildlife Centre'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3361/3260345156_21772a958f_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-3752109238411161618</id><published>2009-02-07T17:55:00.016+11:00</published><updated>2009-02-08T00:34:15.630+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borneo'/><category scheme='http://www.blogger.com/atom/ns#' term='culture'/><category scheme='http://www.blogger.com/atom/ns#' term='james brooke'/><category scheme='http://www.blogger.com/atom/ns#' term='iban'/><category scheme='http://www.blogger.com/atom/ns#' term='orang ulu'/><category scheme='http://www.blogger.com/atom/ns#' term='longhouse'/><category scheme='http://www.blogger.com/atom/ns#' term='sarawak'/><category scheme='http://www.blogger.com/atom/ns#' term='bidayuh'/><category scheme='http://www.blogger.com/atom/ns#' term='melanau'/><category scheme='http://www.blogger.com/atom/ns#' term='village'/><category scheme='http://www.blogger.com/atom/ns#' term='penan'/><category scheme='http://www.blogger.com/atom/ns#' term='malaysia'/><title type='text'>Sarawak Cultural Village</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3246762181/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3121/3246762181_0b56ebc64b_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The Sarawak Cultural Village is located at the Pantai Damai (Damai Beach) resort area, about 40 minutes’ drive from the city of Kuching.  The village contains examples of the types of houses that are characteristic of those built by the ethnic groups that inhabit Sarawak.  Upon entry to the village, visitors are given a “Village Passport” which contains information about the local people.  This passport has a section in which tourists can collect stamps from each of the village houses that they visit.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;iframe width="450" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;t=h&amp;amp;s=AARTsJq8zCksA98QyffSF9T2-6A5zwVIjA&amp;amp;msa=0&amp;amp;msid=103283086063694618477.00046253e7c1c77fa7b15&amp;amp;ll=1.752046,110.316296&amp;amp;spn=0.051474,0.077248&amp;amp;z=13&amp;amp;output=embed"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;A map of the Sarawak Cultural Village and Damai Beach&lt;br/&gt;&lt;a href="http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;t=h&amp;amp;msa=0&amp;amp;msid=103283086063694618477.00046253e7c1c77fa7b15&amp;amp;ll=1.752046,110.316296&amp;amp;spn=0.051474,0.077248&amp;amp;z=13&amp;amp;source=embed" style="color:#0000FF;text-align:left"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;&lt;/center&gt;&lt;br /&gt;The current population of Sarawak consists mainly of the indigenous &lt;a href="http://en.wikipedia.org/wiki/Iban_people"&gt;Iban&lt;/a&gt; people, and immigrant Chinese and Malays.  The Iban traditionally lived in groups in the lowlands, in longhouses that were built to last around twenty years.  Although they were farmers, the Iban gained notoriety among early European travelers as head-hunters.  In some social groups, Iban men were not considered worthy for marriage until they had brought home the head of an enemy from battle.  The descendants of the Iban account for around 30% of the current population of Sarawak.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3260038146/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 180px;" src="http://4.bp.blogspot.com/_S4SxpnrU6X8/SY0_U73BjWI/AAAAAAAAABY/sC5pFRZmB3w/s320/kuching-population-markup.png" alt="" id="BLOGGER_PHOTO_ID_5299961965383355746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://en.wikipedia.org/wiki/Longhouse"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3306/3246772473_607f2fe09b_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/Longhouse"&gt;Longhouses&lt;/a&gt; were a kind of miniature “village within a house”.  Limited privacy was afforded by segmenting the longhouse into rooms that were used for different activities.  The effort expended in constructing the longhouse could thus be shared by all of the people that would inhabit it.  In particular, providing shelter from the rains of Borneo would have been a great incentive for cooperation in the construction of the common roof.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3246759957/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3432/3246759957_17434fcedc_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;In more mountainous regions, another ethnic group, the &lt;a href="http://en.wikipedia.org/wiki/Bidayuh"&gt;Bidayuh&lt;/a&gt;, also traditionally lived in longhouses.  The Bidayuh consist of several sub-groups; namely the Jagoi, Biatah, Bukar-Sadong, Selakau and Lara peoples.  The Bidayuh were often more gentle than the Iban, although they still collected the heads of their enemy in battle and hung them to smoke above the fire.  Among their technological achievements, the Bidayuh invented indoor plumbing!  The mountainous terrain on which they lived allowed them to dam rivers up-stream from their houses and use a gravity-fed system of bamboo conduits to supply water.  The Bidayuh account for around 8.4% of the current Sarawak population.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3246768659/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3444/3246768659_c2f1c4d0b0_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The &lt;a href="http://en.wikipedia.org/wiki/Melanau"&gt;Melanau&lt;/a&gt; people built large houses in coastal regions that were supported about 12 m above the ground.  They preferentially ate Sago palms, instead of the rice that was usually eaten by most of the other ethnic groups.  The remaining indigenous people are often categorized under a single name: the &lt;a href="http://en.wikipedia.org/wiki/Orang_ulu"&gt;Orang Ulu&lt;/a&gt;, which means “up-river dwellers”.  The Orang Ulu comprise the Penan, Kayan, Kenyah, Kelabit and Lun Bawang.  Among these groups, the Penan, who live in the dense jungles of Central Borneo, are often noted for their use of blowpipes in hunting.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3247586232/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3133/3247586232_60105a03a5_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The Cultural Village has an auditorium, at which dance performances are held twice each day.  These dances are quite varied and show off the spectacular traditional dress of each of the ethnic groups.  Having done some jungle trekking, I often had pause to wonder whether the long, elaborate traditional costumes were worn during daily life or only for special celebrations.  Unfortunately, I never had that particular question answered.  We visited in the late monsoon season, and the wet weather had apparently scared away most tourists from the village.  The houses themselves were quite empty for most of our visit, with the exception of the very friendly Bidayuh longhouse, at which we were warmly welcomed.&lt;br /&gt;&lt;br /&gt;My impression was that the Cultural Village was very much set up to cater to tourists.  I think that it represented a good attempt to convey a superficial sense of the culture of the region, but that it was lacking depth in some areas.  Aside from the village passport and some posters which were hung in each of the houses, there was little educational material available.&lt;br /&gt;&lt;br /&gt;European culture was forced upon Sarawak by &lt;a href="http://en.wikipedia.org/wiki/James_Brooke"&gt;James Brooke&lt;/a&gt;, an unsuccessful trader, who arrived there in August 1838 after inheriting a sum of £30,000.  When he arrived, a Bidayuh uprising was in progress against the Sultan of Brunei, who ruled Sarawak at that time.  He helped to induce a peaceful settlement to the uprising and was granted the title of Rajah by the Sultan; thus becoming the first White Rajah.&lt;br /&gt;&lt;br /&gt;Don't forget that more pictures of my journey are available online at my Flickr Photostream: &lt;a href="http://www.flickr.com/photos/28808691@N05/"&gt;http://www.flickr.com/photos/28808691@N05/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-3752109238411161618?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/3752109238411161618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=3752109238411161618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3752109238411161618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3752109238411161618'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/02/sarawak-cultural-village.html' title='Sarawak Cultural Village'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3121/3246762181_0b56ebc64b_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-6435912972153477890</id><published>2009-02-02T02:01:00.008+11:00</published><updated>2009-02-02T03:16:45.439+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borneo'/><category scheme='http://www.blogger.com/atom/ns#' term='malaysia'/><title type='text'>Arrival in Borneo!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3243737629/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3106/3243737629_7f2b5288f9_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;The first thing that I noticed when coming to Malaysia from Australia was the tropical weather.  It hasn’t been extremely hot by Australian standards; maximum temperatures have been around 38°C.  However, the humidity has been close to 100% during this first part of my trip.  The high humidity means that it’s like living in a sauna.  If you sweat, it doesn’t evaporate.  The sweat just stays there, soaks your clothes, and makes you feel like you’re wearing a wet-suit.  Difficult though it is to spend long hours outside, I've been forcing myself to, and I think that I’m gradually acclimatizing.&lt;br /&gt;&lt;br /&gt;My girlfriend and I arrived in the city of &lt;a href="http://en.wikipedia.org/wiki/Kuching"&gt;Kuching&lt;/a&gt;, on the western coast of the island of &lt;a href="http://en.wikipedia.org/wiki/Borneo"&gt;Borneo&lt;/a&gt;, at 11:30 am yesterday.  Borneo itself is split among three nations: Indonesia, Malaysia and Brunei.  There are two states in the Malaysian portion; Sabah in the south west and Sarawak (of which Kuching is the capital) in the north west.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3244560988/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3321/3244560988_e0474e2183_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;Literally translated, &lt;span style="font-style: italic;"&gt;Kuching&lt;/span&gt; means “cat” in the Malay language.  There are several cat monuments on traffic islands in the city, some complete with whiskers!  The city also hosts many stray cats who seem somewhat more outgoing than those that inhabit Kuala Lumpur.&lt;br /&gt;&lt;div style="clear: both;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3243730019/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3301/3243730019_25abf52bd4_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;When we arrived at Kuching Airport yesterday, my girlfriend and I were met by a friend of her family; Mr Pei.  We visited Mr Pei’s house to have lunch, and were serenaded by some of the family with an impromptu karaoke performance in &lt;a href="http://en.wikipedia.org/wiki/Hokkien"&gt;Hokkien Chinese&lt;/a&gt;.  From there, we went on to check in at the Harbor View hotel, situated near the Kuching waterfront on the Sarawak River.&lt;br /&gt;&lt;br /&gt;Yesterday afternoon, we were met by another family friend, Uncle Loo, who is a native of Kuching.  He took us to visit the weekend market on Jalan Satok (Satok road).  Uncle Loo informed us that many of the stall-holders at this market are native river-dwelling people who live further inland than Kuching, and travel to the city only for the weekend market.  They sleep on the streets of the market or in their cars.  It would be interesting to follow some of these market gardeners back to their homes to see how they live, but that will probably have to wait for a future visit.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3243729115/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3365/3243729115_66a6766e2d_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;Today we visited the Kuching waterfront and collected some supplies for later in the week.  We had planned to visit Fort Margherita, which lies across the Sarawak River from Kuching.  Unfortunately, though, we caught the wrong boat across the river and landed at a place from which it wasn’t possible to reach the fort.  The river boats are very small—maybe 3 m long—and lie low in the water.  On the way back to Kuching, the captain of our small boat, with its complement of around 10 passengers, was unable to start the motor, so he paddled the boat by hand across the wide Sarawak River!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3244563174/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3394/3244563174_cda2772122_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;Kuching, like much of the rest of Malaysia, has extreme economic juxtaposition.  Affluent, western-style shopping centers, complete with Starbucks cafes, are situated beside alleys full of crumbling houses.  Dotted among the poorer houses are makeshift mounts for the dishes of satellite TV receivers.  New construction work is also happening everywhere.&lt;br /&gt;&lt;br /&gt;This year, Kuching has suffered unseasonally-long monsoon rains.  The areas surrounding the city have been flooded, and local newspapers have reported that around 800 people have been displaced from their homes due to the flooding.  It has rained almost continually since we arrived yesterday, but the city of Kuching itself doesn’t appear to have any flooded areas.  We have also not seen any sign of the problems that the flooding has caused, but that may be due to our staying in the most affluent part of the city.&lt;br /&gt;&lt;br /&gt;As a caucasian here, I draw some attention as a relative rarity.  The Kuching population seems to be comprised of three main groups: native people, Malays, and Chinese.  Caucasians are called &lt;span style="font-style: italic;"&gt;Gwei Lo&lt;/span&gt;s by the Cantonese-speaking Chinese and &lt;span style="font-style: italic;"&gt;Mat Salleh&lt;/span&gt; by the Malays.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/28808691@N05/3243725441/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 159px;" src="http://farm4.static.flickr.com/3451/3243725441_1ef4ef592f_m.jpg" alt="" border="0" /&gt;&lt;/a&gt;Finally, this evening, we had dinner at a seafood area near to our hotel.  I ate fried fern fronds and various other local vegetarian dishes, which were all very tasty.  I eat garlic quite a lot, and the locals here also make very enthusiastic use of it in their cooking.&lt;br /&gt;&lt;br /&gt;Tomorrow, we are going to the Sarawak Cultural Centre, and hopefully I will have time to write about it in the evening.  Don't forget that more pictures of my journey are online at my Flickr photostream: &lt;a href="http://www.flickr.com/photos/28808691@N05"&gt;http://www.flickr.com/photos/28808691@N05&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-6435912972153477890?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/6435912972153477890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=6435912972153477890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6435912972153477890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6435912972153477890'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/02/arrival-in-borneo.html' title='Arrival in Borneo!'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3106/3243737629_7f2b5288f9_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-6840468436074076880</id><published>2009-01-31T00:53:00.003+11:00</published><updated>2009-02-02T03:17:51.796+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malaysia'/><title type='text'>Arrival in Malaysia</title><content type='html'>I recently arrived in Malaysia for a one month holiday that my girlfriend and I booked early in 2008.  It has been quite hot and very humid since we arrived.  So far, we've visited some of Kuala Lumpur and Petaling Jaya, and are about to head out to Kuching, in Sarawak, on the island of Borneo.&lt;br /&gt;&lt;br /&gt;Some of the pictures of my journey so far are online here: &lt;a href="http://www.flickr.com/photos/28808691@N05"&gt;http://www.flickr.com/photos/28808691@N05&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-6840468436074076880?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/6840468436074076880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=6840468436074076880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6840468436074076880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/6840468436074076880'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2009/01/arrival-in-malaysia.html' title='Arrival in Malaysia'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-1622029111460399646</id><published>2008-08-28T09:38:00.008+10:00</published><updated>2008-08-28T11:46:16.932+10:00</updated><title type='text'>Bound properties in Scala</title><content type='html'>I've been doing some GUI programming in &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; recently.  Following the bean conventions in Java, I tend to require three things of each property I have on an object that will be used in a GUI:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A getter method.&lt;/li&gt;&lt;li&gt;A setter method.&lt;/li&gt;&lt;li&gt;A listener / notification mechanism for when the property changes.&lt;/li&gt;&lt;/ol&gt;The getters and setters are required for encapsulation, so that the internal representation of the properties of an object implementation can be changed without affecting the properties themselves. The notification mechanism is required for a GUI, so that one or more components that display the property can be updated when it changes.&lt;br /&gt;&lt;br /&gt;The key problem with the ad-hoc implementation of properties (as in JavaBeans) is that they tend to make classes noisy, with all of the &lt;code&gt;getX()&lt;/code&gt;, &lt;code&gt;setX()&lt;/code&gt; stuff, and the listener mechanism.  Things become even more complicated when properties take on the nature of collections, where multiple objects can conceptually be added or removed.&lt;br /&gt;&lt;br /&gt;In a search for simplicity, I have been investigating &lt;a href="http://www.sun.com/software/javafx/index.jsp"&gt;JavaFX&lt;/a&gt; and the even more impressive &lt;a href="https://lampsvn.epfl.ch/trac/scala/browser/scala-experimental/trunk/scalafx"&gt;ScalaFX&lt;/a&gt;. However, &lt;a href="http://jfx.wikia.com/wiki/Talk:Combining_data_models_from_regular_Java_classes"&gt;JavaFX does not yet allow bindings to properties implemented in a Java model&lt;/a&gt;, and ScalaFX, although very promising, is not quite ready for prime time.  (It's more the potential for bugs I can't understand rather than API changes that have put me off ScalaFX for the time being.)&lt;br /&gt;&lt;br /&gt;Until ScalaFX is ready, I have found a neat stop-gap solution. Inspired by the &lt;a href="http://scala.sygneca.com/future/properties"&gt;Scala wiki entry on Properties&lt;/a&gt;, I have set up my own properties as follows:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;import scala.swing.Publisher&lt;br /&gt;trait Property[T] extends Publisher {&lt;br /&gt;  def apply(): T&lt;br /&gt;  def update(value: T)&lt;br /&gt;  protected def firePropertyChanged()&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;My Properties extend &lt;code&gt;scala.swing.Publisher&lt;/code&gt; so it's possible to &lt;code&gt;listenTo&lt;/code&gt; them for events.  I defined a &lt;code&gt;PropertyChanged&lt;/code&gt; event that is intended to be fired when a property changes.  The properties also have &lt;code&gt;apply()&lt;/code&gt; and &lt;code&gt;update()&lt;/code&gt; methods which act as getters and setters respectively.&lt;br /&gt;&lt;br /&gt;So, what advantages do these kinds of properties have over normal &lt;code&gt;getX()&lt;/code&gt;, &lt;code&gt;setX()&lt;/code&gt; and a listener mechanism?&lt;br /&gt;&lt;br /&gt;Firstly, the contract of a property is clearly defined.  There is no bean-like assumption that a &lt;code&gt;setX()&lt;/code&gt; method on a class is related to a corresponding &lt;code&gt;getX()&lt;/code&gt; method, nor that a particular event will be fired when a change occurs.&lt;br /&gt;&lt;br /&gt;Secondly, each property is nicely modularized.  Properties often refer directly to a value stored in a class, and it's easy to define a &lt;code&gt;ValueProperty&lt;/code&gt; which performs this automatically.  Then, for the enclosing class, you can write something like this:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;class MyClass {&lt;br /&gt;  val x: Property[Int] = new ValueProperty[Int](42)&lt;br /&gt;}&lt;br /&gt;val instance = new MyClass()&lt;br /&gt;instance.x() = 54&lt;br /&gt;println("x = " + instance.x())&lt;br /&gt;&lt;/textarea&gt;Instead of something like this:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;class MyClass {&lt;br /&gt;  private var m_x: Int = 42&lt;br /&gt;  def x: Int = m_x&lt;br /&gt;  def x_=(value: Int) = { /* update */ }&lt;br /&gt;}&lt;br /&gt;val instance = new MyClass()&lt;br /&gt;instance.x = 54&lt;br /&gt;println("x = " + instance.x)&lt;br /&gt;&lt;/textarea&gt;At first glance, the properties version of &lt;code&gt;x&lt;/code&gt; may appear to break the principle of encapsulation, but it doesn't.  If, in the future, I wish to change the implementation of &lt;code&gt;x&lt;/code&gt;, I could do something like this:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;class MyClass {&lt;br /&gt;  val x: Property[Int] = new Property[Int] {&lt;br /&gt;    def apply(): Int = { /* fetch x */ }&lt;br /&gt;    def update(value: Int) { /* update */ }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;Clients of the code will then be able to use the &lt;code&gt;x&lt;/code&gt; property in the same way they always did.&lt;br /&gt;&lt;br /&gt;This method of defining a clear contract for a property can also be extended to vector properties, in which the property contains a collection.  It can be done fairly generally, so that the collection property may be backed in various ways by pre-existing collections (in the same way that you could implement a &lt;code&gt;Map&lt;/code&gt; as a &lt;code&gt;HashMap&lt;/code&gt; or a &lt;code&gt;TreeMap&lt;/code&gt; or whatever).&lt;br /&gt;&lt;br /&gt;A final advantage of these properties arises when they are bound into a GUI.  For example, I have a text field derivative called &lt;code&gt;BoundIntField&lt;/code&gt; which displays an integer value.  To create an instance of this class, bound to property &lt;code&gt;x&lt;/code&gt; I do the following:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;class MyClass {&lt;br /&gt;  val x: Property[Int] = new ValueProperty[Int](42)&lt;br /&gt;}&lt;br /&gt;val instance = new MyClass()&lt;br /&gt;val xField = new BoundIntField(instance.x)&lt;br /&gt;&lt;/textarea&gt;And... that's it!  The &lt;code&gt;BoundIntField&lt;/code&gt; automatically listens for changes to &lt;code&gt;x&lt;/code&gt; and updates itself.  Also, when &lt;code&gt;BoundIntField&lt;/code&gt; loses focus or receives an enter key press, it updates &lt;code&gt;x&lt;/code&gt;.  This is all done without breaking encapsulation, and without me having to write any duplicate glue code at all!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-1622029111460399646?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/1622029111460399646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=1622029111460399646' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1622029111460399646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1622029111460399646'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/08/bound-properties-in-scala.html' title='Bound properties in Scala'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-4226321999520353115</id><published>2008-08-24T23:20:00.003+10:00</published><updated>2008-08-25T00:11:24.463+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='connex'/><category scheme='http://www.blogger.com/atom/ns#' term='fail'/><category scheme='http://www.blogger.com/atom/ns#' term='ticket'/><title type='text'>Ticketing - Fail</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_S4SxpnrU6X8/SLFg79Pio8I/AAAAAAAAAAw/H-gwOFUTsJ0/s1600-h/ticket-fail.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_S4SxpnrU6X8/SLFg79Pio8I/AAAAAAAAAAw/H-gwOFUTsJ0/s320/ticket-fail.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5238074424776893378" /&gt;&lt;/a&gt;Here in Melbourne, Victoria, Australia, our public transport system is far from perfect. The trains and buses that I catch to work each day are slow and unreasonably crowded. All I can really say in their favor is that they are only rarely delayed by more than 10 minutes, and only rarely are they cancelled. However, more than once, I have missed a train because I simply couldn't get through the doors due to over-crowding.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Public transport here is also expensive. As a result, our trains and stations are policed by small tribes of trench-coat-clad transit police who will gladly dispense large fines to those who are not in possession of a ticket. They are also notorious for being heavy-handed. I don't blame the individual transit police themselves; they're clearly under-staffed and over-worked. I hope readers can see that I'm describing a larger problem here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The tickets themselves work by a process known as "validation". You insert the ticket into a machine, and the machine prints the date and time of the next expiry of the ticket. This information is also encoded in a magnetic strip that runs down the side of the ticket. Simple right? What could possibly go wrong?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A couple of weeks ago, this validation process failed me. I inserted my ticket into a machine, only to receive it back &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;without&lt;/span&gt;&lt;/span&gt; a printed date stamp! I was fully aware that if I were to be stopped by one of the transit police, they would only see me as being in possession of a ticket that had not been validated. I would have no proof that I had actually validated the ticket and the machine had failed. Knowing this, I decided to buy a new ticket, and pay for my journey twice, rather than risking a large fine or a discussion with an unreasonable, dim-witted individual.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, the proof of the machine failure is clearly evident in the picture of the ticket. Where the second trip (and second expiry date of the ticket) should appear, I have a blank line. I assure you that, even though I am entirely capable of it, there is no photographic trickery at work here. The machine simply failed me. Clearly, the magnetic strip encoding did not fail, and kept a record of my validation. Unfortunately, however, the transit police have no way to inspect the magnetic strip, so that would have been useless to me.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the past, I've heard people claim that they tried to validate a ticket and it didn't work. The transit police still fined them. Now I wonder: were some of them actually telling the truth? I pay some $2500 to ride the trains each year. For that kind of money, I should have enough room at least to stand on a train when a seat is not available; I should have courteous, reasonable transit police; and I should have a ticket machine that works. So, of those three, let's see what I &lt;span class="Apple-style-span" style="font-style: italic;"&gt;do&lt;/span&gt; have: Fail, Fail, and... oh yes, Fail.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-4226321999520353115?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/4226321999520353115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=4226321999520353115' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/4226321999520353115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/4226321999520353115'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/08/ticketing-fail.html' title='Ticketing - Fail'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_S4SxpnrU6X8/SLFg79Pio8I/AAAAAAAAAAw/H-gwOFUTsJ0/s72-c/ticket-fail.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-7621497146870908638</id><published>2008-07-08T11:15:00.004+10:00</published><updated>2008-07-08T11:27:40.914+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='brushed metal'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='os x'/><category scheme='http://www.blogger.com/atom/ns#' term='toolbar'/><category scheme='http://www.blogger.com/atom/ns#' term='scala'/><title type='text'>Brushed Metal Toolbars in Java</title><content type='html'>I've been working on a &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/"&gt;Swing&lt;/a&gt; application under OS X.  I recently became a bit frustrated with the ugly, Java-style toolbars that it was using.  They fit in well for Windows, but not on the Mac.  So, I did a bit of searching and found the following two links for making Java applications pretty under OS X, one for &lt;a href="http://developer.apple.com/technotes/tn2007/tn2196.html"&gt;Control Styles&lt;/a&gt;, and another for &lt;a href="http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html"&gt;General Integration Issues&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I couldn't find any built-in solution for creating OS X Brushed Metal toolbars (like the ones in Mail, Pages, etc).  However, with some layout help I was able to create a similar effect by using two buttons; one for the icon (&lt;code&gt;segmentedCapsule&lt;/code&gt;) and the other for the text (&lt;code&gt;segmentedCapsule&lt;/code&gt; with a &lt;code&gt;null&lt;/code&gt; border).  This is the result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_S4SxpnrU6X8/SHLBT4hTcfI/AAAAAAAAAAo/151F88TMNhk/s1600-h/SplinerScreenshot.png"&gt;&lt;img style="float:center; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_S4SxpnrU6X8/SHLBT4hTcfI/AAAAAAAAAAo/151F88TMNhk/s320/SplinerScreenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5220447465409573362" /&gt;&lt;/a&gt;&lt;br /&gt;Not too bad for a Swing application, eh?&lt;br /&gt;&lt;br /&gt;The only down side is that this is not a "proper" way to create this effect.  In addition, the button text doesn't have a correct drop-shadow, and the interaction between the text and the button when you click it is not quite the same as OS X.  However, it's &lt;b&gt;much&lt;/b&gt; better than the default Java toolbar.&lt;br /&gt;&lt;br /&gt;As a side note, I should mention that although this application uses Swing, it is written entirely in &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-7621497146870908638?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/7621497146870908638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=7621497146870908638' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7621497146870908638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7621497146870908638'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/07/brushed-metal-toolbars-in-java.html' title='Brushed Metal Toolbars in Java'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_S4SxpnrU6X8/SHLBT4hTcfI/AAAAAAAAAAo/151F88TMNhk/s72-c/SplinerScreenshot.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-4519570678794373670</id><published>2008-07-01T09:11:00.019+10:00</published><updated>2008-07-01T10:59:10.392+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javaposse'/><category scheme='http://www.blogger.com/atom/ns#' term='multiply'/><category scheme='http://www.blogger.com/atom/ns#' term='list'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='scala'/><title type='text'>Matrix Multiplication in Scala</title><content type='html'>I recently started experimenting with the &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; programming language after hearing the &lt;a href="http://www.javaposse.com/"&gt;JavaPosse&lt;/a&gt; guys raving about it. I found the &lt;a href="http://www.scala-lang.org/docu/index.html"&gt;online tutorials&lt;/a&gt; to be relatively shallow, so I went out and bought the &lt;a href="http://www.artima.com/shop/forsale"&gt;Programming in Scala&lt;/a&gt; textbook. The book is a tutorial-style introduction to the language, and is quite well written. It's not yet finished, so I bought the wip PDF, and will receive the full textbook by mail when it's finally published.&lt;br /&gt;&lt;br /&gt;Scala has a lot to like so far, although at first I found it quite daunting. I remember feeling that I was ready to get started with &lt;a href="http://python.org/"&gt;Python&lt;/a&gt; after doing the &lt;a href="http://docs.python.org/tut/tut.html"&gt;Python tutorial&lt;/a&gt;, but with Scala, it's clear that I have yet to learn about many of the features of the language.&lt;br /&gt;&lt;br /&gt;For my first steps, I decided to make a simple dense matrix class, based on Scala &lt;code&gt;List&lt;/code&gt;s, which the textbook describes as "the workhorses of Scala". Initially, I wanted to make the matrix generic, but discovered that I would need some special voodoo to ensure that the type parametrization of the matrix would only occur for classes that had the appropriate operators (&lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt; and so on). That is way beyond me at this stage, so I went for a concrete implementation using &lt;code&gt;Double&lt;/code&gt;s&lt;br /&gt;&lt;br /&gt;Here is a blow-by-blow account of the class:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols" cols="40"&gt;&lt;br /&gt;class Matrix(els: List[List[Double]]) {&lt;br /&gt;&lt;br /&gt;  /** elements of the matrix, stored as a list of &lt;br /&gt;      its rows */&lt;br /&gt;  val elements: List[List[Double]] = els&lt;br /&gt;&lt;/textarea&gt;The &lt;code&gt;Matrix&lt;/code&gt; class takes a &lt;code&gt;List&lt;/code&gt; of its rows as a parameter, and the rows are then stored in a &lt;code&gt;val&lt;/code&gt; named &lt;code&gt;elements&lt;/code&gt;.&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:firstline[6]" cols="40"&gt;&lt;br /&gt;  def nRows: Int = elements.length&lt;br /&gt;  def nCols: Int = if (elements.isEmpty) 0 &lt;br /&gt;                   else elements.head.length&lt;br /&gt;&lt;br /&gt;  /** all rows of the matrix must have the same &lt;br /&gt;      number of columns */&lt;br /&gt;  require(elements.forall(_.length == nCols))&lt;br /&gt;&lt;/textarea&gt;Here, the number of rows and columns of the matrix are calculated from the list of elements, and we have a &lt;code&gt;require&lt;/code&gt; directive which checks that all rows of the matrix have the same number of elements (ie. the same number of columns). The &lt;code&gt;forall&lt;/code&gt; method returns &lt;code&gt;true&lt;/code&gt; if a particular predicate is true for all members of a &lt;code&gt;List&lt;/code&gt;.  In this case, our predicate is constructed as the function &lt;code&gt;_.length == nCols&lt;/code&gt; which is equivalent to the function object &lt;code&gt;(x: List[Double]) =&gt; x.length == nCols&lt;/code&gt;.&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:firstline[13]" cols="40"&gt;&lt;br /&gt;  private def addRows(a: List[Double], &lt;br /&gt;                      b: List[Double]): &lt;br /&gt;    List[Double] = &lt;br /&gt;      List.map2(a,b)(_+_)&lt;br /&gt;&lt;br /&gt;  private def subRows(a: List[Double], &lt;br /&gt;                      b: List[Double]): &lt;br /&gt;    List[Double] =&lt;br /&gt;      List.map2(a,b)(_-_)&lt;br /&gt;&lt;br /&gt;  def +(other: Matrix): Matrix = {&lt;br /&gt;    require((other.nRows == nRows) &amp;&amp; &lt;br /&gt;            (other.nCols == nCols))&lt;br /&gt;    new Matrix(&lt;br /&gt;      List.map2(elements, other.elements)&lt;br /&gt;        (addRows(_,_))&lt;br /&gt;    )&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  def -(other: Matrix): Matrix = {&lt;br /&gt;    require((other.nRows == nRows) &amp;&amp; &lt;br /&gt;            (other.nCols == nCols))&lt;br /&gt;    new Matrix(&lt;br /&gt;      List.map2(elements, other.elements)&lt;br /&gt;        (subRows(_,_))&lt;br /&gt;    )&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  def transpose(): Matrix = &lt;br /&gt;    new Matrix(List.transpose(elements))&lt;br /&gt;&lt;/textarea&gt;These methods define addition and subtraction by adding rows of the matrices, while we get &lt;code&gt;transpose&lt;/code&gt; for free from &lt;code&gt;List&lt;/code&gt;.  Again in these methods, the underscore notations are equivalent to function objects.  For example, &lt;code&gt;_+_&lt;/code&gt; is in this case equivalent to &lt;code&gt;(x: Double, y: Double) =&gt; x + y&lt;/code&gt;&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:firstline[43]" cols="40"&gt;&lt;br /&gt;  private def dotVectors(a: List[Double], &lt;br /&gt;                         b: List[Double]): &lt;br /&gt;  Double = {&lt;br /&gt;    val multipliedElements = &lt;br /&gt;      List.map2(a,b)(_*_)&lt;br /&gt;    (0.0 /: multipliedElements)(_+_)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  def *(other: Matrix): Matrix = {&lt;br /&gt;    require(nCols == other.nRows)&lt;br /&gt;    val t = other.transpose()&lt;br /&gt;    new Matrix(&lt;br /&gt;      for (row &lt;- elements) yield {&lt;br /&gt;        for (otherCol &lt;- t.elements)&lt;br /&gt;          yield dotVectors(row, otherCol)&lt;br /&gt;      }&lt;br /&gt;    )&lt;br /&gt;  }&lt;br /&gt;&lt;/textarea&gt;This is a really fun way to multiply matrices. It directly implements the concept of multiplying rows of one matrix by the columns of the other. The inner &lt;code&gt;yield&lt;/code&gt; produces a &lt;code&gt;List[Double]&lt;/code&gt; formed from the dot products of each row of the left matrix by all of the columns of the right matrix. This produces a single row of the result matrix. The outer &lt;code&gt;yield&lt;/code&gt; simply collects all of the rows of the result matrix.&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:firstline[61]" cols="40"&gt;&lt;br /&gt;  override def toString(): String = {&lt;br /&gt;    val rowStrings = &lt;br /&gt;      for (row &lt;- elements) &lt;br /&gt;        yield row.mkString("[", ", ", "]")&lt;br /&gt;    rowStrings.mkString("", "\n", "\n")&lt;br /&gt;  }&lt;br /&gt;&lt;/textarea&gt;For pretty-printing, this adds the &lt;code&gt;toString&lt;/code&gt; method.&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:firstline[67]" cols="40"&gt;&lt;br /&gt;object Matrix {&lt;br /&gt;  def apply(nCols: Int, els: Double*):Matrix = {&lt;br /&gt;    def splitRowsWorker(&lt;br /&gt;      inList: List[Double], &lt;br /&gt;      working: List[List[Double]]):&lt;br /&gt;    List[List[Double]] =&lt;br /&gt;      if (inList.isEmpty)&lt;br /&gt;        working&lt;br /&gt;      else {&lt;br /&gt;        val (a, b) = inList.splitAt(nCols)&lt;br /&gt;        splitRowsWorker(b, working + a)&lt;br /&gt;      }&lt;br /&gt;    def splitRows(inList: List[Double]) =&lt;br /&gt;      splitRowsWorker(inList, List[List[Double]]())&lt;br /&gt;    val rows: List[List[Double]] = &lt;br /&gt;      splitRows(els.toList)&lt;br /&gt;    new Matrix(rows)&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/textarea&gt;This object adds the ability to construct a &lt;code&gt;Matrix&lt;/code&gt; from an array of &lt;code&gt;Double&lt;/code&gt;s provided to the &lt;code&gt;apply&lt;/code&gt; method.&lt;br /&gt;&lt;br /&gt;If the above code is in a file called &lt;code&gt;Matrix.scala&lt;/code&gt;, then we can do the following in the Scala interpreter:&lt;br /&gt;&lt;textarea name="code" class="c#:nocontrols:nogutter" cols="40"&gt;&lt;br /&gt;scala&gt; :load Matrix.scala&lt;br /&gt;Loading Matrix.scala...&lt;br /&gt;defined class Matrix&lt;br /&gt;defined module Matrix&lt;br /&gt;&lt;br /&gt;scala&gt; val x = Matrix(3, 1,2,3,4,5,6)&lt;br /&gt;x: Matrix = &lt;br /&gt;[1.0, 2.0, 3.0]&lt;br /&gt;[4.0, 5.0, 6.0]&lt;br /&gt;&lt;br /&gt;scala&gt; x*x.transpose&lt;br /&gt;res0: Matrix = &lt;br /&gt;[14.0, 32.0]&lt;br /&gt;[32.0, 77.0]&lt;br /&gt;&lt;/textarea&gt;So, dense matrices with multiplication, addition, subtraction and transposition can be implemented fairly easily in Scala.  The next steps could include making the &lt;code&gt;Matrix&lt;/code&gt; class parametrizable (so we could have a &lt;code&gt;Matrix[Int]&lt;/code&gt; or &lt;code&gt;Matrix[Double]&lt;/code&gt;).  It would also be interesting to investigate the performance of &lt;code&gt;Array&lt;/code&gt;-based vs &lt;code&gt;List&lt;/code&gt;-based matrix operations.  I think array-based implementations would definitely win out in the case of operations that need frequent random element access (like Gaussian elimination), but may be no better than using lists for things like multiplication and addition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-4519570678794373670?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/4519570678794373670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=4519570678794373670' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/4519570678794373670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/4519570678794373670'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/07/matrix-multiplication-in-scala.html' title='Matrix Multiplication in Scala'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-7729984578790534047</id><published>2008-06-24T08:55:00.001+10:00</published><updated>2008-06-24T08:59:25.265+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pedometer'/><category scheme='http://www.blogger.com/atom/ns#' term='activity monitor'/><category scheme='http://www.blogger.com/atom/ns#' term='fitness'/><category scheme='http://www.blogger.com/atom/ns#' term='accelerometer'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='core location'/><category scheme='http://www.blogger.com/atom/ns#' term='push'/><title type='text'>iPhone Push Notification - Doesn't Solve My Problem</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_S4SxpnrU6X8/SGAgi8z9-LI/AAAAAAAAAAg/wGMVbBiNWpo/s1600-h/xcode.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_S4SxpnrU6X8/SGAgi8z9-LI/AAAAAAAAAAg/wGMVbBiNWpo/s320/xcode.png" alt="" id="BLOGGER_PHOTO_ID_5215204153306773682" border="0" /&gt;&lt;/a&gt;The recent Apple &lt;a href="http://developer.apple.com/wwdc/"&gt;WWDC&lt;/a&gt; heralded the arrival of &lt;a href="http://www.ipodobserver.com/story/36309"&gt;Push Notification&lt;/a&gt; for third-party applications on the &lt;a href="http://www.apple.com/iphone/"&gt;iPhone&lt;/a&gt;, which we can probably expect in the 2.0 release of the iPhone (and maybe the iPod Touch?) software. Much of the focus of the keynote presentation that covered this topic was the use of these notifications for social networking applications. If you have the infrastructure set up to run a server and send out these messages via Apple's exclusive link to the phone, then I think it's clear that the notifications will obviate the need for a background process. However, this only works for applications that fit one particular model.&lt;br /&gt;&lt;br /&gt;Working in biomechanics, I'm interested in seeing the iPhone used as an activity monitor. The existence of both an accelerometer and the Core Location APIs means that the phone has all the ingredients of a basic fitness computer. Indeed, someone has already written a &lt;a href="http://code.google.com/p/iphone-pedometer/"&gt;pedometer application&lt;/a&gt;, showing that this sort of functionality is possible. Whether or not it is practical is yet to be demonstrated, but unfortunately we can't properly develop fully-fledged versions of such applications anyway... read on.&lt;br /&gt;&lt;br /&gt;Imagine some hypothetical software on your iPhone... let's say you go jogging and you use a personal fitness program designed for runners. The program uses Core Location to establish your initial position and logs your route. It uses the accelerometer to count your steps. With this information, it can give you speed, cadence and stride length statistics, it can tell you about the hills you've climbed, and even without heart-rate data it can evaluate your general fitness. The application could also log all of this data, so that you can see your training schedule and how you progress over time. All of this on a phone that fits in the palm of your hand! However, the dream ends as soon as you receive a phone call or want to listen to music while you run. If you do anything like this, you effectively end the application, and its logging will be suspended until you activate it again. Such interruptions would make the use of the program and the phone mutually exclusive of each other.&lt;br /&gt;&lt;br /&gt;This is just one example of an application which, if it is to run on the iPhone, will need to be able to set up a true background process. You can't get around this kind of problem with push notifications. I agree with Apple that we shouldn't use background processes to listen for instant messages or to achieve background downloads. These can be done using callback mechanisms, whether they're server-pushed notifications or API hooks that Apple may provide. Also clear is the fact that an application like the one I've described above &lt;span style="font-style: italic;"&gt;will&lt;/span&gt; be processor-intensive and &lt;span style="font-style: italic;"&gt;will&lt;/span&gt; drain your battery relatively quickly. But just imagine how great it would be! I'm relatively sure that the iPhone battery would be able to cope with logging for the periods of time that most of us are actually capable of running. I hope Apple eventually gives us the ability to run true background processes, for times like this, when we actually need them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-7729984578790534047?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/7729984578790534047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=7729984578790534047' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7729984578790534047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/7729984578790534047'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/06/iphone-push-notification-doesnt-solve.html' title='iPhone Push Notification - Doesn&apos;t Solve My Problem'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_S4SxpnrU6X8/SGAgi8z9-LI/AAAAAAAAAAg/wGMVbBiNWpo/s72-c/xcode.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-1610134806220974194</id><published>2008-06-20T14:43:00.000+10:00</published><updated>2008-06-20T15:15:39.187+10:00</updated><title type='text'>Discarded Graphics - Equine Anatomy</title><content type='html'>I decided I'd upload this picture online. It's a graphic that I created for a paper I've submitted, but it never made it into the final draft of the paper itself:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_S4SxpnrU6X8/SFs2Kws-WbI/AAAAAAAAAAY/OuDdUt1Xz8Y/s1600-h/merritt-et-al-figure-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_S4SxpnrU6X8/SFs2Kws-WbI/AAAAAAAAAAY/OuDdUt1Xz8Y/s320/merritt-et-al-figure-1.png" alt="" id="BLOGGER_PHOTO_ID_5213820552111610290" border="0" /&gt;&lt;/a&gt;You can click on the image to get a larger version. A key to the image is as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;Bones and Joints:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;R - Radius (this is fused to the ulna in the horse)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;C - Carpus (like the human wrist)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;M - Metacarpus (like the bones in the human hand)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;S - Paired proximal sesamoid bones&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;F - Fetlock (metacarpophalangeal) joint&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;P1 - First / proximal phalanx&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I - Proximal interphalangeal joint&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;P2 - Second / middle phalanx&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;D - Distal interphalangeal joint&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;N - Distal sesamoid (navicular) bone&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;P2 - Third / distal phalanx (coffin bone)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;Tendons and Ligaments&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CL - Distal check ligament of the tendon of the deep digital flexor muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;DDFT - Tendon of the deep digital flexor muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;IL - Interosseous / suspensory ligament (third interosseous muscle)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;SDFT - Tendon of the superficial digital flexor muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;EB - Extensor branches of the interosseous ligament&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;ECR - Tendon of the extensor carpi radialis muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;LDE - Tendon of the lateral digital extensor muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CDE - Tendon of the common digital extensor muscle&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;Metacarpus&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Red areas represent regions of attachments&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;T - Metacarpal tuberosity, for attachment of the tendon of the extensor carpi radialis muscle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;MC2 - Second metacarpal (splint) bone&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;MC3 - Third metacarpal (cannon) bone&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;MC4 - Fourth metacarpal (splint) bone&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Z - attachment zone for interosseous ligament&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Cy - Metacarpal condyle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;MSR - Mid-sagittal ridge of the metacarpal condyle&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;The image was created entirely using Open Source software, or software I created. The bones were digitized from the actual bones of a small pony, using photogrammetric software that I wrote myself. The tendons were then added on top of them "artisically", using &lt;a href="http://www.blender.org/"&gt;Blender&lt;/a&gt;. Rendering was done using &lt;a href="http://www.aqsis.org/"&gt;Aqsis&lt;/a&gt;, and labels were added using &lt;a href="http://www.inkscape.org/"&gt;Inkscape&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I've decided to release this image under the &lt;a href="http://creativecommons.org/licenses/by/2.0/"&gt;Creative Commons Attribution License&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-1610134806220974194?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/1610134806220974194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=1610134806220974194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1610134806220974194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/1610134806220974194'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/06/discarded-graphics-equine-anatomy.html' title='Discarded Graphics - Equine Anatomy'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_S4SxpnrU6X8/SFs2Kws-WbI/AAAAAAAAAAY/OuDdUt1Xz8Y/s72-c/merritt-et-al-figure-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-3663872900718855001</id><published>2008-06-20T14:11:00.000+10:00</published><updated>2008-06-20T14:26:06.773+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='horse'/><category scheme='http://www.blogger.com/atom/ns#' term='journal'/><category scheme='http://www.blogger.com/atom/ns#' term='joint reaction force'/><category scheme='http://www.blogger.com/atom/ns#' term='creative commons'/><category scheme='http://www.blogger.com/atom/ns#' term='publication'/><category scheme='http://www.blogger.com/atom/ns#' term='PhD'/><category scheme='http://www.blogger.com/atom/ns#' term='equine distal forelimb'/><category scheme='http://www.blogger.com/atom/ns#' term='mtu'/><title type='text'>Publication - Always a good thing</title><content type='html'>The final revision of one the papers from my PhD was recently published online. Publications are always good, but this one is particularly great because it's published in an Open Access journal. Open Access means that you get all of the benefits of a normal peer-reviewed journal, but the end users don't have to pay a subscription fee. One possible down side is that publication costs tend to be a little higher for the authors (although many closed journals cost a lot for publication too!). That wasn't a problem for me - my boss paid for it.&lt;br /&gt;&lt;br /&gt;The paper itself is this one:&lt;br /&gt;&lt;br /&gt;Merritt, J.S., Davies, H.M.S., Burvill, C. and Pandy, M.G. (2008) Influence of Muscle-Tendon Wrapping on Calculations of Joint Reaction Forces in the Equine Distal Forelimb. &lt;span style="font-style: italic;"&gt;Journal of Biomedicine and Biotechnology.&lt;/span&gt; Article ID &lt;span style="font-weight: bold;"&gt;165730&lt;/span&gt;, 9 pages, &lt;span id="ctl00_ContentPlaceHolder1_LblExtraContent"&gt;doi:10.1155/2008/165730.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.hindawi.com/GetArticle.aspx?doi=10.1155/2008/165730"&gt;&lt;span id="ctl00_ContentPlaceHolder1_LblExtraContent"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;This is a direct link.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oh, and one more thing... it's published under the &lt;a href="http://creativecommons.org/licenses/by/2.0/"&gt;Creative Commons Attribution License&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-3663872900718855001?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/3663872900718855001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=3663872900718855001' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3663872900718855001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/3663872900718855001'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/06/publication-always-good-thing.html' title='Publication - Always a good thing'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3876597699154512435.post-5783134206798731247</id><published>2008-06-20T14:09:00.000+10:00</published><updated>2008-06-20T14:11:02.454+10:00</updated><title type='text'>New Blog</title><content type='html'>OK - I'm starting yet another half-assed blog. I'm going to see what happens when I use a blogging service rather rolling my own.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3876597699154512435-5783134206798731247?l=jsmerritt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsmerritt.blogspot.com/feeds/5783134206798731247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3876597699154512435&amp;postID=5783134206798731247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5783134206798731247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3876597699154512435/posts/default/5783134206798731247'/><link rel='alternate' type='text/html' href='http://jsmerritt.blogspot.com/2008/06/new-blog.html' title='New Blog'/><author><name>Jonathan Merritt</name><uri>http://www.blogger.com/profile/08148499902760061921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_S4SxpnrU6X8/SFsz89s66BI/AAAAAAAAAAM/QzQ1ZosCl4U/S220/n218101316_2077.jpg'/></author><thr:total>0</thr:total></entry></feed>
