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

2008/9/7-12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java, Computer/SW/Languages/Misc] UID:51093 Activity:nil
9/7     I want to learn Design Patterns without having to buy the famous
        book. Is there a place online where I can learn and study it?
        \_ http://c2.com/cgi/wiki/wiki?DesignPatterns
        \_ I'll sell you my copy in near mint condition for $25. -abe
ERROR, url_link recursive (eces.Colorado.EDU/secure/mindterm2) 2025/05/24 [General] UID:1000 Activity:popular
5/24    

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.
	...
2013/4/9-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Apps, Computer/SW/Languages/Perl] UID:54650 Activity:nil
4/04    Is there a good way to diff 2 files that consist of columns of
        floating point numbers, such that it only tells me if there's a
        difference if the numbers on a given line differ by at least a given
        ratio?  Say, 1%?
        \_ Use Excel.
           1. Open foo.txt in Excel.  It should convert all numbers to cells in
	...
2013/4/29-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:54665 Activity:nil
4/29    Why were C and Java designed to require "break;" statements for a
        "case" section to terminate rather than falling-through to the next
        section?  99% of the time poeple want a "case" section to terminate.
        In fact some compilers issue warning if there is no "break;" statement
        in a "case" section.  Why not just design the languages to have
        termination as the default behavior, and provide a "fallthru;"
	...
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+):
	...
2011/3/7-4/20 [Computer/SW/Languages/C_Cplusplus] UID:54056 Activity:nil
3/7     I have a C question.  I have the following source code in two identical
        files t.c and t.cpp:
                #include <stdlib.h>
                int main(int argc, char *argv[]) {
                  const char * const * p1;
                  const char * * p2;
	...
2011/2/5-19 [Computer/SW/Languages/C_Cplusplus] UID:54027 Activity:nil
2/4     random C programming/linker fu question.  If I have
        int main() { printf("%s is at this adddr %p\n", "strlen", strlen); }
        and soda's /proc/sys/kernel/randomize_va_space is 2 (eg; on)
        why is strlen (or any other libc fn) at the same address every time?
        \_ I don't pretend to actually know the right answer to this, but
           could it have something to do with shared libraries?
	...
2010/2/12-3/9 [Computer/SW/Languages/C_Cplusplus] UID:53708 Activity:nil
2/12    I need a way to make a really big C++ executable (~200MBs) that does
        nothing.  No static initialization either.  Any ideas?
        \_ static link in lots of libraries?
        \_ #define a   i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0; i=0;
           #define b   a a a a a a a a a a
           #define c   b b b b b b b b b b
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/7-14 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:53252 Activity:high
8/6     In C one can do "typedef int my_index_t;".  What's the equivalent in
        C#?  Thanks.
        \_ C#? Are you serious? Is this what the class of 2009 learn?
           \_ No.  I have to learn .NET code at work.  I am Class of '93.
           \_ python is what 2009 learns, see the motd thread about recent
              cal courses and languages
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2013/3/5-26 [Computer/SW/Languages/Java] UID:54618 Activity:nil
3/5     Three emergency Java updates in a month. Why do I have a feeling
        that the third one won't be the last one?
        \_ Bingo!
	...
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        http://techcrunch.com/2012/12/18/print-happy-25th-birthday-perl
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?
	...
2012/8/29-11/7 [Computer/SW/Security] UID:54467 Activity:nil
8/29    There was once a CSUA web page which runs an SSH client for logging
        on to soda.  Does that page still exist?  Can someone remind me of the
        URL please?  Thx.
        \_ what do you mean? instruction on how to ssh into soda?
           \_ No I think he means the ssh applet, which, iirc, was an applet
              that implemented an ssh v1 client.  I think this page went away
	...
2011/12/8-2012/1/10 [Computer/SW/Languages/Java, Computer/SW/Security] UID:54252 Activity:nil
12/8    Java code much worse IRL than pretty much everything else:
        http://preview.tinyurl.com/d5e46cq [ars technica]
	...
2011/4/16-7/13 [Computer/SW/Languages/Python] UID:54086 Activity:nil
4/16    Whoa, I just heard that MIT discontinued 6.001 (classic scheme)
        to 6.01. In fact, 6.00, 6.01 and 6.02 all use Python. What the
        hell? What has the world become? It's a sad sad day. SICP forever!
        \_ old story, they've ditched that shitty book and lang for a while.
        \_ I used to think scheme was cool, then I saw Ka Ping Yee's
           "Beautiful Code" class aka 61a in python, and converted.
	...
2011/2/24-4/20 [Computer/SW/Languages/Java] UID:54048 Activity:nil
2/24    Go Programming Language.  Anyone here use it?  It kind of
        reminds me of java-meets python, and well, that is fitting given it's
        a GOOG product.  What is so special about it?
        \_ as I understand it, it's a suitable OOP-y systems language with more
           structure than C, less complexity than C++, and less overhead than
           Java/Python.
	...
2010/8/8-9/7 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Web] UID:53914 Activity:nil
8/8     Trying to make a list of interesting features languages have
        touted as this whole PL field comes around, trying to see if they
        have basis in the culture of the time: feel free to add some/dispute
        1970 C, "portability"
        1980 C++, classes, oop, iterators, streams, functors, templates
             expert systems
	...
2009/12/5-26 [Computer/SW/Languages/Java] UID:53569 Activity:nil
12/4    what do people have their JAVA_HOME's set to on soda?
        \_ don't. are you trying to get sun java? It is installed, but not
           the default.  check dpkg -l and dpkg -L
           \_ I'm trying to run maven to get scala/lift.net working
              properly and it's complaining that JAVA_HOME is not set.
              \_ you probably want one of the directories in /usr/lib/jvm,
	...
Cache (7787 bytes)
c2.com/cgi/wiki/wiki?DesignPatterns
Design Patterns Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice. ChristopherAlexander A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. The solution is a general arrangement of objects and classes that solve the problem. The solution is customized and implemented to solve the problem in a particular context. Maybe because it is easier to look at something one has done and say "Oh, I shouldn't have done that" than it is to look at something one has done and say "My, that was successful. " I think it's the same reason it's easier to tell somebody what not to do than what to do. Isn't the definition or existence of a problem a preceeding step to finding a solution? So to find a successful pattern you have to have first determined some failed approaches which offer needed contrast. Also, it is intuitively persuading to think that there are more ways to fail than to succeed. ScottWalters This is an old, old argument in the Software patterns community. This subject has been brought up and rehashed at every single PLoP (and probably EuroPLoP) conference since the very first one. DesignPatternsBook will tend to see new patterns in terms of their relationship to the 23. Someone will always be able to say "actually that's just a grey-green-blue." AdewaleOshineye One can argue that many of the GoF patterns are not fundamental to OO design, but rather work around limitations in particular implementations of OO. For example, several patterns in the GoF book that work well in Java or C++ are unneeded in languages with a more powerful OO approach; That's an old, weak argument usually put forward by those who either don't understand the patterns much or haven't thought deeply about the capabilities of those languages. did not invent those patterns, I would like to see a variation from the already well known patterns, which IMHO, would be more educative. As the 23 patterns are well known, it is easier to grasp related patterns. After several years of being around patterns, these 23 patterns seem low level -- at the level of two or three objects interacting with each other. For higher-level patterns, I dug out Plop and Plop 2 My favorite pattern from Plop is #2: A Pattern Language for Tool Construction and Integration Based on the Tools and Materials Metaphor. PatternLanguage is supposed to include patterns for all levels of granularity. You select one that is fairly general to handle a general problem, then use progressively finer grained patterns as you get to more detailed levels of design. So what you say indicates that these software design patterns are in fact patterns in the Alexander sense. Gamma et al does have an Interpreter which you can use to parse a simple grammar, but doesn't seem to have other parser or state machine patterns. But I have never coded a parser or state machine with objects, except by using the Interpreter approach. ShieldPattern, which I would call a fundamental programming pattern. Just curious: any chance that patterns could come with example unit tests? I don't expect cookie-cutter unit tests in all available languages that would work 100% of the time for everyone, but I am thinking that, given a pattern, perhaps a suite of unit tests written in Java that could be used as a basis for creating your own unit tests? that would describe the different types of unit tests you should expect to use when developing a solution using a particular pattern. The most obvious to me would be for instance in the Singleton pattern, you would have a unit test to ensure that only one instance of the object is ever created, etc. As a further note, the more I'm exploring unit tests, the more fun I'm having. I'd like to get into patterns more, but I also think that if a particular problem can have a particular architectural solution (a pattern), then that pattern can have a particular set of unit tests. Essentially think of it as a litmus test -- if your architecture can pass the unit tests for ABC, then it can be considered ABC pattern. In fact, I'd prefer them to be in prose form, so that we can then convert them into code ourselves for our particular testing frameworks. Then individuals could look at the pattern, see that there is a prose description of test X but no code in language Y for test X, so they implement the test in language Y and submit it back to the archive for inclusion. Then when you or I come along and want to test we already have the code available. Of course we customize patterns for our own internal use, but given a standard set of unit tests for a pattern, as long as your code passes those tests you are still considered to be using that pattern. OK I'm rambling quite a bit here, but hopefully you get the idea... I think that automated JUnit tests for at least the most obvious and well-known patterns would be a great idea but I also do think that the patterns themselves may serve as the "prose" of a unit test as they fairly well do describe / specify the pattern. Automated JUnit test creation however is quite difficult, given that a pattern can be occluded by other patterns also implemented in one unit, unless you require certain base classes or interfaces to be present. However, with UML and J2SE 15 and other languages that support attributed methods, fields and classes, it could be made possible and likewise be automated by some generic test tool - that would at least require some additional configuration or perhaps user-implemented callbacks - call it a framework. Developers trying to adopt XP practices find writing the unit tests as hard (or harder) than writing the objects under test. Finding ways to automate testing with things like JUnit requires some pretty good lateral thinking (and patience). I'd be interested to hear about anyone that has done a lot of unit testing and accumulated common patterns that crop up again and again; If the reader is not conscious, that we are surrounded by patterns, if we, for example, do not point that the nature is build up from lots of patterns, then we will not convince him that easily about the importance of using them. It must be discovered (determined by somebody) that it is general enough to be useful and applicable to lots of situations in systems design and development. A few brilliant guys identified the first ones, that were, in retrospective, the easiest to get. As time went by, the ones left were more and more difficult to discover, so what has been said about patterns and time is correct, but the inference produced does not stand. As time passes by, it takes much more effort to discover new patterns. com/, which on this topic shows only the slashdot story so far): "ACM's Special Interest Group on Programming Languages (SIGPLAN) recently awarded the 2005 Programming Languages Achievement Award to Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (known as the 'Gang of Four') for their creation of 'Design Patterns' (the computer science book and the subfield at the intersection of programming languages and software engineering). The annual award recognizes an individual (or individuals) who has (have) made a significant and lasting contribution to the field of programming languages." sid=05/07/31/0046223&ti d=185&tid=14 * Credit for what appears to be first news report goes to Brent Hailpern, "a researcher at the IBM Thomas J Watson Research Center, in Hawthorne, New York."