Monday, July 13, 2009

Things that kate needs before I can really use it

I currently use jedit for my PHP development, but I'm always looking at other options. Jedit doesn't look great, and suffers from java oddities, as well as having an uncertain future.

I've tried eclipse, but it's even more of a hog than jedit is, and with the laptop I currently use for work it's simply not feasible.

Since I'm on something of a KDE thing at the moment I have of course looked at kate, and have done a number of times in the past. One I will say, is that kate has made great leaps since I first looked at it a number of years ago, and in a number of ways it is better than jedit. However, it is not quite yet at the point where I could really think about switching to it as it is missing a few things that I find crucial to my work.

I'm going to write about what those things are here, both as a baseline to compare against in the future to see how much further kate has come, and also to put my thoughts out there in the hope that these things get addressed (and I'm not opposed to looking into them myself if I get the time).

My first problem is the management of open files. In jedit I make use of the sessions plugin along with the "buffer list" plugin. This gives me a list of files arranged in their hierarchy on disk. Note that this is distinct from the filesystem browser that kate already has, because it only shows open files (and directories that contain those files). Also supported are options to show the list flat or in a hierarchy, crop the start or end off long paths and filenames, and intelligently use the home directory metacharacter ~ when possible. Of course the files in the list are all right-clickable though which they can be closed and reloaded etc, and directories can also be right-clicked which allows operations to be performed on all files beneath it.

Having said that, kate's sessions support appears to be more robust than jedit's, and also integrates very nicely into krunner (try bringing up krunner and type in a kate session name).

Another thing (and this is missing from Eclipse too) is vertical block selection support. kate is ahead of Eclipse in this regard in that it does have this feature, though it is incomplete when compared to jedit's support. Missing from kate is support for a modifier key for temporarily enabling vertical selection mode, and more importantly being able to edit within a vertical selection. jedit allows you to select a zero-width column of text and then start typing, and what you type is reflected in all rows you have selected. This is a big time saver when reformatting code, and is something that I use a lot.

Another detail is more configurable visible whitespace. kate already shows tabs, which is great, but I would also like to be able to see spaces too, and configure when they are visible. The jedit whitespace plugin allows you to independently configure the visibility of tabs and spaces at the start, end and middle of the line.

jedit has a very useful PHP parser plugin which is extremely useful for spotting errors in the current file. Though it does have a few problems with false positives, it is very good at spotting things that even PHP itself will not. Something similar for kate would be excellent.

Something that may really help to entice new users is some sort of plugin/extension manager. Again, jedit has a very good extension manager which allows me to browse, install and update extensions from within jedit itself. kate has a few plugins bundled, but I've not been able to find many more than that. Other parts of kde seem to have very good integration with online repositories for things like themes and plasma widgets, so it would be nice to see similar integration here too.

Something that drives me nuts is not being able to switch documents quickly. kate gets off to a good start with the Quick Document Switcher plugin, which mirrors a similar jedit plugin. However, it does not appear to be able to work in a case insensitive fashion, which slows you down since you need to worry about getting the case exactly right when trying to switch to a file. My biggest problem is that there seems to be no way to cycle the documents in most recently viewed order (usually via the CTRL+TAB and SHIFT+CTRL+TAB shortcuts), which is something I use very often.

When saving a new file, I will often copy and paste an existing file both as a template, and also so that the Save dialog box will open up in the same directory as the last file I edited. However, in kate it seems to open up in the directory of the last file that I opened, which results in more directory navigation.

Opening files also seems to be more of a pain than it should be, mainly because the open dialog box shows the backup files (*~) as well, which makes selecting a range of files harder than it should be.

The search and replace dialog box could, in my opinion, do with a little adjustment from the point of view of tab ordering. I want to be able to enter the search term, enter the replacement term, and hit ALT+A to replace all. However, currently I have to tab through a number of other controls between the search and replace boxes.

I would also like to have the search and replace history easily accessible. In jedit, the search and replace text boxes have a drop-down feature that allows you to access the most recently used strings.

Another search oddity (to me at least) is that the search term appears to be local to the file. So I can't search for something in file A, switch to file B and hit F3 to continue searching. I have to bring up the find tool and enter the search text again. I'm sure that some people like it that way, so I think an option to choose between the two methods would be nice.

kate is also missing the configurable column line feature that many editors have, which allows a vertical line to be drawn at a set number of columns. This allows easier conformance to a coding standard. Bonus points if it allows for multiple lines to be defined and drawn too.

Well, I think that will do for now. I plan to see if any of these issues have bugs/wishes raised for them already in bugs.kde.org: if not I'll create them myself so at least the requests are in.

Saturday, July 04, 2009

Help! I'm being sucked in!!!

So I have blogged previously about KDE 4.0 and 4.1, and how they weren't there yet (though 4.1 was a definite improvement), and how impressed I was with 4.2.

A week ago I tried to install a PPA so I could try Amarok 2.1, but the PPA also happened to contain the latest beta version of KDE 4.3 as a whole. Oops. So anyway, I went with it, and aside from the odd crash now and again it has actually been pretty stable.

With the first release candidate I got the new Air theme, and very nice it is too! A far fresher and brighter look.

Also included is the ability to connect to a hidden wireless network: a quite shocking deficiency in previous versions, but better late than never I suppose.

The fade desktop switcher is also quite nice, though I still can't decide whether I prefer that over the spinning cube or not. The thing I like about the spinning cube is that it enhances the impression of my desktops bring physically adjacent in the 3d world, while other switchers don't.

Desktop effects now automatically suspend if things become too much for the system, which makes sense and should help out if you have a runaway process that you need to kill, or if you are doing something like running a game.

Another new feature is a panel spacer, which is the solution to the problem I commented on earlier about widgets wanting to occupy lots of space. Unfortunately, I find it quite fiddly to use. I also still don't understand why the clock widget needs to try to occupy so much space either. Shouldn't it just use what it needs to show the longest time string possible with the current settings and leave it at that?

The system tray has also had some attention: there is now an expand/contract widget that I hadn't noticed before to allow you to see hidden icons, and icons can be manually configured to be hidden based on category.

There is a new launcher menu called Lancelot, which has an interesting "no-click" user interface feature. I'm trying it now, and it seems to be pretty useful.

There are quite a few other changes, but these are the ones that I've noticed the most. In general, there is just a sense of greater polish than 4.2, which suggests a very welcome trend in increasing quality.

The reason for my title post though, is that I've now found myself being drawn a little bit more into the KDE world. After the upgrade to RC1, my GTK apps lost their widget theme and reverted to the very ugly standard GTK look. I fiddled a little bit but could not fix it.

I hate ugly user interfaces, it makes me sad to use them. :) So I thought I'd try kmail again. I have tried kmail a number of times in the past (indeed my accounts were all set up already when I fired it up as a result), but it has never grabbed me and I have always ended up back with Thunderbird.

However, this time I have found myself sticking with it. It's hard to say why, but it's probably more to do with it doing what I would miss in Thunderbird if it didn't do it. Things like sorting threads by the most recent message in the thread: I couldn't cope without that.

But there is also a feature that it has that I don't think Thunderbird does have. You can exclude folders from being acted upon when new mail arrives in them. This means you don't get any notification, and the folder doesn't count towards the unread messages total that sits in the system tray.

I've never used an unread message icon with thunderbird before (if one is even possible) because the nubmer would be meaningless: it would include folders that I don't want to read often (such as mailing lists) and some that I keep unread as the number of unread is actually what I'm most interested in. I have a folder which contains exception emails from work which I have filtered to keep only the last 24 hours of emails unread. So if the number of unread goes up, it is an indication that something is going wrong.

So the total number of unread is basically meaningless. But with kmail I can exclude those folders from consideration, so I end up with a smaller count that represents email that I actually want to check.

Aside from that, kmail just seems a lot more snappy than Thunderbird (KDE 4 as a whole seems really snappy, so this just continues the impression). The memory usage also seems to be quite a bit lower too.

The downside is contact integration with gmail: I have seen example of people getting this (and Google calendar synchronisation) working, but so far have not figured out how to do it myself. Hopefully soon!

So another KDE app draws me in. What's next?

Saturday, June 27, 2009

Making Music: what software?

When I was in my second year of university I bought a Tascam 424 MkII portastudio. Mark and I had recorded our two albums using his Fostex 4-track and I had long wanted to have a 4-track recorder of my own.

This turned out to be a very expensive mistake, as just after that computer-based digital recording was just starting to take off, making my new purchase pretty much redundant. From that point it functioned simply as a mixing desk, and I used it to mix the output from my computer, keyboards and mic and route them to the appropriate places (i.e. the computer line in or monitoring amp input).

Back then I was using software that I, erm, shouldn't have been using (a well-known commercial DAW package). However, this time I don't want to go that route and would rather stick with the open source world, where I can hopefully be sure of having access to everything I need without either paying out Big Cash on commercial software and/or obtaining it illegally.

So in looking around this subject, it seems to be considered wise to use a Linux distribution that is dedicated to media production. This is for a number of reasons, but from what I can tell the key ones are:

  1. Real-time kernel
  2. Low-latency sound pathways
  3. No bloat from unrelated software
I haven't really looked into why normal distributions can't use a real-time kernel, but I suppose there must be good reasons. It would be good if they could be worked out though at some point in the future.

The second reason appears to be related to the fact that most professional-grade software for Linux is written for the Jack sound server, rather than using ALSA or PulseAudio. Jack is a very clever system which acts like a patch bay for both audio and MIDI streams of data between software and hardware sources and destination. This sets up a very UNIX-like system of small components doing one job well rather than the windows-style approach of one monolothic application that does everything itself.

The obvious choice would be Ubuntu Studio, since I use Ubuntu on the desktop already. However, I have heard that they are having trouble, and have even considered shutting down the project completely. The distribution that I see recommended the most for audio recording is 64 Studio. So unless I get any other suggestions, I intend to use that.

So 64 Studio will go in its own partition, keeping my audio stuff separate from everything else. I'll not talk about hardware at this point because I think it warrants its own post (and this one is getting long enough as it is!)

So the next decision to make really is about the core recording software itself: what will actually record the audio and MIDI and allow me to sequence, edit and mix everything?

Well, there appear to be a number of choices on this front, but unfortunately none of them appear to be quite what I am really looking for... yet:
  1. Ardour. This appears to be the leading package when it comes to handling audio. However, the current stable version does not support MIDI at all, meaning that I would have to handle that in a separate application which I am not keen on doing at all. I want to be able to see all of my tracks in one place. Having said that though, the in-development Ardour 3.0 will apparently have MIDI functionality added. Hopefully it will be decent: it could make this the obvious choice.
  2. Rosegarden. This has excellent MIDI support (including a full score editor), and does also support audio tracks, but the audio features seem to be quite basic at the moment.
  3. QTractor. I just came across this today, and it looks very interesting. It is relatively young, but looks to be very clean and already very well featured (it supports both audio and MIDI tracks, for example).
  4. MusE. Does both audio and MIDI. I haven't read so much about this so I'll need to read into it a bit more and experiment.
At the end of the day, I'm going to need to spend some time with all of them experimenting with how they work and what they can do. One thing I can say though is that it is quite a delight to have such choice available to me: I'm certain that I will find something that will fit the bill.

Phew, that lot was just about the distro and DAW package, and there's plenty more software to talk about. That then will be for another post. :)

Saturday, June 20, 2009

Getting back into making music

I've been mulling over in my head for some time now the idea of getting back into making music.

For the few of you who read this blog and didn't know this already: I used to be very much into making music around my latter school and university years. I recorded a couple of albums with my good friend Mark in that time which I really enjoyed doing (and which we still reminisce about to this day). Mark and I generally shared all roles (guitar, keyboards, programming, producing, writing and arranging) other than singing (of which Mark did 99%).

It all pretty much stopped when I left university and got a job doing "real" work. Then I got married, started a family and moved to the US. Aside from the time aspect of all of these factors, the latter had a more practical impact in that it involved my selling a large chunk of my music-making equipment, which turns out to be pretty expensive to replace, especially since so much of it is required to do the things I want to be doing.

So it's going to take a while to get to the point where I can actually start recording again as I once knew it (sure, I could just sit down with a guitar and strum some chords into a mic and call it a day, but I've always been into far more elaborate stuff than that, and it has to be interesting to me if I'm going to stick with it). So in the meantime, I'm going to blog about it: both about the gear I'm going to need to collect, and the process of making music itself.

I'll be doing this both because it might actually be interesting to some people, but also as a sounding board so I can get some of my thoughts down in the hope that it helps me along the way.

Monday, June 08, 2009

It's "true" and "false", not "TRUE" and "FALSE"!!!

One thing that bugs me is seeing PHP code like this:

$somevar = FALSE;

or

if ($somevar == TRUE)

Why? Because in very common convention, UPPERCASE is reserved for constants. This follows on from the languages on which PHP is syntactically based, such as C and C++, and most code that I have seen (and written) continues this convention.

The thing is though, true and false are *not* constants: they are keywords.

As a different way of explaining that, consider how one would write the define statement for TRUE and FALSE, without being recursive. The best I can come up with is:

define('TRUE', (bool)1);

define('FALSE', (bool)0);

It's like saying that in order to be able to use 1 in your code you need a define like this:

define('1', 4-3);

Which is clearly insane.

Happily, we don't have to jump through such hoops to get at the boolean values, and it is not via some pre-defined constant; it is via the keywords "true" and "false", which given that they are keywords and not constants, should be written in lower case.

Or as a friend one put it "But... they're blue!" - Referring to the fact that his editor hilighted them as blue along with all other keywords.

Wednesday, March 25, 2009

Linux and suspend/hibernate

As is often the case, when you remove the layers of faux hatred and loathing from Linux Hater's most recent post, you find a great deal of truth.

He speaks of the goal of quickening boot times in Ubuntu 9.04. I can vouch that the boot time is indeed far quicker, but he argues that it's the wrong thing to be focusing on. What they should really be looking at is suspend and hibernate support: on all platforms. To a large extent I agree with this: I don't think you could ever say that a faster boot is a bad thing, but you could quite legitimately argue that suspend and hibernate are far more pressing issues.

I've heard plenty of talk about getting these working properly on laptops, but not on desktop machines. This needs to stop: this feature is important on all machines. I would love to be able to sleep my desktop machine overnight, but it currently doesn't work: I end up having to do a hard reset on it. Contrast that with my Vista dual boot which handles it just fine, and wakes up really quickly (albeit sometimes with the DHCP client down which I need to manually fix each time: so M$ can't get it completely right either).

That's what they really need to be concentrating on, and I really hope they do soon.

Monday, February 02, 2009

KDE 4.2 is much more like it

A while back I outlined why I wasn't able to use KDE yet, which at the time was at version 4.1. Since then, KDE 4.2 has been released and is being much touted as the first version in the 4.x series that is truly suitable for end users.

Well, the short story is that I'm extremely pleasantly surprised!

Here's the long story. Having just upgraded to 6GB of ram, I needed to upgrade to 64-bit in order to take advantage. With jaunty in alpha 3 and offering KDE 4.2, I decided to go ahead and install that, using ext4 too. This other stuff is for another post though: now I'll go through my previous complaints and see where we're at now...

  1. Taskbar entries are now movable: this is configurable in the widget's properties, which allows position to be set to 'manual'. Grouping is also in place and can also be set to manual.
  2. The taskbar height is now fully resizable, and works very well.
  3. There is still no applet for tomboy notes: I don't expect this to change any time soon, if ever.
  4. It looks like KDE's choice of desktop search service is one called strigi, which is itself a part of the larger nepomuk semantic desktop system. This all looks very interesting, but there appears to be some problems with strigi performance.
  5. I have no problems with picking up and dragging around windows now. In fact, this seems to be extremely smooth, and it is very noticeable that there is no tearing as things are being moved around.
  6. As with Tomboy, I don't see this happening any time soon, if ever.
  7. This has been fixed: the system tray now displays very nicely.
  8. I now have no problems assigning keys to switch desktops and move windows from one desktop to the other. In fact, this seems to have come on in leaps and bounds. I wanted to assign something the other day and there it was, exactly where I expected it.
  9. This one still persists, and is probably what bugs me the most. The problem affects the system tray and digital clock widgets, and is documented in this bug.
  10. I still get this, particularly in Thunderbird and Prism. I did find a nice theme for firefox which makes it fit right in with the default KDE theme, and that helped a great deal. Does need more work.
  11. This seems to have disappeared completely, which is obviously very welcome indeed. :)
  12. kopete still doesn't do IRC. However, I really do need to have a look at quassell, which has a very interesting client/server architecture which I think I will find extremely useful.
So from that list we see a considerable improvement over KDE 4.1, enough that I'm going to be sticking with it for the time being.

The main problem for me is the way in which the clock and system tray widgets want to soak up all usable space on the panel, which is horribly messy.

Still, heck of a job. I'm going to be very interested when 4.3 comes along to see what else they've done...