Title: Page 99 – Alex Kirk

---

 * 
   ## 󠀁[trac Report for Feature Voting](https://alex.kirk.at/2011/01/27/trac-report-for-feature-voting/)󠁿
   
 * January 27, 2011
 * I use [trac](http://trac.edgewall.org/) for quite a few projects of mine. Recently
   I tried to find a plugin for deciding which features to implement next. Usually
   [trac hacks](http://www.trac-hacks.org/) has something in store for that, but
   not this time.
 * I wanted to be able to create a ticket and then collect user feedback as comments
   for the feature, with each piece of feedback being a vote for that feature, like
   this:
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2011/01/report.png "report")
 * After searching for a bit I came up with a solution by using just a report with
   a nicely constructed SQL query.
 *     ```
       SELECT p.value AS __color__,
          t.type AS `type`, id AS ticket, count(tc.ticket) as votes, summary, component, version, milestone,
          t.time AS created,
          changetime AS _changetime, description AS _description,
          reporter AS _reporter
         FROM ticket t, ticket_change tc, enum p
         WHERE t.status <> 'closed'
       AND tc.ticket = t.id and tc.field = 'comment' and tc.newvalue like '%#vote%'
       AND p.name = t.priority AND p.type = 'priority'
       GROUP BY id, summary, component, version, milestone, t.type, owner, t.time,
         changetime, description, reporter, p.value, status
       HAVING count(tc.ticket) >= 1
        ORDER BY votes DESC, milestone, t.type, t.time
       ```
   
 * So just by including “#vote” in a comment, it would count towards the number 
   of votes. You can change this text to anything you want, of course. For example
   like this:
 * ![](https://alex.kirk.at/wp-content/uploads/sites/2/2011/01/vote-comments.png"
   vote-comments")
 * I hope this can be useful for someone else, too.
 * [Code](https://alex.kirk.at/category/code/), [Projects](https://alex.kirk.at/category/projects/)
 * 
   ## 󠀁[iOS 2011 Alarm Clock Bug](https://alex.kirk.at/2011/01/11/ios-2011-alarm-clock-bug/)󠁿
   
 * January 11, 2011
 * Just to add to the speculation about the causes of the [2011 alarm clock bug of iOS](http://www.macworld.com/article/156793/2011/01/ios_alarm.html)
   where the one-time alarms would not activate on January 1 and January 2, 2011.
 * My guess is that the code that sets off the alarm takes day, month and year into
   account when checking whether the alarm should go off. But **instead of using
   the “normal” year**, an [ISO-8601 year](http://en.factolex.com/ISO_week_date)
   could have been used. This type of year is **calculated by the number of the 
   week** (with Monday as the first day of the week), thus for the week 52 (from
   December 27, 2010 to January 2, 2011) the respective year **remains 2010**.
 * When setting the date to January 1, 2012, the alarm doesn’t go off as well (week
   52 of 2011). This adds to my theory and also means that this hasn’t been a one-
   time issue and requires a bug fix by Apple.
 * [Code](https://alex.kirk.at/category/code/), [Observations](https://alex.kirk.at/category/observations/)

 [Previous Page](https://alex.kirk.at/page/98/?output_format=md&term_id=1122) [Next Page](https://alex.kirk.at/page/100/?output_format=md&term_id=1122)