Thursday, March 31, 2011

my Samsung "Color Laser Printer" CLP-315

its US-English web-page.

its German web-page.

The printing quality got worse a couple of months ago – low-colour stripes, where I expected bright colour.

I called support yesterday.
He told me to take everything out (all 4 cartridges, the waster toner (box) (in Geman: Resttonerbehälter), and the other beast (I will tell you its name, once I remember)).
I should shake the cartridges a little.
I should clean "it" (that glass area, where the pictures are captured) with something fluff-free and a little wet.
I should let it dry for a couple of hours.
I should also open and close the cover a couple of times, as that would activate a cleaning mechanism.
I actually went for the dry variant, and I was rather successful. I am rather satisfied now.

Blogger Buzz: Fresh new perspectives for your blog

Blogger Buzz: Fresh new perspectives for your blog

Tuesday, March 29, 2011

Google Contacts as XML – rough edges

Some vCards come with a field called SORT-STRING.

It appears to me (I will update this, once I know better), that Google (Mail) Contacts loads this field into their field by the name of "Name (phonetic)". In XML this goes into an attribute of fullName, that they call yomi.

Monday, March 28, 2011

reverse-engineering ORM class interfaces from RDBMS schemas

I found software to create such interfaces for Perl / in Perl; some such software is oriented towards DBIx::Class, some is oriented towards other approaches. I found that in the books on Catalyst.


Is there any such thing for Ruby? Can ActiveRecord do it?

I find that a rather smart thing. Usually you find a lot of existing schemas (if you are in such a situation), and if you are lucky, you can choose the ORM approach.

To be continued …

DBIx::Cookbook - search.cpan.org

DBIx::Cookbook - search.cpan.org

This text pointed me to the Sakila sample database.

MySQL :: the Sakila sample database

MySQL :: the Sakila sample database

That documentation includes a nice diagram, and that diagram led me to MySQL Workbench, now I have an idea of how to create nice database diagrams.

MySQL Workbench - a general database GUI application

MySQL Workbench - Wikipedia, the free encyclopedia

Why Catalyst is an excellent web application framework - Catalyst::Wiki

Why Catalyst is an excellent web application framework - Catalyst::Wiki

Sunday, March 27, 2011

RubyForge: XML::Simple (with my experiences as updates)

RubyForge: XmlSimple: Project Info

Rather short after discovering this module, I made use of it with my FRITZ!Box call monitor in order to read my Google Contacts as XML. With this approach, that was a rather easy piece of cake.

Update 2011-03-29:
If an element has not attributes, the (text) content of that element simply gets appended as string to the list at the hash field by the name of that element.
Now if the element has attributes, the (text) content goes together with the attributes to a hash list, that gets appended to that list instead. The (text) content actually goes into a hash field by the name of "content".
Example:
text -> "e"=>[            "text"]text -> "e"=>[{"content"=>"text","a"=>"v"}]
My Ruby code operates like this:
x.instance_of?(Hash) ? x['content'] : x

ruby XML::Simple

XmlSimple - XML made easy

Saturday, March 26, 2011

Catalyst 5.8: the Perl MVC Framework Book & eBook | Packt Publishing Technical & IT Book Store

Catalyst 5.8: the Perl MVC Framework Book & eBook | Packt Publishing Technical & IT Book Store

Catalyst Book & eBook | Packt Publishing Technical & IT Book Store

Catalyst Book & eBook | Packt Publishing Technical & IT Book Store

What do you look for in an ORM? - O'Reilly Answers

What do you look for in an ORM? - O'Reilly Answers

What's Wrong with ORM

What's Wrong with ORM

DBIx::Class - cpan.org

Alexander Hartmaier / DBIx-Class - search.cpan.org

DBIx::Class (aka DBIC) introduction - 2010

DBIx::Class introduction - 2010

Friday, March 25, 2011

GMarks (Add-ons for Firefox) – Google Bookmarks in the sidebar

GMarks :: Add-ons for Firefox

I loved this explore-like display of my Google Bookmarks in the Firebox sidebar. It's not supported any longer for Firefox 4. And Chrome and Chrome don't have a sidebar anyway.

I really loved adding bookmarks that way.

"Continuity of Care Record" (CCR) – ASTM E2369 - 05e1 Standard Specification

ASTM E2369 - 05e1 Standard Specification for Continuity of Care Record (CCR)
Google Health can export your health profile as CCR, an XML dialect.
Today I added another "problem" to my Google Health profile.

Perl ORM comparison (Class::DBI vs. DBIx::Class vs. Rose::DB::Object)

Perl ORM comparison (Class::DBI vs. DBIx::Class vs. Rose::DB::Object)

Perl ORM - DBIx::Class - www.perl.org

Perl ORM - DBIx::Class - www.perl.org

Thursday, March 24, 2011

Thursday, March 17, 2011

I started using eRuby to create JasperReport JRXML files

All of a sudden I knew, I would immediately need a template mechanism. During the last "Stuttgart.pm" meet-up Mason got mentioned, but I was already a little familiar with eRuby, so I gave it a try, and it was just the right thing to do. The XML file to handle got smaller and smaller and smaller – really, really nice to see.

Update 2011-03-25:
A few days later I am really rather satisfied with this decision.
Of course: eRuby XML files are no longer clean XML, so they are not supported by any editing mode (apart from "text-mode") in emacs, but then that's not too terrible.

Update 2011-04-20:
Of course (again) being able to deal with eRuby XML files as XML files within nxml-mode would be a charm. There are 2 obstacles to overcome:

In order to interpolate ruby expressions into XML this syntax is used:

y="<%=y0+13%>"

but nxml-mode does not accept that for a legal XML attribute value.

Lines starting with '%' are for ruby code, nxml-mode should / may consider them as comments:

% y0 = 97

an extra blank page on PDF-s created by JasperReport has gone

The JRXML, I am creating programmatically, caused the generated PDF to have an extra blank page.

I didn't care a lot, as long as I had not achieved my main goal. Now, that I am going to deliver (OMG!), I tried to smooth that rough edge. As I had not clue, where the problem source really was, I urgently needed to solve that problem today. Spent some time on it, solved it!

My document has only two bands: the Title and the the Background Band.
The Title Band actually doesn't share the page space with any other band. Therefore I thought it may take all the 842 points of height, that the document has itself. That's apparently not true. Apparently the Title Band must be at least be one point smaller the available height. If I respect that rule, I don't have that extra blank page any more.

Friday, March 11, 2011

The Scala Programming Language – the website

The Scala Programming Language

Programming Scala – the website of the O'Reilly book

Programming Scala

R Cookbook - O'Reilly Media

R Cookbook - O'Reilly Media

O'Reilly Media book: R in a Nutshell

R in a Nutshell - O'Reilly Media

installing the Erlang system

installing the Haskell system

installing the Scala system

Erlang Programming - O'Reilly Media

Erlang Programming - O'Reilly Media

emacs: table editing, rectangle editing, making simple drawings, picture more, artist mode

Emacs has "info mode" documentation on "Picture Mode".

"CUA Bindings" (cf. "info mode" entry by this name) come with enhanced rectangle support.

The O'Reilly book Learning GNU Emacs has a chapter (7) on Simple Text Edition and Specialized Editing with sections Rectangle Editing (subsection on CUA Rectangle Editing) and Making Simple Drawings (on Picture Mode and Artist Mode). Occasionally I actually use Picture Mode for drawing tables.

You will find info mode documentation on table editing in section Text > Text Base Tables. I also like that very much.

the Chromium Browser: the Status Bubble

Status Bubble - The Chromium Projects

The Status Bubble was gone with 11.0.697.0 on the Mac. That's pretty bad. I really like "inspecting" links, before I click them.

Update 2011-03-11:
I just installed "12.0.700.0 (77795)", and the Status Bubble is back again. I am relieved.

Java removed from Linux Standard Base 4.1 - The H Open Source: News and Features

Java removed from Linux Standard Base 4.1 - The H Open Source: News and Features

openSUSE 11.4 final arrives - The H Open Source: News and Features

openSUSE 11.4 final arrives - The H Open Source: News and Features

Kiran Nagarkar: God's Little Soldier

Kiran Nagarkar - Wikipedia, the free encyclopedia

This book on indiaclub.com.

Hans Küng: "Islam: Past, Present and Future"


Thursday, March 10, 2011

today I needed a stack class in bash

It's certainly not hard to do, but then it takes a while, until it's done properly.

square photos in Google Contacts – create them with the help of ImageMagick's convert -splice

I really start appreciating ImageMagick and the transformations it supports, that I come across.

Google Contacts really prefers square photos, and if your photo does not have a square geometry, you have to crop it to a sub-square. Now that I know, how to insert a rectangle to the photo (with the help of ImageMagick's "convert -splice", GraphicsMagic doesn't support "convert -splice"), I will happily upload square photos from now on.

I was long wondering, how I could achieve this.

MacPort/DarwinPort and Fink coexisting on my Mac

Both coexist on my Mac, and sometimes installations complain about binaries resp. libraries in an incompatible format.
MacPort/DarwinPort lives in /opt/local, Fink lives in /sw.
In order for fine installations I sometimes have to temporarily rename /opt/local resp. /sw.
After the successful installations I rename them back.

I learned this lesson during the installation of ImageMagick on my Mac.

Linux.com :: ImageMagick or GraphicsMagick?

Linux.com :: ImageMagick (IM) or GraphicsMagick (GM)?

… unless you absolutely without-a-doubt need some new IM option not yet available in GM, the safe bet is to stick to GM's feature set, and write your app to work with either one. …

GraphicsMagick Image Processing System

GraphicsMagick Image Processing System

Wednesday, March 9, 2011

ImageMagick v6 Examples

ImageMagick v6 Examples

apress.com: The Definitive Guide to ImageMagick : 9781590595909

APRESS.COM : The Definitive Guide to ImageMagick : 9781590595909

This book will most certainly also help you with GraphicsMagick.

book: ImageMagick Tricks

ImageMagick Tricks Book & eBook | Packt Publishing Technical & IT Book Store

This book will most certainly also help you with GraphicsMagick.

how to copy a rectangle region from an image file? ("cropping")

My original source files are PDF files, but I already converted them to PNG using Ghostscript.

I was thinking of ImageMagick

I came across phatch, I read of it here. It's a GUI, that helps running ImageMagick with certain operations in a batch. It came with a lot of dependencies on other packages. I tried to fullfil some of of them, eventually I gave up. If I very sure, that phatch was the way to go, that dependency hell wouldn't be a dead end. Spending time on getting phatch to run was a dead end for me.

There is a book on ImageMagick at PackPub, there is also one at Apress. I bought both of them as PDFs. That was the key to the success. I found nice examples, and I was able to apply some easy recipe to my task.

$ convert orig.png -crop geometry new.png

Actually the recommendation says to use "+repage", in order to not confuse certain software:

$ convert orig.png -crop geometry +repage new.png

Without "+repage" the file stores the displacement of the segment wrt. the original image, which comes in quite handy, but … certain software gets confused, eg. when I loaded one such new image into GIMP, GIMP displayed the displacement and presented me rubbish.

There is a fork of ImageMagick called GraphicsMagick. Pretty fast, but you may come across features of ImageMagick, that GraphicsMagick doesn't know.

Monday, March 7, 2011

my call monitor software is going jruby

My FRITZ!Box call monitor is written in ruby-1.9. So far I am running it using MRI-ruby-1.9.

This call monitor is a FRITZ!Box call monitor, it does not monitor the calls on my smartphone yet (which is rather, rather sad). Most of the year (for economical reasons) I should sit in a customer's office quite a little away from my place – receiving calls on my smartphone. So it makes much sense to get my call monitor software to monitor the calls on my smartphone one day (rather sooner than later).

Just recently (with the help of RVM) I delved into the the jruby world, and of course I am trying to run my call monitor software also with "jruby --1.9".
My current problems with "jruby-1.6.0.RC2 --1.9" are with I18N and encodings, so I cannot open my gmail address book with "r:UTF-16LE:UTF-8". My evasive strategy is to let it read a UTF-8 version of it.
The ruby CSV module, that parses my address book using regular expressions, seems to give the runtime system yet unseen tasks.
Maybe I am not too far away from running a slightly adapter version of my call monitor in jruby and therefore on a JVM.

Of course, IronRuby (a .Net ruby implementation) is also an option.

There are not that many different smartphone operating systems, that run JVM-s, so we are mainly talking about Android.
Does Android allow non-core software to (sort of) monitor the incoming and outgoing calls?

Once jruby successfully runs my call monitor, the way is free to go for an Android implementation. I am rather hot for it.

Update 2011-03-07:
After a couple of postings on user@jruby.codehouse.org and especially with the support of Thomas E. Enebo, my software now runs just as well with the very, very latest jruby, that I produced through "rvm install jruby-head".


Update 2011-03-28:
Now it runs reading the XML Google Contacts, which is more comfortable, as I can download it on the command line.

filling JasperReports forms with a "simple" command line utility

Are you interested in such a utility?

I derived this utility from TextApp, that comes with the JasperReports sample applications.

It uses command line arguments in order to assign values to $P{…} within JRXML resp. .jasper.

The advantage over installing JasperReports as a server: it makes use of JasperReports' libraries, but it's stand-alone and pretty lightweight.

Update 2011-04-20
My next "major" feature enhancement for this utility: Let it make use of XML elements and their attributes resp. "content" instead of command line arguments. That should deal with UTF-8 text much better than command line arguments to be supplied from within shell scripts. Actually the JasperReports toolkit already knows how to work with XML, but my point is to make the usage of XML supplied fields look almost like $P{…}.
(Nota bene: this was written rather in a hurry and may need some rephrasing. Once I will start the implementation, I will certainly do this.)

JasperReports – Documentation and Samples

JasperForge > JasperReports Forums

"Black Duck Koders" – Koders.com

Open Source Code Search Engine - Black Duck Koders

A colleague of mine pointed me to that website; he had found code to work with the JasperReports Java API there.

Friday, March 4, 2011

youtube-dl – updating it from github

youtube-dl

I guess, YouTube and youtube-dl's developer are playing cat and mouse.
The utility already has a command line option to update itself to the last stable release, but today I had to update it to "head". Now it works again, and I am happily downloading a few nice videos for my journey home.

XML for ruby: libxml.rubyforge.org

Libxml

XML for ruby: xml-simple.rubyforge.org

XmlSimple - XML made easy

XML for ruby: nokogiri.org

Nokogiri

XML for ruby: builder.rubyforge.org

Builder for Markup

Nokogiri: yet another HTML and XML parser for ruby

Nokogiri: A Faster, Better HTML and XML Parser for Ruby (than Hpricot)

Ruby XML Performance Shootout: Nokogiri vs LibXML vs Hpricot vs REXML

Ruby XML Performance Shootout: Nokogiri vs LibXML vs Hpricot vs REXML

I am really eager to know, what the current state is.

Thursday, March 3, 2011

GoogleCL = command line tools for the Google Data APIs - manual

Manual - googlecl - How to use GoogleCL. (Project Hosting on Google Code)

GoogleCL = command line tools for the Google Data APIs – introduction on the Google Open Source blog

Introducing the Google Command Line Tool - Google Open Source Blog

O'Reilly Media book: XPath and XPointer

XPath and XPointer - O'Reilly Media


Update 2011-03-05:
Happily acquired the PDF e-book.
Lots of nice XPath examples … – now: practice, practice, practice!

Update 2011-03-09:
This book is also available online and for free here, on the O'Reilly Commons wiki.

XSLT Cookbook - O'Reilly Media

XSLT Cookbook, Second Edition - O'Reilly Media

Update 2011-03-05:
Happily acquired the PDF e-book.
Lots of nice XPath examples … – now: practice, practice, practice!

Learning XSLT - O'Reilly Media

Learning XSLT - O'Reilly Media

REXML – an XML toolkit for Ruby – an introduction on developer.com

REXML: Processing XML in Ruby - Developer.com

REXML – an XML toolkit for Ruby – an introduction by David Mertz

XML Matters: The REXML library

REXML – an XML toolkit for Ruby – the API in RDoc style


REXML – an XML toolkit for Ruby – "Home"

REXML - Home

REXML – an XML toolkit for Ruby – tutorial on germane-software.com

REXML Tutorial

Ruby Standard Library Documentation

Ruby Standard Library Documentation

REXML – an XML toolkit for Ruby – on ruby-doc.org

rexml: Ruby Standard Library Documentation [ruby-doc.org]

Wednesday, March 2, 2011

your Google Contacts address book as XML

Today I came across a rather interesting thread on the googlecl-discuss mailing list, it's subject was "Backing up contacts", and it thrilled me instantly. With this command line, you get your address book dumped as completely, as it currently can get:
$ google contacts list --title='' --fields=xml
Of course you must have an up-to-date gdata-python-client and googlecl installation. But you do have that anyway, don't you? I updated mine today.

Yes, the XML misses an enclosing top-level element – but you can add that easily.

I would also love to see the groupMembershipInfo in a rather "accessible" way, but I guess, that will also come sooner or later.

This lists alls groups (and not in XML for currently trivial reasons), but I am not able to relate the groups to the (group) URIs mentioned in the contacts XML:
$ google contacts list-groups --title='' --fields=xml --verbose ".*"


My FRITZ!Box call monitor software will make use of the XML Google Contacts rather soon. That way I can skip all the current JRuby CSV and m17n problems. Its also more comfortable to download, because I can do that on the command line. And if it's more comfortable, you do it more often. Backing up your address book frequently isn't a bad idea either, right?!

Update 2011-03-28:
Task accomplished for my FRITZ!Box call monitor software, also if executed through jruby-1.6.0.