Luke Plant's home page (Posts about Rants)https://lukeplant.me.uk/blog/categories/rants.xml2023-12-22T14:47:20ZLuke PlantNikolaSuper-fast Sphinx docs, and SNOB driven developmenthttps://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/2023-09-27T15:05:48+01:002023-09-27T15:05:48+01:00Luke Plant<p>Code that will make your static doc pages seriously faster, that you seriously don’t need</p><p>If you are using static HTML files for your docs, such as with <a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a> or many other doc generators, here is a chunk of code that will speed up loading of pages after the first one. If you’re using some other docs generator, the instructions will probably work with minimal adaptation.</p>
<ol class="arabic">
<li><p>Create a <code class="docutils literal">custom.js</code> file inside your <code class="docutils literal">_static</code> directory, with the following contents:</p>
<div class="code"><pre class="code javascript"><a id="rest_code_d64135d7232c4544accf5c37446f0fb0-1" name="rest_code_d64135d7232c4544accf5c37446f0fb0-1" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-1"></a><span class="kd">var</span><span class="w"> </span><span class="nx">script</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">'script'</span><span class="p">);</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-2" name="rest_code_d64135d7232c4544accf5c37446f0fb0-2" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-2"></a><span class="nx">script</span><span class="p">.</span><span class="nx">src</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"https://unpkg.com/htmx.org@1.9.5"</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-3" name="rest_code_d64135d7232c4544accf5c37446f0fb0-3" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-3"></a><span class="nx">script</span><span class="p">.</span><span class="nx">integrity</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO"</span><span class="p">;</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-4" name="rest_code_d64135d7232c4544accf5c37446f0fb0-4" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-4"></a><span class="nx">script</span><span class="p">.</span><span class="nx">crossOrigin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'anonymous'</span><span class="p">;</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-5" name="rest_code_d64135d7232c4544accf5c37446f0fb0-5" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-5"></a><span class="nx">script</span><span class="p">.</span><span class="nx">onload</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kd">function</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-6" name="rest_code_d64135d7232c4544accf5c37446f0fb0-6" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-6"></a><span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">body</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">querySelector</span><span class="p">(</span><span class="s2">"body"</span><span class="p">);</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-7" name="rest_code_d64135d7232c4544accf5c37446f0fb0-7" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-7"></a><span class="w"> </span><span class="nx">body</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">'hx-boost'</span><span class="p">,</span><span class="w"> </span><span class="s2">"true"</span><span class="p">);</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-8" name="rest_code_d64135d7232c4544accf5c37446f0fb0-8" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-8"></a><span class="w"> </span><span class="nx">htmx</span><span class="p">.</span><span class="nx">process</span><span class="p">(</span><span class="nx">body</span><span class="p">);</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-9" name="rest_code_d64135d7232c4544accf5c37446f0fb0-9" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-9"></a><span class="p">}</span><span class="w"></span>
<a id="rest_code_d64135d7232c4544accf5c37446f0fb0-10" name="rest_code_d64135d7232c4544accf5c37446f0fb0-10" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_d64135d7232c4544accf5c37446f0fb0-10"></a><span class="nb">document</span><span class="p">.</span><span class="nx">head</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">script</span><span class="p">);</span><span class="w"></span>
</pre></div>
</li>
<li><p>Add an item to your <code class="docutils literal">html_js_files</code> setting in your Sphinx <code class="docutils literal">conf.py</code>:</p>
<div class="code"><pre class="code python"><a id="rest_code_536742c61d14439b80576e2e0c694e09-1" name="rest_code_536742c61d14439b80576e2e0c694e09-1" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_536742c61d14439b80576e2e0c694e09-1"></a><span class="n">html_js_files</span> <span class="o">=</span> <span class="p">[</span>
<a id="rest_code_536742c61d14439b80576e2e0c694e09-2" name="rest_code_536742c61d14439b80576e2e0c694e09-2" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_536742c61d14439b80576e2e0c694e09-2"></a> <span class="s1">'custom.js'</span><span class="p">,</span>
<a id="rest_code_536742c61d14439b80576e2e0c694e09-3" name="rest_code_536742c61d14439b80576e2e0c694e09-3" href="https://lukeplant.me.uk/blog/posts/super-fast-sphinx-docs/#rest_code_536742c61d14439b80576e2e0c694e09-3"></a><span class="p">]</span>
</pre></div>
</li>
</ol>
<p>Rebuild and you’re done.</p>
<p>What this script does is:</p>
<ol class="arabic simple">
<li><p>Load the <a class="reference external" href="https://htmx.org/">htmx</a> library.</p></li>
<li><p>If it successfully loads, adds the <a class="reference external" href="https://htmx.org/attributes/hx-boost/">hx-boost</a> attribute to the body element.</p></li>
<li><p>Initialises htmx on the page.</p></li>
</ol>
<p>This means that htmx will intercept all internal links on the page, and instead of letting the browser load them the normal way, it sends an AJAX request and swaps in the content of the page. This means that the whole page doesn’t need to be reloaded by the browser, saving precious milliseconds.</p>
<section id="actually-please-dont">
<h2>Actually, please don’t</h2>
<p>I will provide reasons why you really shouldn’t use the code above, although it works almost perfectly. But first, a rant.</p>
<p>This post was inspired by <a class="reference external" href="https://www.mux.com/blog/what-are-react-server-components">Mux’s blog post on migrating 50,000 lines of React Server Components</a>. It contains a nice overview of the history of web site architecture, including this quote:</p>
<blockquote>
<p>Then, we started wondering: What if we wanted faster responses and more interactivity? Every time a user takes an action, do we really want to send cookies back to the server and make the server generate a whole new page? What if we made the client do that work instead? We can just send all the rendering code to the client as JavaScript!</p>
<p>This was called client-side rendering (CSR) or single-page applications (SPA) and was <a class="reference external" href="https://begin.com/blog/posts/2023-02-21-why-does-everyone-suddenly-hate-single-page-apps">widely considered a bad move</a></p>
</blockquote>
<p>However, instead of then suggesting that we perhaps we should retrace our steps, the article just plunges on and on, deeper and deeper into the jungle.</p>
<p>Now, this might all make sense if we are talking about a highly interactive site that has the highest possible needs in terms of user interactivity. But I realised the article was about <strong>just their documentation site</strong>, not the main application.</p>
<p>Now, some docs sites are really fancy and do very clever interactive things. Mux’s, however, is not like that. The only interactive things I could find were:</p>
<ul class="simple">
<li><p>tabs – like you can get with something like <a class="reference external" href="https://sphinx-code-tabs.readthedocs.io/en/latest/">sphinx-code-tabs</a>, powered by a <a class="reference external" href="https://sphinx-code-tabs.readthedocs.io/en/latest/_static/code-tabs.js">tiny bit of Javascript</a>.</p></li>
<li><p>their <a class="reference external" href="https://docs.mux.com/changelog">changelog page</a> – which is more complicated, but whose essential functionality could again be implemented by a really small amount of Javascript added to a static page. I should also note that their page is really pretty slugish when you change the filters, much slower than you would get by an approach that just selectively hides parts of the page using DOM manipulation.</p></li>
<li><p>search. Search is definitely important, but I can’t see why it means the whole site needs to be implemented in React.</p></li>
<li><p>A “Was this helpful” component – this could have been a small web component or something similar.</p></li>
<li><p>A few fancy transitions in the side bar.</p></li>
</ul>
<p>These are not the highly stateful pages that React was designed for. Maybe there are a few other things I didn’t find, but 95% of it could be handled using entirely static HTML, built by any number of simple docs generators, with tiny amounts of Javascript.</p>
<p>The only other thing I noticed is that page transitions generally had that instant feel an SPA can give you, and were noticeably faster than you would get with the static HTML solution I’m suggesting.</p>
<p>So, not to be beaten, I came up with the above solution on htmx so I could match the speed.</p>
<p>Now, here’s why you shouldn’t use it:</p>
<ul>
<li><p>A typical docs page with Sphinx loads in a few hundred milliseconds, which is fine. Do you really need to shave that down to less than 50 so it feels “instant”? Do your users care?</p></li>
<li><p>While it is truly a tiny fraction of the complexity of the React docs site Mux described in their post, you are still adding some significant complexity. Is it worth is?</p></li>
<li><p>Are you sure it’s not going to interact badly with some Javascript on some page, maybe some future Javascript you will add?</p></li>
<li><p>Have you considered all use cases – like the person who downloads your whole docs site using <code class="docutils literal">wget <span class="pre">--recursive</span></code> so they can browse offline? Answer: if they have no internet connection when they view the docs, it will actually work fine, because the htmx library won’t load at all. But if they are online, the htmx library will load, and then every internal link will break due to <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS errors</a>. <strong>You just broke offline viewing</strong>. You could fix this very easily with an extra conditional in the script above, but I’m making a point. Is there anything else that’s broken?</p>
<p>No prizes for guessing that while Sphinx-generated sites normally work perfectly with <code class="docutils literal">wget <span class="pre">--recursive</span></code> for offline viewing, docs.mux.com does not work well, to put it mildly. I also wasted hundreds of Mb finding out, due to the vast amount of boilerplate every single HTML file has. Don’t be like them.</p>
</li>
</ul>
<p>This is what you should actually do:</p>
<ul class="simple">
<li><p>recognise that you know exactly how to make your documentation pages load instantly, like an SPA, and could absolutely do it if you wanted to, still with a tiny fraction of the complexity of an actual SPA architecture, and with fixes for the issues I’ve mentioned, in about 15 minutes, then,</p></li>
<li><p>don’t.</p></li>
</ul>
<p>As protection against the FOMO and fashion that drives so much of web development, this attitude needs a catchy slogan, which is the kind of thing I’m not very good at. But as a first attempt, how about: SNOB driven development. SNOB means “Smugly kNOwing Better”. Or maybe that could be “Smugly NO-ing Better”.</p>
<p>Join me. Be an arrogant SNOB and just say No.</p>
</section>No one actually wants simplicityhttps://lukeplant.me.uk/blog/posts/no-one-actually-wants-simplicity/2023-08-22T18:49:31+01:002023-08-22T18:49:31+01:00Luke Plant<p>We think we do, but in fact every web developer will happily sacrifice simplicity to the first shiny thing promising them relief from the mildest of ailments.</p><p>The reason that modern web development is <a class="reference external" href="https://www.youtube.com/watch?v=BtJAsvJOlhM">swamped with complexity</a> is that no one really wants things to be simple. We just think we do, while our choices prove otherwise.</p>
<p>A lot of developers want simplicity in the same way that a lot of clients claim they want a fast website. You respond “OK, so we can remove some of these 17 Javascript trackers and other bloat that’s making your website horribly slow?” – no, apparently those are all critical business functionality.</p>
<p>In other words, they prioritise everything over speed. And then they wonder why using their website is like rowing a boat through a lake of molasses on a cold day using nothing but a small plastic spoon.</p>
<p>The same is often true of complexity. The real test is the question “what are you willing to sacrifice to achieve simplicity?” If the answer is “nothing”, then you don’t actually love simplicity at all, it’s your lowest priority.</p>
<p>When I say “sacrifice”, I don’t mean that choosing simplicity will mean you are worse off overall – simplicity brings massive benefits. But it does mean that there will be some things that tempt you to believe you are missing out.</p>
<p>For every developer, it might be something different. For one, the tedium of having to spend half an hour a month ensuring that two different things are kept in sync easily justifies the adoption of a bulky framework that solves that particular problem. For another, the ability to control how a checkbox animates when you check it is of course a valid reason to add another 50 packages and 3 layers of frameworks to their product. For another, adding an abstraction with thousands of lines of codes, dozens of classes and page after page of documentation in order to avoid manually writing a <a class="reference external" href="https://lukeplant.me.uk/blog/posts/test-factory-functions-in-django/">tiny factory function for a test</a> is a great trade-off.</p>
<p>Of course we all claim to hate complexity, but it’s actually just complexity added by other people that we hate — our own bugbears are always exempted, and for things we understand we quickly become unable to even see there is a potential problem for other people. Certainly there are frameworks and dependencies that justify their existence and adoption, but working out which ones they are is hard.</p>
<p>I think a good test of whether you truly love simplicity is whether you are able to remove things you have added, especially code you’ve written, even when it is still providing value, because you realise it is not providing enough value.</p>
<p>Another test is what you are tempted to do when a problem arises with some of the complexity you’ve added. Is your first instinct to add even more stuff to fix it, or is it to remove and live with the loss?</p>
<p>The only path I can see through all this is to cultivate an almost obsessive suspicion of <a class="reference external" href="https://en.wikipedia.org/wiki/Fear_of_missing_out">FOMO</a>. I think that’s probably key to learning to <a class="reference external" href="https://grugbrain.dev/#grug-on-saying-no">say no</a>.</p>
<section id="links">
<h2>Links</h2>
<ul class="simple">
<li><p><a class="reference external" href="https://lobste.rs/s/ao2x0v/no_one_actually_wants_simplicity">Discussion of this post on Lobsters</a></p></li>
</ul>
</section>Leaving KDEhttps://lukeplant.me.uk/blog/posts/leaving-kde/2010-06-17T01:57:39+01:002010-06-17T01:57:39+01:00Luke Plant<p>After being a loyal fan of KDE for a long time, I've just left...</p><p>After being a loyal fan of KDE for a long time, I've just switched to GNOME.</p>
<p>I'm afraid to say that since the KDE 4 series, I've been unable to recommend
KDE to anyone. With KDE 4.0 to 4.3, that was due to general crashiness,
brokenness and bugs that are at the level of <em>embarrassing</em> – when a bug is
obvious enough and significant enough that a new user would be shocked to find it and I would have a hard time explaining how I could use software that is clearly inferior to whatever they were using before (usually Windows).</p>
<p>With KDE 4.4, most desktop instability has been ironed out, but it has been
replaced by problems that mean I can no longer stomach or risk staying with
KDE for myself, let alone recommend it to anyone else. The final straw was
that the framework for storing PIM data (Akondai) is turning out no better
than <a class="reference external" href="https://lukeplant.me.uk/blog/posts/a-plea-to-kde-developers/">I feared</a> and is
‘losing’ some of my data.</p>
<p>I found that <a class="reference external" href="https://bugs.kde.org/show_bug.cgi?id=232773">some things added to the address book ‘never’
actually end up in the file they are supposed to be stored in</a>. I've added an e-mail
address for a contact, and it appears to have added fine in KAddressBook.
The data persists even across reboots etc., so it isn't ‘lost’ in one sense.
Usually, the data appears in my std.vcf after a few seconds. In this case,
however, four days later it still hasn't appeared in std.vcf. That counts
as close enough to ‘never’ in my book, so it is fair to say it is ‘lost’.
This has happened intermittently since KDE 4.4.1.</p>
<p>One additional result of this is that KMail never sees that address – at the
moment it seems that it looks only in std.vcf, not Akonadi (and this is
probably the only reason I found the bug in the first place). That's a
pain, but the more serious problem is that my data is just not where it is
supposed to be. If I need to backup and restore, I imagine it would be
possible for that to succeed, if the Akonadi data was backed-up and restored
along with the underlying data. But if you get that bit wrong, I can only
imagine a world of pain and subtle data corruption. It is completely
unacceptable that my data is being stored in “my data files + completely
opaque Akonadi database” rather than just “my data files”.</p>
<p>Another bug is that <a class="reference external" href="https://bugs.kde.org/show_bug.cgi?id=232774">the Google contacts Akonadi plugin also loses data in a
serious way</a>, making it far
worse than useless. The nature of this bug makes me think that either there
is a significant bug in the Akonadi framework, or that the framework API
made it is easy to get this wrong – both of which are worrying.</p>
<p>These bugs are on top my general concerns with the framework – it has always
been painful to work with, and the fact that it is even <strong>visible</strong> is a
major failing – the software layer it replaced was, after all, completely
invisible, just as it should have been.</p>
<p>From what I can tell, migration of KMail to Akonadi is going ahead at full
pace and will be mandatory soon. My contact data is modest (500 Kb), so I
have been able to cope with moving it around and fixing some problems,
including some data loss and mistakes caused, I think, by the above bugs,
since backups are quick. But my e-mail data is 2.5 Gb, and detecting
problems or errors is going to be massively harder. I'm not willing to risk
my e-mail data with Akonadi, so I need a new e-mail client.</p>
<p>It turns out that Evolution works for me. It stores data in mbox files,
which isn't my preferred (1 file per e-mail, like maildir or MH, is nicer
for various purposes), but it is a standard format, and since my backup tool
is 'diff' based it will still cope efficiently with it. It even integrates
with Google contacts out of the box, and the calendar app integrates with
Google calendar, while allowing me to work offline. This is what Akonadi is
supposed to offer one day, and I wish them the best of luck with that. But
for now I'm going to stick with a system that prioritises the safety of my
data, and that I know works. Evolution has a few significant niggles, but I
think I can live with them.</p>
<p>That leaves me with the choice of desktop. Using programs from one desktop
suite generally is faster and easier and looks nicer. I had already dropped
Konqueror for Chrome (Konqueror has fallen far too far behind these days),
and GNOME equivalents to most KDE apps work well enough – like
Empathy/Pidgin. That tips the balance over to GNOME – and I can still use
apps like k3b for specialist work when I need them.</p>
<p>Most of my reasons for leaving GNOME in the first place (about 7 years ago I
think) have been resolved. GNOME apps like Nautilus and Evolution are no
longer as excuciatingly slow and bloated as they used to be (and I don't
think it is just that my computer got faster), and actually feel quite
snappy most of the time. In some cases they definitely outperform the
equivalent KDE default app (e.g. Eye of GNOME is very fast and works very
nicely, doing 90% of what I used Gwenview for before, but much faster).
Generally GNOME is much snappier as a desktop – it takes only about 5
seconds to start after I've logged in, which is <em>much</em> faster than KDE.</p>
<p>So I'm using Ubuntu's GNOME desktop, and I no longer have plasma and all the
plasmoids. To be honest, I don't think I'm missing them. I have all the
panel applets I need, and they are well designed and work properly.
Proliferation of plasmoids is like the proliferation of apps on Apple app
store – most of them are not worth having, and having to search through to
find the ones that are is an anti-feature (not to mention that the new
horizontal applet picker in KDE 4.4, which replaced the vertical one in KDE
4.3, is just awful – I don't understand how such a major regression happened).</p>
<p>I certainly won't shed a tear over Nepomuk/Strigi. After <strong>weeks</strong> of it constant disk activity as they attempted to index my files, they never seemed to do anything useful. They have been replaced by Tracker, which works very well, and very quickly, and without being a huge resource hog. It does not update immediately when I add new files, but it is fast enough to know that when I really want to find something in a real situation, it is likely to be in the index already. And it isn't the massive resource hog that Nepomuk was.</p>
<p>First experience with Ubuntu's GNOME has thrown up some problems. Here are some niggles I've been able to fix/solve:</p>
<ul class="simple">
<li><p>PulseAudio - this breaks lots of things, especially games, and provides no
added benefit. But <a class="reference external" href="http://art.ubuntuforums.org/showpost.php?p=9297829&postcount=146">it can be removed</a>.
Perhaps the Ubuntu guys will remove it in future, or make it easier to
remove. Lots of people and programs seem to have problems with it, it's
very difficult to see what value it is adding for most people.</p></li>
<li><p>To turn off desktop effects quickly (for better performance games)
- either: install fusion-icon (use "fusion-icon -n" as the command)
- or, to do it automatically for fullscreen games, set this option to true: /apps/compiz/general/screen0/options/unredirect_fullscreen_windows</p></li>
<li><p>To turn off screen locking on resume - there is setting is in gconf,
search for 'lock'.</p></li>
</ul>
<p>And here are some that are still bothering me a bit:</p>
<ul class="simple">
<li><p>Reading new e-mails with keyboard only - it's a bit buggy/confusing with Evolution.</p></li>
<li><p>Some options are hidden away in gconf, so it's difficult to know if it is
possible to change things.</p></li>
<li><p>GNOME has less configurability in general, or harder to get to it,
especially for creating new keyboard shortcuts.</p></li>
<li><p>Compiz doesn't always seem to obey or understand all metacity options
(e.g. shortcut for fullscreen-ing windows), so it sometimes confusing
working out what is going on.</p></li>
<li><p>The GNOME file dialog boxes have improved a little bit since I was last using GNOME, but haven't begun to close the gap on KDE's far superior ones.</p></li>
</ul>
<p>But there are some niggles which are no longer there due to the switch from
KDE. Overall, things are similar at this level.</p>
<p>To conclude, I think the KDE developers were far too ambitious with the KDE 4 series. The cost has been that the only supported versions of KDE are ones that you cannot recommend to anyone, and that is a critical mistake in a competitive environment. Meanwhile, GNOME has massively improved in speed and has incrementally added features that people actually need, instead of creating large frameworks that may or may not be robust and useful one day.</p>Linux and calendars - bad combination...https://lukeplant.me.uk/blog/posts/linux-and-calendars-bad-combination/2010-03-23T13:22:49Z2010-03-23T13:22:49ZLuke Plant<p>There doesn't appear to be any way for a Linux user to get a local calendar app to inter-operate with Google or other devices.</p><p>So, I'd like to be able to access my sync the calendar on my computer with other devices, like my BlackBerry Curve. This is 2010 right?</p>
<ul class="simple">
<li><p>I already blogged the <a class="reference external" href="https://lukeplant.me.uk/blog/posts/blackberry-curve-kde-pim-sync-on-kubuntu-karmic-fail/">failure to sync directly</a>. Let's not go there.</p></li>
<li><p>How about just syncing KOrganizer with Google, and syncing the BlackBerry with Google? I already have some calendars on Google, and that works fine. But now for my main calender:</p>
<ul>
<li><p>I tried GCalDaemon, but found that it <a class="reference external" href="https://sourceforge.net/tracker/?func=detail&aid=2844153&group_id=184382&atid=909032">ignores/deletes all recurring events on your calendar</a>. Which is pretty evil.</p></li>
<li><p>There is Akonadi... Given how hopelessly buggy Akonadi is for syncing contacts to Google (like, if Google has more than one e-mail for a contact, none of them are transferred, and worse), I'm not very hopeful about this (and I'm using most recent KDE 4.4.1). But I'll try anyway...</p>
<ul>
<li><p>The whole experience is fraught with bugs and confusion. You click 'Add' and things aren't added, you click 'Remove' and they don't disappear, or only after some indefinite period of time (I've waited 30 seconds, is it just broken or should I carry on waiting?). You close the Akonadi configuration and open it again, or restart the server, and items have appeared, and other things that you didn't ask for. A lot seems to go on asynchronously, which might be a good idea, but you get the impression you are attempting to communicate with a forgetful, deaf, sleepy, indecisive, incompetent idiot. I have eventually managed to add a Google calendar resource, but it says "Failed getting last updated event", and nothing appears on my calendar.</p></li>
</ul>
</li>
</ul>
</li>
<li><p>OK, let's try Evolution calendar. At first it didn't work, then it seemed to work a bit better, but trying to modify events returns "Unknown error", and now it refuses to show the calendar at all.</p></li>
<li><p>OK, let's just try using Google calendar, importing all my existing calendar data, ditching any hope of using a local calendar app. But Google doesn't like my calendar file - "Failed to import events: Processing error during upload."</p></li>
</ul>
<p>Epic fail. Bad day.</p>
<hr class="docutils">
<p>Update: in the last case, I discovered after some investigation that Google doesn't like the 'VTIMEZONE' sections in my calendar file. Removing them allows the import to succeed (although it still produces an error message, and I'm guessing it might have lost some time information on summer events though, not sure).</p>A plea to KDE developershttps://lukeplant.me.uk/blog/posts/a-plea-to-kde-developers/2009-09-23T13:15:33+01:002009-09-23T13:15:33+01:00Luke Plant<p>In short: don't touch my data with alpha-quality software like Akonadi, and start working on things people actually want instead of grandiose schemes that have failed.</p><p>I recently upgraded to KDE 4.3.1 (from KDE 4.2.something). As seems to be par
for the course for the KDE 4 series, I then waded through nearly a dozen
bugs/crashes/regressions for the next day, filing bugs where I had the
energy. This has got pretty old, and fills me with no confidence about the
future of KDE – the stable desktop I'm hoping for still hasn't materialised.</p>
<p>But there is one thing about KDE 4 that <strong>terrifies</strong> me, and this post is an
attempt to get the KDE devs to change their approach before it's too late.</p>
<p>KDE 4.2 attempted to migrate some of my data to Akonadi, the new framework
for storing PIM data. There were a bunch of ways in which Akonadi did not
provide the features that previously existed (can't have multiple writable
calendars in KOrganizer, Kopete address book link didn't work...), so I had
to ditch it. Thankfully this was not hard (though the whole experience would
have been extremely confusing to Joe User).</p>
<p>I was prepared to give KDE 4.3 another shot on this front (after carefully
backing up my data). I cleared out any remnants of previous Akonadi data, and
the settings which told it not to do the migration.</p>
<p>The results were pretty disappointing:</p>
<ul>
<li><p>First, there was an initial setup process. This failed.
Unfortunately, the popup simply disappeared before I could note down the
error message. It was something to do with creating an agent. Did the
process crash, or was it supposed to just disappear like that?</p></li>
<li><p>Then, for individual applications, the migrations all partly failed.
Again, the popups telling me what was happening, including the error,
just disappeared after a short delay. The error was something about a
timeout when creating an instance of an agent. Did the process crash? Did
the agent instance get created eventually, so the process could continue
successfully? I've no idea. I can't even file an bug without the error
message.</p>
<p>Even while the popup remained, there was no indication of what I
should do about the error, if anything.</p>
<p>So I'm guessing all the migrations failed – my applications don't
seem to be migrated to using Akonadi at all.</p>
</li>
</ul>
<p>Why does this worry me so much? Well, I can cope with an unstable desktop.
It's a pain, it means I can't recommend KDE to anyone I know in it's current
state, but usually I can work around the pain points. Plasma restarts itself,
so although it is still pretty crashy (far more than the Windows shell, for
instance, has ever been in my experience), I don't have to worry about it too
much.</p>
<p>But Akonadi is a different matter. It is the proposed framework for handling
all PIM data – all my e-mails, calendars and address book. This data is
<strong>extremely</strong> important to me. Akonadi is clearly not up to the job of
handling it – if their migration tool can fail like this, and fail with
worrying errors about timeouts (which actually suggests the migration process
is <em>non-deterministic</em> – it's going to depend on how fast/busy your computer
is), it's clearly far from ready. It's not getting better, it's getting worse
— this time the migration failed completely, and I'm not even able to check
whether it's up to feature parity with non-Akonadi methods.</p>
<p>Even worse than this, is that either the KDE developers:</p>
<ul class="simple">
<li><p>think it's OK to start migrating to an alpha-quality framework for
handling user's data. To me, this is appalling. Desktop eye-candy in
exchange for a bit of instability is one thing, but my data is entirely
different.</p></li>
<li><p>or, they are unaware that Akonadi is not there yet. This is just as
worrying.</p></li>
</ul>
<p>Akonadi seems like an overly ambitious project. If you look at its <a class="reference external" href="http://pim.kde.org/akonadi/">home page</a>, the diagram includes the idea that other
desktop apps, outside of KDE, will use Akonadi as a backend for all their
data. To me, this seems extremely unlikely and is a tell-tail sign of
developers getting ideas that are just too big.</p>
<p>So, what do I propose?</p>
<p>Simply this: ditch Akonadi. Yes, I mean that. KDE 4 seems to lack a BDFL who
is willing to say "this is not working, time to pull the plug". Mark
Shuttleworth did that with a pet project of his when the developers got
<a class="reference external" href="http://www.markshuttleworth.com/archives/4">distracted with shiny geek toys</a>. Windows Vista ditched the
killer feature of Vista, their WinFS filesystem, because it just wasn't
ready. But it seems there is no-one in KDE who can make these kind of
decisions. The major obstacle is egos and pride – after all that work has
gone in for years, can we ditch a big feature like that? Yes, you can, and
you should, for the sake of your users and the future of KDE. Of course, you
can just move it to an experimental branch and come back to it for KDE 5/6/7,
but <strong>please</strong> do not turn it on until it's ready.</p>
<p>Akonadi is one instance of a bigger problem in KDE – grandiose ‘we'll fix
everything but it will take us five years’ schemes that are prioritised over
things users actually want, and could be implemented soon.</p>
<p>For example, I want desktop search and fast e-mail search. After all, this is
2009, right? Is it so much to ask for a decent way of searching all the files
on my computer, and fast full text search for my e-mails? If I used Mac or
Vista or Google docs & Gmail, I would have had this years ago. Instead of
that, KDE gives us: Nepomuk. The usefulness of Nepomuk completely escapes me.
Even though it includes Strigi indexing (which indexes all your files, though
it can be a big pain to get working), there is no decent interface for
searching those files. (No KRunner is not a decent interface). Currently,
turning Nepomuk off has exactly one consequence – it makes my computer much
more responsive and saves me 3 Gb of disk space. AFAICS, there are no
applications which make good use of Nepomuk. I think there is tagging in
Dolphin, but:</p>
<ul class="simple">
<li><p>There is no interface for searching tags! What kind of idiots do you
take us for? Going round tagging files in the hope that one day we'll be
able to make use of all that effort because someone actually implemented
a UI?</p></li>
<li><p>I don't want to manually tag files anyway, I want a decent desktop
search tool!</p></li>
</ul>
<p>Other applications that need tagging are better off implementing their own
solution, and then extracting a simple KTagging library which can be shared.</p>
<p>Nepomuk isn't as bad as Akonadi at the moment – it's useless, but I can turn
it off, and it doesn't threaten my data. But even then, all the effort that
is going into Nepomuk could be directed into manageable, achievable goals of
providing features that users will be able to make use of.</p>
<p>Please, KDE devs, stop the big grandiose schemes. Stop doing anything that
would threaten my data. I've been a loyal fan – pushed to the limits by the
KDE 4 series, I'll admit – but if you foist Akonadi on me in anything like
it's current state, I'm taking all my data and going. I don't yet know where
I'll go. I might go back to GNOME after a <em>long</em> time. It still sucks IMO,
and I'm not sure how I'm going find replacements for KMail (very nice despite
no fast full-text search), KOrganizer, Amarok, k3b etc. KDE currently has the
lion's share of the best Linux apps. But it doesn't really deserve them at
the moment, and it's going to lose all but its most stubborn and loyal users
at the current rate.</p>
<p>If you got this far, thanks for bothering to read this. I know the KDE
developers have got a lot of flack for KDE 4, and I have held back for a long
time, but some of the criticisms are deserved, and you do need to listen
occasionally...</p>Amarok 2 can corrupt MP3 fileshttps://lukeplant.me.uk/blog/posts/amarok-2-can-corrupt-mp3-files/2009-04-23T01:18:10+01:002009-04-23T01:18:10+01:00Luke Plant<p>Amarok 2 is not my favourite application at the moment...</p><p>I've found that Amarok 2 is really not ready to be used...</p>
<p>In terms of interface, it's not that bad, and I'm much happier than most
people with the changes from Amarok 1.4, and I've been giving it a fair try.</p>
<p>I was annoyed that it provides a UI for putting albums into 'Various
Artists', or removing then, but then forgets everything you've done next time
you open the program when it rescans the collection. But I could live with
that for the time being.</p>
<p>The fact that it clips the beginning off some tracks for some unknown reason
is also really annoying (it clips 1.2 seconds off the beginning of one of my
favourite tracks; Dragon Player, another KDE4 apps, also does it, but no
other media players do so).</p>
<p>But it has started doing things that mean I just don't trust it with my MP3s
any more:</p>
<p>Certain tracks start appearing with seemingly random album and artist names
in the playlist (picked from other tracks in my collect), though they have
the correct song title and play the correct song. If I right-click and select
'Edit track details', the same wrong details appear (so if I were to press
save, the wrong details would be saved back to the file). If, in the
collection pane, I go to the album the track ought to be in, it is missing. I
don't know how to find it again, except in the file browser. However, if I
look at the same file in any other player or ID3 tag editor, the correct info
appears. Somehow Amarok is not reading the info from the file itself, but
from some other source which is corrupt.</p>
<p>This means that editing any track details in Amarok is now dodgy, since if I
go to edit one detail, I can't be sure that other details will be supplied
correctly, and when I save I could save Amarok's corrupt data to the file.</p>
<p>Perhaps purging the collection completely might help, but I'm not sure how to
do it, and I don't really want to lose all the album covers etc.</p>
<p>I guess I should file a bug, but I've filed so many recently, and this is one
I don't know how to reproduce, and it's fairly pointless filing it – as a
developer myself, I know that, with the best will in the world, this kind of
bug will eventually just get WORKSFORME.</p>
<p>Before, I couldn't trust Amarok to actually play tracks correctly, and now
can't trust Amarok to show my collection so that I can find songs and albums,
and I certainly can't trust it to manage the MP3 files.</p>
<p>Fairly damning I'm afraid. I'm posting this as a warning to others, Amarok
could be corrupting the metadata in your MP3s...</p>
<p>Should I try upgrading to Amarok 2.1? Or do I just give up now and go back to
mocp?</p>Gutsy woeshttps://lukeplant.me.uk/blog/posts/gutsy-woes/2007-10-15T13:59:32+01:002007-10-15T13:59:32+01:00Luke Plant<p>I upgraded to Gutsy RC last week, and I've really had nothing but trouble, and submitted lots of bugs...</p><p>I upgraded to Gutsy RC last week, and I've really had nothing but trouble,
and submitted lots of <a class="reference external" href="https://bugs.launchpad.net/~l-plant-98">bugs</a> (which
is what you are supposed to do with a release candidate, but with only a few
days left to go, I'm wondering how many of these are really gonna get fixed
in time). Some of these may be particularly related to Kubuntu/KDE, and some
might be due to not having a clean install, I don't know.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://bugs.launchpad.net/ubuntu/+bug/152133">The upgrade tool failed</a> —
in fact I've never <em>ever</em> had a 'dist-upgrade' go smoothly, despite the
advertising. In my case after the tool failed, I had to manually do 'aptitude
dist-upgrade' <strong>3 times</strong> before everything was finally sorted out.
Dist-upgrading is simply not for novices. I guess the problem is that people
do it so infrequently, and test cases are so massively time consuming to set
up, that it is never properly tested in the real world.</p></li>
<li><p>The <a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules-2.6.20/+bug/95956">Ubuntu-packaged nVidia drivers disappear every time I reboot</a>. It means I either have to use the open source
'nv' driver (and no accelerated graphics), or X fails to start and I have to
manually reinstall a package.</p></li>
<li><p>Even when I get the nVidia drivers it working, I still have <a class="reference external" href="https://bugs.launchpad.net/bugs/71913">X crashing on me
when using Compiz</a>. It only happens
when I'm doing lots of things at once – some changes in window activity at
the same time as doing something in the background that is disk and CPU
intensive (e.g. installing software). But this is still unacceptable for a
default option.</p></li>
<li><p>Compiz-fusion itself is quite nice (I've found a combination of plugins that
works very nicely, giving me a nicely animated 2x4 desktop, plus 'Expo' and
nice Alt-Tab mechanisms, with all my normal shortcuts for moving windows
around). However, KDE integration is pretty bad – whether I use the 'KDEWM'
environment setting to start Compiz, or put something in ~/.kde/Autostart, I
end up with lots of problems: <a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/145878">the KDE window decorator dies at startup</a>, and
<a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/129801">randomly dies at other times too</a>; some windows
that appear at startup, especially the prompt for the KDE Wallet, don't
actually ever appear; using KDEWM, the 'Alt-F1', 'Alt-F2' KDE shortcuts don't
work. The only safe method I've found is to do a manual 'compiz —replace'
after my session is completely restored.</p></li>
<li><p><a class="reference external" href="https://bugs.launchpad.net/ubuntu/+bug/152325">KControl and KInfoCenter were empty</a> – thankfully the fix
isn't too hard</p></li>
<li><p>My Input Actions (KHotkeys) were <a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/meta-kde/+bug/152190">wiped out</a>
(thankfully the relevant config file was not emptied, and eventually by
trial and error I found a workaround)</p></li>
<li><p><a class="reference external" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1778330&group_id=954&atid=100954">BibleTime crashes when you change an option for module display</a>, which is a real killer for me. It also <a class="reference external" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1778328&group_id=954&atid=100954">crashes/fails
when you try to add/change side-by-side Bible translations to a window</a>, which is equally painful.</p></li>
</ul>
<p>What's left of the advertised benefits of Kubuntu Gutsy? Well, there is
Dolphin – but I already had that before. There is 'Restricted Drivers
Manager' – great, except that it completely failed with the nVidia drivers
as described above. There is a newer version of strigi, but is no better than
it has been in the past – it is alpha quality software really (things like
the daemon refusing to stop etc, dying randomly, and the interface being
extremely basic compared to Beagle. Actually, it currently dies whenever I
tell it start indexing, so it is basically useless. And this problem reoccurs
after purging the indexes and starting again, after indexing about 300,000
documents).</p>
<p>Then there is GDebi, which is quite nice, but I'm not likely to use it often.
Amarok 1.4.7 is included in Gutsy but I was using that anyway from the
backports repository (using <a class="reference external" href="https://help.ubuntu.com/community/UbuntuBackports#head-0b2a1029f552e385c1af0dc485bf14bcc4ebd5bc">apt pinning to ensure I only got the packages I
deliberated upgraded</a>). There is also the enterprise
version of KDE PIM, which I imagine is quite good for some people, but the
only thing it brought me was a <a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/kdepim/+bug/152883">bug in which events are not updated in the
calendar</a>.
Finally, the OpenOffice suite has been updated to version 2.3, which may well
have some genuine improvements - I haven't used it enough to tell.</p>
<p>There was one really good thing – 'Suspend' actually works on this non-
laptop computer, for the first time. At least, it worked when using the
normal 'nv' video driver – it didn't with the nVidia driver. I'm not hopeful
that it will even if I get nVidia drivers properly sorted out. Which means
that I'll either be choosing between the ability to have 3D accelerated
graphics, and being able to suspend.</p>
<p>In conclusion – there is nothing so far in Kubuntu Gutsy that I would have
upgraded for. If the bugs above aren't fixed soon, then I would definitely be
far better off with Feisty, but I'm still hopeful that the guys at Ubuntu may
be able to get some of these sorted out.</p>
<p>UPDATE: Ubuntu 7.10 is upon us, and none of the above are addressed. I'm
wondering how difficult it is to downgrade...</p>
<p>UPDATE 2: Although nothing has really been addressed, I've discovered how to get
<a class="reference external" href="https://help.ubuntu.com/community/NvidiaLaptopBinaryDriverSuspend">'Hibernate' and 'Suspend' working with nVidia drivers</a>. Since I'm
no longer rebooting, aand not even having to log in again, this has alleviated
some of the problems.</p>
<p>UPDATE 3: Thanks to help on a bug report, I got my nVidia modules to stop
disappearing, result! Some genius also got BibleTime fixed up (had to compile
from source, but it was worth it). X crashing got worse – twice in 10 minutes
yesterday – so I've abandoned it again until the bug is fixed. But my system is
basically all working now, and both Hibernate and Suspend now work perfectly,
which is a real time/power saver, so I'm happy again :-)</p>Facebook broken in Konquerorhttps://lukeplant.me.uk/blog/posts/facebook-broken-in-konqueror/2007-08-23T14:56:25+01:002007-08-23T14:56:25+01:00Luke Plant<p>At the end of the day, contrary to what many web developers and browser writers would like you to believe, quality and standards compliance mean nothing. The only thing that matters is market share.</p><p>A recent update on <a class="reference external" href="http://www.facebook.com/">Facebook</a> has rendered
various bits of the site unusable in Konqueror, including the 'Add to
friends' link. Since this is a pretty crucial part of Facebook, I think I am
justified in the overblown title to this post.</p>
<p>(For the interested, Konqueror reports this error: <code class="docutils literal">Error:
<span class="pre">http://static.ak.facebook.com/js/base.js?12:56066:</span> ReferenceError: Can't find
variable: eval</code>)</p>
<p>Of course, I could file a bug report with them. I'm not going to bother,
because I already did so for one bug, and the response I got back included
this:</p>
<blockquote>
<p>Please note that we only support the browsers listed below and strongly
recommend that you update your browser to the newest version available.</p>
</blockquote>
<p>The browsers listed were:</p>
<blockquote>
<div class="line-block">
<div class="line">Internet Explorer 6.0</div>
<div class="line">Internet Explorer 7.0</div>
<div class="line">Safari</div>
<div class="line">Firefox 1.5 for PCs</div>
<div class="line">Firefox 1.5 for Macs</div>
<div class="line">Firefox 2.0 for PCs</div>
<div class="line">Firefox 2.0 for Macs</div>
</div>
</blockquote>
<p>This kind of thing gets old pretty fast (I had a similar problem with my online
bank just the other day). Konqueror is an absolutely great browser, and being
told to get a newer browser is the last thing I want to hear. Konqueror
integrates brilliantly into the rest of my KDE system (think KWallet for all my
passwords, kioslaves for just about everything,...) and I'm not going to change
for Facebook. It is just such a pain in the neck that Konqueror has such a low
market share (I can't wait for Konqueror to use WebKit).</p>
<p>At the end of the day, contrary to what many web developers and browser writers
would like you to believe, quality and standards compliance mean <strong>nothing</strong> —
Konqueror is easily as good as Firefox, but people don't design to standards,
they design to what the major browsers can do. <em>De facto</em> standards rule the
roost, and the only thing that matters is <strong>market share</strong>.</p>
<p>The only reason I'm bothering to post this is I figure I might actually generate
more attention this way than filing a bug report.</p>HSQL and HaskellDB anguishhttps://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/2007-07-13T20:29:52+01:002007-07-13T20:29:52+01:00Luke Plant<p>I'm trying to use Haskell for a database app, and, as usual for Haskell, I'm finding the lack of decent documentation a real pain...</p><p>I'm trying to use Haskell for a database app, and, as usual for Haskell, I'm
finding the lack of decent documentation a real pain.</p>
<p><a class="reference external" href="http://haskelldb.sourceforge.net/">HaskellDB</a> looks like a nice, high
level approach to using databases, and, despite the look of its main page,
the project isn't dead. However, when running the tests, I get this:</p>
<pre class="literal-block">Problem with FlatDB:
user error (Couldn't load Database.HaskellDB.FlatDB.driver from package askelldb-flat-0.10)
Skipping FlatDB
Problem with HSQL MySQL:
user error (Couldn't load Database.HaskellDB.HSQL.MySQL.driver from package haskelldb-hsql-mysql-0.10)
Skipping HSQL MySQL
Problem with HSQL SQLite:
user error (Couldn't load Database.HaskellDB.HSQL.SQLite.driver from package haskelldb-hsql-sqlite-0.10)
Skipping HSQL SQLite
Cases: 0 Tried: 0 Errors: 0 Failures: 0
Skipped databases: ["FlatDB","HSQL MySQL","HSQL SQLite"]</pre>
<p>This is despite having followed the build instructions carefully. I don't even
know if I'm doing the right thing with these tests – they obviously require some
configuration, which I think I've done right, but there is no README for running
the tests. I've googled for the error, with no results (next step the mailing
list, but it seems crazy that I can't even get this far without subscribing to a
mailing list and bothering someone). Also, the test suite doesn't actually
compile without a minor fix, which indicates that not many people are actively
running these tests, so maybe this entire test suite is non-functional. Who
knows?</p>
<p>So, I'll see if I can just use HSQL straight. Unfortunately, there is no real
documentation or tutorial for HSQL, nothing in the sources that tells you how
to do even a basic test – the online tutorials are very old and don't seem
to actually cover making a connection. I tried this as a test app:</p>
<div class="code"><pre class="code haskell"><a id="rest_code_6f7692f4bb71421c897d2e27aee76313-1" name="rest_code_6f7692f4bb71421c897d2e27aee76313-1" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-1"></a><span class="kr">import</span><span class="w"> </span><span class="nn">Database.HSQL.MySQL</span><span class="w"> </span><span class="p">(</span><span class="nf">connect</span><span class="p">)</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-2" name="rest_code_6f7692f4bb71421c897d2e27aee76313-2" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-2"></a><span class="kr">import</span><span class="w"> </span><span class="nn">Database.HSQL</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-3" name="rest_code_6f7692f4bb71421c897d2e27aee76313-3" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-3"></a>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-4" name="rest_code_6f7692f4bb71421c897d2e27aee76313-4" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-4"></a><span class="nf">main</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="kr">do</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-5" name="rest_code_6f7692f4bb71421c897d2e27aee76313-5" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-5"></a><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="ow"><-</span><span class="w"> </span><span class="n">connect</span><span class="w"> </span><span class="s">"localhost"</span><span class="w"> </span><span class="s">"my_db"</span><span class="w"> </span><span class="s">"my_username"</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-6" name="rest_code_6f7692f4bb71421c897d2e27aee76313-6" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-6"></a><span class="w"> </span><span class="s">"my_password"</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-7" name="rest_code_6f7692f4bb71421c897d2e27aee76313-7" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-7"></a><span class="w"> </span><span class="n">disconnect</span><span class="w"> </span><span class="n">c</span><span class="w"></span>
<a id="rest_code_6f7692f4bb71421c897d2e27aee76313-8" name="rest_code_6f7692f4bb71421c897d2e27aee76313-8" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_6f7692f4bb71421c897d2e27aee76313-8"></a><span class="w"> </span><span class="n">return</span><span class="w"> </span><span class="nb">()</span><span class="w"></span>
</pre></div>
<p>It compiles, but throws this extremely helpful exception:</p>
<div class="code"><pre class="code haskell"><a id="rest_code_78e9a99c49284ee28c01d4ff036ffa9d-1" name="rest_code_78e9a99c49284ee28c01d4ff036ffa9d-1" href="https://lukeplant.me.uk/blog/posts/hsql-and-haskelldb-anguish/#rest_code_78e9a99c49284ee28c01d4ff036ffa9d-1"></a><span class="o">***</span><span class="w"> </span><span class="kt">Exception:</span><span class="w"> </span><span class="p">(</span><span class="n">unknown</span><span class="p">)</span><span class="w"></span>
</pre></div>
<p>So, I'm giving up for now. HaskellDB also appears to have an HDBC backend (HDBC
being another lower level SQL library, like HSQL), so I'll try HDBC when I get
the motivation. I want to know that I have libraries that basically work before
I invest any time on this, and tests or basic examples are essential to finding
this out. Unfortunately these things seem to be somewhat lacking.</p>
<p>OK, </rant></p>Edgy, Feisty, and Pheenet WLU-703Zhttps://lukeplant.me.uk/blog/posts/edgy-feisty-and-pheenet-wlu-703z/2007-04-27T21:17:40+01:002007-04-27T21:17:40+01:00Luke Plant<p>I spent an unprofitable afternoon trying to get a new wireless USB adapter to work under Ubuntu Edgy, but Feisty did the trick beautifully.</p><p>Until about 10 minutes ago, this was going to be a rant that basically said
about Linux and hardware:</p>
<blockquote>
<div class="line-block">
<div class="line">When it's good it's very, very good,</div>
<div class="line">But when it's bad, it's awful.</div>
</div>
</blockquote>
<p>I guess I want to say the same thing now, except that I'm not ranting anymore,
since I'm experiencing the first half.</p>
<p>Basically, I bought a Pheenet WLU-703Z USB wireless adapter this week,
precisely because it was supposed to work well under Linux. In fact, it did
work well even with Ubuntu Edgy in terms of basic driver support, but the
network I want to attach to turns out to be encrypted using WPA, and nowhere
did I find a note that says "remember, WEP is rubbish [which I found out
later], so you need to check whether your device supports WPA, either via a
wpa_supplicant driver, or generic Linux Wireless Extensions with WPA-PSK
extensions [which I found out later]". Getting this second bit to work under
Edgy turned out impossible – the drivers that came on the CD for my USB
device wouldn't even compile, and I never managed to get any other ones to
actually work.</p>
<p>Since I didn't know that much about wireless networks, I didn't even find out
for ages that it was a problem with encryption type, though I suspected as much,
because the interface for configuring wireless networks in Kubuntu Edgy
(wlassisstant) doesn't have anything indicating encryption types other than WEP.
You have to drop down to wpa_supplicant to configure this stuff, and I'm still
not sure I was doing it correctly.</p>
<p>Anyway, I saw a post that suggested this chipset (zd1211) works much better
in Feisty, so I downloaded Kubuntu Feisty and had a go. With KNetworkManager
(plus an updated kernel), it all worked first time, no manual installation of
drivers or anything. I haven't yet installed Kubuntu (I'm running from the
LiveCD), but that's a job for tomorrow. The nice thing about LiveCDs is that
I can confirm that the system upgrade will be worth it (and getting this
wireless internet connection working <strong>is</strong> worth it, since wired is not an
option for me) before actually having to do it.</p>