<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>Advogato blog for e8johan</title>
    <link>http://www.advogato.org/person/e8johan/</link>
    <description>Advogato blog for e8johan</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Thu, 24 Jul 2008 01:48:55 GMT</pubDate>
    <item>
      <pubDate>Wed, 23 Jul 2008 16:08:55 GMT</pubDate>
      <title>Fractalicious</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=309</link>
      <guid>http://www.thelins.se/johan/2008/07/fractalicious.html</guid>
      <description>Ever since I first played with &lt;a href="http://spanky.triumf.ca/www/fractint/fractint.html" &gt;FractInt&lt;/a&gt;, it must have been at least 15 years ago, I've been intrigued by fractals. At first, they seemed like magic to me, but as I learned more maths, I can understand the why, but not always the how.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thelins.se/johan/uploaded_images/dragon-780904.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.thelins.se/johan/uploaded_images/dragon-780902.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A couple of years ago I set out to write a fractal exploration application called Frakter. To be honest, it sucked pretty much, but it was an attempt. The nice things about it where:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Fractals where kept in external scripts, so that the application could be extended.&lt;/li&gt;&lt;li&gt;Colouring was done using special colour maps that could be loaded and saved.&lt;/li&gt;&lt;li&gt;It used a background thread to render the fractals.&lt;/li&gt;&lt;li&gt;It had a zooming history that one could type right into to find interesting ranges in the complex numbers realm.&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.digitalfanatics.org/projects/frakter/screenshots/history.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://www.digitalfanatics.org/projects/frakter/screenshots/history.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now and then I visit &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/index.html" &gt;Paul Bourke&lt;/a&gt;'s great collection of &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/fractals/" &gt;fractals&lt;/a&gt; (and &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/geometry/" &gt;loads&lt;/a&gt; &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/surfaces_curves/" &gt;of&lt;/a&gt; &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/texture_colour/" &gt;other&lt;/a&gt; &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/projection/" &gt;stuff&lt;/a&gt; &lt;a href="http://local.wasp.uwa.edu.au/%7Epbourke/dataformats/" &gt;too&lt;/a&gt;). Each time, I feel an urge to write something that can handle everything that he shows.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thelins.se/johan/uploaded_images/tree-794424.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.thelins.se/johan/uploaded_images/tree-794422.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I want to be able to fit all different types of fractals into a class tree that I can write a GUI around. The data carried from the fractals to the UI would be enough to do basic 2D rendering, 3D rendering, psychedelic colouring, and so on.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thelins.se/johan/uploaded_images/peano-780424.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.thelins.se/johan/uploaded_images/peano-780422.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I've had a couple of half hearted attempts this far, but now I started from the other direction, i.e. starting with the fractal types I never get to otherwise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thelins.se/johan/uploaded_images/fern-766225.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.thelins.se/johan/uploaded_images/fern-766222.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Right now I've implemented &lt;a href="http://en.wikipedia.org/wiki/Iterated_function_system" &gt;IFS&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/L-system" &gt;L-systems&lt;/a&gt;. The implementation is not even an attempt at being efficient and uses loads and loads and loads of memory, but it works. The next step is to create a colouring class that one can inherit to do the funky stuff. Last value, current value and current iteration, fractal specific category are the "input values" I plan to use. Right now, fractal specific category, is "last used transformation set" when dealing with IFS, for L-systems, it is zero.</description>
    </item>
    <item>
      <pubDate>Wed, 16 Jul 2008 20:09:38 GMT</pubDate>
      <title>VB Porting Issues</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=308</link>
      <guid>http://www.thelins.se/johan/2008/07/vb-porting-issues.html</guid>
      <description>Dear Lazy-web,&lt;br /&gt;&lt;br /&gt;I was hoping that someone out there remembers good old VB4. I have an issue when helping out to port a VB4 system to XP. The thing is that I've got a really old system for managing club members and race results that is used by the local bicycle club. I did not write this system, and I'm helping them for free. Anyhow, it uses VB4 + Crystal Reports 1.x.&lt;br /&gt;&lt;br /&gt;Installing these tools on Windows XP works on some machines, but not all. For instance, Swedish XP installations seems to crash Crystal Reports (somewhere in ntdll.dll). Just starting the app, that is.&lt;br /&gt;&lt;br /&gt;Does anyone know what is causing this and how to circumvent it? I would be very pleased...</description>
    </item>
    <item>
      <pubDate>Tue, 8 Jul 2008 20:08:54 GMT</pubDate>
      <title>Standard Template Library - readable?</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=307</link>
      <guid>http://www.thelins.se/johan/2008/07/standard-template-library-readable.html</guid>
      <description>Since I called some STL code readable, I've recieved numerous mails and comments. Fellow Qt/KDE-er dhaumann &lt;a href="http://dhaumann.blogspot.com/2008/07/c-template-magic.html" &gt;added his 0.02 EUR to the pile&lt;/a&gt; and showed the nicety of template specialization.&lt;br /&gt;&lt;br /&gt;Today I thought I'd follow up on some more comments.&lt;br /&gt;&lt;br /&gt;First of all, my personal opinion is that C++ is just as readable as most other languages. Even in this case. What can be less readable are the horrendus error messages that one can end up with. I've even compiled a &lt;a href="http://www.digitalfanatics.org/index.php?title=CompilerErrors" &gt;small list of error messages&lt;/a&gt; and what they really mean in plain English, but this does not - of course - help in ugly template cases. (Yes, the css of digitalfanatics.org is ugly and somewhat broken...)&lt;br /&gt;&lt;br /&gt;Back to readability. Even plain English cannot express the two operations that I suggested in a short way. Both cases results in fairly long sentences. Also, try to formally parse and express such sentences with more "interesting" transformation functions.&lt;br /&gt;&lt;br /&gt;  "&lt;span style="font-style: italic;"&gt;For every item in the source list, add 42 to it and replace it in the source list.&lt;/span&gt;"&lt;br /&gt; &lt;br /&gt;  "&lt;span style="font-style: italic;"&gt;For every item in the source list, add 42 to it and append it to the end of the destination list.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;As the commenter zwabel pointed out, in the put-the-result-in-another-list a simple foreach loop showing the actual operation is good enough and reads better. I agree, but that kind of break my do-everything-on-a-line-thesis.&lt;br /&gt;&lt;br /&gt;Titus Brown pointed out that I do too much on a single line. I have to disagree with this - looping and doing something on each item is simple enough.&lt;br /&gt;&lt;br /&gt;Then I had lots of suggestions that I say that C++ isn't functional, but I use a functional style in my example. I'm not sure that I agree. My impression of the STL is that it can perform a number of functions on lists that I'm interested in, for instance.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Iterating (for_each)&lt;/li&gt;&lt;li&gt;Filtering (remove_if)&lt;/li&gt;&lt;li&gt;Searching (find_if)&lt;/li&gt;&lt;li&gt;Processing (transform)&lt;/li&gt;&lt;/ul&gt;To make these operations flexible, they accept a functor - either a predicate or an actual transformation operation. This isn't really functional programming in my eyes, even if it can be used for functional programming. To me, it is just a set of ways to perform iterations and common tasks.&lt;br /&gt;&lt;br /&gt;Anyway, some fun thought that have poped up while discussing this topic. What if we combine these operations with the &lt;a href="http://doc.trolltech.com/main-snapshot/threads.html#qtconcurrent-intro" &gt;QtConcurrent framework&lt;/a&gt;. I have not tried the framework myself, but I was in Munich and listened to Morten's presentation of it, and to me it looks like it could be done. What is missing is a nice set of flexible map and filter functions, binders and such goodies that the STL carries.</description>
    </item>
    <item>
      <pubDate>Sun, 6 Jul 2008 10:19:34 GMT</pubDate>
      <title>STL, redux</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=306</link>
      <guid>http://www.thelins.se/johan/2008/07/stl-redux.html</guid>
      <description>Funny to see that claiming that the following code is readable stirred up quite a few comments.&lt;br /&gt;&lt;pre&gt;std::transform( list.begin(), list.end(), std::back_inserter( res ), std::bind2nd( std::plus&amp;lt;int&amp;gt;(), 42 ) );&lt;/pre&gt;&lt;br /&gt;Now, there are basically three points that you guys like to point out:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Try another language&lt;/span&gt; - the short answer, no. The longer answer, I like C/C++, much because I've grown to know them, but also because I can see the actual machine code that the code I write will produce. This, to me as an electronics guy, is really neat. It gives me a sense of control.&lt;br /&gt;&lt;br /&gt;Also, I've tried Haskell and Lisp (and Excel, if you want another functional language), and I like the concept, but creating something large and actually useful using these tools... I don't know. I'm sure that you can point out a million examples, but... nah. Not for me. At least not for proper work.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C++0x can do this better&lt;/span&gt; - but why change a winning concept. Lambda expressions does not belong in C++. The C-family of languages contains imperative languages, not functional ones. Call me old, call me granddad, but I like it the way it is. If I could go back in time, I'd rather spend my time pushing MS to improve their implementation than changing the specs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;You call that readability?&lt;/span&gt; - yes I do, and seeing examples from other languages, I do so even more. The trick is to read code from the right direction. For example, compare reading an ordinary mathematical expression to reading it in RPN. Neither is fun, but as soon as you know how to approach it, both are simple.&lt;br /&gt;&lt;br /&gt;I try to read C/C++ from the inside out. Take, the troublesome expression that started this. I would start with the arguments. The first two are simple - just limiting the input data. The third is a bit more tricky: &lt;tt&gt;std::back_inserter( res )&lt;/tt&gt;. Try starting from the inside, what is &lt;tt&gt;res&lt;/tt&gt;? A list of integers. What could a &lt;tt&gt;back_inserter&lt;/tt&gt; do to a list? Perhaps insert stuff at the back of it.&lt;br /&gt;&lt;br /&gt;Continuing with the operation: &lt;tt&gt;std::bind2nd( std::plus&amp;lt;int&amp;gt;(), 42 )&lt;/tt&gt;. Again, starting from the inside, &lt;tt&gt;plus&lt;/tt&gt; probably adds two arguments together, integers judging from the template specialization. So, &lt;tt&gt;bind2nd&lt;/tt&gt;? Coming from an engineering background (and having done this a couple of times) I thing that it is quite clear that it binds (locks) the second argument to a value, in this case 42. I can admit that this is not 100% clear if you're not familiar with the topic.&lt;br /&gt;&lt;br /&gt;So, taking one last step out I find myself looking at the word &lt;tt&gt;transform&lt;/tt&gt;. So, a list of items is transformed into another list. Again, not too hard to grasp, but you might want to look up the details in an STL reference. Speaking of such, SGI hosts are really good &lt;a href="http://www.sgi.com/tech/stl/" &gt;STL reference&lt;/a&gt;. So, for the curios readers, given these links I think that you also can call the transform expression readable:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.sgi.com/tech/stl/plus.html" &gt;plus&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sgi.com/tech/stl/binder2nd.html" &gt;bind2nd&lt;/a&gt;, or actually binder2nd. Kind of hard to look up, but &lt;a href="http://www.google.se/search?q=stl+bind2nd+sgi" &gt;Google knows the way&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sgi.com/tech/stl/back_insert_iterator.html" &gt;back_inserter&lt;/a&gt; (back_insert_iterator)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sgi.com/tech/stl/transform.html" &gt;transform&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 5 Jul 2008 12:08:19 GMT</pubDate>
      <title>STL rocks</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=305</link>
      <guid>http://www.thelins.se/johan/2008/07/stl-rocks.html</guid>
      <description>I've just been writing a small article on the "gems of STL" and found that I really like what I'm seeing. A personal favorite is the transform operation (found in the functional header file). For example, lets do some adding.&lt;br /&gt;&lt;pre&gt;#include &amp;lt;functional&amp;gt;&lt;br /&gt;#include &amp;lt;list&amp;gt;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;std::list&amp;lt;int&amp;gt; list;&lt;br /&gt;list.push_back( ... ); // Populate&lt;br /&gt;&lt;br /&gt;std::transform( list.begin(), list.end(), list.begin(), std::bind2nd( std::plus&amp;lt;int&amp;gt;(), 42 ) );&lt;br /&gt;}&lt;/pre&gt;So, the transform method takes three iterators and an functor. The operators are, from the left, the starting point of the input, the end point of the input and the starting point of the output. The function simply specifies what to do with each list entry to create the output. In this case, std::plus takes two arguments, but we bind the second argument to 2. What this does is that it adds 42 to every item in the list (between begin and end), and replaces the original items (the results are placed from begin and onwards).&lt;br /&gt;&lt;br /&gt;If you want the results to end up in another list, just use the back_inserter magical interator and point it to your results list.&lt;br /&gt;&lt;pre&gt;{&lt;br /&gt;std::list&amp;lt;int&amp;gt; list, res;&lt;br /&gt;list.push_back( ... ); // Populate&lt;br /&gt;&lt;br /&gt;std::transform( list.begin(), list.end(), std::back_inserter( res ), std::bind2nd( std::plus&amp;lt;int&amp;gt;(), 42 ) );&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Quite readable and really cool code if you ask me.</description>
    </item>
    <item>
      <pubDate>Tue, 1 Jul 2008 10:17:45 GMT</pubDate>
      <title>QCodeEdit</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=304</link>
      <guid>http://www.thelins.se/johan/2008/07/qcodeedit.html</guid>
      <description>A spin-off from the &lt;a href="http://www.edyuk.org" &gt;Edyuk&lt;/a&gt; project has finally been released with a website of its own. The &lt;a href="http://qcodeedit.edyuk.org/" &gt;QCodeEdit&lt;/a&gt; project looks really promissing. What you get is a code editor with syntax highlighting for a range of languages (yes, you can add support for more languages) developed using Qt - i.e. 100% cross platform - and good looking as well.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.thelins.se/johan/uploaded_images/qcodeedit-cut-775587.png" &gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.thelins.se/johan/uploaded_images/qcodeedit-cut-775584.png" alt="" border="0" /&gt;&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 19 Jun 2008 12:11:04 GMT</pubDate>
      <title>Storebror - Big Brother</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=303</link>
      <guid>http://www.thelins.se/johan/2008/06/storebror-big-brother.html</guid>
      <description>As the Swedish parliament &lt;a href="http://arstechnica.com/news.ars/post/20080618-swedish-parliament-rejects-big-brother-surveillance-bill.html" &gt;passed the "FRA law"&lt;/a&gt;, a.k.a. the big brother law, it is time to change broad band provide. The ISP Bahnhof will &lt;a href="http://www.bahnhof.se/privat/news.php?open=28" &gt;not follow the new law&lt;/a&gt; and promises to reroute its traffic to avoid it if needed.&lt;br /&gt;&lt;br /&gt;They offer ADSL at reasonable prices (24 Mbit/s @ 239 SEK/month) - &lt;a href="http://www.bahnhof.se/stad/adsl" &gt;place your orders&lt;/a&gt;.</description>
    </item>
    <item>
      <pubDate>Sun, 8 Jun 2008 21:10:50 GMT</pubDate>
      <title>What a drive!</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=302</link>
      <guid>http://www.thelins.se/johan/2008/06/what-drive.html</guid>
      <description>&lt;a href="http://www.formula1.com/results/season/2008/793/6520/" &gt;Congratulations&lt;/a&gt; to the entire BMW Sauber F1 team and all the supporters!</description>
    </item>
    <item>
      <pubDate>Wed, 4 Jun 2008 10:21:53 GMT</pubDate>
      <title>SpeedCrunch 0.10.1</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=301</link>
      <guid>http://www.thelins.se/johan/2008/06/speedcrunch-0101.html</guid>
      <description>SpeedCrunch just reached 0.10.1, or 0x5 as I interpret it. Read about it at &lt;a href="http://speedcrunch.blogspot.com/2008/06/speedcrunch-0101-released.html" &gt;the SpeedCrunch blog&lt;/a&gt;.</description>
    </item>
    <item>
      <pubDate>Mon, 2 Jun 2008 10:15:27 GMT</pubDate>
      <title>GCF Goes Commercial</title>
      <link>http://www.advogato.org/person/e8johan/diary.html?start=300</link>
      <guid>http://www.thelins.se/johan/2008/06/gcf-goes-commercial.html</guid>
      <description>One of the nice things about Qt, in my opinion, is that they satisfy the needs not only of the F/OSS community, but also by the big dragons creating closed source software. They do this along the principle of "Quid Pro Quo", that is, if you make money without sharing your source, you need to pay. If you share your source we [Trolltech, which I'm not affiliated with] share ours for free.&lt;br /&gt;&lt;br /&gt;Anyway, holders of commercial Qt licenses can do the same thing for their software. This is what &lt;a href="http://www.vcreatelogic.com" &gt;VCreateLogic&lt;/a&gt; just did with their &lt;a href="http://www.vcreatelogic.com/oss/gcf/" &gt;GCF&lt;/a&gt; framework. According to Prashanth, they &lt;a href="http://prashanthudupa.livejournal.com/24458.html" &gt;sold 13 commercial licenses in one month&lt;/a&gt; - congratulations!&lt;br /&gt;&lt;br /&gt;I got to know GCF as a judge in last year's &lt;a href="http://www.qtcentre.org" &gt;QtCentre&lt;/a&gt; programming contest. It takes the abstraction one level beyond widgets and make it possible to build user interfaces using components. The cool thing is that you get a modern (albeit Microsoft-ish) look for free. And as GCF is dual licensed, you can try it out for your F/OSS project right now.</description>
    </item>
  </channel>
</rss>
