2009-07-26

Fantasy

This post is mostly for my own future reference on how to deal with web-fonts

This is a 'guest' post by your same regular author. If you're using Firefox 3.5, it should look slightly different. It's using a font Un Dinaru which you probably don't have installed on your machine, but which as a web-font hosted on my server you could still see it.

That is, given a browser that supports web-fonts. Even IE does, but I'd have to do something slightly special to support IE which I haven't yet. Opera and Chrome should, but I don't know about Safari. Firefox 3.5 is what I'm using anyway. This paragraph is in LetsTrace

Two problems that I've encountered so far include

  • font size. Un Dinaru is normally a 1MB-big font. That's as large as many high-resolution photos! That's a big file for people to have download (and for my server to serve) and that could get expensive in time and bandwidth. Thankfully, http://fonts.philip.html5.org/ exists, which offers a bunch of fonts for which it will generate a trimmed down version including only the characters you care about. Un Dinaru wasn't one of them, so I had to download the service's source code and generate a trimmed-down version for myself. The page lets you click on an example of the font you want to use, type the characters (or all the text) you want to use in that font, and lets you download the resulting trimmed down file, which you'd have to host yourself on your own server. It also gives you the HTML and CSS code you'd want to use to actually use the font.
  • cross-domain access. Mentioned briefly above, browsers won't load a font-file from a domain that is not your own. I'm having issues with a blogspot blog in trying to use webfonts hosted here at kosmokaryote, since one is blogspot.com and the other is kosmokaryote.org. Grr. It makes sense, preventing people from leeching off larger fonts hosted on your server. (It doesn't really help prevent copyright violations, since you still need to be able to download the font via your browser (just in the background) to see it anyway, so you can keep it around and abuse it if you like, though you should not like!) There is at least one good way around it, which is to allow specific domains to access things on your server side. Sadly, I can't easily do that on kosmokaryote.org right now, but I've contacted the hosting provider to see if he can enable the module I need :) More details at: http://openfontlibrary.org/wiki/Web_Font_linking_and_Cross-Origin_Resource_Sharing

Really, I wish Mozilla would have offered some error message or warning that it couldn't load the fonts; it took me a long while to discover why I couldn't see fonts hosted at kosmokaryote.org on blogspot.com. Ah well.

2009-07-22

Google Contacts error handling

Wahoo! That was quick. I found a small bug in Evolution (mail/calendar/tasks), did a bunch of investigation for it, reported it, and then it was fixed within a couple hours! Milan Crha sure has some energy.

Linux still sucks :(

Things that crash more than I remember:

  • X server
  • Firefox
  • Eye of GNOME (simple image viewer)

Things that still crash more than I'd like:

  • Evolution (mail, calendaring, contacts)

Things that crash less than I'm used to:

  • Totem (which doesn't help much, since their codecs feel too inefficient to watch anything full screen)

Several reasons I cannot in good conscience recommend Linux desktops to people.

git 'er dun

I'm not sure why, but git as a version control system feels so easy to use and so cryptic too.

I got an error message when trying to resync gitorious.org/libgdata-picasaweb today,

! [rejected] master -> master (non-fast forward)

But thankfully, googling for git usually turns up the answer. Thank you Junio C Hamano.

2009-07-20

My imagery is nothing like Picasso's

 
Icarus: the desktop PicasaWeb browser
Why?  Simply to exercise libgdata's PicasaWeb support, not to really be used in place of the web interface.
It caches file and lets you successfully upload files now.  It has discovered a few issues with libgdata's PicasaWeb support (which I'm partially to blame for) and I've file and helped fix one problem so far.  Yay PicasaWeb!

Ah, yes. THAT button.

TA: I click this button and... nothing happened?
Me: Yah, it doesn't do anything.
TA: Ah, yes.

2009-07-18

EvoAqua?


I decided that I actually really do want the functionality sooner than later, though I'm not currently interested enough to run Tracker from git to write that metadata registrar.  (Honestly, I don't really use Evolution or Tracker at all as they generally get in the way.)  I am already running mail-notification so I thought that perhaps I could add it as a feature there.  Despite a test release of gob2 2.0.16, I still cannot get mail-notification .gob files to parse/compile properly.  (Yes, I had separately tried applying the relevant mailing list patches.)  So, that was a disaster.  But you know what did work?  ... patching notification-daemon!  I wrote a really ugly prototypy patch to just see if it would work or work well, and it does, more or less.


In this case, mail-notification uses libnotify(right?) to send notices to notification-daemon which then publishes them in a notification bubble.  Other pieces of software use this, too, and I believe Pidgin can use it via a plugin.  The current "patch" I wrote is a couple dozen lines in daemon.c's notify_daemon_notify_handler() to read aloud whatever notice it got.  It's just a terrible hack right now.  I even added a small function to strip the XML elements off of the notice, since I dislike hearing Speech Dispatcher reading markup.  However, this might be a good place to add some generic notice-speaking code.  Add a speech.c file and add a couple options; things could be nice.  It would mean that IMAqua might be less necessary, too.  Of course, there are some cooler things I can do when writing a plugin or a patch for an application itself instead of relying on reading its notification-bubble text, but the latter might be sufficient in some cases, especially those where I don't want to try to write a plugin or patch :)  It might also prove more generic :)


G'night

Developer Accessibility


EvoAqua (temporary vanity name for my mail speech-notification project) will probably be on hold for a little while.  I was going to integrate it into Evolution as an EPlugin, but besides being terribly ugly, they don't see to export a message's subject or sender information.  (Bug 588843.)  A better solution might be available soon that involves becoming a registrar that listens to DBus for mail notifications from more apps than just Evolution.  See http://live.gnome.org/Evolution/Metadata for more information.  It's on hold because, for that metadata, an EPlugin was written for tracker that will sit in Evolution to export it.  Then, I can listen to and grab it and do with it what I will.   Yay.


I'll note that documentation is a bit frustrating.  Everyone agrees that it needs to be better and that there needs to be more of it.  In Open Source, I'm welcome to jump in and help.  However, I and most other people already have many time sinks, and documentation is never as trivial to write as some calls for it make it sound.  You don't want to write ill-informed documentation.  That just doesn't help that much.  Trying to figure out how to write a simple EPlugin was painful, because I had to read a somewhat "comprehensive" though at times incomplete manual to EPlugin: http://projects.gnome.org/evolution/developer-doc/eplugin/.  It leaves me dangling on the edge of a bunch of theories that build up and cram up in my brain, trying to find concrete instantiation in an example to see how they actually apply.  In the end, it was useful, but it felt like it could have been much simpler.  I recall recently following the also-incomplete Pidgin documentation for writing a plug-in and having a much more pleasant experience.


I know I should also look at how other plugins are written, but they of course end up being rather large making it difficult to separate out the parts that are actually relevant to me.  In the end, it feels like I should learn much more about a system than I should need to to write a relatively small 100 line plugin.  Understanding the system I'm writing in is important, but some documentation and examples end up making that understanding much more expensive than it needs to be.


Official DBus GLib documentation is also incomplete.  Examples of usage online was somewhat helpful, but it largely pales in comparison to the informative capacity of something like Java's documentation.


So, I know it's expensive for the developer to invest a lot of time into the documentation; especially when they don't know how much of it will be used.  However, you have to wonder how many contributions or users of a framework are lost to people feeling put off by the guess-work they have to do.  I don't have a difficult time trying to think of why Maemo would switch toolkits (a massive change, isn't it?) from GTK+ to Qt.  (Though, I'm sure Hildon's redundancies didn't help.)  I cringe everytime I see people advertise certain frameworks or toolkits for other developers to come and use.  Yes, I like these very systems that I complain about right now, but their accessibility (by developers, not a11y) and polish are not yet something I'd want to market.  I hope it's not something systemic to Open Source.  Ugh.

2009-07-16

icarus

http://gitorious.org/icarus

The source code for Icarus is now available.

I'll note again that Icarus is a test application to exercise the libgdata support for PicasaWeb.   It's also good practise for me to do things like non-blocking network IO and learn how to use GtkTreeView (ugh) and GtkBuilder (not quite as ugh, but it could be so much more!.

Cheers!

2009-07-14

PicasaWeb, libgdata, and fun

The other month, I contributed a chunk of code to libgdata to access PicasaWeb.  Peter Withnall was cool and eventually polished it and integrated.  Yay.

For the last 2.5 days, I've been writing a test programme to exercise the resultant libgdata picasaweb API.  The first day, I struggled with GtkBuilder and GtkTreeView, the former just lacks a bit of polish and the latter just excels in sadism.  However, by the end of it, I had a working album/photo browser... for my local file system. 

Yesterday I didn't get to work on it too much, though I did cure it's disgusting memory hole.  (I need to learn about memory handling with GObjects and when it's appropriate to unref things :).  However, this afternoon, I got it hooked up to libgdata and replaced the local filesystem code with the libgdata picasaweb API.  Yay!

I'll upload the code to gitorious after kendo practise this evening.

Why am I interested in PicasaWeb?  It's my primary photo storage location (though it's free storage is woefully small) and I previously wrote a libsoup-heavy uploader to it, for which I wrote a plugin for Eye of GNOME and for which I wrote a Nautilus Action script.  However, it wasn't in any state to really share, and its HTTP-based PicasaWeb API-accessing code wasn't very general.  libgdata was something I had hoped to find when I started writing the above uploader and plugins, since I had wanted to write them in Vala which can easily use C libraries. 

Anyway, once I exercise the API quite a bit, I'll switch to writing some useful plugins for F-Spot, Eye of GNOME, etc. again.  Yay.

2009-07-10

BellAqua released!

A record time for development, no doubt!

Actually, this is just the prototype.

BellAqua's purpose is to announce aloud the hour on the hour, like some feature I heard on a friend's computer once.  I hope to write a trivial GNOME Panel applet for this, which is definitely overkill. Here's the prototype though:


#!/bin/sh 

# by Richard Schwarting (aquarichy  gmail  com);
# 2009/07/10
# http://www.kosmokaryote.org

function calc_period {
    CURMIN=`date '+%M'`
    CURSEC=`date '+%S'`

    # I should learn how to calc things in the shell properly 
    export WAITSEC=`echo "(60 - ${CURMIN})*60 - ${CURSEC}" | bc`
}

echo `date`
while true; do
    calc_period;
    echo "waiting ${WAITSEC} second until next hour";
    sleep ${WAITSEC};
    CURHOUR=`date '+%l'`; # it should be hard to arrive here *before* the hour # %k for 24-hour, %l for 12-hour 
    spd-say "It is ${CURHOUR} o'clock";
    echo `date`;
done;

I'm not very good at bash shell scripting, so this could break a bunch of times, and might say the wrong hour, but I don't think it will (I reckon I'll probably over sleep instead!  Or, at least I hope this programme is as lazy as me).

It's GPL2 of course.

To use it, save to a file, run with bash, and forget.  You might consider setting it to run when you start, using System > Preferences > Startup Programmes (or whatever it's called in the English localisation) or however you like.

IMAqua source release

Hello.

If you use Pidgin for Instant Messenging and a system that supports the Speech Dispatcher library for speech output (i.e. a Linux system),  then IMAqua might be for you!

http://gitorious.org/imaqua

As the previous post notes, it will announce aloud the author of incoming messages and, optionally, the message's content.  You can choose which voice to use out of those your voice engine supports.  (That is, Speech Dispatcher can use Festival or others which offer different voices, and you can pick which voice!)  Also, it will by default only speak when you're not actively at your computer (when your status is not set to available).  This can be changed, so as to always announce them.  Let me know how it works for you.

If you need help building it for your system, please let me know, and I will try to package it for you.

Cheers,
  Richard

P.S.  Windows users might enjoy Audible Alerts which uses eSpeak directly.

IMAqua

IMAqua is underway!

I know, it doesn't make any sense.  It should probably be "Telegraham" or something.  But my name's not Graham, it's Aqua. 

Anyway, it's a plugin for Pidgin which will announce a message's author and content, like Rhythmbox's DJAqua announces a track's title and artist.

However, IMAqua is already more complete, with preferences!  If you use Pidgin and are interested in the plugin, but I haven't posted the source yet, just e-mail me (front page) and bug me to hurry up. 

Cheers,
  Richard

2009-07-09

Fixing commenting, finally

Hello.

Once upon a time, comments worked on this page.

Then, a friend complained a couple times that commenting didn't work for him.  At the time, when I would test it, it would sort of work for me, and so I wouldn't invest the time to fix it. 

Well, after trying to post a comment myself to my own post for 15 minutes, losing my text repeatedly, I have finally realised how annoying and painful that must be to try to leave a comment and have it just TOTALLY DISAPPEAR FOR NO APPARENT REASON.

Thus, a pop-up window for comments should now pop-up, and it should work.  If it doesn't, please write me.  (My e-mail is on the front page.)

Cheers,
  The Proprietor

DJAqua RPM

If you use Linux and the music jukebox Rhythmbox, here is DJ Aqua, a plugin that will announce the artist and title of a track before and after it plays. It uses Speech Dispatcher for speech, so a working installation of that will be necessary.
UPDATE:

If you have installed Speech Dispatcher and you don't hear anything from DJAqua or when running spd-say on the command-line, perhaps it is not able to output sound in your session.

If it connects to alsa at system startup, or if speech-dispatcher isn't setup to run by default (like on Fedora 11) you might want to do this
  • Set 'AudioOutputMethod "pulse"' in /etc/speech-dispatcher/speechd.conf (the line should exist with alsa instead of pulse, and it might be commented out)
  • Create a Startup Applications (System > Preferences) entry with the command speech-dispatcher -d -P /tmp/sd.pid for your session.
 Then, when you login, speech-dispatcher will start and try to connect to the running pulseaudio daemon, which will be the one for your session.  Try spd-say again, and if it works, then so should rhythmbox's DJ Aqua.

2009-07-08

The Future Is Nigh

The National Student Loans Services Centre (NSLSC) and the Ontario Student Assistance Program (OSAP) in Canada are a bit strange on the web. They're migrating like much of the world to more electronic, web-based services. I think these types of services are amazing when done well and done right. Very often, you see them done poorly. Apparently, one of my banks won an award once for their sites' usability, but it and another have always been painful for me to use. In contrast, the bank I use in New Zealand has an amazing website. It's like they considered contracting out to a normal firm that could be relied upon to be well-versed in creating terrible websites, but instead they let the geek on floor 12 do it. Business-class professionals create some of the worst websites you'll ever use. Especially for banks.

The NSLSC and OSAP websites aren't horrible like some (all?) Canadian bank websites. They're not quite as amazing as at least the one NZ bank website. They're more "in transition", and that's the weird part.

To modify the terms of my repayment, I can go online and ... generate a PDF with my new repayment terms on it, which I then need to print and mail or fax to them... what? Why can I not simply change them online? Is it this fetish with inked signatures that the world still carries? I have a tablet PC, you see. I once signed an important document digitally and returned a "scanned" version of it, though I never actually printed it. Instead, e-mail attachment -> PDF -> PNG -> PDF -> e-mail attachment. The receiver was alright with it, though it was unusual. A small glimpse of That Better Time.

And likewise, I had recently made an application for a loan via OSAP which I had to cancel to-day (due to cost-cutting measures undergone by the NZ government). You can usually cancel applications in progress from the web UI, but once submitted, you now have to telephone them to do so. I'm not quite sure the reason, why. After sitting through over a minute of menus (one of the phone's many failings (note: the web and phone will merge at some point)) and about 3 minutes of hold muzak, I spoke for 20 seconds with a lady.

Me: "I'd like to cancel a loan application."
Her: "What is your name and date of birth?"
Me: "<insert relatively public information here>"
Her: "For <insert University name here>"
Me: "Yes."
Her: "Alright, you should see the change online in the next couple of days."
Me: "Thank you.  Good bye."

What was the reason this? Is it just so I can confirm some relatively public information? Is it a small degree of reduced liability or that courteous "thank you" at the end that makes them sleep better at night?

So, it's almost there. Now, if only universities, governments, and student assistance programmes didn't also didn't form a cyclic graph sometimes. I'm sure things get better, despite the porcupines.

2009-07-03

A Quick Break Point

Due to issues with the remote work situation and the limitations of my contract, I've left my job which I've had for the last year on positive terms.   Now that I'm in New Zealand and with a lot of free time, what will I do?  I'm contemplating school.  Once upon a time, up until June 9th, 2009, German citizens (yay, me?) qualified for domestic tuition rates for Masters here.  That was until June 9th.  The government decided that the additional students that might draw were not worth the reduced tuition income, and have opted to cancel.   So, I am now contemplating school a little less.  Too many options now :)

While working, there's been a lot of fun and important work postponed due to time constraints, so I've started tackling that now.  There's a bunch of new bugs in Redhat and GNOME's bugzilla now filed.  I've cleared out some reading queues and cleaned up my inbox.  A large foreboding mountain of papers to my right has been re-organised and some of it dealt with.  Progress!

DJAqua

My Rhythmbox plugin, DJAqua, that announces a track's artist and title before and after play has had an annoying bug for a while: it froze Rhythmbox.  I've now narrowed down the cause to Speech Dispatcher's involvement.  It's only when functions passed to Speech Dispatcher as callbacks try to adjust Rhythmbox's volume that Rhythmbox freezes.  Python threading issues?  I'm not quite sure.  I've come up with a slightly less ideal solution, though.  I still want Rhythmbox's volume to lower when Speech Dispatcher is reading out the text for the track's artist and title, and for it to be restored afterwards.  Unable to rely on Speech Dispatcher's callbacks when speech begins (to lower) and ends (to restore the volume), I now lower it when I send the command to speak, and schedule the restoration with an estimate of how long the announcement will take. 

Here's part of the neat part.  Originally, I was just going to guess it would take 6 or 7 seconds (based on informal timings) to read it out, but that really won't work when the title and artist are longer than usual or shorter than usual.  So, I did the intelligent thing.  I collected some sample data on how long it took for 11 random samples to be spoken, and how many characters were in those samples.  I then analysed the number of characters per second and found that the average was consistently around 15 with a few outliers.  So, now it expects the speech to take (# of characters to be spoken / 15) seconds, and it works very well.  Yay.  This lets me ignore Speech Dispatcher's other race condition which sometimes prevents the callback from being called when speech begins.

I've filed a bug with Redhat for the issue of Begin not being emitted, and a bug with GNOME for Rhythmbox's UI freezing due to the plugin:
I know I need to pursue this better with Speech Dispatcher.  I wrote them about the first bug and they are vaguely aware of the problem but didn't have a solution at the time.  Then I disappeared due to work business.

So, yah, now DJAqua doesn't freeze.  If you want to hear what track is playing and its artist, and you have a working installation of Speech Dispatcher (in Fedora 10, I had a bunch of other issues that don't seem to be problems in Fedora 11, regarding Pulse Audio and stuff), please try it out.  I actually have to move the new code to its gitorious repository, ah well.


Phone Number Portability

Having grown up with super-portable e-mail addresses, the fragile connection between a mailing address and a phone number to a person seems utterly ridiculous to me.  Clearly, people should specify that mail should go to me and not some building, and that a phone call should to me and not some randomly assigned phone number. 

Consequently, I use my father's mailing address all the time.  It adds almost a week or two of latency for a lot of mail, but it ensures it will get to me now and in the future.  As a co-op student, I moved way too much to keep track of who has what address and to try to update them all.  Regarding phone numbers, I've been grateful to have my Vonage phone number for so long.  Of course, it fails in being regional to Guelph, but that's alright for me.  I end up getting a local number wherever I go, but that's often split with others, so the cost isn't doubled. 

The future will be better.

For example, people in the future won't, when moving into a new home, end up with a recycled phone number that once belonged to an automotive shop, who continues to receive daily calls to the number.  Internet listings are in part to blame, particularly ones to which you cannot contact to request the now residential number be removed :(  Hehe. 

Celebration of Freedom

While my work was not slave labour (though the remote work environment, given the time difference, left me feeling isolated as though I lived in a closet), it is always pleasant to celebrate change and free time.   Of course, with unemployment comes economy, so homemade cupcakes and half-price arcade fun it was!  I have my girlfriend to thank for both.  Hurrah for her!

The influx of self-directed time has led me to review all my pending goals and tasks, to reorganise them and to start milling through them.  Some are as common as "Clean this room!"  or "Pad the doorway to prevent the slamming noise".  Others are "save the world" and "figure out what I want to do for the next year, the next three years, where I want to be, the value of people and time with them, etc.  I sometimes wish I had a wise sensei like Splinter from Teenage Mutant Ninja Turtles or Enho from The Twelve Kingdoms to offer some advice. 

Debugging, problem solving, and mail notification

Mail Notification by Jean-Yves Lefort has a bug.  I reported it a couple years ago, but it remains.  The CPU seemingly random takes 100% while it continually claims it cannot connect to the IMAP server, which is true, but I don't know why.  It is probably triggered when I resume from suspend, or when I am disconnected and reconnect, or when the hour turns.  I don't know. 

I don't really know how to debug the 100% CPU activity.  I'm going between ltrace, sysprof, and gdb and learning a bit about each.  I think I'd really like to use Linux Trace Toolkit, but it's not as trivial to setup, it seems, requiring a kernel patch.  Or maybe I'm just confused.  Anyway, whenever it comes out, I quickly quit what I'm doing and think about how I can figure out what's going on.  I am sure victory is within my grasp.


Blog Archive

About Me

My Photo
Richard Schwarting
I am a simple star hidden in the night sky.
View my complete profile