Berkeley CSUA MOTD:Entry 32778
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2004/8/9 [Computer/SW/Languages] UID:32778 Activity:nil
8/9     bool urlP(string s) {
          if (s is of the form "<DEAD>blahblah"<DEAD> return #t
          else return #f
        }
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2009/6/30-7/15 [Computer/SW/Languages/JavaScript] UID:53098 Activity:nil
6/30    Javascript, I love you:
        var b = new Boolean(false);
        b;        // false
        !b;       // ALSO false
        !b == b;  // But this is true!
        !!b == !b // Negate both sides and it's false again. FUCK.
	...
2007/9/27-10/2 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Python] UID:48202 Activity:moderate
9/27    Ok so to do the equivalent of  the following:
        bool ? a : b
        In Python, it is:
        (bool and [a] or [b])[0]
        Uh, kick ass?
        \_ 99 times out of 100 if you use the trinary operator you are
	...
2007/1/17-25 [Computer/SW/WWW/Browsers] UID:45555 Activity:nil
1/17    Hey, Firefox can launch an external application to view source.  Go to
        about:config and check out view_source.editor.external (bool), and
        view_source.editor.path (string)
        \_ Thanks!  I just took a few seconds to set this up and it
           works great.
	...
2006/8/25-28 [Computer/SW/Languages/C_Cplusplus] UID:44153 Activity:nil
8/25    Dear C++ experts. Why would there be two "const" in the following
        method declaration?
        const bool ILikeMotd() const;
        \_ The first const refers to the data type returned.  The second
           const says the function doesn't modify an object's member variables.
           The first const in your example is bad, I believe; it should
	...
2005/11/20-22 [Computer/SW/OS/OsX] UID:40665 Activity:high
11/20   Is there an easy way to map the left "alt" key to "meta" key in
        Mac OS X Tiger,  X11 (in full-screen mode).
        \_ Try: defaults write com.apple.x11 swap_alt_meta -bool true
           \_ Sweet . That did it!   Here's another question:
              Is there a similarily elegant way to have Command N
              launch a new rxvt window instead of an xterm?
	...
2004/10/19-20 [Computer/SW/Languages] UID:34229 Activity:nil
10/19   I know leap years occur every 4 years, but there was some exception
        to that. Can anyone tell me what it was? I believe it involved years
        that were multiples of either 100 or 400. Thanks.
        \_ http://www.boulder.nist.gov/timefreq/general/leaps.htm
        \_ Year mod 4 == 0, leap year
           Year mod 100 == 0, no leap year
	...
2004/5/11-12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:30151 Activity:low
5/10    On a 32 bit architecture, if I declare something boolean or byte,
        does it still use 32 bits, or is it possible to have a different
        offset for the alignment to pack it more efficiently? ok thx.
        \_ For boolean, it's all up to your compiler.  For byte, most likely
           it's 8 bits, but it's still up to your compiler.
           \_ I heard that if the alignment isn't 32, either the arch
	...
2000/6/21-22 [Computer/SW/Languages/C_Cplusplus] UID:18506 Activity:very high
6/20    I have a variable inside a struct.  I want to be able to initialize
        that variable ONCE and not write to it again.  Any subsequent writes
        should not be permitted.  Is there a way to do that in C?  I know
        about "const int foo = 5;" but the value I need to pass in is dynamic
        and happens at runtime.  Declaring a variable as const doesn't let
        me assign anything to it at all.  Thanks.
	...
1999/9/19-21 [Computer/SW/Compilers, Computer/SW/Languages/C_Cplusplus] UID:16550 Activity:very high
9/18    what does the term "co-ed" mean?
        \_ Co-Education. It is a old term used to differentiate those
           who studied in single-sex (boys only or girls only) classes
           and those whose classes had both sexes. In the vernacular
           a co-ed means "a sexy little sorority slut".
        1: a sexy little sorority slut
	...