Vitavonni

Wed, 21 Feb 2007

Rauchfrei in München

Auf der Suche nach einem rauchfreien Lokal für unseren Stammtisch, habe ich folgende Listen gefunden:

Muenchen.de Cafes, Muenchen.de Restaurants

Belair-Muenchen.de

NI-muenchen.de

Mein Blog hat (absichtlich) keine Kommentarfunktion. Wenn ihr Empfehlungen habt (insbesondere sollte es nicht zu "übertrieben elegant"/ elitär sein, gemnütlich und keinesfalls laut - wir wollen uns unterhalten können ohne nacher heiser zu sein...), schickt sie mir doch per Mail (erich AT debian DOT org) oder meldet sie bei den oben genannten Seiten.

Ich hoffe ja, dass das Gesetz wirklich gemacht wird (und nicht im letzten Moment zwecks Populismus alles nur wischiwaschi), und die Suche so bald erheblich einfacher wird... sonst sind halt weiterhin WG- und Wohnheim-Treffen die bevorzugte Lösung.

[category: /de/muenchen | Permalink]

Dojo WTF?

From Dojo Toolkit (a very powerful AJAX toolkit), but should probably go to The Daily WTF...

_getAdjustedDay: function(/*Date*/dateObj)
  //summary: used to adjust date.getDay() values to the new values based on the current first day of the week value
  var days = [0,1,2,3,4,5,6];
  if(this.weekStartsOn>0){
    for(var i=0;i<this.weekStartsOn;i++){
      days.unshift(days.pop());
    }
  }
  return days[dateObj.getDay()]; // Number: 0..6 where 0=Sunday
}
That code is inefficient and stupid on so many levels. For example the if statement... you might be aware that 0 < 0 is false.

Yep. I'd prefer something along the lines of

  return (dateObj.getDay() - this.weekStartsOn) % 7;
No arrays were abused during the making of this function.

I always thought PHP programmers were the worst, but apparently some JavaScript "coderz" are up to par.

[category: /en/xml | Permalink]

Sending notifications from Python

I've been using Python to automate some tasks. A common thing with automation is to somehow notify yourself when it's completed.

Here's an elegant way to do that in Python (at least for GNOME users):

#!/usr/bin/python
import dbus
sesbus = dbus.SessionBus()
notify_obj = sesbus.get_object('org.freedesktop.Notifications',
                              '/org/freedesktop/Notifications')
notify_if = dbus.Interface(notify_obj, 'org.freedesktop.Notifications')
notify_if.Notify('HelloWorld',0,'','Summary','Body',[],{},-1)

For details, see pydoc dbus and the Notification Daemon API.

[category: /en/linux | Permalink]
Menu
[planet.debian]
[planet.xmlhack]
[planet SELinux]
[munichblogs]
[email]
[RSS 2 feed]
[English RSS 2]
Categories
< February 2007 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728   
Archives
2010-Mar
2010-Feb
2010-Jan
2009-Dec
2009-Nov
2009-Oct
2009-Sep
2009-Aug
2009-Jul
2009-Jun
2009-May
2009-Apr
2009-Mar
2009-Feb
2009-Jan
2008-Dec
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
Other links:
Swing and the City - Lindy Hop in Munich