Berkeley CSUA MOTD:2007:April:30 Monday <Sunday, Tuesday>
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2007/4/30-5/4 [Transportation/Car, Transportation/Car/RoadHogs] UID:46479 Activity:nil 66%like:46447
4/30    Part 2 of the OSC anti-car rant.  I liked the last one better.
        http://www.ornery.org/essays/warwatch/2007-04-15-1.html
2007/4/30-5/4 [Science/Electric, Science/GlobalWarming] UID:46480 Activity:nil
4/30    "Solar rises over Fog City - Solar panels are now so efficient that
        fog no longer mandates remaining on the grid"
        http://www.csua.org/u/il0 (SFGate.com)
        \_ I very much want to put these on top of my apartment, but it's still
           not cheap enough. Cool advances, though.
2007/4/30-5/2 [Science/GlobalWarming] UID:46481 Activity:nil
4/30    Woman must pay $2000 to clean up broken CFL bulb.
        http://csua.org/u/iky
        \_ This article is a load of crappe.  It's probably
           still a good idea to remove mercury from CFL though
           \_ Sure it would be "good" to remove mercury from CFL, but
              zero point energy would also be "good."  Doesn't mean it's
              happening anytime soon.
        \_ Holy crap.  I realize mercury might be necessary to get such
           crazy efficiency, but why oh why would you distribute that much
           of it.  It seems like a huge liability which puts a lot of people
           and the environment at risk. -mrauser
           \_ The article is a little confusing, but part of the point was
              5 mg of mercury is nothing.  Requiring a HAZMAT to clean
              up a CFL is ludicous.  However, the factory creating the
              bulbs may contaminate it's vicinity, and the bulbs may
              contaminate landfills.  So it's also ironic that groups with
              a history of over-the-top mercury scaremongering are now
              pushing CFLs.
              \_ In the U.S., most mercury contamination comes from...
                 <wait for it>...coal-burning electrical plants!
2007/4/30-5/4 [Computer/SW/Security] UID:46482 Activity:nil
4/30    Can someone recommend a website that provides the same service as
        cafepress, with custom t-shirt designs, but that does not censor?
        I want to make shirts that I know would get censored at cafepress,
        based on past bad experiences with them.
2007/4/30-5/1 [Transportation/PublicTransit] UID:46483 Activity:low
4/30    Free public transit in the Bay Area today!
        \_ I'm surprised that there was no surge in BART ridership on Monday.
           Usually there's a surge during Spare-The-Air free-transit days.
2007/4/30-5/1 [Politics/Domestic/President/Bush] UID:46484 Activity:low
4/30    It's nearly noon in DC. Why hasn't Bush vetoed the bill yet?
        \_ They're delivering it tomorrow.  4th anniversary of "Major
           combat operations in Iraq have ended" speech.
        \_ 'cause he ain't woke up yet?
           \_ Damn you, O'Doul's!
        \_ I keep wondering what would happen if W just signed it with a
           "signing statement" saying congress has no power to direct
           troop assignments, and he'll assign the tropps as he sees fit to
           protect american interests.
2007/4/30-5/4 [Computer/SW/Languages/C_Cplusplus, Computer/SW/WWW/Server] UID:46485 Activity:nil
4/30    Technical question:
        I have a threaded webserver, one thread waits around and calls
        accept, then pulls threads out of a thread pool to handle the
        requests.  I want to be able to shut down the webserver cleanly, so
        I have the main thread wait for a signal to shutdown.  It then
        joins on the accept thread while the accept thread cleans up the
        threadpool.  The only problem is, how do I get the accept thread
        to exit?  I can't get it to stop waiting on accept.  Even closing
        the socket out from under it doesn't always get it to wake up from
        the accept call.  Is there a standard way to handle this?
        Addendum: Oops, Using C on *nix.
        \_ Umm, what language are you using?
           \_ obviously english. :D
        \_ Use select to see if there is something available on the socket
           before you accept.  Create the accept socket with O_NONBLOCK.
           It's all in the man page for accept.
        \_ You generally need to use select(2)/poll(2) on the fd to make
           sure there is something to read before calling accept(2), or
           you will run into this problem. Take a look at Stevens, Unix
           Network Programming Vol. 1 2d Ed., Ch 6 and Ch 27 for fairly
           detailed examples of how to do this.
        \_ Use shutdown(fd, SHUT_RDWR) instead of close.  It will wake up
           the accept.
Berkeley CSUA MOTD:2007:April:30 Monday <Sunday, Tuesday>