Notes

Emacs 26.1: secret-search-items bug: dbus-call-method: (wrong-type-argument consp "host") [workaround]

Bug has been reported and fixed.

My emacs version:

GNU Emacs 26.1

My smtpmail is configured to use secrets, resulting in the following call:

(secrets-search-items "Default" :host "myhost" :port "587" :user
"myuser")

Since the 26.1 upgrade this resulted in:

Debugger entered--Lisp error: (wrong-type-argument consp "host")
dbus-message-internal(1 :session "org.freedesktop.secrets"
"/org/freedesktop/secrets/collection/Default"
"org.freedesktop.Secret.Collection" "SearchItems"
dbus-call-method-handler (:array :dict-entry "host" "myhost" :dict-entry
"port" "587" :dict-entry "user" "myuser")) apply(dbus-message-internal 1
:session "org.freedesktop.secrets"
"/org/freedesktop/secrets/collection/Default"
"org.freedesktop.Secret.Collection" "SearchItems"
dbus-call-method-handler (:array :dict-entry "host" "myhost" :dict-entry
"port" "587" :dict-entry "user" "myuser")) dbus-call-method(:session
"org.freedesktop.secrets" "/org/freedesktop/secrets/collection/Default"
"org.freedesktop.Secret.Collection" "SearchItems" (:array :dict-entry
"host" "myhost" :dict-entry "port" "587" :dict-entry "user" "myuser"))
secrets-search-items("Default" :host "myhost" :port "587" :user
"myuser")

dbus-call-method expects arrays with dict-entries to provide a cons:

A dictionary entry must be element of an array, and it must contain only a key-value pair of two elements, with a basic D-Bus type key.

So in this example, dbus-call-method expects

'(:array :dict-entry ("host" "myhost"))

rather than

'(:array :dict-entry "host" "myhost")

secret-search-items builds this list incorrectly:

(defun secrets-search-items (collection &rest attributes)
  "Search items in COLLECTION with ATTRIBUTES.
ATTRIBUTES are key-value pairs.  The keys are keyword symbols,
starting with a colon.  Example:

  (secrets-search-items \"Tramp collection\" :user \"joe\")

The object labels of the found items are returned as list."
  (let ((collection-path (secrets-unlock-collection collection))
    result props)
    (unless (secrets-empty-path collection-path)
      ;; Create attributes list.
      (while (consp (cdr attributes))
    (unless (keywordp (car attributes))
      (error 'wrong-type-argument (car attributes)))
        (unless (stringp (cadr attributes))
          (error 'wrong-type-argument (cadr attributes)))
    (setq props (append
             props
             (list :dict-entry
                        ;; FIXME ------------------
               (substring (symbol-name (car attributes)) 1)
               (cadr attributes)))
          attributes (cddr attributes)))
      ;; Search.  The result is a list of object paths.
      (setq result
        (dbus-call-method
         :session secrets-service collection-path
         secrets-interface-collection "SearchItems"
         (if props
         (cons :array props)
           '(:array :signature "{ss}"))))
      ;; Return the found items.
      (mapcar
       (lambda (item-path) (secrets-get-item-property item-path "Label"))
           result))))

Let's fix this function so that it constructs arguments using list:

(defun secrets-search-items (collection &rest attributes)
  "Search items in COLLECTION with ATTRIBUTES.
ATTRIBUTES are key-value pairs.  The keys are keyword symbols,
starting with a colon.  Example:

  (secrets-search-items \"Tramp collection\" :user \"joe\")

The object labels of the found items are returned as list."
  (let ((collection-path (secrets-unlock-collection collection))
    result props)
    (unless (secrets-empty-path collection-path)
      ;; Create attributes list.
      (while (consp (cdr attributes))
    (unless (keywordp (car attributes))
      (error 'wrong-type-argument (car attributes)))
        (unless (stringp (cadr attributes))
          (error 'wrong-type-argument (cadr attributes)))
    (setq props (append
             props
             (list :dict-entry
                   ;; HACK fixed so that dict entries are conses
                   (list
                    (substring (symbol-name (car attributes)) 1)
                    (cadr attributes))))
          attributes (cddr attributes)))
      (prin1 props)
      ;; Search.  The result is a list of object paths.
      (setq result
        (dbus-call-method
         :session secrets-service collection-path
         secrets-interface-collection "SearchItems"
         (if props
         (cons :array props)
           '(:array :signature "{ss}"))))
      ;; Return the found items.
      (mapcar
       (lambda (item-path) (secrets-get-item-property item-path "Label"))
       result))))

Or as define-advice so that we can easily hotfix:

(define-advice secrets-search-items (:override (collection &rest attributes) my-secrets-search-fixed)
  "Fix cons building in dbus-call-method call"
  (let ((collection-path (secrets-unlock-collection collection))
        result props)
    (unless (secrets-empty-path collection-path)
      ;; Create attributes list.
      (while (consp (cdr attributes))
        (unless (keywordp (car attributes))
          (error 'wrong-type-argument (car attributes)))
        (unless (stringp (cadr attributes))
          (error 'wrong-type-argument (cadr attributes)))
        (setq props (append
                     props
                     (list :dict-entry
                           (substring (symbol-name (car attributes)) 1)
                           (cadr attributes)))
              attributes (cddr attributes)))
      ;; Search.  The result is a list of object paths.
      (setq result
            (dbus-call-method
             :session secrets-service collection-path
             secrets-interface-collection "SearchItems"
             (if props
                 (cons :array props)
               '(:array :signature "{ss}"))))
      ;; Return the found items.
      (mapcar
       (lambda (item-path) (secrets-get-item-property item-path "Label"))
       result))))

Questions

Exporting Data from ColorNote Android

First: If you’re googling this because you think about using ColorNote: don’t! It does not support exporting your data to a free format. You have to jump through internal hoops to get it back.

If however you have used it in the past, here is how to liberate your data:

  1. Install the android sdk so that you have adb
  2. Enable adb debugging on your device
  3. Connect to your device:
    1. Connect phone via usb cable
    2. Switch to usb mode (in case you were debugging over network before): adb usb
    3. Check if your device appears in the list: adb devices
  4. Backup ColorNote app data to ./backup.ab, i.e. run: adb backup -noapk com.socialnmobile.dictapps.notepad.color.note
  5. extract the file: dd if=backup.ab bs=1 skip=24 | python2 -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))"= | tar -xvf -
  6. Open databases/colornote.db in something like SQLite Browser
  7. List all the notes: SELECT datetime(created_date/1000,'unixepoch') as created, datetime(modified_date/1000,'unixepoch') as modified,note FROM notes ORDER BY created
  8. Export as CSV
  9. Try this script to convert to org-mode headlines

Caveats:

Instructions based on http://android.stackexchange.com/a/92756 and http://stackoverflow.com/a/17876731.

RSS Feeds for Ebay Searches

Append &_rss=1 to any Ebay search to get an RSS feed for that search [source]. Works with ebay.de, but does not seem to reflect country/international settings, so it might be useless.

About Shoes

Some thoughts/experience with shoes

Note: I am not a cobbler, this is from my experience only and mostly trivial.

Buying Guidelines

Sizing

Shoe care

Wearing Shoes

Shoelace lengths

In case you need to replace your shoelaces:

k1x Cali
120 cm
Boxfresh Eavis
110 cm
Hanwag Waxenstein Bio
170 cm

Computer Graphics Conferences: Paper Deadlines

Here’s my collection of important computer graphics conference’s deadlines for org-mode. Dates in the future are just shifted by one year from the last conference, so make sure to double-check dates.

* Conference Deadlines
** SIGGRAPH Papers Deadline
DEADLINE: <2017-01-20 Fri -2m ++1y>

** Computer Graphics International Papers Deadline
DEADLINE: <2017-02-14 Tue -2m ++1y>

** EGPGV Papers Deadline
DEADLINE: <2017-02-19 Sun -2m ++1y>

** EGSR Papers Deadline

DEADLINE: <2016-04-01 Fri 00:00 -2m ++1y>

*** Abstract Deadline
DEADLINE: <2016-03-28 Mon 23:59 -2m ++1y>


** HPG papers deadline
DEADLINE: <2017-04-04 Tue 23:59 -2m ++1y>

*** Notification of paper acceptance
<2016-05-12 Thu>

*** Revised papers due
<2016-05-23 Mon>


** Pacific Graphics Papers Deadline
DEADLINE: <2017-06-03 Sat -2m ++1y>

** SIGGRAPH Asia Papers Deadline
DEADLINE: <2017-06-02 Fri -2m ++1y>

** VMV Papers Deadline
DEADLINE: <2017-06-20 Mon -2m ++1y>

** TODO EG Papers Deadline
DEADLINE: <2016-10-14 Fri -2m ++1y>

*** TODO Abstract Deadline
DEADLINE: <2017-10-07 Sat -1w ++1y>

** TODO I3D Papers Deadline
DEADLINE: <2016-10-21 Fri -2m ++1y>