“Slow-smoked” baby back ribs

I made some ribs tonight.  Took about 3 hours to make and about 3 minutes to eat.

Preheat oven to 325F.

Dry rub:

* 1 part salt
* 1 part pepper
* 2 parts smoked paprika
* dash cayenne pepper (to taste)

Combine dry rub ingredients.  Remove membrane from ribs.  On a piece of aluminum foil, rub dry rub into the ribs.  Start with about 2 tbsp of dry rub per rack, but don’t leave too much excess in the foil (or the corners of the ribs will end up too salty).  Splash about 1 tsp of concentrated liquid smoke onto each side of the ribs.  Wrap ribs in two layers of aluminum foil as tight as you can get them without tearing.

Bake in oven on a baking pan for 1.5 hours at 325F membrane side up.  Flip over, then bake for another 1.5 hours at 300F with membrane side down.

BBQ sauce:

* 1 part salt
* 1 part pepper
* 2 parts brown sugar
* 8 parts ketchup
* 4 parts apple cider vinegar
* big splash worcestershire sauce
* light splash concentrated liquid smoke

Combine BBQ sauce ingredients.  Remove ribs from oven.  Carefully open up ribs and lay them on one layer of aluminum foil membrane side down (discarding one layer of foil).  Be mindful of the hot steam that will escape when you open the foil.  Cover topside of ribs with BBQ sauce, about 3 tbsp per rack.

Place ribs back into oven and broil on top rack of oven for 2-3 minutes, or until sauce on the top begins to caramelize.  Remove from foil and serve.

I gotta give props to Cheater BBQ for inspiration on this one.  Their indoor rib recipe is great, but I think mine is better. 🙂

Streaming mp3 server with NS-K330 NAS running SnakeOS

I just got a NS-K330 NAS off Deal Extreme, it’s a super cheap-o 3W network attached storage device.  Just add a USB powered HD and you’re ready to go.

The operating system that it comes installed with doesn’t do very much, so the good hackers over at SnakeOS have made a simple BusyBox-based distribution that you can use to replace it.  In 3 minutes you’ve got an embedded Linux server running ssh/sftp, ftp, samba, http.  Did I mention it only draws 3W?

Once I got SnakeOS installed I was disappointed to discover the embedded web server doesn’t support directory listings.  It does however support CGI scripting.  It took me a few minutes to put this together, but here are two scripts you can install in your web server /cgi-bin directory to enable directory browsing and automatic generation of m3u files for your mp3 collection:

#!/bin/sh
# Generates a directory listing, links directory to m3u generator
echo "Content-type: text/html"
echo ""
QUERY=`echo ${QUERY_STRING} \
| sed -r 's/%20/ /g' \ | sed -r "s/%27/'/" \
| sed -r 's/^\///'` echo "<h2><a href=\"/cgi-bin/m3u?$QUERY\">/$QUERY</a></h2>" ls -l "../$QUERY" | grep ^d \
| awk '{$1=$2=$3=$4=$5=$6=$7=$8=""; print $0}' \ | sed -r 's/^[ ]+//' \ | sed -r "s/^(.*)$/<a href=\"?$QUERY\/\1\">\1<\/a><br>/" ls -l "../$QUERY" | grep -v ^d \
| awk '{$1=$2=$3=$4=$5=$6=$7=$8=""; print $0}' \ | sed -r 's/^[ ]+//' \ | awk "{printf(\"<a href=\\\"/$QUERY/%s\\\">%s<br>\", \$0, \$0);}"
#!/bin/sh
# Generates m3u from query parameter
echo "Content-type: audio/mpegurl"
echo ""
QUERY=`echo ${QUERY_STRING} \
| sed -r 's/%20/ /g' \ | sed -r "s/%27/'/g" \
| sed -r 's/^\///'` find "../$QUERY" -name *.mp3 \
| sed -r 's/\.\./http:\/\/192.168.0.11:8080/' \ | sed -r 's/ /%20/g'

Not the cleanest of scripts, but it gets it done.  BusyBox doesn’t have a complete “find” implementation so this kinda limited what I could do.

As I’m writing this it does not appear this system is the most robust of web servers… Both WinAMP and Windows Media Player are seizing up part way through songs and reporting network errors. Hmm. I guess for $40 I can’t complain.

Linux, ALSA, Jack, Renoise: Configuring a mono microphone as a stereo microphone

I’ve been spending some time with Renoise recently, and this LADSPA plugin called Autotalent that acts as an auto-tuner / real-time pitch corrector.  For a while I was playing around with it using pre-recorded samples, but the other night I thought it would be fun to try it out live.

Unfortunately I couldn’t get my motherboard to work with any of my (analog) microphones, so I pulled out an old Logitech USB microphone I had for my Playstation 2.  Linux recognized it, and I was able to record, but then I discovered that Renoise has an unusual shortcoming: it does not support monaural input sources.  Well, this is Linux.. there must be a way to make this work, right?

Sure enough, there is!  I dunno if this was the smartest way to get it working, but I got Renoise to recognize the mic as a stereo microphone if I configured a virtual pcm device in in ALSA, ran a Jack server with this virtual pcm as the capture device, and then reconfigured Renoise to use Jack instead of ALSA.  The latency was noticeable, but still good enough to allow me to do my own T-Pain and Wallpaper renditions.

Here’s how it’s done:

$ arecord --list-devices
card 2: Microphone [Logitech USB Microphone], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ cat /etc/asound.conf
pcm.stereo_capture
{
type route
slave.pcm hw:2
slave.channels 1
ttable.0.0    1
ttable.1.0    1
}
$ sudo jackd -d alsa -P hw:0,0 -C stereo_capture

GridOS

FusionGarage is trying to make a comeback after their JooJoo debacle, it’s called GridOS.  They have a few videos of it in use on their website.

When I used to work in games people would say to me, “hey I have this great idea for a game…” and then I’d have to gently explain that either the idea had already been tried or probably wouldn’t be fun for xyz reasons.  Or I would just smile and nod.  Watching the GridOS videos they have on their website brought that feeling back.  I cringed watching them.  I imagined this dude telling some poor programmer, “hey I have this great idea for a user interface…”

“The desktop should never end! It should just go on and on…” Great idea, genius.  So you want people to get lost finding their apps?  Or worse, lose their apps?

“Oh well then we’ll have this map in the top corner so you don’t get lost!”  How about you just don’t let people get lost in the first place.  Confine the apps to as small an area as possible.

“Grids are cool! Everything should be in a grid with massive blocks of dead space between groups.”  So, you want people to get tired of scrolling?  You want to not use the available screen real estate to convey useful information?

“There should be this gadget for your left thumb that acts like a jog dial, and have scroll momentum and do this neat little shaking of the items attached to the wheel!”  So you want to violate your grid design and rigid fade-in/fade-out visual semantics for this one different UI element. O.. K.. And you also want things to not actually be visible until they stop shaking / stabilize?  And you want this under the user’s thumb, so they can’t actually see what they’re controlling? Right.

“But the right thumb should be like a context menu, and have this grid pop-out with context sensitive options, (and all the options should be on the same background with single-color icons).”  Is there any rhyme or reason to how these icons are arranged?  “Sure! Arrange them based on the distance your thumb has to travel, so commonly used items are closed to the edge.. you know, like Dvorák and stuff.”  Alright, I guess people will have a hard time finding where things are the first time, but maybe they’ll develop a muscle memory for where things are.  Oh wait. This is a tablet.  There is no physical feedback mechanism.  They’ll have to use visual feedback and get lost every time.

“We’ll have the coolest UI for playing music!”  Uhh, yea, isn’t that kind-of a solved problem?  Plus, you don’t really need much of a UI for listening to music on a portable device.  Unless you’re developing a great UI for managing music–and sync’ing that management with wherever your music library is stored–then you might be onto something.  But I suspect you’re not.

Too harsh?

Reporting country of origin should be required for online sales

I find it frustrating that there is no requirement to inform the customer of the country of origin of a product when it is purchased online. I often times have no idea what country something was made in until it arrives at my doorstep and I open the box.

According to the Customs and Border Protection document “Marking of Country of Origin on U.S. Imports” the purpose of this marking is:

To inform the ultimate purchaser in the United States of the country in which the imported article was made… The ultimate purchaser is generally the last person in the United States who will receive the article in the form in which it was imported.

When you buy something from an online retailer you don’t get to see this marking until you’ve already made the purchase.

The intent of this law is not being met.

The Mythical Beer Month

A new paper I co-authored with a few of my colleagues is scheduled to appear at SIGLP* 2011:

Abstract: The Mythical Beer Month is a software project management method that builds on the close relationship between software engineers and their beer. The method exploits properties of Booze Law to maximize the effectiveness of software developers by carefully rationing them beer.  Software developers are placed into a matrix organization according to their individual Ballmer Peak and rewarded with beer during and immediately following accomplishment of a milestone.  In this paper we present the Mythical Beer Month method, a summary of projects that have implemented the method, and finally some criticisms of the method.

(ACM Special Interest Group on Lazy Programming)

Killing the graphics API

bit-tech got all excited by some statements from AMD’s head of GPU developer relations where he advocates killing the graphics API.
This is great for console gaming, in fact it’s already the norm, but its a terrible idea for PC gaming.

A graphics programmer working on PC titles doesn’t want to have to code a game using the display list language of a bazillion different graphics cards.  At the very least you would have to support the “common” set of cards from nVidia, ATI AMD, and Intel.  In order to make your game marketable, you would end up essentially recreating DirectX or OpenGL yourself, negating the benefit of eliminating these APIs in the first place.

On a console, especially if you are a first party developer, you want access to the display list language because that’s the most efficient way to make the best use of the hardware, hands down.  And you only have one target platform to worry about, so it makes sense.  I don’t know about Xbox, but on PSP and PS3 the only way to push the hardware to its limits is to code display list generation commands directly into your game and skip the graphics APIs all together.  On PS3 you need to do this anyways in order to be able to generate graphics from the SPUs.

I would be surprised if Sony isn’t taking this approach on PSP2 also.  It’s good for the console manufacturer to lock developers into a platform–and I suspect that might be where the AMD guy is coming from also.

But he’s wrong to advocate this for PCs.  It would probably stifle innovation more than advance it (as he claims it would), because now hardware vendors would feel compelled to make their opcodes backwards-compatible for free of breaking compatibility with older, popular games.  You would recreate the same problem we have now with the “venerable” x86 platform.

Unless he’s talking about reconfigurable ISAs on the GPU.  That could be interesting.

Better Mac and Cheese

I’ve been doing some mac and cheese just about every week since the holiday break and tonight made a batch that may possibly be the best mac and cheese I’ve ever had.  I hate to brag folks, (well, not really), but this recipe is my idea of what mac and cheese should be like in terms of taste, texture and color.  At the very least it’s a base upon which I will build all future attempts at a more sophisticated mac and cheese.  Here it goes:

2 cups elbow mac
15 oz medium cheddar cheese (diced)
8 oz whole milk
8 oz heavy cream
6 tbsp butter
5 tbsp flour
1 tsp salt

Cook the noodles, set aside.  In a large pot (or the same pot you cooked the noodles):

Melt butter over low temperature.  Add flour.  Stir frequently until roux has been bubbling for a minute or two.  Add milk, heavy cream, cheese and salt.  Continue to stir until all cheese has melted.  The sauce should be very thick–but if it’s too thick you can just add more milk.

Add noodles until desired cheese to mac ratio is reached.

This is way better than my previous recipe.

Good beans

Everything is better with bacon. –Anonymous

Them some good beans! –Myself, after finishing my third bean burrito in a row with these beans

2 cups black beans

3/4 cup bacon grease
1 tsp ground cumin
1 tsp chili powder
1 bay leaf
Express bean soak: Rinse beans and place in a 2-cup microwave safe measuring cup (Pyrex).  Microwave for 2 minutes, let stand for 10 minutes and drain.
Place soaked beans in a large pressure cooker and cover with at least 2″ of water.  Add bacon grease, cumin, chili powder and bay leaf.  Seal pressure cooker and cook on high for 90 minutes.  Salt to taste.
Serve with chopped onion and grated cheese.