Archive for April, 2004

Introducing CUBlog, a Blogger-compatible interface to the CU Community

Monday, April 26th, 2004

As many of those familiar with blogging already know, the easiest way to post a new entry to a blog is not through a web browser. Instead, many bloggers will use programs like w.bloggar to write entries. These programs give the average user a quick way to write and preview their post. When the user has finished editing, the program sends the post to the blog with the click of a button.

Sound nice? Well, now you can use those programs with the CU Community.

CUBlog is a program that makes the CU Community look like a blog, letting you post and edit your CU Community entries with any blogging tool. CUBlog acts as an intermediary between the blogging tool and the CU Community by receiving your post from the blogging tool and sending it to the Community.

Here’s how to use CUBlog with w.bloggar. (For those in the know, the CUBlog server is Blogger API 1.0 compatible, and runs on host “sacarny.com” port 80, path “/cublog/”. If that made sense, go have a blast. If you’re confused, read these directions to set up CUBlog for yourself):

  1. Download and install w.bloggar. You only need the latest version. Once it is installed, just double-click the “w.bloggar” icon on your desktop to load it up.
  2. If this is your first time running w.bloggar, a new account window will pop up. If this isn’t the first time you’ve run blogger, you’ll have to click File from the top menu, click “Account Settings”, then choose “>> New <<” from the “Account” dropdown box. If this step isn’t making sense, it’s probably the first time you’ve run w.bloggar, and you can ignore it.
  3. Enter your username and password for CU Community into the text boxes:

  4. Yes. Yes you do want to create the account.

  5. A window will pop up. At the top of this window, find the “Blog Tool” drop down box. Choose “>> Custom <<” It’s the topmost choice:

  6. Now fill in the section below. Click on the “API Server” tab and make sure the text boxes are filled in with “Account Alias” set to “CU Community”, “Host” set to “sacarny.com”, “Page” set to “/cublog/”, “Port” set to “80″, and “Timeout” set to “30″.

  7. You are practically done. Just click the “Custom” tab. Change it so that the “Templates” drop-down box says “Not Supported”. It should look like this:

  8. That’s it. Click “OK” and you can log in and begin working with your CU Community account.

If you want to run the CUBlog background program on your own computer, you can download the Windows version, which comes with a nifty graphical front-end. Just download the exe or zip and run it. After the program has started up, follow the directions as above, but for step 6, change “Port” to “2000″, “Host” to “localhost”, and “Page” to “/”. That’s it!

If you use OS X, you’re probably not using w.bloggar (It’s a Windows-only program.) If anyone wants to make instructions for using CUBlog with, say, iBlog, go right ahead. If you do happen to write instructions, please tell me so I can link to them. The CUBlog program itself runs on OS X but I haven’t written a frontend for it.

Geeks Only:

CUBlog is written in perl and can run as a standalone daemon or as a CGI script. It emulates the Blogger XML-RPC interface and implements the entire 1.0 API, more-or-less (templates are not supported, since CU Community doesn’t support them). Since the CU Community doesn’t have an XML-RPC interface, CUBlog interacts with it by making standard HTTP requests.

You can view the source by downloading the tarball, available here.

On classes, and economics.

Thursday, April 22nd, 2004

So last week in Econ my professor (who surely is the most excellent professor in the world) ended the class in this manner:

It was the end of the 1970’s, an election year. With the problem of inflation and stagnation both at once, Professor Mendell approached then-candidate Reagan with a radically different plan for dealing with the economic crisis. Candidate Bush called it “Voodoo Economics”. So what exactly was this plan? We’ll talk about it next class.

At which point I was on the edge of my seat, although it seemed like everyone else wanted to run out. Yesterday he finally explained it to us, and now the whole world makes sense. I could never figure out if Bush was Keynesian or not. Now I know: he’s not. Not in a strict sense at least. Let me explain:

Keynesian economics deals with the demand side of the economy. It proposes that recessions are caused by inadequate consumer spending, and you can counteract that “gap” (It’s only a temporary thing) by:

  1. Increasing government spending, so that the government purchases what the consumers don’t
  2. Cutting taxes (Increasing disposable income for the consumer), thereby giving them incentive to purchase

So it’s all about increasing demand, whether it comes from the government or the consumer. Supply siders posit that there’s too much focus on demand, and they propose to stimulate the supply end of the system. To counteract a recession, supply siders propose:

  1. Putting money into the hands of those who will invest it, since that will give businesses capital to expand
  2. Decreasing business taxes on the margin — lowering taxes in order to give businesses the incentive to produce more

Those two reasons have pretty similar effects. Decreasing taxes on the margin means lowering taxes as the bracket gets higher. And the ones who invest are the ones in the higher brackets. (I haven’t been able to find any info online about the business taxes. I think that’s what prof said though…)

Supply side economics explain’s Bush’s tax cuts: cutting taxes on the rich and on capital gains allows for greater investment, which helps businesses, which stimulates the supply side. Tax nods to big business? Same deal.

If you’re interested, check out Supply Side Economics and Keynesian Economics on the Wikipedia.

As for classes: it turns out that next year’s sole Macroeconomics class comes at the same time as next year’s sole Data Structures and Algorithms class, which happens to need as a corequisite another Comp Sci class. Forced to choose between Comp Sci and Macro, I threw Macro out the window and picked the two CS classes and Microeconomics.

Lamenting the situation, my father woefully commented, “Micro sucks.”

A final word

Wednesday, April 14th, 2004

Oh yeah. Um. Sorry if that last post didn’t make much sense. I needed to get all that geekiness out of me.

i’ll pick you up by your puffy scruff (or: a day at the w bar)

Wednesday, April 14th, 2004

Ever since I received the prestigious title of web master/mistress for next year at wbar.org, I dreamed of updating the streaming server. I wanted, first of all, to have a unix-like operating system to play with. I also wanted to stream in Vorbis. Using Windows made doing such a thing very tough, because in order to stream MP3’s on Shoutcast, you (normally) run Winamp and configure it to use a special output plugin for encoding. Well, the output plugin only knows how to encode MP3, so encoding Vorbis requires another plugin. But you can only use one plugin at once, and when it comes down to it, you have to choose between the two formats.

I found a nifty program called Darkice that could simultaneously encode MP3 and Vorbis. It required an Icecast server. I wanted to run all of this on FreeBSD, but the system’s sound card had only commercial drivers on that platform. Linux with ALSA it would be.

After consulting the techie brain trust, I decided on Debian testing, the pretty-stable-but-we-can’t-guarantee-it version of Debian. I was excited. I read Crime and Punishment and sat through a few hours of class, anticipating the joy of installing Linux (oddly enough, the previous statement bears some truth).

The station has two servers: a “real” Dell server, and an old Compaq desktop computer. They both ran Windows 2000, but the Dell box did pretty much all of the tough work. I started by downloading a Debian netinstall image and setting up the Compaq box to act as a temporary server. When it came time to burn the netinstall image, though, it turned out that wbar didn’t actually have any burners in their computers. Somehow one turned up in the closet, and after about an hour of fiddling (don’t ask) I managed to get it installed in one of the servers (don’t ask).

With the netinstall CD burned, I turned off the Dell server and gave the Compaq its old IP address. Instant changeover! The listeners wouldn’t know the difference… or they shouldn’t have, if I had done things right. But there were only around 5 listeners, and, well, you know…

I used the rescue mode of my SUSE install CD to resize the Dell’s main partition. GNU parted worked like a charm and within minutes I had space for Debian. I rebooted into the Debian installer and immediately noticed that it was different from previous versions. The dreaded kernel module configuration dialog was no longer, and I didn’t have to enter any partitioning information. Excellent! My only gripe was that I couldn’t figure out a way to add my own source for grabbing the base system.

Once base was installed the system rebooted and I did some final configuration. I chose packages to install, which worked fine except for the fact that I needed to do several runs through the package installation step. I’m not sure why this always happens with Debian — for large apt-get’s, you always seem to need to run apt-get several times. Eventually apt-get kept failing on inn, so I just removed it. My system was installed.

X worked more or less out of the box, although some mouse driver tinkering in XF86Config-4 was necessary. I installed ALSA so that I could drive the high-end sound card. I also downloaded alsa-tools and compiled envy24control by myself — Debian doesn’t include it for some reason. Well the damn program kept on refusing to detect the sound inputs and segfaulting! After endless tinkering, I realized that it was a version incompatibility — 1.0.4 of alsa-tools, 1.0.3 of alsa-base. Jesus. One minor version! The slightly older envy24control worked like a charm, showing the input levels and letting me adjust gain. Why Debian won’t include alsa-tools, I have no idea.

With sound set up, I began working on Icecast/Darkice. Icecast2 wasn’t included in testing, so I downloaded the deb from unstable and installed it. I gave the streaming server a base configuration, then configured Darkice. Oh yeah, because Debian has some worries about patents, they didn’t compile Darkice with LAME (mp3 encoding) support. Thus making it useless. Compile-from-source, here we come.

I downloaded the sources for Darkice and LAME, compiling them both into Debian packages. In all my years using Debian I had never compiled a Debian package from source (not counting Kernel), so this was a big thing for me. Surprisingly easy! I modified the Darkice package so that it used LAME, and soon thereafter I had a functioning MP3 streaming server.

With the high bitrate MP3 stream working, I added a low bitrate MP3 stream and a high bitrate Vorbis stream, all of which the server handled very well. Unfortunately Darkice can’t downsample/downmix audio for Vorbis (even though the Vorbis encoder supports just downmixing), so I couldn’t get a low bitrate Vorbis stream running.

I made an init script for Darkice by basically copying the init script for icecast-server. I really like start-stop-daemon: I was able to figure out how to use it in almost no time. I made some simple modifications and quickly had Darkice automatically starting up and shutting down. After a reboot to test if the server knew what to do automatically, I declared my work more or less done.

I switched the stinky Compaq machine back to DHCP, and gave the Dell machine back its old IP address. By the way, Debian’s “interfaces” file is an amazingly simple way to manage network configurations. I had my IP info typed in in a few minutes, even though I had little experience with this system beforehand. As a final measure, I added some aliases on the server to make the Icecast server look more like the old Shoutcast server (e.g. requesting http://server:8000/ gets you an MP3 stream, instead of a 404 Not Found error). I tried the links on the site for one more sanity check. Everything a-ok. Time to go.

It was 9:20PM when I left. I had arrived at 12:30.