2009-11-03

CouchDB auf WinXP


  • Installationspaket gibts hier

  • Nach dem Installieren müssen noch in >installdir</bin/erl.ini zwei Pfade angepasst werden

  • [Update]in couchdb.bat musste ich noch in der Zeile nach "setlocal"
    %~d0
    einfügen


Und dann ...

D:\Programme\CouchDB\bin>couchdb.bat
CouchDB 0.11.0b819947 - prepare to relax...
Eshell V5.7.2 (abort with ^G)
1> Apache CouchDB 0.11.0b819947 (LogLevel=info) is starting.
1> Apache CouchDB has started. Time to relax.
1> [info] [<0.35.0>] Apache CouchDB has started on http://127.0.0.1:5984/

bzw.

2009-10-16

Ersatzakku für i-Blue 747 GPS Data logger


Heute kam der Ersatzakku für mein i-Blue GPS Data logger. Da mir die Angebotenen Akkus mit der Typbezeichnung HX-N3650A zu preisintensiv waren, habe ich mich stattdessen für die Nokia Variante entschieden - BL-5C. Und siehe da er passt.

2009-07-18

Rake Task to show installed and pending migrations

While developing with Rails I often want to know which migrations are already installed and which are pending. Migrations have names and version numbers. In some rake migration tasks you must specify a migration - but this must be the number :-|

To rest my brain I wrote two rake tasks to show the installed and pending migrations. Feel free to use it for your own - just copy it to a .rake file in your /lib/task directory.


namespace :db do
namespace :migrate do
desc 'Shows installed migrations'
task :installed => :environment do
mt = ActiveRecord::Migrator.new(:up, "db/migrate/")
list = mt.migrations.select{ |mi| mt.migrated.include?(mi.version.to_i) }
print_migration_list(list)
end

desc 'Shows pending migrations'
task :pending => :environment do
mt = ActiveRecord::Migrator.new(:up, "db/migrate/")
print_migration_list(mt.pending_migrations)
end
end
end

def print_migration_list(migrations)
return if migrations.empty?

max_length = migrations.inject(0) {|max, m| [max, m.name.length].max }
puts "Version Name"
puts "---------------" + "-" * max_length
migrations.each do |m|
puts "#{m.version} #{m.name}"
end
end


See also pastie.org

2009-07-14

Generic Cucumber Steps

Zwei generische Steps, die das Ergebnis erster Gehversuche mit Cucumber sind. (Factory = factory_girl)


# Match steps like:
# * And I have projects named A, B, C
Given /^I have .+ named (.+)$/ do |names|
names.split(', ').each do |name|
Factory.create(name)
end
end

# Match steps like:
# * And I should have 1 project
# * And I should have 5 users
Then /^I should have ([0-9]+) (.+)$/ do |count, classes|
Kernel.const_get(classes.singularize.capitalize).count.should == count.to_i
end

2009-06-17

SAT Receiver repariert

Nachdem ich erst letzte Woche auf dem Mainboard von meinem PC einen Elko ausgetauscht hatte, hat sich dann ein paar Tage später der SAT-Receiver gemeldet bzw. eben nicht mehr gemeldet. Zu erst ließ sich das Gerät nicht mehr aus dem Standby aufwecken, und dann ging es auch nach einem Power-Off/Power-On Zyklus nicht mehr an. Ein Blick auf die Netzteilplatine offenbarte dann die Schuldigen: 4 Elkos hatten sich verabschiedet (erkennbar an den gebogenen Deckeln).


Ersatz-Elkos waren schnell bestellt (Low-ESR Typen hab ich nicht auf Halde liegen, Infos zu ESR Elkos gibt es hier), heute kam die Lieferung, eingebaut und ... läuft wieder ;-)