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.

Bed Time Check List

All Posts No Comments »

(a.k.a. what tabs do I keep permanently open in my browser?)

Before I go to sleep (and many other times during the day), I check:

Tomorrow’s forecast (noaa.gov)
Tomorrow’s schedule (Google Calendar)
Any unread items in Google Reader?
Anything new on Forum.case.edu?
Any new updates on Facebook?
Any new posts on Twitter?
Any new e-mail?

Sleep.

Now on FriendFeed

All Posts No Comments »

I’ve been hearing about FriendFeed on and off for the last few months and I decided to give it a try.  Friendfeed is a service that lets you aggregate your friends’ online presences.  I’m able to track what my friends upload to Flickr, post on Twitter, share in Google Reader, upmod on Reddit, and so on.

So why not just grab RSS feeds for these things and follow it all from Google Reader?  Well, for one, FriendFeed will automatically start showing me updates from services that my friends have just added. So, there’s no need for them to announce they’ve just joined X service.  And it will also let me comment on their updates as well.

I’ll be experimenting with the service for the next few weeks and see what I can do with it.  I’ve already replaced the Twitter Updates widget in my side bar with my FriendFeed widget.  I’m planning on changing my blog theme soon, so the widget won’t clash so much with the current theme (although you can customize it with CSS, but I don’t have the time to do that right now.)

And if you want to check out my page, here it is: http://friendfeed.com/alexhutnik.

P.S. I just found out/remembered that fellow Case student Ben Golub works for FriendFeed.  Nice work, Ben!

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