tag:blogger.com,1999:blog-70127427293726089362024-03-13T18:31:36.326+01:00This is not a programmer's blog.Computers, technology, games. And other ramblings. And sometimes in Swedish.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.comBlogger109125tag:blogger.com,1999:blog-7012742729372608936.post-77856113065479645042016-05-26T08:26:00.001+01:002016-05-26T08:28:06.602+01:00Linux remote desktop woesI've often tried to get a remote-desktop solution to work on Linux as smoothly as remote desktop works on Windows, but this has long been an area where Linux simply isn't up to the task.<br />
<br />
<i>To clarify things, by "remote-desktop solution" I mean connecting to a remote Linux workstation for the purposes of being able to work e.g. from home. There are of course other use-cases which have other requirements and possibilities.</i><br />
<br />
There are lots of articles online which cover the topic of "best remote desktop solutions on Linux", so go ahead and <a href="https://www.google.se/search?q=remote+desktop+linux" target="_blank">google it</a>. <br />
<br />
Requirements? Well, I have a few:<br />
<ul>
<li>Cross-platform on the client side. I want the flexibility of using any OS to connect.</li>
<li>It has to use a encrypted connection. </li>
<li>It has to be able to connect to the physical desktop, i.e. the same screen as is displayed on the monitor physically connected to the machine.</li>
<li>Performance. It needs to be "fast enough", which is a very subjective measure.</li>
<li>When connecting to the remote Linux machine, the client should automatically resize the remote (physical) screen to the native size of the client's screen. The remote Linux machine will often have multiple monitors, but the client will typically not.</li>
<li>I should be able to connect to the machine and login using the same credentials as when I'm at the machine.</li>
</ul>
When I say that "Linux is simply not up to the task", I mean that there is no standard way included in all Linux distributions which fulfills my requirements out-of-the-box. Yes, there are a number of different solutions (e.g. ssh tunnels), but none of them qualify for "out-of-the-box".<br />
<br />
<a href="https://www.nomachine.com/" target="_blank">NoMachine</a> is a novel concept where your physical desktop is streamed as a compressed video-stream, as opposed to sending logical drawing operations and compressed bitmaps as e.g. VNC does. (Disclaimer: this is the impression I got when using NoMachine, but I may be wrong). Despite claims of being blazingly fast, I wasn't impressed with the performance, at least not when I compare it with RDP on Windows. Also, it never was able to resize the remote screen despite claims to have support for that.<br />
<br />
I've made several attempts at getting x11vnc to work, but I've always given up due to bad performance and that it requires many manual steps to get everything working. However, I recently gave it another try and actually managed to get something which almost was acceptable:<br />
<ul>
<li>Starting the server as "x11vnc -find -nopw" makes it automatically find my physical desktop even when logging in remotely via ssh.</li>
<li>Setting up a putty ssh tunnel is of course annoying, but with a Typically my brain goes like this: "Hm, I need to work from home today. I'd like to work on my Linux laptop, but I left it at work. <br />
little fiddling you can automate almost all of it.</li>
<li>Performance-wise it was better than I remember it. Maybe this is due to improved broadband connection at home.</li>
<li>Using "xrandr -s 1920x1080" (on the remote machine, after connecting) successfully managed to resize the screen to the client's native resolution. Not exactly "automatic", but better than nothing. Also, it is really annoying that I need to manually reconfigure my monitors when I get back to work.</li>
</ul>
So now I have two options for working from home. One is to fiddle around with x11vnc, putty, and xrandr in order to be able to work in a nice and friendly Linux environment. Or two, connect quickly and directly to my Windows machine at work and suffer the torment of having to work on Windows.<br />
<br />
Actually, there is a third choice. Bring my laptop home with me, but since I don't have VPN access on my Linux machine, that means I'm limited to offline development. Which of course sometimes can mean improved productivity.<br />
<br /><br />
<ul></ul>
Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-60161307286765769062015-03-16T11:54:00.001+01:002015-03-17T21:59:59.159+01:00EclipseCon 2015This time of year I usually find myself somewhere in the US attending EclipseCon. This year was no different. This time EclipseCon stayed put in the same location as last year, in Burlingame, CA. The venue was good (although most business hotel places tend to all look the same and a little boring, but then again I didn't come here to visit innovative hotels).<br />
<br />
Being my 7th EclipseCon I'm almost getting the feeling of being a veteran, and it was great fun to meet friends which I usually only meet at EclipseCon. I also had the good sense of attending the hackathon on tuesday evening and got my feet wet with a real commit to CDT. Thanks to Marc Khouzam and Marc-Andre Laperle for helping me out with that.<br />
<br />
As it so often is when you're at a conference, there are more talks than you can attend, but I'll try to summarize some trends or themes as I saw them.<br />
<br />
The first theme I found interesting was the two seemingly unconnected talks <a href="https://www.eclipsecon.org/na2015/session/boosting-cdt-builds" target="_blank">Boosting CDT Build</a> and <a href="https://www.eclipsecon.org/na2015/session/eclipse-gradle-best-both-worlds" target="_blank">Eclipse & Gradle - The best of both worlds</a>. Both focused on the importance of maintaining build models and the possibility of being able to consume builds in different ways. By using an external process as a build server and implementing a well-defined API, builds can be made more stable and more flexible. Maybe Gradle has the potential to solve the CDT MBS mess as well.<br />
<br />
The second theme is cloud development which had <a href="https://www.eclipsecon.org/na2015/session-tracks/cloud-development" target="_blank">its own track</a>. Eclipse Che, Eclipse Orion, and Eclipse Flux are just a couple of examples of using your browser as an IDE. But this trend is not only about IDE-in-a-browser, but also about extending the Eclipse ecosystem to include more than just the Eclipse Platform. This has been going on for some time, but it became very clear to me at this conference.<br />
<br />
The third theme I'd like to mention is UI testing. <a href="https://www.eclipsecon.org/na2015/session/jekyll-and-hyde-jubula" target="_blank">Jubula</a> has been around for a while, but this was the first time I had the possibility to attending a talk about it. Another similar tool is <a href="https://www.eclipsecon.org/na2015/session/why-ui-testing-so-hard" target="_blank">RCPTT</a> which addresses much the same issues, but has some different takes on it. I've tried several ways at doing automated UI testing, but it always boils down the the problem of identifying UI elements in a way that allows you to capture UI logic such that it is possible to write useful, stable, and maintainable tests.<br />
<br />
There were many more talks and things to mention about EclipseCon, but I will leave it at that.<br />
<br />
Other links about EclipseCon 2015 (let me know if I should add more links to this list):<br />
<ul>
<li><a href="http://cdtdoug.ca/?p=627" target="_blank">Doug Schaefer's blog</a></li>
<li><a href="http://www.itworld.com/article/2896753/oracle-lays-out-lego-like-future-of-java.html" target="_blank">Paul Krill on Mark Reinhold's Java 9 keynote</a></li>
<li><a href="https://www.youtube.com/results?search_query=eclipsecon+2015" target="_blank">Youtube videos</a> (speaker pitches among other things)</li>
<li><a href="http://adtmag.com/blogs/watersworks/2015/03/eclipsecon-2015-wrap-up.aspx" target="_blank">John K. Waters wrap-up</a></li>
</ul>
<br />Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-4002358657569304712014-08-19T12:07:00.002+01:002014-08-19T12:07:34.950+01:00Just let me code!The other day I ran into <a href="http://www.drdobbs.com/tools/just-let-me-code/240168735">this</a> article on Dr. Dobbs. The headline is "just let me code!", and the author laments the lack of "coding" in his daily work routine. This is nothing new (although the author seems to want to imply that this is a recent change. I remember a figure mentioned during a lecture back in '93 or so, where the average programmer spent around 10% percent of his time actually writing code. The rest were spent in meetings, administrative tasks, building, testing, etc.)<br />
<br />
The articles goes on and blames the "complexity of the tools" for preventing the programmer from doing what he likes most: writing code. Tasks such as managing the SCM system, IDE, build system, deployment, testing on a variety of client systems and hardware platforms. This takes time from the <i>pure, creative </i>task of programming.<br />
<br />
I have a rather different take on it.<br />
<br />
Programming today is complicated because the systems we build are complicated. They are no longer simple executables which take some input and produce some response. They handle huge data sets using databases. They handle a wide variety of client platforms by leveraging a Javascript-enabled web browser. They handle automatic updates using continuous delivery platforms. And so on.<br />
<br />
Demanding that you, as a professional programmer, who makes a living creating complex software products, should be able to "just code", is like a carpenter wanting to just have to do woodwork, and not have to bother about boring things like "following local building regulations". It works if you are only doing it as a hobby, but not if you intend to make a living on it.<br /><br />
Source code control, build systems and test frameworks are just as much part of the noble art of programming as writing nice, elegant, pure functions in Haskell. Writing makefiles, tests, and deployment scripts is also "coding", and should not be treated as anything less.<br />
<br />
Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-27382983323084155172014-03-24T11:36:00.002+01:002014-03-24T11:36:15.938+01:00EclipseCon 2014<h2>
EclipseCon 2014</h2>
<div>
<span style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="56" src="https://www.eclipsecon.org/na2014/sites/all/themes/eclipsecon_base/2014/ecna2014/logo.png" width="200" /></span><a href="https://www.eclipsecon.org/na2014/">EclipseCon</a> has been a yearly event for my part the last 5 years. It is a great opportunity to get a feeling of how things are in the Eclipse ecosystem, meet other Eclipse developers, and to visit (hopefully) new places. This year EclipseCon was back to the same location as it was in 2005, <a href="https://www.google.com/maps/place/1333+Bayshore+Hwy-Hyatt+Regency/@37.59393,-122.3644,17z/">Hyatt Regency in Burlingame, CA</a>.<br />
<blockquote class="twitter-tweet" lang="sv">
So much good content at last <a href="https://twitter.com/search?q=%23EclipseCon&src=hash">#EclipseCon</a> that just summarizing it in a blog post seems like a huge task...<br />
— Mickael Istria (@mickaelistria) <a href="https://twitter.com/mickaelistria/statuses/447994724704858112">24 mars 2014</a></blockquote>
I tried to priotize my time as good as I could. The <a href="https://wiki.eclipse.org/CDT/summitecon2014">CDT summit</a> was a good place to talk to other CDT people, and see some of the new work that has been done: standalone CDT debugger, multicore debugging, new jobs API, new launch UI, various UX improvements from Momentics, and many more things. There were also a number of interesting CDT talks on the schedule. One of these were about multicore debugging with the Parallella board, a computer the size of a Raspberry Pi but with 16 cores on it.</div>
<blockquote class="twitter-tweet" lang="sv">
Excited about presentation on Parallella multicore debugging with <a href="https://twitter.com/marckhouzam">@marckhouzam</a> at Eclipsecon in SF. <a href="https://t.co/Schnb3jEe6">https://t.co/Schnb3jEe6</a><br />
— Andreas Olofsson (@adapteva) <a href="https://twitter.com/adapteva/statuses/411175818489233408">12 december 2013</a></blockquote>
<b>Internet of Things</b> (or IoT) was one of the major themes this year. Even if IoT is the buzzword of the day, it is really not new. IoT at Eclipse is also to a large extent about <b>open source; </b>with the increase of open hardware platforms such as Arduino, Beagle Bones, and Raspberry Pi, there is lots of possibilities for innovation in this space. Catarina Motas keynote "<a href="https://www.eclipsecon.org/na2014/session/bits-atoms-and-back">From Bits and Atoms and Back</a>" was about "open materials" showed many examples of open source hardware growing from obscure hobbies to a large movement. The image of the young child who played catch with his 3D-printed prosthetic hand will stay with me for a long time. Some of the material shown during the keynote can be found <a href="http://community.bonitasoft.com/blog/eclipse-con-keynote-catarina-mota-all-links-she-shared-about-open-hardware">here</a>.<br />
<br />
The Java 8 official release was timed to be on the same day as the Java 8 theme day, and there were several talks about new features. My main disappointment was that Java 8 does not support compiling Java 8-specific features to run on a Java 7 VM, something I was hoping for.<br />
<br />
Since I like geocaching, I couldn't resist going to the talk about <a href="https://www.eclipsecon.org/na2014/session/designing-applications-handling-space-and-time">Designing Applications Handle Space and Time</a>, which was about projects in the new LocationTech working group. These are Eclipse projects which somehow deal with geospatial data (maps, coordinates, etc). One particularly interesting project was <b>GeoGit, </b>a git-like tool for versioning and editing of spatial data.<br />
<br />
Another theme this year was <b>Cloud</b>, particularly how to apply cloud concepts to current desktop IDE environment. How can we bring the benefits of cloud applications into the domains of desktop IDEs and compiled languages. One cool project is <b>Project Flux</b>, which is describes as "Dropbox for your IDE". In short it connects your Eclipse projects to a cloud service so that you can access it from any browser with full support for code-completion, syntax highlighting, and other IDE features.<br />
<br />
One of the slides during the Project Flux talk was this one, which was massively retweeted around the world:<br />
<blockquote class="twitter-tweet" lang="sv">
A legit question! <a href="https://twitter.com/search?q=%23eclipsecon&src=hash">#eclipsecon</a> <a href="http://t.co/9Mnv5qIkmp">pic.twitter.com/9Mnv5qIkmp</a><br />
— Java (@java) <a href="https://twitter.com/java/statuses/446384369536479233">19 mars 2014</a></blockquote>
Many of the comments where the usual ranty replies about how slow Eclipse is, but I think the answer to the question is really very simple. Google spends billions of dollars in manpower and hardware to keep search fast (this is probably their most important business goal). If Eclipse were to get even a fraction of that to improve performance, Eclipse would be blazingly fast in every respect.<br />
<br />
What was my lasting impression, then? Well, EclipseCon was a little smaller (counted by the number of attendees) than previous years, but the community and ecosystem is growing and Eclipse is today so much more than just an IDE.<br />
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script>
Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-61244731792253073942013-10-15T11:49:00.003+01:002013-10-15T11:49:44.943+01:00Using Clang to analyze legacy C++ source code<h2>
Legacy Code</h2>
At IAR Systems where I work, we have a fair amount of C++ source code, some of which is very old. The oldest parts probably date back to the mid 90s. We've done a fairly good job at maintaining the code so many parts are still in active use.<br />
<br />
There is one particular code base which has been of interest to me for some time. The code base is (in code years) very old, I believe many parts of it has roots in the mid 90s. The code is used to describe configuration data together with functional parts which describe relationships between the objects in the configuration. There are two main problems with the code:<br />
<br />
<ol>
<li>The only way to reliably change properties in the model is to interact with a UI: pressing buttons, entering text, etc. The model can be serialized to XML, but the XML contents cannot be correctly understood without access to the C++ code.</li>
<li>The only output possible is a sequence of strings on a certain format to be passed on to other tools.</li>
</ol>
<div>
In other words, you can edit the model using a UI, and you can execute the model by passing the results to other tools. For example, it is not possible to</div>
<div>
<ul>
<li>Enumerate all properties which can be modified.</li>
<li>Describe the properties (their type, the possible values)</li>
<li>Describe how properties interact with other properties. The set of valid values of a property may depend on the values of other properties, but this is hidden in the C++ code.</li>
</ul>
</div>
A typical piece of code might look like this:<br />
<br />
<pre>class Person;
class Manager : public Person
{
...
};
class Assassin : public Person
{
...
};
class SecretAgentBehavior : public DefaultSecretAgentBehavior
{
SecretAgentBehavior(Person boss) { ... }
std::string getArguments()
{
Assignment a = boss.getAssignment();
return "-dostuff " + a.getName + " -o output.txt";
}
};
// Bob The Boss is a secret agent manager
Manager boss("Bob The Boss", new BossBehavior /* defined elsewhere */);
// John Smith is an assassin, and Bob The Boss is his manager
Assassin john("John Smith", new SecretAgentBehavior(boss));
</pre>
<br />
I would like to be able to extract as much useful information from this code base as possible, to facilitate a future migration of the configuration data to a system which makes it easier to analyze the data and generate different outputs based on the data. <i>Enter Clang.</i><br />
<h2>
</h2>
<h2>
<a href="http://clang.llvm.org/">Clang</a></h2>
<div>
The first approach I tried was to try to modify the code itself to produce some useful information, but this did not work well. The necessary metadata was simply missing. For example, the only place where the type of the model elements (the secret agents in the example above) was stored was as C++ types. The limited support for reflection in C++ made this approach impossible.</div>
<div>
<br /></div>
<div>
I then got this "crazy idea" to try to use Clang to parse the C++ source code. The source code itself is fairly structured and follows a handful of different patterns, so we are not talking about analyzing arbitrary C++ source code. Also, we are only interested in parsing the source code, not generating executable code. This is fortunate, since the code in question has never been compiled by anything other than Visual Studio, and uses lots and lots of Visual Studio-specific things (MFC, for example). Would it be possible for Clang to at least be able to build an AST of the code?</div>
<div>
<br /></div>
<div>
It turned out to be if not trivial, at least fairly easy. The main problem was that Clang was unable to parse the Windows-specific header files defining things like <tt>CString</tt>, <tt>CWinApp</tt>, etc. I solved this by placing dummy definitions in a special header file. To make sure that all source files which expects to get these definitions actually get them, I created a set of replacement header files (afx.h, windows.h, etc.) which all simply included the header file with the dummy defininitions. For example, the definition of CWinApp looks like this:<br />
<br />
<pre>class CWinApp
{
public:
HICON LoadIcon(LPCTSTR name);
HICON LoadIcon(UINT resid);
};
</pre>
<br />
That's it. Since Clang does not need to compile and link, these kind of dummy definitions are enough.<br />
<br />
Ok, so once the code base passed successfully through clang-check, then what? How do we get any useful information out?<br />
<br />
<h2>
AST Matchers</h2>
</div>
<div>
There are good <a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html">tutorials</a> on how to write a Clang tool, so I will skip over that here.</div>
<div>
<br /></div>
<div>
The Clang AST is a complex beast (run clang-check -ast-dump on any non-trivial program), and to make it easier to navigate and make sense of the AST, the AST Matchers API allows you to write "simple" rules describing the parts of the AST that you are interested in.</div>
<br />
For the example above, a rule which matches the persons may look like this:<br />
<br />
<pre>varDecl(
hasDescendant(
constructExpr(
hasType(recordDecl(isSameOrDerivedFrom("Person"))),
hasArgument(0, expr().bind("name")),
hasArgument(1, expr().bind("behavior")))));
</pre>
<br />
The bind() calls are placed so that the corresponding AST node can be extracted in the callback function which is invoked each time the rule matches.<br />
<br />
The rule will be invoked twice, once for the boss and one for the assassin. The callback function looks like this:<br />
<br />
<pre>virtual void run(const MatchFinder::MatchResult &result)
{
const Expr *name = result.Nodes.getNodeAs<expr>("name");
const Expr *behavior = result.Nodes.getNodeAs<expr>("behavior");
// Now we can do interesting things
name->dumpColor();
behavior->dumpColor();
}
</expr></expr></pre>
<br />
Since Clang gives us access to the entire C++ AST (including information from the preprocessor and the source code itself), we can extract all sorts of useful information from here. For example, we can generate output which contains the configuration data on a structured format, together with the source code implementing the functional parts.<br />
<br />
<pre>person:
name: Bob The Boss
type: Manager
source: {
Manager boss("Bob The Boss", new BossBehavior /* defined elsewhere */);
}
</pre>
<br />
Of course, we still would need to implement the <tt>getArguments</tt> function somewhere.<br />
<br />
<h2>
Conclusion</h2>
<div>
Clang is the perfect tool (or rather, platform) for analyzing C/C++ source code. It gives full access to the entire AST, since this is the same AST which is used by the actual Clang compiler, it gives you the complete AST, and not some approximation. The AST matchers framework also is a major time-saver, since it allows you to match out the parts of the AST you are interested in without having to write large statemachine-like code to keep track of where in the AST you are.</div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com7tag:blogger.com,1999:blog-7012742729372608936.post-71003333678034601082013-05-21T21:31:00.004+01:002013-05-21T21:31:39.263+01:00Garmin 600 initial impressionsMy previous GPS went AWOL a few months ago, and I've been waiting for Garmin to release their new Oregon 6xx series so that I can get a new one. Last week I saw that they were in stock at <a href="http://www.cyberphoto.se/">http://www.cyberphoto.se/</a>, so I put in an order and I got it delivered the next day. Excellent service!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-7PT2IH50Kv4/UZvSVVyAmzI/AAAAAAAAb9U/b0fmGDlCw60/s1600/253208_10151452248466295_69254890_n.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-7PT2IH50Kv4/UZvSVVyAmzI/AAAAAAAAb9U/b0fmGDlCw60/s320/253208_10151452248466295_69254890_n.jpg" width="240" /></a></div>
The new Oregon 6xx comes in four different variants (as with the 5xx series). The models vary primarily in whether or not they have a camera (600 vs 650) and whether or not they include a topographical map (6xx vs 6xxt). I opted for the cheapest one (600); I don't use the camera much, and OSM maps works well enough. The 650-series also sport a rechargable batterypack which can be charged while the device is connected via USB.<br />
<br />
<a href="http://4.bp.blogspot.com/-Us-VPHEusSQ/UZvZK6Dx7RI/AAAAAAAAb9k/80AlDmOvB5M/s1600/203.bmp" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="http://4.bp.blogspot.com/-Us-VPHEusSQ/UZvZK6Dx7RI/AAAAAAAAb9k/80AlDmOvB5M/s200/203.bmp" width="120" /></a>The overall impression is very good. I was a little worried about the ruggedness, but this definitely feels like a device made for outdoors activities. Even though the real test will come when I actually start using it for some actual work. The new capacitive touch screen is really nice, pinch zoom and scrolling is smooth and snappy. I haven't tried it with gloves yet, though.<br />
<br />
<a href="http://2.bp.blogspot.com/-qM0TdISAcWM/UZvZK5QH9fI/AAAAAAAAb9g/shriwQ7gqwM/s1600/78.bmp" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="http://2.bp.blogspot.com/-qM0TdISAcWM/UZvZK5QH9fI/AAAAAAAAb9g/shriwQ7gqwM/s200/78.bmp" width="120" /></a>GSAK still does not seem to support the 6xx series, so I used the 5xx setting which limits the size of a cache file to 5000 caches. Hopefully there is a GSAK update soon so I can take advantage of the possibility of exporting my entire cache database.<br />
<br />
Since I did not opt for the model with the topo map, I had to download a OSM map separately. This is super easy to do from here: <a href="http://garmin.openstreetmap.nl/">http://garmin.openstreetmap.nl/</a>. I selected "Sweden", downloaded the map, renamed the "gmapsupp.img" file to "sweden.img" and copied the map file to the Garmin directory on the device.<br />
<br />
Now, lets take the little thing out for some fun.<br />
<br />Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-3459470872735927802013-04-22T08:09:00.003+01:002013-04-22T08:10:31.401+01:00Using gnome-keyring to avoid storing unencrypted passwords (Ubuntu 12.10)I finally got around to figuring out how to avoid the pesky
<br />
<br />
<pre>-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<http://xxx:80> My Subversion server
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/myself/.subversion/servers'.
-----------------------------------------------------------------------
</pre>
<br />
As usual, stackoverflow.com and superuser.com provided very useful information, and in my specific case (Ubuntu 12.10) it turned out to be really easy since we can use the GNOME keyring more or less out-of-the-box. First step, modify <tt>.subversion/config</tt> like this:
<br />
<br />
<pre>store-passwords = yes
store-plaintext-passwords = no
password-stores = gnome-keyring
</pre>
<br />
Second step, export the GNOME keyring settings in your shell init script.
<br />
<br />
<pre>export `gnome-keyring-daemon`
</pre>
<br />
Third step, delete the <tt>.subversion/config/auth</tt> directory to remove any passwords stored in plaintext.
<br />
<br />
<pre>rm -r ~/.subversion/auth
</pre>
<br />
Now, when you try to do an <tt>svn update</tt>, you should be prompted to login to Subversion and (probably) to your GNOME keyring:
<br />
<br />
<pre>$ svn update
Updating '.':
Authentication realm: <http: xxx:80=""> My Subversion server
Password for 'myself':
Password for 'login' GNOME keyring:
At revision 1234.
</http:></pre>
<br />
To convince yourself that there is no locally stored password, you can open the files (there is probably only one) in <tt>.subversion/auth</tt>. The filename is a hash, so you will have to lookup the actual filename in your directory. You should see something like this:
<br />
<br />
<pre>~/.subversion $ cat auth/svn.simple/XXX
K 8
passtype
V 13
gnome-keyring
K 15
...
</pre>
<br />
Note that the passtype is now <tt>gnome-keyring</tt>.<br />
<br />Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-64177142021564695202013-04-02T15:44:00.001+01:002013-04-02T15:46:48.600+01:00EclipseCon 2013<a href="http://www.eclipsecon.org/2013/sites/all/themes/econ2013/logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://www.eclipsecon.org/2013/sites/all/themes/econ2013/logo.png" /></a><a href="http://www.eclipsecon.org/2013/">EclipseCon 2013</a> took place in Boston at the <a href="http://www.seaportboston.com/meetings-and-events/trade-shows-and-exhibits.aspx">Seaport World Trade Center</a>. It was the 12th EclipseCon, counting the <a href="http://www.luisdelarosa.com/2005/02/27/a-brief-history-of-eclipsecon/">meetings at JavaOne</a> in 2002 and 2003. It was my fifth EclipseCon, having previously attended EclipseCon 2008, 2010, 2011, 2012.<br />
<br />
Like the last few years, EclipseCon was co-located with <a href="http://www.osgi.org/DevCon2013/HomePage">OSGi DevCon</a> and <a href="http://www.eclipsecon.org/2013/almconnect">ALM Connect</a>. OSGi is the underlying application platform on which Eclipse is built. ALM (Application Lifecycle Management) concerns topics around Agile development, distributed source control, social coding, continuous integration.<br />
<br />
I got the opportunity to meet lots of people, and the atmosphere at EclipseCon was as usual very welcoming. In the light of the recent <a href="http://www.bbc.co.uk/news/technology-21896442">debacle at PyCon</a>, I must say that I'm very proud of EclipseCon and the absence of sexist jokes or other offending remarks.<br />
<br />
There are lots of photos on <a href="http://www.flickr.com/groups/econ2013/">Flickr</a>. I think I managed to stay out of the photos this year.<br />
<h2>
<br /></h2>
<h2>
Themes</h2>
<div>
<b>Xtend</b> Following the trend from last year, there were several talks and tutorials focused on text-based modeling and language frameworks, mainly centered around <a href="http://www.eclipse.org/Xtext/">Xtext</a> and <a href="http://www.eclipse.org/xtend/">Xtend</a>. </div>
<div>
<br /></div>
<div>
<b>M2M</b> The M2M acronym stands for Machine-to-Machine and is about communication between "the internet of things". Unfortunately I managed to miss all the the cool action around the Arduino and Raspberry Pi devices. :(</div>
<div>
<br /></div>
<div>
<b>Eclipse in Space</b> Following the incredibly cool keynote from three years ago where Jeff Norris did a live demo of a mars robot, this year we got to see how NASA uses Eclipse to control experiments on the ISS (more about that talk below).</div>
<h2>
<br /></h2>
<h2>
Keynotes</h2>
<a href="http://thenewkingmakers.files.wordpress.com/2012/05/newkingmakers.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="http://thenewkingmakers.files.wordpress.com/2012/05/newkingmakers.jpg" width="132" /></a>This year, the keynote slot was split into two 30-minute talks. The first keynote on Monday was by on the topic of <a href="http://thenewkingmakers.com/">Developers are the New Kingmakers</a> (I had to look up what a <a href="http://en.wikipedia.org/wiki/Kingmaker">Kingmaker</a> is). The key point of the keynote was that technology choices was made by the people which had the money (and thus purchased the software), while open source software has shifted that towards the developers making the choice instead, and thereby determining in which direction technology develops.<br />
<a href="http://www.eclipsecon.org/2013/users/1387">Stephen O'Grady </a><br />
<br />
The second keynote was titled <a href="http://www.eclipsecon.org/2013/sessions/moving-towards-alm-30">Moving Towards ALM 3.0</a> by <a href="https://www.eclipsecon.org/2013/users/1386">Jeffrey Hammond</a>, and almost felt like a continuation of the previous keynote. Modern ALM practises and new technologies and principles are changing how we build software, and developers are more in command today than before. This also means that many of the architectures we've used during the last 20 years are crumbling, which puts pressure on developing new architectures and frameworks which are more adapted to the new way we develop software. (If this sounds a little fuzzy, its because I had a hard time taking useful notes.)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://a248.e.akamai.net/assets.github.com/images/modules/logos_page/Octocat.png?1361400666" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="166" src="https://a248.e.akamai.net/assets.github.com/images/modules/logos_page/Octocat.png?1361400666" width="200" /></a></div>
The Wednesday keynotes were <a href="http://www.eclipsecon.org/2013/sessions/how-github-works">How Github Works</a> by <a href="https://www.eclipsecon.org/2013/users/1390">Zach Holman</a>, and <a href="http://www.eclipsecon.org/2013/node/1629">The Future of Mobile Development</a> by <a href="http://www.eclipsecon.org/2013/users/1462">Jeff Seibert</a>. Holman described his view of how open source works, and the importance of doing fun things. Good motivational talk about getting into open source development. Seibert talked about the difficulties in doing agile mobile development under the limitations of modern app stores (publishing times on iTunes, for example).<br />
<br />
<a href="http://blogs.oracle.com/nashorn/resource/rrr256x125.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://blogs.oracle.com/nashorn/resource/rrr256x125.jpg" /></a>The last keynote was <a href="http://www.eclipsecon.org/2013/node/1586">Nazhorn, Javascript for the JVM</a> by <a href="http://www.eclipsecon.org/2013/users/1388">Jim Laskey</a> from Oracle. He described Nazhorn, which is a Javascript implementation for the JVM, which is supposed to be faster and better than <a href="https://developer.mozilla.org/en-US/docs/Rhino">Rhino</a>. A little slide and bullet-heavy keynote which was kind of boring to me since I don't have much experience with Javascript. The last keynote about <a href="http://www.eclipsecon.org/2013/node/1603">Vert.x - Polyglot Asynchronous Applications for the JVM</a> by <a href="http://www.eclipsecon.org/2013/users/1398">Tim Fox</a> had to be cancelled due to illness.<br />
<h2>
<br /></h2>
<h2>
Tutorials</h2>
The first tutorial on Monday was about "What every Eclipse developer should know about Eclipse 4". Not having done any real stuff for Eclipse 4, it seemed like (and turned out to be) a good choice. I got to play around with a real Eclipse 4 app, and got some in depth practise in how to integrate into the application model. More about Eclipse 4 later.<br />
<br />
<a href="http://upload.wikimedia.org/wikipedia/en/1/12/Xtend_Logo_Color.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/1/12/Xtend_Logo_Color.png" /></a>The second tutorial was on <a href="http://www.eclipse.org/xtend/">Xtend</a>, which is a language which compiles to idiomatic Java code. Unlike <a href="http://www.scala-lang.org/">Scala</a> and <a href="http://groovy.codehaus.org/">Groovy</a> which compile to Java byte code, Xtend will generate Java code which is visible inside your project. This has a number of benefits, especially when it comes to integrating with other Java libraries. Apart from giving an introduction to Xtend, the tutorial also described one of the really cool features in the new Xtend 2.4 release: Active Annotations. They provide a way to control in detail <b>how</b> Xtend generates Java code, and allows the programmer to customize the generated Java code, for example by adding methods.<br />
<br />
<h2>
<br /></h2>
<h2>
Talks</h2>
<div>
<a href="http://www.eclipsecon.org/2013/node/1312">The Art of Java Performance Tuning</a> by <a href="http://www.eclipsecon.org/2013/users/188">Ed Merks</a> (the architect behind EMF) was an interesting talk about how to make your Java programs go faster (or become smaller, or both). Ed Merks is always fun to listen to, and his some of his points were "measure, measure, measure" (something I've talked about in <a href="http://thisisnotaprogrammersblog.blogspot.se/2012/04/universal-answer-about-optimization.html">another blog post</a>), "precision is not the same as accuracy", "there is no excuse for bad code", and "micro benchmarks are fraught with problems" (and a whole lots of other experiences). He also described a benchmarking harness he wrote to measure small pieces of Java code so that the measurements become useful.</div>
<div>
<br /></div>
<div>
<a href="http://3.bp.blogspot.com/-PBQQK3N77BM/UVrHe_siIFI/AAAAAAAAbMA/84I_UFwfyxw/s1600/Screenshot+-+04022013+-+01:56:27+PM.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="130" src="http://3.bp.blogspot.com/-PBQQK3N77BM/UVrHe_siIFI/AAAAAAAAbMA/84I_UFwfyxw/s200/Screenshot+-+04022013+-+01:56:27+PM.png" width="200" /></a><a href="http://www.eclipsecon.org/2013/node/1413">Google Analytics for Eclipse Plugins</a> by <a href="http://www.eclipsecon.org/2013/users/379">Max Rydahl Andersen</a> and <a href="http://www.eclipsecon.org/2013/users/873">Andre Dietisheim</a> from Red Hat was about how to use Google Analytics to collect information about your plugin users. The trick is to fetch a URL from your website when the plugin starts, and encode information about your user that you want to collect in the User-Agent field of the request. For example, the JVM version used is encoded in the field for the flash version, and the Eclipse product being used is encoded as the user agent name. Cool little trick which allows you to know where your users are from, what OS they run, etc.</div>
<div>
<br /></div>
<div>
<a href="http://www.eclipsecon.org/2013/sessions/eclipse-4-goes-formal-api-you-can-rely">Eclipse 4 Goes Formal: API You Can Rely On</a> by <a href="http://www.eclipsecon.org/2013/users/199">Eric Moffatt</a> from IBM was another Eclipse 4 talk, but more focused on the details on the API, and how it allows users to do things which was previously impossible. For example, since the application model is just another EMF model, it is easy to programmatically add views, commands, etc. Dependency injection also makes it easy to write code in a more declarative way where dependencies are declared (and later injected).</div>
<div>
<br /></div>
<div>
<a href="http://2.bp.blogspot.com/-49TqaVMY0Lk/UVrLivtbnuI/AAAAAAAAbMQ/IqJGx4x1D4g/s1600/Screenshot+-+04022013+-+02:13:49+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="140" src="http://2.bp.blogspot.com/-49TqaVMY0Lk/UVrLivtbnuI/AAAAAAAAbMQ/IqJGx4x1D4g/s200/Screenshot+-+04022013+-+02:13:49+PM.png" width="200" /></a><a href="http://www.eclipsecon.org/2013/node/1143">This Is Not Your Father's CDT</a> by <a href="http://www.eclipsecon.org/2013/users/1174">Doug Schaefer</a> and <a href="http://www.eclipsecon.org/2013/users/66">Marc Khouzam</a> was another cover-new-features CDT-talk. It covered the new features which have been added two the CDT over the last two years: Dynamic printf breakpoints (logging breakpoints with printf support), step into selection, expression wild cards and groups, and multi core visualization. Working with the IAR Systems Eclipse/CDT debugger integration, it would be nice to know how easy it is to integrate this support into other debuggers than gdb.</div>
<div>
<br /></div>
<div>
<a href="http://www.eclipsecon.org/2013/node/1300">No Stone Unturned - the journey of getting from one year release cycle to continuous delivery</a> by <a href="http://www.eclipsecon.org/2013/users/1270">Kai-Uwe Maetzel</a> was a very interesting talk about how IBM went from one-year release cycles on their Rational Team Concert product to continuous delivery. Much is about development culture, communicating processes, having everyone on board, and looking at <b>every</b> step of the process. </div>
<div>
<br /></div>
<div>
<a href="http://www.eclipsecon.org/2013/node/1284">Shake that FUD: How to migrate Eclipse 3 code to Eclipse 4</a> was a very enlightening talk by <a href="http://www.eclipsecon.org/2013/users/820">Lars Vogel</a> and <a href="http://www.eclipsecon.org/2013/users/1261">Wim Jongman</a>. It was about how to migrate existing 3.x RCP apps to 4.x. This can be done using one of three different approaches: (1) do nothing; use the existing compatibility layers (2) embrace the new programming model and rewrite your code, and (3) mixed mode where you use the compatibility layers, but rewrite code piece by piece. This was pretty straightforward, but I will get back to this talk later.</div>
<div>
<br /></div>
<div>
<a href="http://www.eclipsecon.org/2013/node/1291">Are you user-friendly? Improve your designs and delight your users with fast and easy user feedback</a> by <a href="http://www.eclipsecon.org/2013/users/1241">April de Vries</a>. A non-tech talk about how to perform usability tests and how to design user surveys. Finished up with a fun demo of usability testing on the EclipseCon website (which didn't go too well).</div>
<div>
<br /></div>
<div>
<a href="http://www.ericsson.com/shared/eipa/images/elogo~r9057.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://www.ericsson.com/shared/eipa/images/elogo~r9057.png" /></a><a href="http://www.eclipsecon.org/2013/node/1254">Building an in-house Eclipse support team</a> by <a href="http://www.eclipsecon.org/2013/users/526">Emilio Palmiero</a> and <a href="http://www.eclipsecon.org/2013/users/604">Pascal Rapicault</a> from Ericsson. They talked about how Ericsson supports their own Eclipse users (which are in the thousands), with a custom support site, custom-built Eclipse installations and update-sites. They used "shared installations" where users can simply select an Eclipse installation and run it from a network drive. Each user can then install plugins locally.</div>
<div>
<br /></div>
<div>
<a href="http://4.bp.blogspot.com/-mY7t0cIWnXs/UVrTU3ot89I/AAAAAAAAbMg/GfrV60oIb_o/s1600/Screenshot+-+04022013+-+02:46:56+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="58" src="http://4.bp.blogspot.com/-mY7t0cIWnXs/UVrTU3ot89I/AAAAAAAAbMg/GfrV60oIb_o/s200/Screenshot+-+04022013+-+02:46:56+PM.png" width="200" /></a><a href="http://www.eclipsecon.org/2013/node/1161">Injection in Eclipse 4: All you need to know about it</a> by <a href="http://www.eclipsecon.org/2013/users/590">Olivier Prouvost</a>. The talk covered many aspects of <a href="http://en.wikipedia.org/wiki/Dependency_injection">Dependency Injection</a> (DI) i Eclipse 4, for example how and in which order fields are injected, how the context hierarchy works, and how "re-injection" is used to replace the classical "listener" pattern. It was very nice to get some details around how this works, since it is such a central part in Eclipse 4.</div>
<div>
<br /></div>
<div>
<a href="http://4.bp.blogspot.com/-eKGSxsGIEX4/UVrUNAczvWI/AAAAAAAAbMo/JgPpvY87iq8/s1600/Screenshot+-+04022013+-+02:50:48+PM.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="91" src="http://4.bp.blogspot.com/-eKGSxsGIEX4/UVrUNAczvWI/AAAAAAAAbMo/JgPpvY87iq8/s200/Screenshot+-+04022013+-+02:50:48+PM.png" width="200" /></a><a href="http://www.eclipsecon.org/2013/sessions/hallo-bonjour-%E4%BB%8A%E6%97%A5%E3%81%AF-hello-babel-tools-make-internationalization-easier">Hallo, Bonjour, 今日は, Hello! Babel tools make internationalization easier</a> described how to use the Babel tools to simplify translating Eclipse plugins to other languages. The tools can help with finding untranslated strings, partially translated strings, etc. The talk also covered the Babel translation server which is able to "crowdsource" plugin translation, and how to setup your own Babel translation server.<br />
<br />
<a href="http://git-scm.com/images/logo@2x.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="83" src="http://git-scm.com/images/logo@2x.png" width="200" /></a><a href="http://www.eclipsecon.org/2013/node/1319">A tale about a big SVN to Git migration</a>. A fun talk by <a href="http://www.eclipsecon.org/2013/users/379">Max Rydahl Andersen</a> where he describes the process of migrating the JBoss Subversion repos to Git. Lots of repositories, lots of data, and lots of history. The workflow is to first use "svnsync" to create a Subversion mirror which can be kept up-to-date incrementally. This way you do not need to disturb the live server while testing different ways to convert the repos. He also included some tips about how to proceed after the conversion: "train your team", "learn the cli before using the UI", "ban git push --force".<br />
<br />
<a href="http://www.eclipse.org/modeling/emf/images/emf_logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="89" src="http://www.eclipse.org/modeling/emf/images/emf_logo.png" width="200" /></a><br />
<a href="http://www.eclipsecon.org/2013/node/1152">Now that I got a model, where's my application?</a> by <a href="http://www.eclipsecon.org/2013/users/204">Eike Stepper</a>. Some parts of this talk was stuff I already knew (how to generate an EMF editor, etc.), but the parts on how to create pluggable storage models was interesting. By creating a custom storage implementation, it is possible to control exactly how EMF objects are persisted, without affecting any of the EMF code itself. The talk also covered CDO, which is a database storage layer for EMF, so that EMF object can be stored in a relational database with support for concurrent editing and realtime support. This means that a model in one application instance can be kept automatically in sync with a model in another application.<br />
<br />
<a href="https://si0.twimg.com/profile_images/188302352/nasalogo_twitter.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="171" src="https://si0.twimg.com/profile_images/188302352/nasalogo_twitter.jpg" width="200" /></a><a href="http://www.eclipsecon.org/2013/node/1120">NASA uses Eclipse RCP applications for experiments on the International Space Station</a> by <a href="http://www.eclipsecon.org/2013/users/1030">Tamar Cohen</a>. NASA talks always attract many attendees, and by a planning mistake this had been scheduled in a small room, so it was packed to the last seat and people were sitting on the floor and standing along the walls. Tamar Cohen described a few cases where NASA uses an Eclipse RCP app to implement experiments which are performed on the ISS. Interesting to see how strict NASA software standards are and how the example require all application which run on the ISS (and which communicate with the ISS) to conform to certain rules. For example, any button which causes a command to be sent to or from the ISS has to look a certain way to make it visually clear to the user what the command does.<br />
<br />
<a href="http://www.eclipsecon.org/2013/node/1144">Bling 3D</a> by <a href="http://www.eclipsecon.org/2013/users/1151">Tony McCrary</a> was about a game-designer application based on Eclipse where they run the entire UI on 3D hardware. They also talked a bit about different requirements when writing software for artists and designers. Nice example of how powerful Eclipse 4 is.<br />
<br />
In <a href="http://www.eclipsecon.org/2013/node/1189">You're not failing fast enough</a>, <a href="http://www.eclipsecon.org/2013/node/1189">Sarah Goff-Dupont</a> from Atlassian talked about agile best practises, and how to get fast test feedback. Not anything revolutionary, but good to see how other companies are facing the same issues we are.<br />
<br />
<a href="http://www.eclipsecon.org/2013/node/1415">EMF Community, time for moving to Eclipse 4 thanks to the Extended Editing Framework 2.0</a> by Goulwen Le Fur. This was my last session for the conference, and I was having definite problems to concentrate. Anyway, this talk was about how EEF can be used to describe a UI model using EMF and automatically bind values to the application model. Useful technology to keep on the radar screen.<br />
<h2>
<br /></h2>
<h2>
CDT Summit</h2>
The <a href="http://wiki.eclipse.org/CDT/summitecon2013">CDT summit</a> took place on Thursday parallel to the other talks, and I was able to attend parts of it, as some parts There was several interesting discussions: pros and cons of using Eclipse 4 APIs, possibility of supporting platform version -1, Java 7, web integration in Eclipse, advertising new features, CDT launch improvements, multi-process debug launches.<br />
<h2>
<br /></h2>
<h2>
Conclusion</h2>
EclipseCon is absolutely necessary in order to keep up-to-date on whats happening in the Eclipse world. It offers unique possibilities of talking to the people behind the stuff that you work with every day. Something which may take three weeks to figure out by reading the source on your own can be solved in five minutes by talking to the right person at EclipseCon.<br />
<br />
<a href="http://www.infoq.com/author/Alex-Blewitt">Alex Blewitt</a> has also done <a href="http://www.infoq.com/news/2013/03/eclipsecon-2013">an excellent write-up</a> of EclipseCon 2013.<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-63405880583210642852012-05-25T12:56:00.004+01:002012-05-25T12:56:58.223+01:00Concurrency in C++I wrote <a href="http://programmers.stackexchange.com/a/150175/2301">an answer</a> on <a href="http://programmers.stackexchange.com/">programmers.stackexchange.com</a> about concurrency in C++, which turned out to get some opinionated responses.<br />
<br />Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-80026980655369305682012-04-09T09:12:00.000+01:002012-04-09T09:12:35.679+01:00Universal answer about optimizationWhen reading through questions on <a href="http://stackoverflow.com/">Stackoverflow.com</a> related to optimization ("is X faster than Y"), I often want to reply with the <a href="http://stackoverflow.com/a/716645/13051">same answer</a>, regardless of what the question was about:<br />
<br />
<i>When optimizing you should always follow these steps:</i> <br />
<ul><li><i>Don't optimize until you have a nice, clean, and <b>working</b> version of your code. </i></li>
<li><i>When you have a version which is nice and clean, decide if it is fast enough.</i></li>
<li><i>If it isn't fast enough, <b>measure its performance</b>. This step is important for two reasons. If you don't measure you won't (1) know the impact of any optimizations you make and (2) know where to optimize.</i></li>
<li><i>Optimize the hottest part of your code.</i></li>
<li><i><b>Measure again.</b> This is just as important as measuring before. If the optimization didn't not improve things, <b>revert it</b>. Remember, the code <i>without</i> the optimization was <b>clean, nice, and working.</b></i></li>
</ul>Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-71888741773886315792012-04-05T14:14:00.000+01:002012-04-05T14:14:05.566+01:00Google+ Message megafailI usually like Google and their products, but what on earth went through their minds when they decided to add functionality to Google+ which is <b>not </b>available on the web? I'm of course talking about "Huddle" aka "Google+ Messenger", which Google decided should <b>only</b> be available on mobile devices. Some collective design meltdown? Aliens inflitrating the usability testing department? I don't know.<br />
<br />
Several times I've gotten notifications on my phone -- bear in mind that messenger and regular notifications look more or less identical -- and when I log in to G+ on my desktop, the conversation is nowhere to be found.<br />
<br />
Not only is this a bad design decision for messenger, it <b>causes the entire G+ to be less useful for me</b>, since I suddenly have two devices I have to check in order not to miss things people send to me. This is annoying enough with both G+, Facebook, Twitter, and all other things I use to communicate with people.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-17634300713448777262012-04-03T13:41:00.000+01:002012-04-03T13:41:01.397+01:00EclipseCon 2012Last week was the <a href="http://www.eclipsecon.org/2012/sites/all/themes/themes/econ2012/images/logo.png"><img alt="" border="0" src="http://www.eclipsecon.org/2012/sites/all/themes/themes/econ2012/images/logo.png" style="cursor: pointer; float: left; height: 54px; margin: 0pt 10px 10px 0pt; width: 190px;" /></a>time to go to <a href="http://www.eclipsecon.org/2012/">EclipseCon</a> again. For me it was the fourth time which almost puts me in the "veteran" category, but not really. This year EclipseCon was held in <a href="http://maps.google.com/maps?q=1800+Presidents+St,+Reston,+VA+20190,+USA&hl=en&sll=39.147315,-77.616042&sspn=0.003407,0.008256&oq=1800&hnear=1800+Presidents+St,+Reston,+Virginia+20190&t=m&z=17">Reston, Virginia</a>. I supposed they listened to all the feedback from people who where fed up with the somewhat dull place Santa Clara (no restaurants or shops anywhere nearby), and from all the Europeans who had to travel 9 timezones.<br />
<br />
As usual, there was lots of <a href="http://www.flickr.com/photos/33725200@N00/6871678382/in/pool-1918270@N20">socializing</a>, <a href="http://www.flickr.com/search/?q=eclipsecon+2012&f=hp">photographing</a>, <a href="http://www.flickr.com/photos/33725200@N00/7018069571/">beer-drinking</a>, <a href="http://www.flickr.com/photos/33725200@N00/7027405693/in/pool-1918270@N20">eating</a>, <a href="http://www.flickr.com/photos/33725200@N00/6877767690/in/pool-1918270@N20">talking about programming</a>, <a href="http://www.flickr.com/photos/33725200@N00/7024454171/in/pool-1918270@N20">watching cool demos</a>, <a href="http://www.flickr.com/photos/33725200@N00/7018530493/in/pool-1918270@N20">listening to talks about programming</a>, <a href="http://www.flickr.com/photos/33725200@N00/6881334458/in/pool-1918270@N20">listening to keynotes</a>, and <a href="http://www.flickr.com/photos/33725200@N00/6875298362/in/pool-1918270@N20">watching people holding invisible things in their hands</a>. You can even <a href="http://www.flickr.com/photos/33725200@N00/6881334962/in/pool-1918270@N20/lightbox/">spot me</a> in one of the photos. I'm usually not that blurry.<br />
<br />
The major theme this year was <a href="http://www.eclipse.org/e4/" style="font-weight: bold;">Eclipse e4</a>, the new Eclipse Platform on which this year's release train (Juno) is being released on. Eclipse e4 was conceived 4 years ago at EclipseCon 2008 (coincidentally the first EclipseCon I attended). Back at that time it was all up-in-the-blue ideas for how to make an Eclipse Platform which would meet the needs for the Eclipse ecosystem (plugin developer, RCP developers, users, etc). Eclipse 4.x brings two "new" technologies to the table: <a href="http://www.eclipse.org/modeling/emf/">EMF</a> and <a href="http://code.google.com/p/google-guice/">Dependency Injection</a>.<br />
<br />
<h2>Monday</h2><a href="http://xtext.itemis.com/binary.ashx/element=E0E0E1/~image.attribute/36523/image.gif" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="" border="0" src="http://xtext.itemis.com/binary.ashx/element=E0E0E1/%7Eimage.attribute/36523/image.gif" style="float: right; height: 85px; margin-bottom: 10px; margin-left: 10px; margin-right: 0pt; margin-top: 0pt; width: 128px;" /></a>Monday was (as usual) tutorial-day (also referred to "day 0"). The first tutorial for me was <a href="http://www.eclipsecon.org/2012/sessions/dsls-java-developers-xtext"><span style="font-weight: bold;">DSLs for Java Developer with Xtext</span></a>. Xtext has been one of the hot Eclipse topics for the last couple of years. It allows you to easily create your own (domain specific) language such that much of the IDE tooling you are normally used to is implemented automatically. By writing a grammar, Xtext will automatically generate an editor for you with support for auto-completion, syntax coloring, etc. I haven't attended any Xtext tutorial at previous EclipseCon, so I was glad to be able to get into this one.<br />
<br />
For the afternoon tutorial I was unsure which one I should choose. There were <a href="http://www.eclipsecon.org/2012/program/session-schedule/tutorials">several interesting ones</a>, but in the end I went with <span style="font-weight: bold;"><a href="http://www.eclipsecon.org/2012/sessions/building-eclipse-plugins-and-rcp-applications-tycho">Building Eclipse plugins and RCP applications with Tycho</a>.</span> Tycho (together with Maven and Nexus) is gaining traction in the Eclipse community, so I wanted to learn more about Tycho to see if this is something that we want to investigate. We are currently using Buckminster for building, but there are some parts of the workflow which Tycho/Maven seems to be better at. For example, Maven has a more complete command-line interface where you can build everything out of the box using "mvn clean install", whereas Buckminster in practise requires you to have a wrapper (ant) script to handle the long command lines. I will probably test Tycho/Maven one a smaller project to get a feeling of how it applies to our environment.<br />
<br />
<h2>Tuesday</h2>Tuesday was the start of the "real" conference. First out was Alex Russell's keynote <a href="http://www.eclipsecon.org/2012/sessions/web-platform-past-present-and-future"><span style="font-weight: bold;">The Web Platform is the Past, Present, and Future</span></a>. Good keynote on the topic of the web as a successful platform despite its lack of technical merits. After the keynote, people scattered to go to various talks. I went to <a href="http://www.eclipsecon.org/2012/sessions/eclipse-4-application-platform-explained" style="font-weight: bold;">The Eclipse 4 Application Platform explained</a>, which was a good overview of how to use the new Eclipse 4.x platform. It covered areas such as dependency injection, the context hierarchy and the application model.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/spraying-quick-way-create-graphitis">Spraying - a quick way to create Graphiti</a></b>talked about a DSL (implemented using Xtext, of course) used to create graphical editors on top of the GEF framework. GEF is a useful tool to create graphical editors (WindowBuilder, for example, is implemented using GEF), but it is also pretty repetitive and cumbersome to program. Graphiti/Spray makes this easier by using Xtext and Xtend2 to describe the editor concisely.<br />
<br />
One of the best talks of the conference was <b><a href="http://www.eclipsecon.org/2012/sessions/eclipse-sdks-greatest-hits-first-ten-years">Eclipse SDK's Greatest Hits: The First Ten Years</a></b>. It described several implementation details and algorithms that Eclipse is built on. Incremental builds, the efficient delta-tree handling, JDT compiler improvements, and design principles such as "when designing functionality, always ask if someone wants to do it differently" (i.e. extension points).<br />
<br />
Last talk on tuesday was <a href="http://www.eclipsecon.org/2012/sessions/3mf-emf-infinity-and-beyond" style="font-weight: bold;">3MF: EMF to the infinity... and beyond</a>. It covered three different use cases which EMF cannot handle well today. The first one was to handle multiple versions of the same Ecore model at the same time. The solution to this is to identify the EPackage using the URI and a version. The second use case was to separate the interfaces from the implementation. Currently there is a static reference in the package interface to the implementation class. This can be solved using dependency injection instead. The third use case was to allow using other OSGi containers. Not sure what the conclusion was on that, though.<br />
<br />
Tuesday was also the day for the <b><a href="http://wiki.eclipse.org/CDT/summitecon2012">CDT Summit</a></b>, where several members of the CDT development team get together and discuss topics related to CDT. This was not in the official conference schedule. There were a lot of things discussed here, see the link above for more details.<br />
<br />
<h2>Wednesday</h2>The keynote on wednesday was <a href="http://www.eclipsecon.org/2012/sessions/building-plug-and-play-application-development-platform-car-future"><b>Building a Plug-and-Play Application Development Platform for the Car of the Future</b></a>. TJ Giuli talked about Ford's application platform and how to use it to program "smart cars". Some cool ideas, but very Ford-specific which made it kind of boring.<br />
<br />
After the keynote I decided to attend an informational session on <b><a href="http://wiki.eclipse.org/Common_Build_Infrastructure">Common Build Infrastructure</a></b>. This is an initiative to create a set of "standards" for how to build Eclipse software, such that building Eclipse projects becomes really easy (for any Eclipse developer), and also to enable third-parties to build the Eclipse platform. Being interested in how to build software in general, this was a good session to attend.<br />
<br />
Next talk I attended was <b><a href="http://www.eclipsecon.org/2012/sessions/language-tooling-orion">Language Tooling in Orion</a></b>. Orion is an Eclipse-based IDE running inside a browser. It is primarily used for JavaScript development. Interesting to see how well the web works even for complicated applications such as an IDE, although using it for compiler-heavy languages such as C++ is probably not very useful.<br />
<br />
After lunch I attended <b><a href="http://www.eclipsecon.org/2012/sessions/experiences-porting-commercial-rcp-application-eclipse-4x">Experiences from porting a commercial RCP application to Eclipse 4.x</a></b>. This was a good talk describing how FindOut Technologies went about porting one of their RCP applications to Eclipse 4.x, and lessons they learned.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/building-guis-windowbuilder">Building GUIs with WindowBuilder</a></b> was a "filler" talk for me, since I've used WindowBuilder quite a bit before, but there were no other interesting talks in that slot. I learned a bit as well, like how to create widget factories, and how to use databinding to bind properties of custom widgets.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/migrating-git-lets-git-party-started">Migrating to Git: Let's Git this party started</a></b> described how the Eclipse projects migrated 10 years of CVS history into 25 Git repositories. Challenges, changing the build process, trimming repositories, helping committers making the transition, and so on. The advice at the end of the talk was "Read", "Test migration", and "Communicate".<br />
<br />
Final talk on wednesday was <b><a href="http://www.eclipsecon.org/2012/sessions/xcore-ecore-meets-xtext">Xcore: Ecore meets Xtext</a></b>. This was a talk by Ed Merks (one of the authors of the EMF book) about a DSL frontend to Ecore using Xtext. The talk covered several aspects of Xcore (writing EOperations using Xbase, compilation to Java, exporting Ecore to Xcore, etc). Xcore seems like it will become a really crucial part of EMF. Unfortunately is only available for Eclipse 3.8/4.2.<br />
<br />
<h2>Thursday</h2>The keynote was <a href="http://www.eclipsecon.org/2012/sessions/future-alm-developing-social-code-graph" style="font-weight: bold;">The Future of ALM: Developing in the Social Code Graph</a> by Mik Kersten, project lead for the <a href="http://www.eclipse.org/mylyn/">Mylyn</a> project. He talked about how open source ALM tools changes the way (open source) developers cooperate. A good speaker and a topic which was very relevant to a large part of the audience probably made this the best keynote this year.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/debugging-2012">Debugging in 2012</a></b> was a talk about the <a href="http://www.chrononsystems.com/">Chronon Debugger</a>, a trace-based debugger which allows you to jump to any point in time and inspect the program contents. The demo was impressive. It would be neat to be able to include Chronon support in a product allowing customers to send bugreports with a complete program trace, but the size of the trace file (~50 MB for a non-trivial program) probably makes that difficult.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/eclipse-xtend-language-made-java-developers">Eclipse Xtend - A Language Made for Java Developers</a></b> described the features of Xtend, a cool new language which is designed to integrated very closely with Java, but bridge some of the language defects in Java. It compiles to Java source code, which means that you can use it completely transparently as a replacement for Java.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/eclipse-4-meets-cdo-now-you-see-it-and-so-do-they">Eclipse 4 meets CDO: now you see it, and so do they</a></b> was a talk that I did not attend, but I thought I would mention it anyway. CDO provides a way to synchronize EMF models across machines, and since Eclipse 4 is built on top of EMF, combining these two technologies allows users to use the <b>same</b> application instance from different machines (using different host environments, and even different localization settings). Nice proof-of-concept talk.<br />
<br />
<b><a href="http://www.eclipsecon.org/2012/sessions/eclipse-42-tips-api-best-practices-3x-plugin-running-both-platforms">Eclipse 4.2 - Tips on API best practises for a 3.x plugin running on both platforms</a></b> was a good, although somewhat unstructured, talk about how to maintain plugins which are supposed to run on both the 3.x and 4.x.<br />
<br />
The last talk I attended was <b><a href="http://www.eclipsecon.org/2012/sessions/xtext-best-practices">Xtext - Best Practises</a></b>. This was a kind of extension to the monday tutorial, where Sebastian Zarnekow covered a bunch of guidelines on how to create your DSL, things like "favor syntatic predicates before backtracking", and "try to avoid follow-up errors".<br />
<br />
Last session on thursday was the closing ceremony with the project lead panel, useless statistics, and a few other things.<br />
<br />
<h2>Friday</h2>On friday i hooked up with a <a href="http://stackoverflow.com/users/44089/bananeweizen">fellow geocacher</a> and went to Washington, DC, for some geocaching. The result was 12 virtual caches and 2 earth caches before I had to leave for the airport to catch the flight back to Sweden.<br />
<br />
<h2>Conclusion</h2>There were a couple of themes this year:<br />
<ul><li><b>Eclipse 4</b>: Since this year's Eclipse Platform release (Juno) will be based on Eclipse 4, there were many talks which related to this in one way or another.</li>
<li><b>Xtext</b>: DSL tooling is still a hot topic; several new cases of DSL built on top of Xtext was presented this year (Spray/Graphiti, Dart, DESAGN, protobuf-dt, Xcore)</li>
<li><b>Agile/ALM</b>: Being co-located with the Agile ALM Connect conference, there was many talks related to Agile and various ALM tools.</li>
</ul>EclipseCon would not be the nice conference it is without the social stuff inbetween. I made several new friends, and got the opportunity to talk to several people behind the technologies that we use.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-7760851424422377182011-10-22T17:33:00.003+01:002011-10-22T17:56:00.752+01:00AmigaOS refuses to dieI was an avid AmigaOS user in the early 90s, but my Amiga has been collecting dust in the attic for the last 15 years or so. But its fun to see that AmigaOS is not quite dead yet. AmigaOS 4.1 is available from <a href="http://www.amigaos.net/">http://www.amigaos.net/</a>, and Hyperion seems to be putting out updates on a fairly regular basis.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-6SR6wvStqHw/TqLzGcFuuII/AAAAAAAAB3Q/3JVPrpeR_5M/s1600/amigaone_x1000_case_sm.jpg.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 175px; height: 135px;" src="http://4.bp.blogspot.com/-6SR6wvStqHw/TqLzGcFuuII/AAAAAAAAB3Q/3JVPrpeR_5M/s400/amigaone_x1000_case_sm.jpg.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5666358573130496130" /></a><br />But it is sad to see that Hyperion doesn't realize that for desktop computing, x86 is the only relevant hardware platform today. As long as they limit themselves to PowerPC, they will never reach other users than the old hardcore Amiga fans from the 90s -- I will simply not purchase a separate piece of pretty expensive hardware from some obscure online store in Germany for my already crowded desk just to be able to run an OS which was cool 20 years ago.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-78928231565205378272011-09-21T11:40:00.004+01:002011-09-23T07:37:22.666+01:00Eclipse sucks. Or does it?I stumbled across this long-running blog-post about people complaining about Eclipse. Pretty fun to read actually: <a href="http://techdetails.agwego.com/2007/02/23/121/">http://techdetails.agwego.com/2007/02/23/121/</a>. Lots of the comments are your regular aggressive internet trolls and other people venting their frustration, but there are some gold comments in there:<br /><ul><br /><li>"It is like a sweet cherub that lures you in with kind smiles and a gentle touch, AND THEN, when you want to do something out of its little box of gay baby tricks, it turns into devil spawn, with the wrath of all injustice ever served, it sucks your soul dry, and makes everything black and death and hate and pain. DO NOT USE THIS SOFTWARE. You have been warned."<br /><li>"I look back on the time I used eclipse and a dark shadow falls upon my whole being. I can see now that it was some twisted mind f*ck that I will never understand the extent of the evil behind. It is a darker, more spirited and intent evil than any else i know of on Earth. At the time of using Eclipse, its power blocked all light and i could see only darkness, a deep desperate hole that the Eclipse designers and engineers had constructed so perfectly there seemed to be no seam; no way out. I can now see past it. To all other developers that find themselves in the depths of despair that Eclipse will bring you, I offer you only solace: if you have any human soul you will defeat the dark, dark evil that lies in the lines of code of this devil-sent tool. Find the strength to defeat this great evil. Developers everywhere require it of you."<br /></ul><br />I think Bjarne Stoustrop said (about C++) that <i>There are two kinds of programming languages: The kind everyone complains about, and the kind no one uses. </i>This is true for Eclipse as well. For any piece of software in widespread use, you can find a number of people who think that it is a piece of shit.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com1tag:blogger.com,1999:blog-7012742729372608936.post-70339352823941293432010-08-25T17:54:00.006+01:002010-08-25T20:23:53.297+01:00Using git-svn for cross-platform developmentI do a lot of cross-platform development, mostly Windows and Linux. Being able to build and test on multiple platforms before pushing changes to other people is crucial in order to avoid build and test failures. Git is almost the ideal tool to do this, but since we are using Subversion at work (that won't change in the forseeable future), I've been trying out git-svn to see if it is up to the task.<br /><br />A typical work-flow goes like this:<br /><ol><li>Update local source tree with new changes from central repository</li><li>... hack hack ...</li><li>Build and test on Linux</li><li>Transfer local changes to a Windows machine</li><li>Build and test on Windows machine</li><li>Fix problem which only shows up on Windows</li><li>Transfer changes back to Linux machine </li><li>Commit all changes to central repository, confident that everything builds and runs on both Linux and Windows.</li></ol>The tricky parts are the "transfer changes from machine A to machine B" without committing to the central repository. I've tried several solutions to this (source code on a network share, "manually" copying the sources (for various values of "manually")), but none of them really flew. I always ended up committing to the central repo anyway. Fortunately we have a fairly low-traffic repo, and I can usually fix broken things before breaking anyone elses build.<div><br /></div><div>(For the rest of this post, I'm ignoring Subversion branches, even if git-svn does handle Subversion branches as well as could be expected.)</div><div><br /></div><div>Now, using git-svn isn't completely unproblematic either. In an ideal world, I would like to be able to both push and pull to/from the central repo from both machines A and B as well as push/pull between them, but git-svn does not support that. The translation of git commits and their Subversion counterparts has to be done in a single place, or havoc will ensue. In practise, this means that we have a single repo where we run git-svn. This repo can be pulled from, but should not be pushed to (or git-svn will get confused when trying to pull new changes from the central Subversion repo), nor should we pull from any other repo into it. The exact reasons for this is the topic for another post.</div><div><br /></div><div>How do we then get our changes back into the git-svn repo if we cannot push or pull into it? The solution is to use the command "git format-patch". This command creates a patch-set containing a set of changes. "git format-patch origin" will create a patch for all changes present in the local repo, which is not present in the "origin" remote, so if I on the Windows box pull from the Linux machine, I can do "git format-patch origin" to get all the local commits I've made which I need to apply to the repo on the Linux machine (the git-svn repo) and from there committed to the central Subversion repo. </div><div><br /></div><div>Once the patches have been transferred to the Linux machine (this can be done in many ways, I just copy the .patch files over a network share), they can be applied using "git am *.patch". This will apply the patches and commit the change. Conflicts are resolved just as normal git conflicts.</div><div><br /></div><div>The workflow then becomes:</div><div><ol><li>Bring in new changes from the central Subversion repo: git svn rebase</li><li>... hack hack ...</li><li>Pull changes to Windows machine: git pull</li><li>Build and test on Windows</li><li>Fix eventual problems on Windows</li><li>Generate patch set to bring back changes to Linux: git format-patch origin</li><li>Copy patch files back to Linux</li><li>Apply changes: git am *.patch</li><li>Commit things back to Subversion: git svn dcommit</li></ol>It is still a bit cumbersome, but the benefits are several:</div><div><ul><li>I can produce commits which I have tested on both Windows and Linux.</li><li>I can use "git rebase -i" to edit/reorder the commits before finally pushing them to Subversion. This makes it easy to produce clear and concise commits.</li><li>I can use "git gui" to commit partial files. I can include a single added line from a file with hundreds of other changes in it. This also helps in produce commits which are easy to understand.</li></ul></div><div>In short, git and git-svn allows me to <i>write better code.</i></div>Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-53557355995488843792010-05-19T20:15:00.004+01:002010-05-19T20:56:57.432+01:00Resistance is futile. You will be simulated.<span style="font-style:italic;">Resistance is futile. You will be simulated.</span> was the text printed (using a <a href="http://www.talshiar.org/Fonts/StarDown.ttf">Star Trek font</a>) on a limited number of t-shirts we had printed when I worked at <a href="http://www.virtutech.com/">Virtutech</a>. The simulator is called Simics, and is a full-system simulator capable of simulator entire computer systems with sufficient fidelity that the simulated software is not aware that it is being simulated.<br /><br />Raymond Chen recently posted an entry on his excellent <a href="http://blogs.msdn.com/oldnewthing/">The Old New Thing</a> blog, titled <a href="http://blogs.msdn.com/oldnewthing/">If you can detect the difference between an emulator and the real thing, then the emulator has failed</a>. This made remember a fun challenge once held at a party at Virtutech after I had left the company (I don't remember the occasion). There were two black screens displaying a Linux command prompt. One of the screens was connected to a physical PowerPC board, and the other was connected to a simulated PowerPC board. The task was then to decide, using the only the command lines of the two machines, which machine was simulated and which one was not.<br /><br />Doing "cat /proc/cpuinfo" only revealed that both systems where running on PowerPC hardware (the output was different, but then only the people setting up the challenge new exactly which PowerPC hardware was being used), and the simulation was fast enough to not reveal anything performance wise. Now, I happened to have some insider info allowing me to solve the problem: Simics does not (or did not then) have any USB-support, which meant that the "lsusb" command should provide some crucial hints. Quite correctly, the simulated machine did not have any USB-devices, while the real hardware had a number of USB-related devices. I'm not sure if I won the challenge or not, but I remember a bunch of people standing around the terminal discussing different ways of beating the system.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-1536340346037595532010-05-16T19:36:00.001+01:002010-05-16T19:36:16.682+01:00EgitI have a hobby programming project I work on from time to time. The goal is to implement a JVM (or something resembling one). It will most certainly never be completed, but it is fun to work on it. <br /><br />One thing I've used it for is to learn and experiment with git in a way were I don't risk breaking things for other people.<br /><br />Git's command line interface is as impressive as they come, but since I've used Eclipse CDT for writing the code, I wanted to try Egit. Also, since git is on it's way to replace cvs at Eclipse, I thought it would good to know. <br /><br />The general impression about Egit is that it is pretty solid, but a few areas needs polishing, for example, there's no easy equivalent to "git pull". The "fetch from" command gives me a big dialog with no sensible defaults. A lot of thought has been put into the command line interface, and creating a GUI with the same expressiveness is not done overnight. <br /><br /><br />- Posted using BlogPress from my iPhone<br />Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-56953372187867019312010-04-07T06:36:00.002+01:002010-04-07T06:44:43.307+01:00Error recovery features in Clang<div>Came across this blogpost about the cool clang error recovery features:</div><div><br /></div><a href="http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html">http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html</a><div><br /></div><div>Clang really goes "above and beyond the call of duty" to deliver good error messages. For example, it has a built-in spell-checker, so that if you type "int64" instead of "int64_t", it will actually point that out. It also detects source code conflict markers, and only parse one side of it (failing of course, but without attempting to parse the conflict markers). </div><div><br /></div><div>This is probably very true:</div><blockquote><div><a href="http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html"></a><i>It's sad but true that being an experienced C++ programmer really means that you're adept at decyphering the error messages that your compiler spews at you.</i></div><div><i><br /></i></div></blockquote><div></div>Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-30746302988931255502010-03-29T09:37:00.003+01:002010-03-29T09:46:41.873+01:00New keyboard<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://a248.e.akamai.net/7/248/2041/1677/as-images.apple.com/is/image/AppleInc/MB869LL?wid=326&hei=326&fmt=jpeg&qlt=95&op_sharpen=0&resMode=bicub&op_usm=0.5,0.5,0,0&iccEmbed=0&layer=comp"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 326px; height: 326px;" src="http://a248.e.akamai.net/7/248/2041/1677/as-images.apple.com/is/image/AppleInc/MB869LL?wid=326&hei=326&fmt=jpeg&qlt=95&op_sharpen=0&resMode=bicub&op_usm=0.5,0.5,0,0&iccEmbed=0&layer=comp" border="0" alt="" /></a><br />While at EclipseCon, I visited the Apple Store at the Valley Fair Mall, and bought an <a href="http://store.apple.com/us/product/MB869LL/A?fnode=MTY1NDA1Mg&mco=MTA4Mzc5NDY">Apple Keyboard</a>. Very nice and clean keyboard which frees up quite a bit of space on my desk.<div><br /></div><div>Setting it up wasn't really that difficult, but in order to be able to access keys like <i>forward delete</i> and <i>page-up </i></div><div><i>/page-down, </i>I had to install the boot-camp drivers. <a href="http://superuser.com/questions/88912/does-apple-magic-mouse-fully-work-on-windows-7-x86-x64">This question</a> on <a href="http://superuser.com/">Superuser.com</a> proved useful in order to find the drivers. Now I just need to train my fingers a little to avoid pressing Fn instead of Control.</div><div><br /></div><div>Highly recommended keyboard. If you can't live without the numerical keyboard, I recommend that you buy <a href="http://store.apple.com/us/product/MB110LL/A?fnode=MTY1NDA1Mg&mco=MTA4Mzc4ODA">this one</a> instead.</div><div><br /></div>Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-34076149982101787392010-03-19T23:04:00.002+01:002010-03-19T23:09:34.634+01:00EclipseCon 2010I'm leaving for EclipseCon 2010 tomorrow morning. Looking forward to an interesting week, and hopefully some SF sightseeing as well.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-28880679309822937642009-10-25T23:14:00.003+01:002009-10-25T23:16:12.884+01:00Debugging parallell code using a simulator<a href="http://jakob.engbloms.se/archives/975?owa_from=feed&owa_sid=">Excellent article</a> about tracking down a particularly nasty concurrency code using <a href="http://www.virtutech.com/">Simics</a>, by <a href="http://www.engbloms.se/">Jakob Engblom</a>.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-117396107704459392009-10-03T18:05:00.004+01:002009-10-03T19:10:26.957+01:00Windows 7I recently got a new laptop at work (an <a href="http://www.google.se/search?q=hp6930p+notebook">HP 6930p</a>) which I'm very happy with. The harddrive was blank (presumably because I ordered a 250GB instead of the standard 160GB), so I had a good opportunity to skip Vista and install Windows 7 directly. Since it had 4GB I installed the 64-bit version (Enterprise), and the overall experience is pretty good. One thing I am really impressed with is the 32-bit compatibility on 64-bit Windows. The details may be gory, but the bottom line is that there is really no reason whatsoever to take the 64-bit Windows if you have 4GB or more.<br /><br />Performance-wise I don't want to say anything for a year or so when Windows-machines usually start to get bogged down, but feature-wise there are quite a few goodies in there. Here are some of my favorites:<br /><ul><li>The new dock-like taskbar.</li><li>The window-management shortcuts (window movement/maximizing), taskbar navigation.</li><li>Notification icon cleanup.</li></ul>But of course, there are areas which Microsoft has forgotten about completely and which basically have not gotten any attention since Windows 2000:<br /><ul><li>Environment variable setup. WTF!? Why can I at least get a <span style="font-weight: bold;">multiline</span>-control for editing values?<br /></li><li>The Windows console. Resizing? Copy/paste? Tabs? The list of missing features is endless.</li></ul>I'm normally a Linux-guy, but nowadays I'm doing so much work in Eclipse that the operating system really doesn't matter too much. Also, requirements at work make it difficult for me to use Linux at work, so the last months I've worked completely in Windows. And Windows 7 is definitely a big improvement over both XP and Vista.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com0tag:blogger.com,1999:blog-7012742729372608936.post-23104081205198927372009-08-14T07:10:00.003+01:002009-08-14T07:44:46.132+01:00Top things I miss when going from Eclipse JDT to Visual Studio C++I recently dived into Visual Studio to do some C++ hacking after several months of doing mostly Java in Eclipse, and discovered a few items which I really miss.<div><div><ul><li>Hot code replacement. This is <b>really</b> addictive in Eclipse: I set a breakpoint in a function, edit the code around it. After saving, the code in the debugged JVM is replaced and PC is reset to the start of the function. The other day I got annoyed when this didn't work (I changed the class' external signature), and I actually had to restart the debug session. Oh no!</li><li>Drop-to-frame. I can at any time reset the execution state to a frame further down on the stack and rerun from there.</li><li>Automatic code formatting. In Eclipse I have function "format entire source file on save" switched on, basically letting the editor do all the formatting for me. It even does line-wrapping inside comments, something I find very handy. In Visual Studio I have to manually indent each line (well, the indentation level is given automatically), but things like line-wrapping I have to do manually. </li><li>Incremental background compilation. I can sit several seconds waiting for the code to build before I realize that I need to start the build manually. (You also have to <b>save</b> your code before you can get any sort of feedback from the compiler.)</li><li>The "open type" and "open resource" commands. "Open type" allows me to interactively search for a class and jump to it. Visual Studio has a similar search, but I often get multiple matches and need to think about which match I'm actually interested in. "Open resource" does the same thing, but searches for files in the workspace. Visual Studio only gives me the regular Open File dialog, which is useless since I first need to locate the directory the file is in.</li><li>Red squiggles for errors. Compilation errors are indicated as a tiny line in the margin, instead of a red squiggle in the code.</li><li>The Emacs-bindings in Visual Studio are much crappier than in Eclipse. The most annoying part is that TAB doesn't indent an empty line, so you have to start your line at column zero, and not until you've written at least one character can you indent the line. (The Emacs-bindings in Eclipse aren't perfect either, I especially miss the kill-ring).</li></ul>I realize that several of these issues are very difficult to get right in a C++ IDE (hot code replacement and drop-to-frame, for example), or completely subjective (I don't really expect Microsoft to spend a lot of time getting Emacs-binding completely right; I'm actually very happy that there are Emacs bindings at all).</div></div>Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com2tag:blogger.com,1999:blog-7012742729372608936.post-1359310571494911582009-08-11T09:34:00.002+01:002009-08-11T09:57:15.864+01:00The role of exercise in weight lossI've recently lost a bit of weight by using a controlled diet. By writing down everything I eat (using the Weight Watcher's point system) I managed to lose around 18 kg in around 30 weeks, getting me down from 105 kg to a considerably healthier 87, where I've stayed now for a while. I can now run without breaking my knees, and my current personal record over 10km is under 54 minutes. Using a pulse-meter I've also been able to keep a decent track of calories spent while exercising.<br /><br />One of the revelations I got when starting to document how much I ate (calories or weight-watcher points, it doesn't really matter), is that exercise does not really matter when losing weight. First, if you're 20 kg overweight like I was, chances are that you're overeating with at least a day or two worth of food per week. A pizza easily covers 80-100% of your recommended calorie intake per day. To balance one day worth of calories, you will need at a significant amount of intensive exercise. Going swimming or running 30 minutes twice a week will not help.<br /><br />According to the article <a href="http://www.time.com/time/health/article/0,8599,1914857,00.html">Why Exercise Won't Make You Thin</a>, exercise will also stimulate hunger, causing you to eat more. (It certainly does for me; I ofter food-hallucinate when I'm running.)<br /><br />So, while exercising is a good idea for most people, don't expect to lose any weight unless you also change what you eat.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com2tag:blogger.com,1999:blog-7012742729372608936.post-45418334272334686012009-07-07T13:02:00.002+01:002009-07-07T13:16:26.165+01:00Mobile broadband in Ubuntu JauntyWriting using mobile broadband in the archipelago outside Stockholm...<br /><br />Getting the broadband dongle from <a href="http://tre.se">3</a> to work, I braced myself for an afternoon of twiddling around. To my surprise it actually worked directly out of the box. Well, almost. The dongle wasn't recognized directly when inserted, but had to be manually added in the Network Manager. This was really easy; I just selected "3 (Bredband)" in the wizard, and typed in the PIN code when asked to. After that, everything worked. (Not too good bandwidth though, but I can live with that.)<br /><br />This actually makes it even easier to use from Linux than from Windows, where you need to install a special client application, manually start the client application, enter the PIN, and connect to the network.Anonymoushttp://www.blogger.com/profile/00034116782690900048noreply@blogger.com2