September 15, 2010

Clementine: Amarok 1.4 continued

Posted in Amarok, Clementine, Linux at 19:17 by theBlackDragon

So I stumbled over this post on the LinuxJournal website today about Clementine a project that is porting Amarok 1.4’s functionality to QT4. I’ve always loved Amarok 1.4’s user interface and now there is even a stable Windows version available, something Amarok 2 has unfortunately been sorely lacking thus far.

Even though Clementine is only at version 0.4, the most important functions are there already, the only things I really noticed that was missing were the playcount and last played fields in the playlist window and the ablity to display the track number in the library view.

Advertisements

March 11, 2008

Dynamic class loading in Java

Posted in Java at 12:03 by theBlackDragon

This is a repost of an older article I wrote back in 2006 (yes, I had to use the wayback machine to get it back ;))

I was looking for a way to dynamically load plugins from (at development time) unknown jars the other day and after some searching (nowadays they call that Googling I guess?) I found the solution in Java’s ClassLoader class, in URLClassLoader to be precise. This task turned out to be amazingly simple.

I just defined an interface called Plugin that all the Plugins should implement so that I can cast whatever I get from the ClassLoader to this interface.

So without further ado, here’s the code (yes, only 6 lines of actual code):

        URL[] jarFiles = findAllJars();
        if(jarFiles != null)
            classLoader = URLClassLoader.newInstance(jarFiles);

This gets me a new ClassLoader with all the plugins in a given directory. findAllJars() is a oneliner grabbing all jars from my projects “plugin” directory using a FilenameFilter to filter the Jars from the cruft 😉

I can then load a plugin like this:

    public static void load(String p)
    throws ClassNotFoundException, InstantiationException, 
    IllegalAccessException{
        Class c = classLoader.loadClass(p);
        Plugin plug = (Plugin) c.newInstance();
    }

This uses the ClassLoader to load an instance of the dot-notated classname I pass in (eg. be.lair.remes.plugin.ircplugin.IRCPlugin), I then use this Class to create an instance which I then cast to the correct type.

Notwithstanding the fact that I didn’t find a great deal of example of this on the net it was amazingly simple to get working. Makes me wonder why people always need to pick on Java.

June 3, 2007

GNU Emacs 22.1 released!

Posted in Emacs, Linux, Techie stuff at 11:26 by theBlackDragon

This morning I check in on #fvwm and the first thing I notice is the following:

03/06|01:03:06 < Hun> theBlackDragon: aaaaaaaaaaah!
03/06|01:03:13 < Hun> e22 has been released!

So I run off to the Emacs homepage, but nothing to be found about a new release. Hmm.
So what can you do? Check usenet of course, and sure enough on gnu.emacs.devel (e-mail addresses removed for obvious reasons):

From: David Kastrup <*@*>
 Subject: Re: Cygwin binaries for Emacs-22.1 released!
 Newsgroups: gmane.emacs.devel
 To: Angelo Graziosi <*@*>
 Cc: emacs-devel@gnu.org
 Date: Sat, 02 Jun 2007 21:18:05 +0200
Angelo Graziosi <*@*> writes:
> Cygwin binaries for 22.1 release here:
 >
 >    http://www.webalice.it/angelo.graziosi/Emacs.html
I was going to mouth off about premature announcements and being
 careless about release numbers, but checking on the ftp server have
 found that the tarball for Emacs 22.1 has been uploaded.
Did I miss the announcement on this list?
--
 David Kastrup

And sure enough, there it was, on the GNU FTP server, all shiny and new: an Emacs 22.1 tarball, the changes from 21.x are a little bit too numerous to sum up here, I’d say just upgrade or read the ChangeLog.

June 2, 2007

FVWM Forum upgrade to phpBB 3.0 RC1

Posted in FVWM, Web at 17:03 by theBlackDragon

After years of good service phpBB2 finally succumbed under the pressure of spambots, the amount of work required to keep a phpBB2 board spamfree was getting out of hand very quickly, phpBB3 was going to make keeping spam out of your board easier as well as getting rid of any spam that got through after all easier to track down and remove.

But phpBB3 remained something at the distant horizon for way too long, for a while it appeared to be obtaining some sort of Duke Nuke ’em For(n)ever like cult status: highly anticipated but always just out of reach. Competing packages came and went and all the time it became more apparent that phpBB2 no longer lived up to the today’s bulletain board standards. Lots of boards switched to competing forum software, others kept on waiting, because phpBB3 was right behind the door, nearly there. But now, the first Release Candidate of phpBB3 is among us with a huge load of improvements over phpBB2 and we (being the FVWM Forum admins) decided very quickly we wanted to switch to RC1 right away and not wait for the Final to come about.

So? Was it worth switching? In my opinion it was. Conversion from phpBB2 went smooth, to say the least and the new anti-spam and anti-bot measures like usage of blacklists look very promising, though only time will tell how effective they will be in the end when phpBB3 becomes more mainstream.

The Administration Control Panel (ACP) is pretty overwhelming at first and it’ll probably take some time before you know where to look for the options you need. But after a bit of searching it became apparent that all settings from the phpBB2 board were nicely imported into phpBB3, the only thing that annoyed me a bit is that a lot of the new features (like attachments) are turned on by default, I would have preferred them to have been turned off by default.

The new default style takes some getting used to and I haven’t decided whether I like it or not yet. But for the people that really can’t stand the new look an updated version of phpBB2’s SubSilver style is also available in the default install albeit disabled by default.

It’s now also easier to modify the styles in phpBB3, replacing most graphics can be done from the ACP using ImageSets. It’s similarly possible to edit the Styles’ CSS and Templates from the web interface, this makes small modifications possible without having to get out an FTP client and digg through the sourcecode of phpBB or the Style you wanted to change.

Another interesting feature is the Jabber integration, not only can you now add a Jabber address to your profile, you can also use this address to send messages to users (if the Administrator has enabled this, of course). There’s only one problem with this: Google Talk accounts won’t be able to receive messages sent via the forum (see this thread on the phpBB forums for more information) at least not in RC1. It looked to me as if Google blocked messages sent from people not on your roster by default, but I would be happy to be proven wrong on this.

Other interesting features are the ability to search for a user using different search criteria or request a list of inactive users on which you can batch perform an action like activating or deleting them.

New options have been added for moderators too. Moderators can now ‘officially’ warn a user for misbehaviour which has the advantage that other moderators can see these warnings and act accordingly to repeated misbehaviour.

Other actions like merging and splitting topics have been made easier to perform as have a number of other actions that deal with multiple posts or topics. Moderators now have access to a list of (unexpired) warnings issued to users as well as to lists of posts that are in the moderation queue, posts/users that have been reported for violations by other users and a log of the actions other moderators have performed which makes it easier for moderators to prevent stepping on eachother’s toes . They can now also ban users by username, ip or e-mail address something that previously had to be done by an administrator.

For forum users not a lot has changed on first sight, things that worked before still work in mostly the same way in phpBB3 although some actions have been streamlined more.

One of the first changes you’ll probably notice is the total redesign of the User Control Panel (UCP). The UCP has been broken up into that make keeping an overview a lot easier, something which is important as the amount of settings has been expanded quite a bit in comparison to phpBB2.

It’s now possible to only show topics or posts from the past x days by default, this can be done on a per forum basis but can also be set to a default board wide value in the UCP.

All in all I’m liking phpBB3 so far, many of the new features make life a lot easier for administrators and/or moderators (these were my main reasons for upgrading and my main gripe with phpBB2), but the new features for users are pretty nice as well and the ones that don’t seem useful (like the “Friends & Foes” list in my case) are easy to turn off.

May 18, 2007

Pidgin doesn’t fly very high…

Posted in Linux at 23:22 by theBlackDragon

So I installed Pidgin (formerly known as Gaim) today and I noticed that the protocol Icons were gone. All users from all IM services now have the same icon.

Despite users listing a bunch of good reasons in a bug posted because of the removal of this feature they keep on getting asked the question “but why do you need it?”, talk about being thick skulled (see for yourself). They also closed the bug from further comments and a bug that was later opened to request for re-adding of protocol icons got closed as a duplicate of a bug on which people could no longer comment (but which just got re-opened I noticed).

I must say I was quite shocked by the reaction of the Pidgin developers (or some of them at least) and their total lack of trying to see the points being made.

But that’s not all, in the ChangeLog they also managed to trample the feet of Slackware developers and users (see this mailinglist post).

I really don’t get it, I thought Free and Open Source software were a community effort and feedback of the users was essential in this effort, but instead they choose to ignore their users in such a harsh way, it’s good to see that they have reopened bug #1108 as to at least allow some form of discussion, but the single mindedness of some of their developers is quite disturbing. It’s like they don’t want to see the points being made and keep on replying the same over and over again.

The attack on Slackware was totally unwarranted and very low to the ground in my humble opinion and worthy of an apoligy if you ask me.

I really hope they manage to rectify these issues as I really liked Gaim as an application, but given these recent events my faith in the project has sustained quite a dent…

March 4, 2007

Neverwinter Nights 2, Obsidian Entertainment and the “rushed game syndrome”

Posted in RPG at 11:50 by theBlackDragon

Obsidian Entertainment, creator of Neverwinter Nights 2 and Knights of the Old Republic 2 (the first installment of both of these games was done by Bioware), both games with huge potential that they managed to screw over royally in the same way, heh, when speaking solely about RPGs I’d nearly call it the “Obsidian way”.

So how come they still get such favorable reviews? Simple, they never manage to finish any of their games properly, they create a great story, a great start to that story and then when you expect the story to finally really get going, when you’re already totally addicted they just drop the hammer on you. They did it in KotOR2 and they do it again in NWN2. Reviewers never notice because they obviously don’t play every game they have to review to the finish.

The fact that you can eventually obtain your own keep in NWN2 is something they’re very proud of, but it is, in a way, one of the major letdowns in the game. Sure, it’s nice to have, well worked out and all that, but at the same time you gain your keep you also get the full dose of linearity of the NWN2 OC (Original Campain, as it is known to NWN players) thrown into your face. There are virtually no (none, zero, nada, noppes) side quests in the entire game and the ones that are there usually revolve around picking up something or someone along the way during a part of the main quest. So there went my idea of using my keep as a nice base of operations while racking up the gold needed for repairs to said keep by doing sidequests.

Still the main storyline is worked out reasonably well although the endgame, as in KotOR2, boiled down to butchering whole legions of “baddies” and then whacking the “boss” in an epic battle followed by a horrible “cinematic” explaining what “happened” to you and your party. For me this was the biggest anticlimax in any game up till now, at least in KotOR2 they told you what would happen to (most of) your companions (quite literally too) and you yourself had some future perspective, but none of that in NWN2, you and your companions “dissapear”.

I know I sound awfully negative here, but the truth is that I really enjoyed the game the first time through so the ending cinematic was a really big letdown. The lineairness of the OC really didn’t bother me the first time through, but I doubt I’ll be replaying this game very often.

I really really wish companies would start decently finishing games for once, no more obviously rushed games please.

Games that were decent to good and would have been great if actually finished:

  • Vampire: the Masquerade: Bloodlines (Troika, no longer exists)
    • contained more bugs and quircks than Windows ME
  • Knights of the Old Republic 2: The Sith Lords (Obsidian)
    • lots of bugs (crashing, savegame corruption)
    • unfinished story with lots of content cut in such a hasty way that you can’t help but notice (unless you’re blind or think that references to areas marked on maps but which you can’t reach are “normal”, there’s even proof an entire planet was hastily cut (it’s still referenced in HK-47’s dialogs which are still in the game))
    • a lot of stuff in the (obviously rushed) ending didn’t make any sense because too much got cut
  • Neverwinter Nights 2 (Obsidian)
    • lots of bugs (needed a 100MB patch file the first time I started playing, seemed to have fixed most issues though)
    • rushed ending
    • (very) weak ending cinematic

I guess I’ll have to wait with buying any games from now on until the first reports from people that have actually finished it start tickling in as reviews have proven not to be trustworthy. But at least in NWN2’s case we can hope for good community created content.

January 21, 2007

Emacs tips #4: the Emacs Lisp REPL

Posted in Emacs at 16:40 by theBlackDragon

Everybody knows you can evaluate elisp expressions in the scratch buffer, but a lot less people seem to be aware of ielm the interactive Emacs Lisp mode, this mode opens a sort of Emacs REPL that allows you to work with Emacs Lisp much in the same way you’d do at a Common Lisp REPL.

Another little known fact is that you can evaluate elisp expressions at the eshell prompt, just try typing (+ 12 9) and hitting return. Spiffy eh? But you’ll quickly run into eshell’s elisp limitations: it doesn’t correctly indent code so it’s not really useful for ‘real’ elisp hacking, ielm is much better suited for that purpose as it does corretly indent elisp code.

December 29, 2006

Emacs tips #3 : automatically making scripts executable

Posted in Emacs at 15:01 by theBlackDragon

I don’t remember where I found this snippet (maybe comp.emacs) but it’s mighty useful so I thought I’d share it with you:

; Sets +x on scripts stating with a shebang
(if (< emacs-major-version 22)
       (add-hook 'after-save-hook
                 '(lambda ()
                    (progn
                      (and (save-excursion
                             (save-restriction
                               (widen)
                               (goto-char (point-min))
                               (save-match-data
                         (looking-at "^#!"))))
                           (shell-command (concat "chmod u+x "
                             buffer-file-name))
                           (message (concat "Saved as script: "
                             buffer-file-name))))))
       (add-hook 'after-save-hook
         'executable-make-buffer-file-executable-if-script-p))

Emacs versions below 22 need the former, longer method while Emacs 22 can use the oneliner in the last line.

December 2, 2006

The Job

Posted in Life, the Universe and Everything at 12:48 by theBlackDragon

I started working for Tri-ennium as a Java develeper yesterday. It’s been only one day now but I’m looking forward to it. Only time will tell whether my enthusiasm will last though 😉

On another note I’ll be moving to my own place by the end of this or the start of next month, I hope to stay online during that period but it’s very well possible that I’ll be without internet access for some time. Will be nice to finally have a place to really call my own 🙂

November 22, 2006

Cleanup time?

Posted in Gentoo at 15:54 by theBlackDragon

I’ve been running Gentoo on my desktop for quite some time now, according to my emerge.log since 3 april 2005,

% head -n 1 /var/log/emerge.log
1112547957: Started emerge on: Apr 03, 2005 17:05:57

but I haven’t cleaned any portage directories since that day. So after more than a year of use Portage hogged over 4.6GB of space in /var/tmp/portage…

Today I decided to do some more cleanup after a corrupt package download and this is what I got:

[theblackdragon@ira ~]% rm /usr/portage/distfiles/*
zsh: sure you want to delete all the files in /usr/portage/distfiles [yn]? y
zsh: argument list too long: rm
[theblackdragon@ira ~]% ls -l /usr/portage/distfiles|wc -l
3229
[theblackdragon@ira ~]% du -hs /usr/portage/distfiles
9.9G /usr/portage/distfiles

This really made me go “yoinks”… Guess I should clean up more often. Heh.

Previous page · Next page