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

2000/12/8 [Computer/SW/Languages, Computer/SW/Languages/Java] UID:20040 Activity:very high
12/7    Eh, why are some virtuals set to 0 (pure virtual) and some are not?
        The following should look familiar to people who have been killed
        in the class:

#define Expression_SHARED_EXTRAS                \
virtual tree_node *createPARSETree();           \
virtual void scope_check();                     \
virtual void insert_type();                      \
virtual Symbol type_check();                      \

#define Case_EXTRAS                             \
virtual tree_node *createPARSETree() = 0;       \
virtual void scope_check() = 0;                 \
virtual void insert_type() = 0;                 \
virtual Symbol type_check() = 0;                  \
        \_ if someone can answer this, please do.  I want to know too.
        \_ defining as virtual = 0  to create an interface definition or
        abstract class
           \_ Yes.  In particular, pure virtual functions are a signal to both
              the compiler and client code that this class is not expected
              to be instantiated, only inherited from.  It also requires any
              child classes to provide the method, but doesn't provide a
              default implementation.  There are many situations where this
              is exactly what you want.  You may not really get this until
              you're trying to make a framework of code that other people
              are expected to use, but not modify... -mogul
2025/05/27 [General] UID:1000 Activity:popular
5/27    

You may also be interested in these entries...
2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil
1/14    Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
        C?  I have some overloaded functtions where one takes an integer
        parameter and the other a pointer parameter.  When I call it with
        "NULL", the compiler matches it with the integer version instead of
        the pointer version which is a problem.  Other funny effect is that
        sizeof(NULL) is different from sizeof(myPtr).  Thanks.
	...
2012/7/19-11/7 [Computer/SW/Languages/C_Cplusplus] UID:54439 Activity:nil
7/19    In C or C++, how do I write the code of a function with variable
        number of parameters in order to pass the variable parameters to
        another function that also has variable number of parameters?  Thanks.
        \_ The usual way (works on gcc 3.0+, Visual Studio 2005+):
               #define foo(fmt, ...) printf(fmt, ##__VA_ARGS__)
           The cool new way (works on gcc 4.3+):
	...
2010/8/12-9/7 [Computer/SW/Languages] UID:53921 Activity:nil
8/12    Judge Walker denies Stay. Prop 8 null and void from next Wednesday:
        <DEAD>ecf.cand.uscourts.gov/cand/09cv2292<DEAD>
	...
2010/6/4-30 [Computer/SW/Languages/C_Cplusplus] UID:53849 Activity:nil
6/4     Is this valid C++ code?
        std::string getStr(void) {
            std::string str("foo");
            return str;
        }
        void foo(char *s);
	...
2006/2/21-23 [Computer/SW/Languages/Java] UID:41939 Activity:nil
2/21    What is the best way to get the current method name in Java?  So far
        I have seen 3 approaches:
        1. Create new Exception, grab the first frame off its stack trace.
           Inelegant, requires creating a stack trace (expensive).
           \_ Yeah it sucks.  Yeah it does much more work than you need.
              Yeah it is really fragile and may break when you switch java
	...
2006/2/1-3 [Consumer/CellPhone, Computer/SW/Security] UID:41652 Activity:low
2/1     Dear old farts. What was the consumer end of telecomm like before
        the 1983 divestiture of AT&T into 7 baby Bells, in terms of price
        for consumers, sound quality, reliability, and service?
        \_ Most of you youngin' were too young to remember this but back
           then long distance calls were prohibitively expensive. On the
           other hand, you didn't have tons of long distance carriers to
	...
2006/1/23-25 [Computer/SW/Languages/Java] UID:41480 Activity:nil
1/23    I'm trying to make somebody else's code thread-safe and it seems like
        my synchronization blocks are not being respected.  Does anyone know
        a problem with this code?
        class FooPoller {
          protected static Boolean lock = new Boolean(true);
          private static void poll() {
	...
2013/5/1-18 [Computer/SW/Languages/Java, Computer/Theory] UID:54669 Activity:nil
5/1     What's the difference between CS and Computer Engineering?
        http://holykaw.alltop.com/top-ten-paying-degrees-for-college-graduates
        \_ One is science and the other is engineering.
        \_ From http://en.wikiquote.org/wiki/Computer_science
           'A folkloric quotation ... states that "computer science is no more
           about computers than astronomy is about telescopes."  The design
	...
2012/12/4-18 [Computer/SW/Languages/Java] UID:54544 Activity:nil
12/4    Holy cow, everyone around me in Silicon Valley is way beyond
        middle class according to Chinni's definition:
        http://en.wikipedia.org/wiki/American_middle_class
        \_ Let's set our goals higher:
           http://en.wikipedia.org/wiki/Upper_middle_class_in_the_United_States
           \_ How about this one?
	...
2012/10/29-12/4 [Science/Disaster, Computer/SW/Languages/Java, Politics/Domestic/President/Bush] UID:54516 Activity:nil
10/29   Go Away Sandy.
        \_ Sorry, Coursera is performing preventive maintenance for this
           class site ahead of Hurricane Sandy. Please check back in 15 minutes.
           class site ahead of Hurricane Sandy. Please check back in 15
           minutes.
        \_ Bitch.
	...
2012/1/18-3/3 [Computer/SW/Languages/Java, Finance/Investment] UID:54290 Activity:nil
1/18    I own a bunch of NFLX stocks bought at several different periods
        (from high $200 all the way down to $80). I dumped a few and
        still have a few. Why the hell is Reid Hastings still making
        $500,000/year? How do I join the pending NFLX Class Action
        Lawsuit?
        \_ Why would you buy stock in a company run by a narcissistic
	...