40
I Use This!
Inactive

News

Analyzed 9 days ago. based on code collected almost 5 years ago.
Posted about 16 years ago
In XMMS2, the coding guidelines require you to use a mix of tabs and spaces to indent code: tabs indent blocks, while spaces are used to align multi-line statements. It’s all very natural really: [tab][tab][tab]foo_function (arg1, [tab][tab][tab] ... [More] arg2, [tab][tab][tab] arg3) Unfortunately, if you use the default C indentation mode in emacs, what you get (when breaking like with C-j or RET TAB) is the following: [tab][tab][tab]foo_function (arg1, [tab][tab][tab][tab][tab] arg2, [tab][tab][tab][tab][tab] arg3) So you mean to tweak the code yourself to fix the tabs. Tedious, annoying. We know better! I wrote a hook to fix this. The idea is to fix tabs when we’re in an argument list context. It can probably be further improved (please send patches!), but it’s quite useful already. Just add the following to your .emacs file. (defun xmms2-c-mode ()   "C mode with adjusted defaults for use with the xmms2."   (interactive)   (c-mode)   (c-set-style "K&R")   (setq tab-width 4)   (setq indent-tabs-mode t)   (setq c-basic-offset 4)   ; Align closing paren with opening paren   (c-set-offset ‘arglist-close ‘c-lineup-arglist-intro-after-paren)   (add-hook ‘c-special-indent-hook ’smart-tab-indent-hook)) (defun get-nonempty-context ()   (let ((curr-context (car (c-guess-basic-syntax))))     (if (or (eq (car curr-context) ‘arglist-intro)             (eq (car curr-context) ‘arglist-cont)             (eq (car curr-context) ‘arglist-cont-nonempty)             (eq (car curr-context) ‘arglist-close))         curr-context       nil))) (defun smart-tab-indent-hook ()   "Fixes indentation to pad with spaces in arglists."   (let ((nonempty-ctx (get-nonempty-context)))     (if nonempty-ctx         (let ((tabbed-columns ( (point-at-bol)                                  (/ (c-langelem-col nonempty-ctx t)                                     tab-width)))               (orig-column (current-column)))           (tabify (point-at-bol) tabbed-columns)           (untabify tabbed-columns (point-at-eol))           ; editing tabs screws the pointer position           (move-to-column orig-column))))) Note: don’t forget the c-set-offset bit, else it won’t work properly for the last argument before the closing parenthesis. And avoid using c-indent-new-comment-line to break lines, it can fail with this hook; use c-context-line-break instead, it’s smarter anyway! [Less]
Posted about 16 years ago by [email protected] (Tobias Rundström)
As you might or might know I resigned from my position at Procera Networks in the end of 2008. My new position will be at a company called Purple Scout, where I will lead a small team of developers and develop processes and infrastructure for ... [More] in-house development work. Between my two positions I have managed to scrape together almost a month of spare time. While most of this time has been spent with family for holiday celebrations I have also spent quite some time researching GTD (Getting Things Done). I have decided to decided to try to implement this full out at my new position.I will spend some posts in the blog about my way to implement this methodology. I will not try to explain all the finer details about GTD, this is explained in numerous sites around the internet. I will just described my attempts on implementing it. So far I haven't really implemented it fully, but this is the steps I have done so far.I read the book and I don't think there is a short cut around that, just read it. Also listen to the 43 folders podcast with David Allen interviews. They give you a lot of practical tips.I have been using Things for a long time, both for my Mac and for my iPhone, but I have never really got around to learn how to use it correctly, the pieces was falling in to place when I started to read the Getting things done book, more about that one later.First thing I really implemented was the Inbox Zero mail handling. I have two mail accounts, one for my work and one personal GMail account.I read my work email with Mail.app and I started off by changing the settings for getting emails in Mail.app, instead of polling email every 5th minute it's now polling every hour. I also turned of "Badge" notification (i.e. showing in the icon how many new emails you have) and disabled Growl Mail. I think these things are essential, because the whole point with GTD is that you should have specific slots for collecting and processing data, if you get interrupted when you actually do work this could really hurt the process. Secondly I downloaded and configured MailActOn to handle three different keyboard shortcuts: Ctrl-A will move the email to the Mail Archive folder, Ctrl-T will move the email to the To Do mail folder and Ctrl-R will move the email to the Read folder.This makes it very easy to sort the email when they arrive. If it's a item that I can't do anything about and I don't want to save it: I delete it, if it's a email I can't do anything about but I want to save it for future reference I press Ctrl-A and get it out of my INBOX. If the email contains something I want to read, but is not a direct action I press Ctrl-R and revisit it later when I have some spare time. Now if there is a action in the email, something I need to reply to or do in any other way, then I press Ctrl-T. The emails that ends up in the To Do folder are collected and categorized in the "process" phase. When collected and categorized I will archive it. This is not optimal, my goal would be to get the To Do emails filed in my Things INBOX so that I have just one way to collect actions.GMail is actually pretty well prepared for GTD. It has the concept of "archive" that just get's things out of my INBOX and into a search able index. It also have the possibility to put a Star on emails with keyboard shortcuts. I use it the following way: press 'e' and archive emails that I can't do anything about, star the email and archive it if it's something I want to read or to do anything about, then collect and categorize the starred messages later in my collection phase.Instead of writing a monster post for everything I have done so far I will stop here and write another post later in the week about how I use Things and my data collection. I also have a lot of ideas on how to work with GTD in my future team, more about that will also come later. [Less]
Posted about 16 years ago
It was some time between Christmas and New Years last year I carried my Technics SL-1200MK2 home in my arms. Now a year later I can say that it’s hands down one of my best investments ever, I mean.. just look at it.. The first 6 months it wasn’t ... [More] used more than perhaps once a week, but when moving to my new apartment it was the easiest source of music for a long time due to the caos of getting things to their proper place. When finally getting the apartment into order the habit was already there. I’ve listened to almost no digital source of music for the past 6 months when being at home, and my collection is close to filling my first box. When spending most of my awake time in front of a computer it feels very relaxing to kick back in the sofa to a really great analog music experience. Here’s the list of my current albums, with albums I’ve listened to the most marked as bold: Metallica Ride the Lightning …and Justice for All Kill ‘em All Master of Puppets The Beatles Abbey Read White Album Sgt Pepper Magical Mystery Tour Peps Persson Rotrock Persson sjonger Persson Bob Marley Kaya Uprising Jimi Hendrix Band of Gypsys Electric Ladyland Jim Morrison An American Prayer The Doors The Soft Parade Absolutely Live Waiting for the Sun LA Woman Glen Miller Story A Memorial 1944-1969 U2 Under the Joshua Tree Nirvana Nevermind Mikael Wiehe Kråksånger The Human League Reproduction Plasticman Sheet One Closer Musik Black Sabbath Black Sabbath Sabbath Bloody Sabbath Paranoid Pink Floyd The Wall Dark Side of the Moon Atom Heart Mother Wish You Were Here A Saucerful of Secrets Animals Front 242 Tyrrany For You Kraftwerk Autobahn The Man Machine Radio-Activity Bo Hansson Ur Trollkarlens Hatt Sagan om Ringen El-ahrairah Mellanväsen The Stooges No Fun If you’re thinking about getting a vinyl player but haven’t made the final decision yet, then doit! You will not regret it.        [Less]
Posted about 16 years ago
Two weeks ago it happened again. The annual synth music festival in Malmö, electricXmas. The evening started with some boozing up at the office with a crowd of 10 persons or so, lots of nice music and chattering before we hit the club. This years ... [More] lineup was pretty nice: Biomekkanik, Autodafeh, Agonize, Interlace and Welle:Erdball. I wasn’t really interested in anything other than Interlace and Welle:Erdball, but these two artists had each really great sets. Also.. Welle:Erdball also threw out their instrument of choice into my drunk arms: Unfortunatly it doesn’t seem to work properly after that crazy night, or I’ve failed to tune in the TV correctly (although I can easily find my other C64 on this TV). Next up is probably to switch over my other C64 into this new and signed chassi and get it to actually play some Welle:Erdball sids. Pretty nice to have a dedicated Welle:Erdball-computer Right, and I at least requested vinyl versions of all of Interlace’s albums, the answer was that it was interesting, and that it might happen. Enough for me to keep on hoping.        [Less]
Posted about 16 years ago by [email protected] (Tobias Rundström)
End of the year, let's summarize how the electronic music scene looked like in 2008? Generally there was a lot of talk about how the "synth" genre is dead, no-one innovates and so on. Well, I for one tend to disagree, there was a lot of really ... [More] interesting releases this year, as you can see below.5. Negative Format - GradientsNegative Format returns with yet another release that is both trance, EBM and dreamy sound scapes. The track Hues of Grey is probably one of the best tracks NF ever did. Looking forward to even more tracks from NF in the future.4. Ayria - Hearts for BulletsAyria or Jennifer Parker released a very very good record 2008. She describes her music as "Tit-zerEbb" style, greasy bass-lines, great hooks and hard beats. Together with Jennifer's voice this makes for a very very pleasant musical journey. Best tracks include "Girl on the Floor" and "Invincible".3. Informatik - BeyondThis release really came as a surprise for me, I have heard Informatik before but I have never really gotten into their music. Beyond on the other hand really blew me away! Catchy synth-pop tunes with a powerful voice and awesome hooks. Listen to the tracks "Nothing Greater" and "Don't be Afraid" and be amazed!2. Standeg - Ultra High Tech VioletAnother surprise! By mid 2008 Standeg released a free digital EP called "Rushing Pictures", after listening to this EP day out and day in they finally released "Ultra High Tech Violet". This is innovative release mixing trance sounds, intriguing melodies and very fine details. This is one of those releases where the more you listen to it, the more details you notice. The music is like a futuristic sound track for a sci/fi future. Best tracks are "25 hours", "Homes & Gardens 3.0" and "Image in motion". Haven't you bought it yet?1. KieTheVez - Non-BinaryI have been talking about innovations and complex music for a futuristic world. But sometimes plain old beautiful will just work! KieTheVez is a Swedish synth-pop band from Gothenburg, they released a couple of records during the 90ies but have been silent for 11 years before they released "Non-Binary". This is pure synth-pop bliss! Haunting, beautiful and with great sing-along values. This might not be innovating or complex, but it's still great and it tops my last.fm list for the year! Smash hit is "One world for the next" but the disc is filled with awesome tracks.Worth to mention as well is that the best gig of the year was Interlace at electriXmas, they have just released two new songs "istatue" and "nemesis" that can be found at their myspace page. If the new material will be anything like these two songs then it's going to be one of the strongest releases they ever made.This years disappointment is Imperative Reaction's "Minus All" which is pretty dull record compared to the rest of their material. To bad, they used to be one of my top groups.Now I am looking forward to 2009 with up-coming releases by Interlace, Combichrist, Depeche Mode, In Strict Confidence and hopefully a new Headscan release. [Less]
Posted about 16 years ago by [email protected] (Tobias Rundström)
2008 was a crazy year...This is the reason I haven't been posting stuff to my blog that often. I really hope that I can get back into it during 2009. So much of my creativity was lost into my day job, so much of the fun was stripped away. This is why ... [More] I have resigned from my post at Procera Networks.From the 12th of January I will start my new job at Purple Scout. I have been hired to structure their newly founded development group, to create processes and infrastructure for in-house development projects.Purple Scout is a workplace where I think I can find my creativity again. Hopefully this will mark my return to open source and XMMS2, which I miss so much. In light of my new position I will also try to blog a bit more about driving a development team and development processes which has been inspired by both GTD and my work with the XMMS2 community.Also watch out for more blog posts about this years best music and books later on. [Less]
Posted over 16 years ago
If you’ve been hanging around the XMMS2 hype-sphere lately, you’ve certainly heard “wait for rv-split to be merged” almost as often as “it should be a service client”. Well, wait no more, for rv-split has made it into the -devel tree! It means that ... [More] all C clients are broken now, and possibly clients in other languages too. Yes, yours too. It needs fixing, and I’m going to explain how. But, you ask, what is rv-split in the first place? The result/value-split, AKA “rv-split” or sometimes just “rv”, is a change in the XMMS2 clientlib. Up until now, values returned by the server were kept inside the xmmsc_result_t structure that you got back from the call. The data was to be fetched directly from the result. In sync mode, it went something like this: [code lang="c"] xmmsc_result_t *result; const char *name; result = xmmsc_playlist_current_active (conn); xmmsc_result_wait (result); if (xmmsc_result_iserror (result)) { printf (”Server error: %s\n”, xmmsc_result_get_error (result)); exit (1); } // The name is retrieved from the result if (xmmsc_result_get_string (result, &name)) { printf (”Active playlist is %s\n”, name); } // We free the result, which also frees all the data it referenced, // i.e. the ‘name’ string xmmsc_result_unref (result); [/code] The goal of rv-split was to isolate values outside of the result structure (for reasons that will become more obvious when we talk about the async calls). To do that, we introduced a new structure called xmmsv_t (for “xmms value”), that can contain any type of value. Accessor functions are used to extract each type from it, in a similar way to how it was done with result structures. Let’s show the sync example again: [code lang="c"] xmmsc_result_t *result; xmmsv_t *value; const char *name, *errbuf; result = xmmsc_playlist_current_active (conn); xmmsc_result_wait (result); value = xmmsc_result_get_value (result); if (xmmsv_get_error (value, &errbuf)) { printf (”Server error: %s\n”, errbuf); exit (1); } if (xmmsv_get_string (value, &name)) { printf (”Active playlist is %s\n”, name); } // We free the result, which also frees the value it contained, // i.e. the ‘value’ variable, and the ‘name’ string xmmsc_result_unref (result); [/code] All we have to do is extract the xmmsv_t from the xmmsc_result_t. No raw data is stored in the result structure anymore. Note that it also affects the error handling: if the server returns an error, it’s not a special state; it just returns an xmmsv_t of type ERROR. xmmsv_get_error is used to retrieve the error message, or the function will return FALSE if the value was not an error. Just like before, the value is freed automatically, so no need to worry about anything, just free the result structure. Now, let’s move to the async case. In async, we don’t wait on results, we register one (or more) callback (AKA notifier) that will be called when the answer comes back from the server. Up until now, callbacks received the original result structure in argument (plus a userdata pointer). Like before, the result contained the value returned by the server. It could also be used to restart signals or disconnect broadcasts (more on that later). In code: [code lang="c"] void callback (xmmsc_result_t *result, void *udata) { const char *name; if (xmmsc_result_iserror (result)) { printf (”Server error: %s\n”, xmmsc_result_get_error (result)); exit (1); } // The name is retrieved from the result if (xmmsc_result_get_string (result, &name)) { printf (”Active playlist is %s\n”, name); } // Each notifier holds a reference to the result xmmsc_result_unref (result); } int main () { // [...] xmmsc_result *result; result = xmmsc_playlist_current_active (conn); xmmsc_result_notifier_set (result, callback, NULL); xmmsc_result_unref (result); } [/code] One of the arguments for the rv-split refactoring was that the result structure is meant to handle the command and how we treat it, but we don’t really need it to be passed to the callback. It allows developers to do weird stuff (wait on the result in the callback, restart a non-signal, etc — don’t try this at home). All we need really is the value that the server returned. That is, the xmmsv_t! Which gives: [code lang="c"] int callback (xmmsv_t *value, void *udata) { const char *name, *errbuf; if (xmmsv_get_error (value, &errbuf)) { printf (”Server error: %s\n”, errbuf); exit (1); } // The name is retrieved from the value if (xmmsv_get_string (value, &name)) { printf (”Active playlist is %s\n”, name); } // Note that we do not need to unref anything here! // The value will be freed automagically after this! // I will explain this in a minute… return FALSE; } int main () { // [...] xmmsc_result *result; result = xmmsc_playlist_current_active (conn); xmmsc_result_notifier_set (result, callback, NULL); xmmsc_result_unref (result); } [/code] Easy and safer! But maybe you noticed a hitch: hey, how do I restart my signals or disconnect my broadcasts from the callback now? Well, it’s even easier than before. Previously, here is how you restarted signals: [code lang="c"] void signal_callback (xmmsc_result_t *result, void *udata) { xmmsc_result_t *newres; // [...] newres = xmmsc_result_restart (result); xmmsc_unref (result); xmmsc_unref (newres); } [/code] This simply becomes: [code lang="c"] int signal_callback (xmmsv_t *value, void *udata) { // [...] return TRUE; } [/code] That’s right, it’s that simple! The return value of a callback is some sort of “keep alive” flag. If a callback returns TRUE, the signal will be restarted or the broadcast will keep going. If it returns FALSE, the signal will die off (not restarted) or the broadcast will be disconnected. Note that the return value has no meaning in the case of regular commands, like the earlier example. Here are a couple of other things you might need to know about the new API: By default, the xmmsv_t is freed automatically (since it’s owned by the xmmsc_result_t). If you want to keep it around for some reason, you can ref it using xmmsv_ref, but don’t forget to unref it again when you’re done with xmmsv_unref, else your client will leak! Dict and List accessors have been made more generic and sexy, so check the documentation to learn how to access these types! PropDicts (returned by xmmsc_medialib_get_info) have been replaced by dict-in-dicts, but you can convert them back to regular Dicts using the xmmsv_propdict_to_dict helper function. Again, use the Doc, Luke! Check how your favorite bindings handled the upgrade, the upgrade path might be softer depending on the language. The tutorials have been updated (or will be shortly as soon as my patch for #2018 is merged — you can check it in the meantime). It features some code working with propdicts and list iterators, and other things in general. I think you should now be ready to upgrade your clients to rv-split! It’s been fun hacking on the new code this summer, and getting help from everyone to improve it and get it into -devel! Feel free to ask questions on IRC or in the comments! [Less]
Posted over 16 years ago
Sometimes you’ve played around in the history of a branch, edited some stuff in older commits, perhaps reordered them. You’ve reset’d back a few commits, and now you want to get to the final state you were at initially (or whatever state you want to ... [More] get to). Say you’ve kept a branch called ‘the-end-state‘ with the working end state you wanted to get back to before you started messing around with the history. You don’t want to merge (merging two alternative histories of the same development wouldn’t make any sense), you don’t want to rebase (it’s about building a new history, not forwarding it on top of the old one). You just want a new commit to bring you to ‘the-end-state‘. And you want to get there now! The intuitive way to do this is the following: $ git diff ..the-end-state > finish.patch $ patch -p1 < finish.patch $ git commit -a -s But why three steps when you can do with just two, using git read-tree to import the tree from the-end-state branch into your index (-m to merge it) and populate your work tree (-u): $ git read-tree -m -u the-end-state $ git commit -a -s Thanks Junio for the tip on gitml! [Less]
Posted over 16 years ago
Just opened this new blog at bytes.inso.cc to host ramblings and thoughts and tips about computer-related stuff. The idea is to stop scaring my grandfather, who does read my regular blog, and start posting more regularly about XMMS2, Git, mindmaps ... [More] , the power of syndication feeds, crappy/genius UIs, Information Architecture, Human-Information Interaction and other such trendy buzzwords. And perhaps it will encourage others to blog more regularly on the XMMS2 Planet! So, stay tuned… [Less]
Posted over 16 years ago
Having finished my crazy gonzo travel blog saga about my last trip to Japan, I have decided to split my blog in two. The idea is to start posting more technical articles without scaring the hell out of friends/relatives who don’t care about Git ... [More] merging strategies, reading their mail in Emacs or experimental Ruby prototypes of XMMS2 clients. This blog will remain at inso.cc, and will continue to host all my posts about stuff normal people might care about: Japan, music, creative writing, society, travels, culture, etc. The new blog has appeared at bytes.inso.cc and will contain all the computer-related posts (xmms2, development, projects, information architecture articles, etc). This is the blog for the coders, technologists, transhumanists among you. More about that side of me on the about page. I have already copied all the technical articles from this blog to the new one, and I plan to rename and rework inso.cc to better represent the content shift. Nota bene: both blogs have separate RSS feeds, so if you want to follow the new blog, don’t forget to subscribe to that feed as well! [Less]