Randomizing A Table In MySQL

All Posts, Computers No Comments »

I’m working on a project right now where I want to collect a Network ID (for prize-drawing purposes) from a survey participant but I don’t want it to be able to be tied to their response.  Even if there’s no relational connection through keys or anything, just the fact that the order of the network IDs in the table matches the order of survey responses is enough for correlation.

I tried alter table netIDs order by rand(); but that gave me an error. I used the Google and found a decent solution which I modified for my purposes:

set autocommit=0;
begin work;
insert into netIDs values ('$netID');
create table netIDs_temp like netIDs;
insert into netIDs_temp (select * from netIDs order by rand());
truncate netIDs;
insert into netIDs (select * from netIDs_temp);
drop table netIDs_temp;
commit;

I wanted to wrap the whole operation in a transaction for atomicity - losing network IDs while keeping responses would be a nightmare, not to mention a violation of research ethics.

Popularity: 5% [?]

iTunes Music Library Visualization

All Posts, Computers 2 Comments »

Inspired by this post I decided to put my iTunes library through wordle:

Unfortunately they don’t have larger thumbnails.

Popularity: 9% [?]

How I Manage My Own Data Storage

All Posts, Computers, Linux No Comments »

I’ve been (seriously) playing with computers since I was about 12 years old.  So in the last 10 years or so, one of the things I’ve always tried to remain conscious of is how reliable (or unreliable) my computer is.  No one likes it when their computer breaks (not even someone who is talented at fixing them).  For me, this concern has been brought on by the stress of losing data that, in hindsight, may not have been all that important.  But, it was a data loss nonetheless and no one likes it when it happens.

So when I was in high school, my first strategy was to put my OS on a different drive than my user data.  I figured that the system drive would experience many more read/writes than the data drive, because of paging and other things.  So, it would be more prone to stress than a data drive that gets used less vigorously.  I kept this strategy for several years.  I was lucky enough to replace drives before they failed (as all drives do).

But, when I got to Case, I was exposed to a ridiculously fast fiber optic network that made it even easier to fill my hard drive with junk I probably don’t need.  I needed a storage solution that met a few objectives:

  • It had to be a relatively large amount available storage.
  • It had to provide some level of fault-tolerance
  • It had to run on Linux, since I was tired of switching between Linux and Windows Server 2003.  I chose Linux and I was sticking with it.

So I built a 1.2TB software RAID5 array. There’s a pic missing on that page, I’ll see if I can locate it or take another.  I also have some other items to add to that page, including benchmarks and other info.  The RAID array is terrific.  It’s survived one and a half drive failures (one legitimate drive failure and half a drive failure that I simulated by yanking a disc while it was on).  Rebuilding the array takes several hours, but that’s to be expected.  More on that when I update that post.

So of course, even with local data fault-tolerance, I want to have an off-site backup service.  At first I was using Dreamhost, but they tried to extort a bunch of money out of me to use my storage space for backups.  It was really shady.  But it did force me to look elsewhere, and I’m glad I did.  I wanted a cross-platform solution (given the heterogenous nature of my current computer collection).  So I selected JungleDisk, which uses Amazon’s S3 web service for data storage.  I pay a pitance (maybe a couple of dollars per month, if that) to store about 20GB of data.  Backups happen nightly (or however often you select).

I use JungleDisk to backup all of the documents I’ve written in college, all of the code I’ve written, all of my digital photos, my encrypted password database, and a dump of my MySQL databases.  Everything is encrypted before it even leaves my computer.  The client runs right on my file server and just works.  It’s an absolutely terrific product.  My only complaint (a feature request, really) is that I wish it would e-mail me a copy of its log file every time a backup occurs.  That way I know if it was successful and what was transferred.

I foresee keeping this setup for quite a while.

Updates: I added an extra drive to the RAID array.  A few quick terminal commands later and I’m up to 1.5TB.  Also, JungleDisk added a reporting option.  You can get an e-mail when a backup job completes but if you want details you have to pay for their monthly service.

Popularity: 18% [?]

Will I Get a New iPhone today?

All Posts, Computers No Comments »

There are two answers to that:

1. Hell yes.

2. Who knows. Apparently the phones might not be on sale until next week.

Either way, I’m really excited to get one. As it turns out, I can realize a lower TCO over two years by canceling my current Verizon contract, paying the cancellation fee, selling my current phone on eBay, and then signing a new AT&T contract and buying an iPhone (with or without the rumored subsidies) than by upgrading my current service (to the minimum $80/month) and getting a Blackberry (which I would have to purchase at full price - $400).

Update: No.  July 11th.  I’m camping out in front of the store the night before.  MacBookPro and DSLR in hand.

Popularity: 22% [?]

Problems with Pidgin and Google Talk (GChat)

All Posts, Computers No Comments »

Today I had some problems with using Pidgin for Google Talk.  I was getting weird errors like “read error”.  I don’t think it’s a Pidgin problem because that package hasn’t been updated recently.

Anyway I search around for a bit and found this solution: http://www.manast.com/2007/05/11/how-to-configure-pidgin-to-work-with-google-talk/

Scroll to the bottom of the post and read the update.

Popularity: 33% [?]

How To: Install Stata 10 on Ubuntu 7.10

Computers, Economics, How-To's, Linux 1 Comment »

I recently had a need to install Stata 10 on Ubuntu 7.10.  It’s actually pretty easy.

1. Open a terminal
2. We’re going to have to do a few things as root so type ‘sudo su‘.
3. Type ‘mkdir -p /usr/local/stata10 && cd /usr/local/stata10
4.  Put the Stata 10 CDROM in your computer.  In the terminal, type ‘/media/cdrom0/install‘.
5.  Answer the appropriate questions in the installation wizard.
6.  When it’s done installing, it will ask you to run ‘./stinit‘.  Go ahead and type that in to the terminal.
7. After entering your licensing information, type this: ‘ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
8. You can now start Stata 10 from the commandline with ‘/usr/local/stata10/stata‘ or ‘/usr/local/stata10/xstata‘ if you want the xwindow version.
9. Optionally, you can run ‘ln -s /usr/local/stata10/stata /usr/bin/stata‘ if you want to run Stata with just ‘stata‘ at the commandline (or you could also include the install directory in your path)

Popularity: 36% [?]

The Decline of Facebook: Now Selling Paper at $1 a sheet?

All Posts, Computers, Economics No Comments »

Unless I’m missing something because I stopped watching MTV 5 years ago, why is Facebook selling paper as one of their cheesy gifts?:

Facebook Paper Gift

Honestly, I think the idea of Facebook gifts is ridiculous.  From a business standpoint though, it’s brilliant.  Because, unfortunately, the company has made millions selling little icons to people for a dollar.  How much does it cost to produce one?  Maybe a hundred dollars or so in wages?  You could probably crank out 2 or 3 a day, put them online, and the next day you’ve made a couple hundred thousand dollars or more.

Popularity: 33% [?]

Think Digg has a lot of Mac Fanboys?

All Posts, Computers No Comments »

Digg Apple Top Ten

Me too.

Popularity: 19% [?]

MIDS385: Tutorial Session

All Posts, Computers, mids385 1 Comment »

I tried getting the word out through some people in the class that I’m going to be in the MIDS lab at 4:30 tomorrow.  I’ll be available to help anyone if they need it.  I plan on answering specific questions for the first 10 minutes or so while everyone shuffles in, then I will spend the rest of the time walking through how I would do the assignment.

Additionally, you should use some of Nikhil’s files as a reference.  You can get them at http://magpie.case.edu/~aah16/ldap.zip. That should provide you with a good starting point.

Again, I encourage you to subscribe to this site via e-mail or RSS.  That is the best way I know of getting information out to everyone.

Popularity: 24% [?]

MIDS385: Edit your files on Magpie with Dreamweaver

All Posts, Computers, Linux, mids385 1 Comment »

OK, in my last post I showed you how to edit files on Magpie using a program called WinSCP3. However, that program just allowed you to transfer the files between your Magpie and your computer, but you had to use something else to actually edit the files (WinSCP3 does have a crude editing program built-in but it is not designed for what we want to do). What if you could edit the files and transfer them to and from Magpie all in the same program?

  1. Download and install Dreamweaver from the software center.
  2. Follow this guide: Windows or Mac.  The settings you want to use are:
    1. Server: magpie.case.edu
    2. user name: your user name
    3. password: your Magpie account password (I suggest checking the box for ’save password’).
    4. Check ‘Use SFTP’ This is important, if this isn’t checked, this won’t work.
    5. I strongly suggest checking the box that says “Automatically upload files to server on save.
  3. Now you should have a Site that is your Magpie account.

This will probably be my last post regarding MIDS 385 unless someone has a specific question about how to do something for the class.  If there is enough demand, I will continue to post tutorials when my schedule allows.

Popularity: 23% [?]

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in