The READIN Family Album
(April 19, 2002)

READIN

Jeremy's journal

A memorandum-book does not, provided it is neatly written, appear confused to an illiterate person, or to the owner who understands it thoroughly, but to any other person able to read it appears to be inextricably confused.

James Clerk Maxwell


(This is a page from my archives)
Front page
More recent posts
Older posts

Archives index
Subscribe to RSS

This page renders best in Firefox (or Safari, or Chrome)

Sunday, February 17th, 2008

🦋 Out of here

OK, turning off the computer now. We're flying out early tomorrow. Hope the internets can get along without us for a week.

posted evening of February 17th, 2008: 1 response

🦋 Bleak Romania

This afternoon we watched 4 Months, 3 Weeks and 2 Days, on Scott's recommendation -- gosh what a disturbing film that is. Recommended for sure but make sure you know what you're getting into before you go.

A couple of questions: what was the meaning of Otilia taking Dr. Bebe's id card that he had left with the hotel? Was it a fake id, so he had abandoned it? Was she going to use it against him somehow? And it seemed like she left her own id on the desk the last time she left the hotel. (Or, maybe it was his id that she dropped there.)

posted evening of February 17th, 2008: Respond
➳ More posts about The Movies

🦋 The Sally Cycle

I'll record these songs when we get back from vacation. I think it's a nice sound.

  1. Sally's Sleeping
  2. Sally's Dreaming
  3. Sally Woke Up
  4. Sally in the Kitchen
  5. Sally's Dance

posted afternoon of February 17th, 2008: Respond
➳ More posts about Songs

🦋 Vacation Reading

Taking two books along this week: Seeing and Never Let Me Go. As noted below, I won't be blogging; but I am hoping to take notes the old-fashioned way, and compose some good posts on my return.

posted morning of February 17th, 2008: Respond
➳ More posts about Never Let Me Go

Saturday, February 16th, 2008

🦋 Another song about Sally

So I've been writing these short fiddle tunes over the past couple of months with "Sally" in the title. (You can listen to some of them here.) The new one tonight is called "Sally's Reel", though I'm not totally sure what conditions a song has to meet for a reel to be danced to it; I just sounds kind of reelish. ABC Format or PDF.

Update: renamed to "Sally's Dance" -- Gabe let me know that reels generally have a more even rhythm than this tune. And suggested chords for it!

posted evening of February 16th, 2008: Respond
➳ More posts about Music

🦋 The Carter Family

Wow, this is excellent! While going through stuff to pack for our vacation, I just found a CD I had thought lost forever, viz. disk 1 of "The Carter Family" -- this box set about which I think, disk 1 is really amazing music, disks 2 through 5 vary in quality but have an unfortunate tendency towards corny.

posted morning of February 16th, 2008: Respond

Friday, February 15th, 2008

🦋 Never Let Me Go

In the interview yesterday (which features good humor and some real insight) Robyn recommends Kazuo Ishiguro's Never Let Me Go as "a gently devastating book." I had not heard of the book before but now I'm thinking it looks really interesting. -- Here is an interview with Ishiguro and some readings from the book. Onto the queue it goes!

posted evening of February 15th, 2008: Respond
➳ More posts about Kazuo Ishiguro

🦋 Shanghai Love Motel

We're off to see them this evening, at the Yippie! Museum. Cool!

A little vacation coming up; on Monday we're flying away to St. Thomas for a week. I'm going to try and stay away from computers while we're there, unless a work emergency intrudes; so not blogging. Also I think I will take a vacation from my music: not bring along an instrument or an iPod, and only listen to new sounds. Send me your address (by Sunday) and I will send you a postcard.

Hmm, no SLM for us this evening. We did not feel up to the journey into the city -- instead we had a very nice dinner at home and watched Time Bandits, which Ellen has never seen before. What a great film -- I think it is the best ... fantasy? movie -- I hesitate to call Time Bandits "fantasy" but I guess all the lesser movies I associate it with are in that genre.

posted evening of February 15th, 2008: Respond
➳ More posts about Shanghai Love Motel

🦋 Nick and Robyn

Nick Lowe and Robyn Hitchcock are coming to the US! Dates are April 9 (NYC), April 11 (LA), April 12 (SF). How exciting!

posted evening of February 15th, 2008: Respond

🦋 Multiplexing

The fix is in -- the server is using poll instead of select, a new version has been built and delivered to the client, it can handle loads of clients. Here is the long and short of how you do it (without error-checking, which is dull*):

The Old Code

void select_files(int *fds, int nfds)
{
    int i, maxid;
    fd_set rset, wset;
    timeval tval;

    FD_ZERO (&rset);
    FD_ZERO (&wset);
    maxid = 0;
    for (i = 0; i < nfds; ++i) {
        FD_SET (fds[i], &rset);
        FD_SET (fds[i], &wset);
        if (fds[i] > maxid) maxid = fds[i];
    }
    tval.tv_sec = 5;
    tval.tv_usec = 0;

    select (maxid + 1, &rset, &wset, NULL, &tval);
    for (i = 0; i < nfds; ++i) {
        if (FD_ISSET(fds[i], &rset)) 
            read_file(fds[i]);
        if (FD_ISSET(fds[i], &wset)) 
            write_file(fds[i]);
    }
}

The New Code

void poll_files(int *fds, int nfds)
{
    int i;
    pollfd *pfds = (pollfd *) 
              malloc (nfds * sizeof (pollfd));

    for (i = 0; i < nfds; ++i) {
        pfds[i].fd = fds[i];
        pfds[i].events = POLLIN | POLLOUT;
        pfds[i].revents = 0;
    }

    poll (pfds, nfds, 5000);
    for (i = 0; i < nfds; ++i) {
        if (pfds[i].revents & POLLIN) 
            read_file(fds[i]);
        if (pfds[i].revents & POLLOUT) 
            write_file(fds[i]);
    }
}

In order to take advantage of the newly accessible file descriptors above 1024, you will need to add these lines to your /etc/security/limits.conf file:

(username)          soft    nofile          1024
(username)          hard    nofile          4096

I chose 1024 for the soft limit since most apps are not interested in the high number of files, and 4096 for the hard limit because I read on some message boards that performance will degrade above that number. Feel free to choose other values.

You then need to make the following calls from your code (or call ulimit from the script that starts your application):

    struct rlimit nofile;

    if (getrlimit (RLIMIT_NOFILE, &nofile) != 0) {
        fprintf (stderr, "Could not get NOFILE");
        exit (1);
    }
    nofile.rlim_cur = 4096;
    if (setrlimit (RLIMIT_NOFILE, &nofile) != 0) {
        fprintf (stderr, "Could not set NOFILE");
        exit (1);
    }

*If you're interested in the error-checking code, drop me a line -- I just don't feel like typing it out right now.

posted afternoon of February 15th, 2008: Respond
➳ More posts about Programming

Previous posts
Archives

Drop me a line! or, sign my Guestbook.
    •
Check out Ellen's writing at Patch.com.

What's of interest:

(Other links of interest at my Google+ page. It's recommended!)

Where to go from here...

Friends and Family
Programming
Texts
Music
Woodworking
Comix
Blogs
South Orange