Posted by Doug
on November 12, 2010
Technology /
No Comments
“Eternal September” is, as wikipedia describes it, the era of mass consumption internet. In its most rarefied state, the Internet had only thoughtful participants who respected one another. A general code of conduct and decorum prevailed. Since 1993, when AOL and other ISPs have brought exponentially more, and less civil, users to the internet, that prior balance has been lost.
I’m sure this is mostly a matter of concern among technophiles, but I have been noticing the irritating effects of what may be deemed the Web 2.0 edition of Eternal September. Since the advent of blogs and commenting, people who could never write a web page have been able to make their voices heard. As a result, and perhaps this has accelerated with increased familiarity with public comments and a continued decline of decorum, every newspaper and widely read blog post have a full gamut of obnoxious comments.
Continue reading…
Posted by Doug
on September 30, 2009
Technology /
1 Comment
This is stupidly obvious: if you want to do a dual monitor setup with the NVidia GeForce 8500GT, all you have to do is use a VGA input for one screen and a DVI input for the other. I tried using a DVI splitter to put both on DVI, but that’s not how it works! It’s analog + digital. Simple.
As an aside, why can’t the Nvidia linux driver do Twinview for my two graphics card (Nvidia 6500 and 8500GT)? Windows can!
Posted by Doug
on July 24, 2009
Technology /
No Comments
I have been using R for a few weeks now, and now that I have a feel for how to get things done, I am starting to explore how to get those things done faster. On the suggestion of a friend, I picked up Data Manipulation with R by Phil Spector. Once you get the hang of R syntax, it is a great book to show you how to actually get things done; I am most of the way through it, and would highly recommend it.
One thing he introduces in chapter 9 tangentially is the “system.time” function; feed it a code block, and it will tell you the amount of real and system time elapsed. So, it is the perfect test bench for which of two methods runs faster; he uses it to show you how you get a 4x speedup using the built-in “colSum” function over “apply”. Using vectorization, a loop is just as fast as “apply”, however without vectorization, you get a 60x slowdown using element-by-element looping.
This points to the key to R-speed: don’t lie to R. Tell it everything, so that it can allocate memory efficiently, which is by far your slowest task. Take this example for applying “rbind” across a set of data frames. Previously, I had thought “functional programming”, and naturally went with “Reduce”. However, this book motivated me to find the “do.call” solution. Observe the results.
> df <- lapply( 1:1000, function(z) data.frame( runif(1000 )))
> system.time( a <- do.call( cbind, df ))
user system elapsed
0.54 0.01 0.59
> system.time( b <- Reduce( cbind, df ))
user system elapsed
40.16 0.80 42.61
That’s right, the “Reduce” method took 80x longer than the “do.call” method. I am going to change some of my code right now…
Posted by Doug
on July 05, 2009
Technology /
No Comments
On the theme I’m using (Big City), the wordpress default for showing counts next to categories looks awful. The lines break after the link, so it will say something like “Technology ::break:: (31)”. The solution I found was basically just to hack the code where it prints the count, and move that up. This stuff is hard-coded in wordress, and I couldn’t find a CSS solution to my problem (I do suck at CSS, but that’s another story).
Here are the changes as of WP 2.8.
In “general-template.php”, locate the lines that say
$after = ' ('.$arcresult->posts.')' . $afterafter;
and change them to
$text .= <...>
There are a number of such lines, so this will make them all consistent. I think I counted 4 such changes.
The other change to make is in “classes.php”. Break line 1336 (which looked something like this before I got to it)
$link .= $cat_name . "</a>";
So that it becomes
$link .= $cat_name;
$link .= "</a>";
Now move up this block between those two lines:
if ( isset($show_count) && $show_count )
$link .= ' (' . intval($category->count) . ')';
This will change your formatting slightly if you were using the feed code, and I don’t have a good answer for you on that.
Posted by Doug
on June 20, 2009
Technology /
No Comments
Add to my list of fantastic software you should be using (Firefox, Dropbox, Adblock, XMarks) another: Zotero. It is an organization tool for your research that exists as a Firefox add-in (I don’t know why it only supports FF). You can bookmarket pages (imagine that!), sort them, tag them. However, you can also store files in with your bookmarks, refile bookmarks in several places, add notes, citations, and annotations. Basically, it is your bookmarks on super steroids. You can back the bookmarks up to their server, and the stored files to your own server, so everthing can be duplicated across machines. (You know how I feel about that!)
Continue reading…
Posted by Doug
on June 17, 2009
Technology /
No Comments
For unknown or inadequate reasons, I bought a copy of Office 2007 the other day and loaded it up for work. (As an aside, Amazon has Office 2007 Home & Student for $80 and Excel 2007 for $105 — and it says people are buying the individal program after comparing the two?). For the past few weeks I have been developing code that pulls financial data from Yahoo and populates a template sheet, among other things. Because of the way I add the data to the sheet (the fastest way excel supports, setting a range’s value equal to a VBA array), some summary functions at the top of the sheet have to account for the fact that the data could be of an arbitrary height.
My solution to this problem in the original version, written and debugged in Excel 2003, was to have those summary cells reference the range A23:A65536 and take a count, etc. to get the number or summary of those cells. This was fine. My code would take 30 seconds per run, most of which I thought was spent in VBA.
Enter Excel 2007. On a whim, I saved my spreadsheet in 2007 format and ran it. It was slow. I mean, mind bogglingly slow. I thought it was just the network taking a long time to download the data, however my coworker ran it a few times and it locked up his computer. Then it dawned on me: the formulas were rewritten to now reference A23:A1048576. Excel was touching 1 million rows over and over again every time the sheet calculated, which was often (he was using an RTD link, so it recalculated constantly). A simple solution: write a UDF that would count excatly the size of my data array, and use that instead.
This was the surprise: since I only had about 1,000 data points (but I didn’t want to hardcode to that number, and so I referenced all rows on the sheet), my running time, even using Excel 2003, went down from 30 seconds to about 6 seconds. The original slowness I had mostly chalked up to Excel handling data poorly; instead, it was purely a function of my forcing it to handle the data poorly, a problem only exposed by migrating to a higher-throughput device. The moral of the story is that if it doesn’t scale, it may be your fault, not theirs.
Posted by Doug
on May 29, 2009
Technology /
No Comments
A few weeks go I finally got fed up of picking out which music to listen to. I don’t have the biggest music library, and since I moved back to Windows, I have been at a loss to find something that displays it in a way conducive to listening to all my tracks. (Somehow, Amarok on Linux did that job very well. Awesome player.) As a result, I started using Pandora, and really liked it. At first it played my “seed” songs too much, but a little nudging caused it to branch out, and now I have a couple of really enjoyable stations with a good variety of music.
Now for the inevitable problem: my computer is loud and it’s a waste of energy and a distraction to turn it on to listen to music. The solution: listen to Pandora on a stand-alone device. As a secondary requirement, I wanted a device with an iPod dock, since I have felt a similar problem with not being able to listen to the iPod.
The only device I found out there was the Grace Digital Audio IR3020. It has quite a bit more features than my basic requirements; it plays Sirius radio over the internet (with a subscription), Pandora, iPod, any of a number of streams (podcasts, terrestrial radio over the internet), and music files shared over your local network. You can also set an alarm clock and a sleep timer. It has a remote, and you can set 99 presets (haven’t explored that feature).
Out of curiosity and interest, I have tested most of those features, except for the podcasts (although I’m checking it out now), and the Sirius. Here are some thoughts on each of them and the device.
- Pandora. Works as advertised. All your stations show up in a list, and you bookmark, thumbs up or down, and skip tracks. The Quickmix is available, but you can’t select which stations go into the quickmix (I’m not sure if your configuration from the website holds over.) The big downside is the remote is completely ineffective for this. They don’t have the “Reply” button on the remote, and so you can’t give feedback or skip tracks.
- iPod. You can navigate with the iPod wheel to pick music as usual. Similar to Pandora, you can’t really control the iPod with the remote. Shockingly, I couldn’t even change tracks; I could fast forward and pause. Unlike the radio stations, you can’t set iPod as a preset, so you have to be able to see the screen to play the iPod.
- Streaming Radio. Thousands of stations from around the world are available to stream, and you can add them to your player through the website. This web-config option is one of the coolest things. Change a setting on the internet, and the option appears on the player. This doesn’t have many controls, so there’s nothing the remote can’t do.
- Network Music. I actually did not expect this feature; it can play music from a Windows share, as well as from a Universal Plug’n'Play server. I haven’t been able to get the former to work (very frustrating!), but Windows Media Player 11 sets up the latter with ease, and if my computer is on, I can access my entire library through the radio. And to really placate me, it allows you to navigate through your music either by artist, etc. according to the ID3 tags, or through the filesystem. I am really organized, so the latter is generally a very good choice for me. If you have a home media server, this would be a really sweet feature.
- In general, the interface is very poor. I have harped on how the remote doesn’t really do anything. The turn-wheel on the front of the player, used to navigate menus and make selections, has so much resistance that when you try to push it, you slide the radio across the table. The screen is too small for its functionality–showing only 3 lines of information and a line of status–so you are constantly scrolling and discovering easter eggs because you didn’t know certain menu items exist!
- It has both an ethernet jack and a wireless b/g antenna. It was a little annoying entering the 16-digit (or however long) key for the router in there using the scroll wheel, but it was a one-time exercise. One cool thing is that it sets the time automatically when you get online, so it pays you back in effort right there.
- For completeness, I’ll tell you that it (apparently) has 2 20-watt speakers, RCA and headphone out. The equalizer has a half-dozen presets.
Overall, it is a very good device. It meets your needs, but on its terms. That, of course, is the story of consumer electronics.
Posted by Doug
on May 08, 2009
Technology /
No Comments
There isn’t much to it; this post explains it all. Make sure you use the driver version they tell you to download, not the one off the linksys website.
You don’t get the Linksys interface this way, but the built-in windows software works as well as I recall linksys working; I am getting a signal from 3 stories down and 30 linear feet away.
Posted by Doug
on May 01, 2009
Technology /
No Comments
This post on the dropbox forums says exactly what to do: you can either install an old version of dropbox (I couldn’t figure out how to make it run properly in Linux), or you can use that guy’s Python script. He even provides a Windows binary.
To use the script in Linux, note that you have to change a few lines to manually input your dropbox.db file loation (since the APPDATA variable will not be set). Also, when entering your new dropbox location, don’t use a trailing slash. It worked perfectly for me; now I have Windows and Linux syncing from the same directory!
Posted by Doug
on April 15, 2009
Technology /
1 Comment
If you listened to me and installed dropbox, kudos! I hope you love it as much as I do.
I just started using the software to collaborate on files, and found that it behaves very funny. In particular, when you open an excel (or other MS Office file), Dropbox does not sync the file to the server until after you close it. Furthermore, if a person opens an excel file, even if they make no changes, dropbox will mark the file as changed and potentially create a conflict.
The solution, according to this forum post is to mark your spreadsheets as collaboration. As a result, excel doesn’t lock the files, so saves will be synced automatically, and changes will be merged across files. (And presumably, changes will also be updated as you work on them, but I’m not sure how that works).
I haven’t tried this yet, but I will follow up in a few days once I have had a chance to look at it. I can see that dropbox may still get confused as two people are editing the same file (particularly macros, which don’t like to change once you have opened a file), but I think MS has probably conquered this problem by now.