Clementine – Amarok for Windows and Mac OS

My favorite mp3 player is Amarok for KDE driven systems. It comes with intelligent playlists offering an almost always appropriate mix from your music collection. The neat user interface is well-arranged and informative. It’s only a click away to retrieve the album covers of all your albums from the internet, read the song lyrics while listening, find similiar artists, watch photos of artists or read their biography.

But Amarok has one big downside: on Windows and Mac OS it also depends on the KDE lib and therefore it is not integrated seamlessly. So I was very happy when I stumbled upon Clementine (Project Page), a media player based on Amarok 1.4, available for Windows, Mac OS and Linux. It runs without the KDE libs but uses the more lightweight Qt framework for its graphical interface.


Clementine

Keywords: amarok, mp3 player, media player, lyrics, retrieve covers, find covers, linux, windows, mac

Feel Free

Duokan – the alternative Kindle OS – in english

Update 2011/06/29: They released a lite version for kindle 3. I’ll write about it this weekend. Here’s the link to the new lite version at duokan.com: http://www.duokan.com/forum/thread-16541-1-1.html

Update 2011/06/02: Updated links to new Duokan version 0.5.13.8942 (2011/05/20) with english language preconfigured and to the original chinese version. Please leave a comment including your kindle model (2, 3, dx or dxg) if the english language version shows up with another language after installation.

Release notes for Duokan released on 2011/05/20, translated from chinese by google:

The restoration of the Bug:
The Amendment 1 zip in the picture, click and click twice back home to provide crash tonnyfly


EPUB, CHM, DOC and djvu documents on your Kindle? It’s possible! The alternative OS for Kindle, Duokan, is now available with an english GUI supporting these document types. Duokan works with Kindle 2, 3 and DX and it will install besides the original OS, so you’re able to switch easily between it and the original Kindle OS.


Kindle3 Duokan Home

You may download version 0.5.13.8942 (2011/05/20) with preconfigured english language from my site or always the current version through the regarding chinese forum post at the Duokan website where you also could find the chinese installation instructions. For english installation and upgrade instructions see below. I don’t understand chinese so I’ve used the instructions translated by google. Also check this english thread at their forum.


Kindle3 Duokan displaying an EPUB


Kindle3 Duokan displaying a PDF normally


Kindle3 Duokan displaying a PDF with Smart Layout

With Duokan you’re not just able to read EPUBs. Another convenient feature is that Duokan is able to change the font size or crop the white border for PDFs. To crop the white border, open the PDF, press “Aa” and select “Screen Zoom A”. To change the font size, open the PDF, press “Aa” and select “Smart Layout”. After this you may press “Aa” again and adjust the font size. While the crop feature leaves the original PDF design untouched, the smart layout feature tries to adjust the PDF, so the results may be dissatisfying. You should bear in mind that the current version is a beta version.

When I was playing with the WLAN feature which is not working for my WPA2 secured WLAN yet, Duokan had frozen up. Don’t panic if this happens to you. You’re able to reset your Kindle by pushing the power switch for 15 seconds.

For more discussion about Duokan check their forum or also this thread concerning Duokan at mobileread.com.

Installation instructions:

  1. Get  Duokan with preconfigured english language
  2. Connect your Kindle to your computer via USB
  3. Open the Duokan archive and copy the folders DK_System, DK_Documents and DK_Pictures to your Kindle root directory.
  4. Also copy all the .bin files from the corresponding subfolder in 升级包 (e.g. k3升级包 subfolder for Kindle 3) in the archive to the Kindle root.
  5. Disconnect USB
  6. Make sure that your Kindle is charged (at least 50%)
  7. On your Kindle, press “Home”, then “Menu”, then select “Settings” and then press “Menu” again. Choose “Update Your Kindle”
  8. Kindle restarts and after restarting be quick and press Q for Duokan (W is for the original Kindle OS). If you’re not fast enough, go to Home, then Menu, then select “Settings” and then press Menu again. Choose “Restart” and be quicker pressing Q next time. In some cases you will get back to the original Kindle OS after updating. If this happens to you, choose “Restart” in the settings menu.
  9. That’s it! In the settings you now might want to add your ebooks of your original installation to Duokan. To do this, simply go to “Home” in Duokan, press “Menu”, select “Settings”, find “Other->Use Kindle Lists” and select “Yes”. Additionally you may copy some ebooks to your DK_Documents folder to use them only in Duokan.

Upgrade instructions:

  1. Switch your Kindle to the original Kindle OS if it has been switched to Duokan before. To do this in Duokan, press Menu, select “Settings” and then select “Switch to Kindle”.
  2. Then follow the installation instructions above, with a minor difference: there’s no need to copy the empty DK_Documents and DK_Pictures folders again. You could also delete the old DK_System folder first, maybe some files are not needed any longer. And again, don’t forget the bin files.

To uninstall, start Duokan, open the settings and select “Uninstall System”.

Archive of Duokan releases

Advertisement: Screen protection for your kindle.

Keywords: Kindle, Duokan, alternative OS, alternative firmware, alternative, alternate, english, translation, epub, resize pdf font, better pdf support

Secure model mass assignment for administration panels

For the most applications I’m developing I want the users to be able to edit their user data or profile using model mass assignment in Rails.  Moreover I want additionally an easy administration panel for super users who can access all the attributes of the users (and nested attributes) via mass assignment.

Now what’s an easy and rails-like way to allow users and super users to edit exclusively the attributes they have access for? I’ve searched the web and found dirty solutions like accessing the current_user from your model or modifying before_*-handlers. So here is my way.

In the user-model I declare the attributes the user has access to, using attr_accessible:

class User < ActiveRecord::Base
  attr_accessible :login, :email, :birthday, :country, :city, :age_is_public
end

For the administration panel I create a new model which extends the User model. This AdminUser model extends the accessible attributes of the User model for the super user.

class AdminUser < User
  attr_accessible :role, :comment, :level
end

Now I access the User model from the controller for standard users and the AdminUser model from the admin controller.  The verification for a valid and logged in super user is done there.

class UsersController < ApplicationController
  before_filter :login_required
  [..]
  def update
    @user = User.find(current_user.id)
    @user.update_attributes(params[:user])
  [..]
end
class AdminUsersController < ApplicationController
  before_filter :login_required, :admin_required
  [..]

  def update
    @user = AdminUser.find(params[:id])
    @user.update_attributes(params[:user])
  [..]
end

That's it. Nice and clean model mass assignment depending on the security level of the user. This also works nice with nested attributes. Don't forget to add _attributes to your symbol name in attr_accessible in this case (like  :profile_attributes for a has_one relationship with the profile model).

Keywords: admin panel, control panel, rails, nested_attributes_for, mass assignment, attr_accessible, attr_protected

“undefined method `use_transactional_fixtures=’” after upgrading to Rails 2.3.2

After upgrading to Rails 2.3.2 I’ve tried to run the testcases. The following error occured:

test/test_helper.rb:22: undefined method `use_transactional_fixtures=’ for Test::Unit::TestCase:Class (NoMethodError)

Solution:

Test::Unit::TestCase changed to ActiveSupport::TestCase, so simply edit your test/test_helper and change the name of the class.

Keywords: functional test problems