Skip to content

Run Spotify on Archlinux with wine

I’m a big fan of Spotify, a music listening service that lets you listen to top songs for free with minimal advertising.  I’m also interested in programmatically generating Spotify playlists, so of course I’ll be doing that work on a Linux machine.  So I need a way to run Spotify on Linux.

Spotify offers an Ubuntu version of their software in deb format, but that’s not particularly helpful for me since I’m on Archlinux.  It took a bit to figure out, but here are the steps to get Spotify running on Archlinux via wine.

1) Install wine and assorted utilities

sudo pacman -S wine wine_gecko winetricks

2) Configure wine for an initial run

winecfg

3) Install native winhttp code from Windows

winetricks winhttp

4) Install and run spotify

winetricks spotify

At this point, I was up and running with Spotify on Archlinux with wine, sound and everything!  If there are issues, check the output and try to work from there for debugging.  Before I had native winhttp installed, the app would crash immediately after log-in, which is the first time that the winhttp code is run with Spotify on wine.  If you have no sound, then muck around in the Audio tab of winecfg and see if you can get it going.  In general, ALSA is quite stable and pretty default.  If it doesn’t work, you can fall back to the older OSS sound output too.

Either way, I’m now enjoying running Spotify through wine on my Archlinux laptop with no issues.  Good luck getting yours set up too!

Show Me The Code

As I come closer and closer to graduation, I’m looking back at the Georgia Tech Computer Science program, the things it did well and not so well.

One piece I feel is missing in the curriculum is having students read good, high quality code.  We’re asked to code alone and code in groups, code in labs and code in dorms, code on paper and code in IDEs.

It seems like the administration and professors think this skill just magically appears with practice.  I disagree, and I think we can do better.

There’s no class dedicated to showing students good code and having them write some.  Each one has some ulterior motive.  Our CS1 class isn’t about learning Python.  It’s about using computers to manipulate media, or robots.  Our CS2 class isn’t about learning Java.  It’s about writing code in an Object-Oriented style.  Each successive class, a new concept: data structures, algorithms, hardware, systems, operating systems, networking.

But we have only one class that even makes an attempt at teaching coding practices: CS3300.  And even in it, the focus is much less on reading good code, and more about hacking something together to pass a project demo.

Students shouldn’t be able to graduate with a Computer Science degree from Georgia Tech without being able to read and write production quality code.  And what do Georgia Tech CS graduates do with their undergraduate degrees?  Go to industry (and code) or go to academia (and code).

I know adding yet another mandatory course is unpopular, and if everyone with a passion made their pet project a degree requirement, we’d get out with a B.S. in seven years instead of four and a half.

So let’s either make a suggested course where building coding skills is the primary focus, or integrate the software engineering discipline throughout the curriculum.

The thought of professors actually show production code in class seems like glimpsing a foreign land.  The only code I see on the projector is pseudocode or from a toy project.

Another potential solution is to have a class specifically dedicated to reading good code.  With so many excellent open source projects freely available, I’m frankly a bit surprised I didn’t see them more often in lectures.  This isn’t 1987 and gcc isn’t the only freely available compiler in town anymore.

Let’s take a guided tour through some of the more famous open source projects: gcc, Linux, Apache, MySQL, Python, Firefox, Audacity, GIMP, VLC, 7-Zip, Blender, memcached, node.js, socket.io, and many many more.

What design decisions did they make?  What common patterns do we find?  How easy are they to extend?  What’s their build process like?  What existed before they did?

I believe many students would find this course exciting, engaging, and incredibly useful for the types of jobs and graduate degrees I see my friends going into.

I teach my school’s CS2 class, Intro to Object Oriented Programming using Java.  This is my seventh semester, as a TA, and I’ve seen a lot of bad homework.  What might help students craft better code is seeing what it actually looks like.

So this is my question: Why is no one showing me the code?

Facebook Registration with Django

There’s a difference between solving every coding problem you have yourself and finding an already-existing project that does it.  You hope there’s a project out there you can use and extend, but fear that you won’t be able to find it and will be forced to recreate it.

I’m working on a project built on Django now, and one of the design requirements we have is to allow logging in to the site with Facebook.  After struggling against several libraries and making little headway, I started to think I might have to face my fears: re-implement my own solution.

Luckily I found Aidan Lister‘s project just in time. He created django-facebook for the exact same reasons I did.  And after adding a couple quick features that I needed (pre-populate user data and first login redirect), I had Facebook login checked off my TODO.

What makes this interesting is that it’s a first for me: my first pull request on github and my first major contribution to an open source project.

Github is a great site for collaborating on code.  Not only am I using it on this django-facebook plugin, but I’ve also converted my research project over to use it.  I love how easy merges are in git, how every copy of the repository is a full backup, and how blazingly fast git is.  Using revision control is critical to building quality code and using both centralized and distributed revision control systems helps me understand it even more.  If you spend enough time watching open source projects deal with patches, pull requests, feature branches, and the like, you get a really good sense of how code is built in the trenches.

What I like most about this experience is giving back to open source.  It’s great to be a part of building better code for everyone else, and it’s great to have better code to work with in my own projects.

Learning Haskell

Classes have finished for the year, and I finally have some time to get real work done! One of the whole host of things I got involved with this semester was working on designing a new programming language with my friend Alex Marquez.

One of the major hurdles for me is that a new type system is core to the language, and that type system uses all sorts of techniques that I’m unfamiliar with. Type inference, pure functional style, reification, currying, kinds (type of types) and many other things I now vaguely understand with from talking about the language with Alex, but there’s certainly a long way to go.

So I decided to rectify that by giving a shot at Haskell, that crazy, purely functional language with monads and all sorts of interesting things. I’m working through a collection of resources now, and thought I’d collect them here for others to start from.

  • The first is Real World Haskell (RWH), the O’Reilly book by Bryan O’Sullivan, John Goerzen, and Don Stewart.
  • Next is Learn You A Haskell (LYAH), the quirky tutorial by Slovenian Miran Lipovača.
  • I also found the Gentle Introduction to Haskell (GIH), by Paul Hudak, John Peterson, and Joseph Fasel to be useful as well.
  • And for a great search engine of Haskell types and documentation, check out Hoogle.

Of the three tutorials, RWH is the most gentle. It also features a wonderfully innovative comment system, where user comments can be made on a paragraph by paragraph basis. Several times I found that a comment had a particularly useful addition or alternate explanation, which greatly added to the straight text. Reading RWH+Comments feels akin to being at a conference while following the backroom chatter on Twitter during a presentation. You’re given both the presentation and the critique, interwoven in time.

But at times, RWH felt a bit too slow at getting to the interesting stuff. I wandered around a bit and found myself at LYAH, which is the site I started learning Haskell from several months ago. With quirky drawings and a good pace, I switched over to using LYAH as my primary Haskell tutorial.

And by browsing around online (imagine…) I came across GIH, the most academic of the three. GIH does an excellent job of formally defining functions and concepts as you move forward, but it’s quite heavy. I found myself glancing at other resources to actually understand what was going on, and in several cases I only understood a piece of code because I’d learned something from another tutorial. I’d say that GIH is better for a later tutorial once you get the big picture of Haskell and are looking for more details. GIH goes into more depth on language constructs and has extensive links to the official Haskell definition and the code implementing the Prelude (standard library).

And a great resource shared with me by friend David Hollis is the search engine Hoogle. I’ve ended up using Hoogle mostly as a reminder of what functions do, not just what their type signature is. And searching by a type signature is something I’ve never seen before. Very cool!

Best of luck in learning Haskell!

UROP Newsletter Posted

So of course the day after I write a post saying the profile I wrote will be ready within a week, it’s posted! I’m featured in the UROP Newsletter on page 8.

Undergraduate Researcher Profile

News on the research front! Besides pursuing an Amazon AWS research grant, I was selected to be featured in the GT UROP newsletter for my work on the Music Technology research as an undergraduate. The newsletter will be ready to go within a week or so, and I’ll be sure to look out for copies around campus and online.

In the meantime, I have typeset the profile in LaTeX (a favorite to work with, though quite the pain sometimes). Here is the Undergraduate Researcher Profile.

Amarok development on ArchLinux

I switched my play laptop over to Arch sometime last semester, and had a great time getting everything set up. It’s much more of a hands-on experience, and like everyone who writes up an account of an Ubuntu -> Arch transition, I feel like I have a much better idea how the boot process and wireless configuration work. Of course, nowhere near as much as setting up an LFS installation, but still…

After two years with Mac OS X on my primary laptop, I’m getting that itching again for going back to an open source community OS. Sure, suspend/hibernate is flawless on Macs, and Firefox is formidably fast, but iTunes is a poor replacement for my Amarok installation. There was an Amarok2 build for the Mac a while back that I beta tested, but it’s just not ready for primetime yet, and I haven’t heard much of any development work done for the Mac platform in months.

So with a weekend where I’m already busy (finals week — papers, projects, exams anyone?), I sat down and figured out ABS, found an amarok2-svn PKGSOURCE, and have started hacking away. A great first place for KDE projects to look for trivial things to fix is Krazy (down now for some reason). I looked at comparison to and concatenation with single-quoted characters instead of double-quoted ones (QString works faster on characters than other QStrings), and sent off a patch to the Amarok mailing list.

Hopefully with a few weeks at the beginning of this summer between school and my internship, I’ll be able to finally hack around on Amarok a bit. It’s about time, since I’ve been following development for at least two and a half years now!

Back from India!

I actually returned from India a bit over two weeks ago, but the standard school fair has been keeping me quite busy. Apart from the research symposium mentioned below (slides coming soon?), I also had to: grade HW, do CS2200 HW, Databases project, 8-10pg PUBP paper, open the TA application, 2200 Project, Research demonstration, Research presentation, Prob/Stat HW, and a 2200 Test. And I was supposed to be playing piano for church and competing in a debate tournament over that weekend, but those just weren’t able to happen…

The India trip was a one-week Friday evening to Sunday morning father-son trip. My dad and I left Atlanta for our 8,500 mile, 17 hour direct flight Atlanta-Mumbai. After sleeping nicely, we arrived at Mumbai’s international airport, met our local contact Pradeep, and made it to the hotel via taxi. Since it was only midnight local time (9:30 in the morning on our bodies!) we went out for some “breakfast”. We spent the next couple days wandering around the back roads of Mumbai, hitting up the highlights of Haji Ali, Sassoon Docks, Gateway to India Arch, Elephanta Island, Mani Bhavan (Gandhi’s house), Cafe Leopold, the Taj Mahal Hotel, and all sorts of intriguing back roads. We have this tendency of tryin to avoid doing just the “tourist thing” when visiting other countries, being ferried around by vehicle from site to site without getting a true experience for the flavor of a country’s local culture.

After Mumbai we took a domestic flight down to Coimbature and taxi’d up to Ooty, where we were able to meet with a couple from our church working on Freedom Firm, an organization working for “rescue, restoration, and justice for victims of sex trafficking”. Really powerful work there. Also while in Ooty we woke up early to track elephants and tigers in a nature preserve, hiked the 3hr Cooley trail (and ran away from a lone male elephant), and visited the tea museum and a local tea factory. This is also where Dad got sick and we lost a morning due to illness. Though it slowed us down, it was a nice break from just experiencing and offered the chance for reflection. How much does experience matter if you can’t take those experiences and forge them into coherency for actually impacting your life?

Leaving Ooty via taxi, we made our way to Mysore to see the palace there, but had to miss it because we’d lost so much time that morning. We ended up barely making it to Bangalore in time to make the overnight train up to Hyderabad. What a fantastic experience! In Hyderabad we stayed at Pradeep’s parents’ house, which had a welcome sense of familiarity even though we’d never been to the place. Although much of our siteseeing in Bangalore didn’t work out, we were able to meet up with some great guys at India Missions Association, where Pradeep’s parents work.

There’s certainly way too much for me to able to fit all of my experiences in today, so maybe I’ll have more posts in the future on this wonderful opportunity to visit India I had.

Applying for UROP Research Symposium

Coming on April 1, there will be an undergraduate research symposium at Georgia Tech, with opportunities for both presenting at poster sessions and a 20 minute oral presentation. Part of the application for the presentation is a 250-word abstract of the research thus far, so this was the first time that I’ve had the chance (or had a good reason to) write more about the project. We have recommendations working great now, and are now getting to increasing the size of our music database from 500 tracks to roughly 1700. Soon we’ll also have tempo incorporated into the recommendations, which we think will be a good discriminating feature for tracks. It’s still in the early stages of customizing the CBR algorithm to our specific body of music (Indian music) so there are a lot more improvements to make.

What’s been holding me up recently is unicode text in Python 2.4.4. There are all sorts of funky characters in some of the tracks we’re using, both for filenames and id3 tags. For getting tracks into the databse, we try to have artist, album, year, and filepath. Since filepath is often a function of artist, album, and track number, it is filled with funky characters too. I’m in the process of debugging to figure out what’s going on, and am experimenting with the unicode method, bash language settings, python language settings, and vim language settings in ways I never have before. Hopefully I’ll be able to post my fix soon!

Buying Sheet Music Online

You would think that in the world we live today, getting ahold of sheet music for some of your favorite songs online wouldn’t be that big of a deal. I mean, just poke your nose into enough dark corners of the internet and eventually what you’re looking for reveal itself. Right? There seem to be plenty of people getting along just fine using that approach for music, movies, TV shows, software, and even e-books now. But you would be surprised how difficult it is to find freely available sheet music, let alone the legal kind.

So what’s a music aficionado supposed to do? Well, I happened to stumble upon a site today that does sheet music right, worshipmusic.com. Sure, it’s a highly specialized target audience, but read this: I was able to buy a digital lead sheet for a song I’ll be playing in a few days for just $2.50. Yeah, two dollars and fifty cents. A nice and simple process too. The standard shopping cart, checkout fare, but then I instantly received a download link via email for the pdf. Not any of those crazy proprietary plugins that tend to cause Firefox crashes, but nice simple pdfs. Exactly what everybody wants. I had a great experience and worshipmusic.com, and would have bought several more songs if they would have had them available for digital download.

Maybe I want everything my way, but it still wasn’t good enough. If I can get a song for $0.99 on iTunes, why should it cost $2.50 for the sheet music? And especially since I’m just downloading a file. You can’t even plead printing, shipping, and distribution costs on that one, buddy. The two and a half bucks was a low enough price point for me on this one-time purchase, but it’d probably need to be closer to the buck-a-pop range that iTunes has gotten. The selection is also extremely limited. Out of six songs I was looking for, they only had one. Browsing was a bit difficult as well. With long lists of items and not much effort put into usability, particularly categorizing the catalog, it took a while to figure out that they even had that song.

So what would the perfect sheet music store look like for me? Probably a lot like Amazon.com‘s mp3 downloads, but with pdf files instead of mp3. It’s a clean store, easy to find things. The download process is simple, and gives you exactly what you wanted: that file quickly, easily, and legally. If old media is to not get run over by turning public opinion regarding file sharing, they’ve got to fight with products, not lawsuits. And this sort of product is exactly what I’m looking for.