<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">All Unkept</title>
  <subtitle type="text"></subtitle>

  <updated>2013-05-24T11:16:23Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog" />
  <id>http://lukeplant.me.uk/blog/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://lukeplant.me.uk/blog/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Adventures in Haskell - ODBC under Windows]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/adventures-in-haskell-odbc-under-windows/" />
    <id>http://lukeplant.me.uk/blog/posts/adventures-in-haskell-odbc-under-windows/</id>
    <updated>2006-09-01T18:12:09Z</updated>
    <published>2006-09-01T18:12:09Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Haskell" />
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <summary type="html"><![CDATA[Adventures in Haskell - ODBC under Windows]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/adventures-in-haskell-odbc-under-windows/"><![CDATA[
<div class="document">
<p>OK, so I took the advice of some of the commenters on my last post and
tried using Haskell for creating developer tools at work.  I needed a simple
tool to extract certain info out of a database and store in some
files.  So, I first had to get a database library installed and
working, to connect to the MS SQL Server database.  Here is how I got on:</p>
<div class="section">
<h1><a id="steps" name="steps">Steps</a></h1>
<p>First, I had to choose one from the <a class="reference" href="http://haskell.org/haskellwiki/Libraries_and_tools/Database_interfaces">Haskell Database Interface</a>.
The HSQL links gave me 404s, so I went with HDBC.  I've added a wiki
page on <a class="reference" href="http://haskell.org/haskellwiki/HDBC-ODBC_under_Windows">HDBC-ODBC under Windows</a>, but I'll summarise here:</p>
<p>I found I then had to:</p>
<ol class="arabic simple">
<li>Get hdbc</li>
<li>Get hdbc-odbc</li>
<li>Install the Microsoft MDAC SDK</li>
<li>Compile the hdbc and hdbc-odbc packages</li>
</ol>
<p>The READMEs in the former were quite helpful, but didn't really go all
the way, and it took me a while to do everything.  Here are my
reflections on the whole process:</p>
</div>
<div class="section">
<h1><a id="gripes" name="gripes">Gripes</a></h1>
<ul>
<li><p class="first">No tutorial style help for either doing this installation, or how to
use the library.  The docs that do exist for HDBC are fairly
straightforward though.</p>
</li>
<li><p class="first">So I want to create a connection.  HDBC docs say:</p>
<blockquote>
<p>A Connection object is created by specific functions in the module
for an individual database. That is, the connect function -- which
creates this object -- is not standardized through the HDBC
interface.</p>
</blockquote>
<p>So you would expect some ODBC specific docs.  The readme for hdbc-odbc
just says look at the hdbc docs, which don't have the information. I
had to browse the ODBC source to find the the connectODBC function.
Thankfully it wasn't too hard to work out.</p>
</li>
<li><p class="first">I feel like I'm the first person to do this.  I know I'm not from
mailing list messages I've read, but it's scary, and it feels like
no-one else cares enough to write a tutorial for this kind of thing.</p>
</li>
<li><p class="first">I get crashes (well, out of memory really, but it amounts to the
same thing) whenever I try to do anything with query results that
involve an MSSQL 'ntext' field.</p>
<blockquote>
<p>GHC's heap exhausted: current limit is 268435456 bytes;
Use the '-M&lt;size&gt;' option to increase the total heap size.</p>
</blockquote>
<p>This is a blocker for me.  Bummer.  I wasted about 4 hours on this dead end.</p>
</li>
<li><p class="first">Where do I report bugs?  Where are the mailing lists? Where is the
'KNOWN BUGS' list - or have I discovered the only known bug?  I'll
e-mail the author listed in the copyright, but it would be more
reassuring if there was some website I could browse.</p>
</li>
<li><p class="first">The documentation problem reflects the documentation for Haskell
itself -- very variable.  There are big gaps in Haskell
documentation.  For example, record syntax - the <a class="reference" href="http://cs.anu.edu.au/Student/comp1100/haskell/tourofsyntax.html">Tour of Haskell
syntax</a>
doesn't even mention records.  The <a class="reference" href="http://en.wikibooks.org/wiki/Programming:Haskell">Haskell wikibook</a> is much better
on this, but it's hard to find. The Haskell wiki page for <a class="reference" href="http://haskell.org/haskellwiki/Keywords">Haskell
keywords</a> has lots of
entries which are still just 'TODO'.  There are several attempts to
create comprehensive references, but none are complete, so you have
to look through them all, and they are not always easy to find.</p>
</li>
</ul>
</div>
<div class="section">
<h1><a id="praise" name="praise">Praise</a></h1>
<ul class="simple">
<li>Compilation just worked, once I'd got it set up, and using in ghci
worked perfect, no further messing around with paths or anything was
required.</li>
<li>Haskell people know how to write APIs.  The only ones I had to learn
to get some values from my DB were 'connectODBC' and 'quickQuery'.
That is just great, and compares favourably to every other DB API
I've had to learn.  The OO C# version I ended up having to write was
much more verbose and clunky (though much quicker to write, as I
knew what I was doing, and everything was already installed etc.)</li>
<li>I managed to get some actual SQL queries working from the ghci
interactice prompt within a pretty short period of time, which was
very nice.</li>
</ul>
<p>So it didn't work out, but I don't think it was a complete waste - I
made some progress, and was impressed at how easy it was to get data
out of a database, especially for a language where I/O was seen as an
embarassing problem for so long (on the wiki page I wrote you can see
how little code is actually required).  Also, knowing open source
developers like this, I imagine I might get my bug fixed very quickly.</p>

<p>However, there are serious issues if I really wanted to use Haskell
for development tools on Windows.  The problem is that all the other
developers already have compilers, libraries etc for .NET and C#, and
not much else.  Installation would need to be tons easier before I
could get away with writing tools in Haskell. Under Linux these things
would have been <em>much</em> easier, as I could have just put together a few
debs and been done, but installation of software is such a hassle in
Windows.</p>
</div>
</div>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Replacement dos box for Windows - emacs shell mode]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/replacement-dos-box-for-windows-emacs-shell-mode/" />
    <id>http://lukeplant.me.uk/blog/posts/replacement-dos-box-for-windows-emacs-shell-mode/</id>
    <updated>2006-09-01T09:18:06Z</updated>
    <published>2006-09-01T09:18:06Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Personal and misc" />
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <category scheme="http://lukeplant.me.uk/blog" term="Linux" />
    <summary type="html"><![CDATA[Replacement dos box for Windows - emacs shell mode]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/replacement-dos-box-for-windows-emacs-shell-mode/"><![CDATA[
<p>The Windows dos box (command prompt) sucks in many ways in comparison to an xterm (and I'm not even including 'command' vs 'bash' here).  But if you have emacs you can make it suck a little bit less.  "M-x shell" gets you shell mode, and you can select text etc, and use emacs keybindings for editing your commands etc.</p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[IE7]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/ie7/" />
    <id>http://lukeplant.me.uk/blog/posts/ie7/</id>
    <updated>2006-07-26T23:15:44Z</updated>
    <published>2006-07-26T23:15:44Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <category scheme="http://lukeplant.me.uk/blog" term="Web development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Internet" />
    <summary type="html"><![CDATA[IE7]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/ie7/"><![CDATA[
<p>Interested in <a href="http://www.ie7.com/">IE7</a>?  You should look there if you want to <a href="http://www.ie7.com/">download IE7</a>.</p>

<p><small>(just a little of help in helping google decide correctly...)</small></p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Web development on Linux]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/web-development-on-linux/" />
    <id>http://lukeplant.me.uk/blog/posts/web-development-on-linux/</id>
    <updated>2005-04-23T14:20:41Z</updated>
    <published>2005-04-23T14:20:41Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <category scheme="http://lukeplant.me.uk/blog" term="Web development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Linux" />
    <summary type="html"><![CDATA[Web development on Linux]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/web-development-on-linux/"><![CDATA[
<p>Having lacked IE on my home PC for a few weeks, and now got it back again, I came to ask myself -- can you do any serious web development on a Linux platform?</p>

<p>For general web usage, I never need Internet Explorer, nor would I want to use it.  I use <a href='http://konqueror.kde.org/'>Konqueror</a> almost always, which is a truly excellent browser, and for web design stuff I sometimes use <a href='http://getfirefox.com'>Firefox</a> (it has some nice developer extensions, like realtime CSS editing).  However, Internet Explorer is the dominant browser by miles, so whether you like it or not, any moderately advanced web design has to take it into account.  The hoards of serious and bizarre bugs in Internet Explorer, especially its awful CSS support, mean that you cannot rely on any slightly complex design just working on IE.</p>

<p>But how do you test it without a copy of Windows?  I have tried using <a href='Having lacked IE on my home PC for a while, I came to ask myself -- can you do any serious web development on a Linux platform?'>Wine</a>, but didn't get very far with running IE6, despite using a genuine Windows installation as the basis.  Those who have reported success seem to also report buginess that isn't in the original, such as javascript not working etc, which would make that option useless for real testing of websites.</p>

<p>Since I've needed Windows 98 for a while for work, and I bought a copy of Win4Lin, I've not had to think about this much, because I've always had a copy of IE available while running Linux.  The other option is <a href='http://www.codeweavers.com/'>CodeWeavers</a>' Crossover Office, which apparently runs IE with <a href='http://www.codeweavers.com/site/compatibility/browse/name?app_id=15;issues=1'>only minor problems</a>.  Is there any free alternative that really works?  I guess that CrossOver Office is probably the best option -- it means at least that you are not paying the Microsoft tax just to be able to do web development.</p>

<p>Such is the sad state of affairs when we allow one company to have such a monopoly.</p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Irregular Expressions]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/irregular-expressions/" />
    <id>http://lukeplant.me.uk/blog/posts/irregular-expressions/</id>
    <updated>2004-11-11T23:47:35Z</updated>
    <published>2004-11-11T23:47:35Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Rants" />
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <summary type="html"><![CDATA[Irregular Expressions]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/irregular-expressions/"><![CDATA[
<p>I've been using Microsoft Visual Studio 2003 at work for development work, and it has mainly been very good.  I discovered today that it's find and replace function includes support for Regular Expressions.  "Awesome", I thought -- and anyone who knows about Regular Expression (reg exps for short) will know why.  Regular expressions are essentially a very powerful syntax--almost a language really--for doing pattern matching and replacing.  The task I needed to do today was remove all whitespace (spaces and tabs) from the beginning of every line in a text file, but nowhere else.  A regular expression search and replace makes this trivially easy -- just <b>s/^\s*//g</b> as a Perl command, for instance.</p>

<p>The \s bit wasn't working so I looked at the help and then came the shock: Microsoft's idea of regular expressions are initially very similar to real reg exps, but very different.  There was agreement on the meaning of <b>. * ? ^ $ [ ]</b> and a few of the escape sequences (<b>\n</b> and a few others) but after that things went quickly astray.  While Perl, sed, Javascript, PHP and probably every other language  have one syntax for regexps, with agreement on all the essentials, and backwards compatibility in general for the rest, Microsoft have decided to introduce a different syntax and call <i>that</i> Regular Expressions.  </p>

<p>My question is this: why?  <b>why?  WHY?</b>  As if the computing world has not been scarred enough already by Microsoft design decisions!  Perhaps Microsoft's dislike for standards is now so ingrained that they just can't help it -- they simply have to create things that go part way with a standard, and then deviate, even when it makes no sense at all.  It's not like they can't follow it - they've written correct regular expression libraries for javascript and vbscript and probably lots of others.  But the IDE makes you learn a different syntax just to confuse you.</p>

<p>OK, rant over.</p>
]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[First day]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/first-day/" />
    <id>http://lukeplant.me.uk/blog/posts/first-day/</id>
    <updated>2004-11-01T21:07:32Z</updated>
    <published>2004-11-01T21:07:32Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Personal and misc" />
    <category scheme="http://lukeplant.me.uk/blog" term="Microsoft" />
    <category scheme="http://lukeplant.me.uk/blog" term="Linux" />
    <summary type="html"><![CDATA[First day]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/first-day/"><![CDATA[
<p>First day at my new job today, it was a fairly undemanding day, and I think the rest of the week will be too, as development on the contracts I'll be first involved with hasn't really started yet.  So I can't say that much about the work, or really about the people, as I've only met a few (and this blog is not nearly anonymous enough for that anyway!)</p>

<p>The biggest change that I'm going to have to get used to (from being self-employed) is using Windows again.  The work I did with my self-employment was all Windows based, but I used <a href='http://www.netraverse.com/products/win4lin50/'>Win4Lin</a> so that I could run it all under Linux.  This meant I could use the absolute minimum of actual Windows applications - I would normally only ever be using two apps at once - a file manager and either Excel, Inno Setup (for creating installers) or Microsoft HTML Help workshop (for creating help files).  Using Win4Lin, all the Windows files are just normal files in your Linux home directory, so everything else could be done using Linux tools - I used <a href='http://subversion.tigris.org'>Subversion</a> for revision control for example.  </p>

<p>So I'm really a stranger to using Windows, especially Windows XP.  Here are a few usability comments on Windows from the perspective of a Linux/KDE user (makes a refreshing change!):</p>

<p>Some annoyances:</p>
<ul>
 <li><b>Internet Explorer</b>:
 <p>IE kept on plaguing me to install Flash.  It doesn't remember the fact you've said no, so on a site that uses Flash for ads, you get prompted just about on every page.  I kept saying 'no' mainly to see what it would do and also because the company policy is to get permission before installing things (though I don't know if it really extends to browser plugins).   But IE made this policy very difficult to enforce.  The approach IE takes to this is totally, totally wrong: <b>&lt;rant&gt;software should not be easy to install!&lt;/rant&gt;</b>.  The easier software is to install, the easier viruses are to install.  At least these two things should be required:</p>
 <ul>
  <li>All system installations of software (i.e. installs that affect more than just a user area) should require the root password</li>
  <li>You should never be prompted while in the middle of trying to do something.  Especially bad are prompts that effectively say "you need to install x to do what you want to do.  Do you want to install x?".  That is the worst possible time to make a decision that affects system security.  If you want a system that is stable, then making changes to the system should be seen as a big deal.</li>
 </ul>
 <br/>
 <p>Preferably, you should also have this:</p>
 <ul>
  <li>All installation of software goes through a single, central tool for installing.  This way, the user learns how to add and remove software in a single manner, all software comes through trusted channels, and everything else is suspect.</li>
  
 </ul>
 <br/>
 <p>I don't actually know of any system that achieves this last one, as it's quite difficult to do in practice.  Debian gets close -- I very rarely have to get software from outside Debian's repositories, and usually it's because I'm doing advanced things anyway (e.g. running and developing the CVS version of an app).  Windows is pretty awful on all these.  In today's experience, <b>not</b> installing software was quite difficult, as my patience was worn out pretty quickly saying 'No' to all those pop-ups.</p></li>

 <li><b>Scrollbars and scroll-wheels</b>
 <p>Qt (the toolkit that KDE uses), and GTK2 and even GTK1 (I think) have got this all sorted, but Windows hasn't yet.  I've had the following problems, which are just nits but after a long time with KDE/Linux they get to you:</p>
 <ul>
  <li>You have to click inside the relevant frame for the scroll wheel to affect the right scrollbar -- in Qt, you just hover your mouse inside the relevant area, and that area is scrolled.  This is annoying whenever there is more than one region on an app with a scrollbar, which happens very often.</li>
  <li>Horizontal scrollbars are never scrolled -- in Qt, usually the vertical scrollbar is default, but you can scroll the horizontal one by hovering the mouse of the scrollbar itself, or by pressing the 'Alt' key -- you can't do anything similar in Windows as far as I've discovered.
 </ul>
 <br/>
 <p>Linux apps also tend to make other nice usages of the scroll wheel, like Ctrl+scrolling for zooming, also missed in Windows.</p>
 </li>
</ul>

<p>Thing's I'm missing:</p>

<ul> 
 <li><b>Tabbed browsing:</b>
 <p>This has been part of my computer experience for so long I find it very difficult to live without.  Most GNU/Linux browsers have had this for quite a number of years, I think Konqueror (which I now use) was one of the last.</p>
 
 <p>I'm hoping I'll be able to install Firefox, and can almost certainly do so on the grounds of needing it for testing my work (which will be web development at least initially).  I may have to wait for the final release, but that's only next Monday.
 </li>
 
 <li><b>Virtual Desktops:</b>
 <p>Almost all Linux window managers, and all popular ones, allow you to arrange windows on virtual desktops, and this has been a feature for at least as long as I've used Linux, about 6 years now  In a corner of the screen, you have a pager showing all the desktops you have (usually arranged in a grid), and you can easily define shortcuts to move between them, either by number, or by position e.g. "move to the desktop to the right".  Why is this a great idea? Well, screens are 2D devices, but the metaphor of windows is semi-3D - you can have layers, and windows overlapping each other.  Imagine now if your real physical desk was like this - say it was the size of an A4 sheet of paper (letter sized, for Americans).  You could in theory do all your work, by shuffling pages, but it would be a pain, and this is what it's like if you're organising windows on a single desktop area. With virtual desktops, it's like you have a <b>huge</b> desk.  As with a normal desk, you can only work at one bit at once, but you can move to any area of your huge desk instantly, and certain types of document always appear in the same corner of your desk, so you can <b>feel</b> where there are, and find them very quickly. Virtual desktops give you a huge feeling of liberation and space that I am sorely missing, especially when the task-bar is full of loads of apps (the current lack of tabbed browsing makes this even worse).
 </p>
 </li>
 
 <li><b>Mouse gestures</b>
 <p>KDE has a background process called KHotKeys which can be used for global and context specific keyboard shortcuts and mouse gestures (Firefox and other browsers have mouse gestures too, but with KDE it can be used for any application).  Mouse gestures are particularly good for tasks where you don't need the keyboard much e.g. web browsing.  They mean you don't have to move your mouse to find a button -- you just hold down a mouse button (in my case the right mouse button)  and do a movement  wherever the mouse happens to be, and the program responds appropriately according to what you've programmed it to do.  As well as browsing, I also find them great for controlling my music player -- it means the music app takes up absolutely minimal screen space, as you never need to click on its buttons.</p>
 </li>

 <li><p>The main thing I lament though, is just the fact that windows is GUI only.  The shell and shell scripting are incredibly useful and powerful tools, and even integrates brilliantly into a number of GUI tools and methodologies.  Some examples:</p>
 <ul>
  <li><p>The text editor I am writing this is has a great feature to integrate shell commands:  A very simple perl script I wrote can be fed a bible reference and will return an HTML link to a gospel-com page for that verse.  I can use this from my editor, so a single keyboard shortcut will now turn John 3:16 into <a href='http://bible.gospelcom.net/cgi-bin/bible?version=NKJV&passage=John%203%3A16'>John 3:16</a></p></li>
  <li><p>File management from the shell is so fast in lots of situations, and what's more it's very repeatable -- just put it in a script and run it again whenever you need to.  While I do use graphical file managers in Linux (actually, I love Konqueror, but hate all the rest), I keep coming back to the shell 'cause it's so fast.</p></li>
  <li><p>Retrieving the contents of text files from shells - for example, finding the link for Win4Lin above took about 4 seconds from start to finish -- with GUI methods it probably would have taken a minute at best, as I would have had to browse to a folder, open a file, then look through the file and finally copy and paste.  The link to Subversion took me about 10 seconds, but that was without knowing what file it was in! </p></li>
  <li><p>KDE's <b>dcop</b> -- I've got a number of examples of cool (and useful!) things you can do  with dcop and scripting in my <a href='/blog/categories/kde/'>KDE articles</a>.</p></li>
 </ul>
 </li>
</ul>

<p>On the other hand, I have some nice things to say about Windows and Microsoft apps:</p>
<ul>
 <li><p>The Microsoft development tools are great.  Things like auto-completion that just works, even in mixed language environments (like ASP which contains VB script and HTML), and instant context-sensitive help are just great, and the lack of these features in many Linux IDE's is a great shame.  On the other hand, I think some proprietary Linux IDE's like KDE Studio have these things, and are probably a <b>lot</b> cheaper than the Microsoft tools I was using today without any thought to the huge license fees behind them.  Also, I think some of the free Linux IDE's have some of these features too, but can take a bit of setting up.</p></li>
 <li><p>With some registry hacks, IE can be made a bit more friendly.  You can change the default search engine (used when typing in the address bar) to Google, which was the first thing I did.  You can even do some registry editing to reproduce behaviour like Konqueror's 'Web Shortcuts', allowing searches on different search engines by typing some keyword before the search string.</p></li>
 <li><p>No crashes yet! :-)</p></li>
</ul>
]]></content>
  </entry>
</feed>
