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

2001/11/28-29 [Computer/SW/Languages/C_Cplusplus, Computer/Theory] UID:23132 Activity:high
11/28   http://unicoi.kennesaw.edu/~jbamford/greguide/gresample.html
        Question 8, why isn't the answer C? 1/2 of a binary search (on
        average) would be (log2 N) - 1, where N is the number of nodes in
        a complete binary tree right? So C SHOULD be the answer. But for
        some reason it is not. Help.
        \_ you should send email to help@csua.berkeley.edu.  maybe they
        \_ you should send email to root@cory.eecs.berkeley.edu.  maybe they
           can help you there.
                \_ please don't waste our time                  -kevinm
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.
	...
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
	...
2005/11/14-15 [Computer/SW/OS/Solaris] UID:40576 Activity:moderate
11/14   Ugg. It took me all of 20 seconds to figure out NIS on linux.
        I can't even figure out how to lock a yppasswd on solaris.  Help.
        \_ Hint: Your issue is not with NIS
           \_ Uhh, what is it with?
              \_ Solaris' passwd mechanism doesn't provide a locking mechanism
                 (unless it's a recent addition i don't know about)
	...
2001/2/9-11 [Computer/Theory] UID:20547 Activity:high
2/8     I have 20 positive numbers and five desired totals (all floating point
        numbers).  I need to pick five mutually exclusive sets (not necessarily
        exhausive) of numbers from the 20 numbers, and then sum up the numbers
        in the five sets to get five totals.  My goal is to minimize the
        mean-of-squares of the differences between the five totals and the five
        desired totals.  I wrote a C program to do the brute-force try-all-
	...
Cache (4056 bytes)
unicoi.kennesaw.edu/~jbamford/greguide/gresample.html
Varied Sample Questions: These questions come directly from the materials sent from the ETS with the return registration card. They are actual questions that have appeared on the GRE CS subject exam in the past. I strongly recommend that students interested in taking the GRE purchase the book available from the ETS itself - it is invaluable for its sample problems. The answers are here. Which of the following sort algorithms yield approximately the same worst-case and average-case running time behavior in 0(n log n)? A) Bubble Sort and Selection sort B) Heap sort and Merge Sort C) Quicksort and Radix sort D) Tree Sort and Median-of-3 Quicksort E) Exchange sort and Insertion Sort 2) If all variables are of type integer and if a = b (mod m) and x = y (mod m), which of the following must be true? II. III. A) II only B) III only C) I and II only D) I and III only E) I, II, and III 3) S --> A0B A --> BB|0 B --> AA|1 What is the number of terminal strings the length of 5 generated by the context-free grammar show above? A) 4 B) 5 C) 6 D) 7 E) 8 4) Consider a computer system in which processes can request and release one or more resources. Once a process has been granted a resource, the process has exclusive use of that resource until it is released. If a process requests a resource that is already in use, the process enters a queue for that resource, waiting until the resource, is available. Which of the following will NOT deal effectively with the problem of deadlock? A) Giving priorities to processes and ordering the wait queues by priority B) Having a process request all its required resources when it first begins, and restating if it cannot obtain them all C) Numbering the resources and requiring that processes request resources in order of increasing number D) Having processes time out and restart after a random interval of waiting E) Having the operating system monitor the wait queues and restart the processes to break deadlocks. Many cryptographic protocols base their security on assumptions about the computational difficulty of integer factorization. Integer factorization serves this purpose because it is believed that: A) integer multiplication is a function whose inverse, factorization, remains difficult for a large class of inputs B) P = NP C) Even if P = NP, integer factorization is still likely not to be polynomial-time computable D) Testing primality is computationally intractable E) Integer factorization is NP-hard 6) Suppose one wishes to be certain that after execution of the statement if a > b then x := a; Of the following, which is the weakest (least restrictive) condition that must be necessarily hold before execution of that statement? A) (x = a) \/ (a > b) B) (a > b) /\ (x = a) C) a > b D) x > b E) x = a 7) A relation can be defined by giving the ordered pairs of elements for which the relation holds. If the relation R over {a, b, c} is given by R = {(a,a), (a,b), (b,a), (b,b), (c,c)}, which of the following properties does R have? Symmetry II. Antisymmetry III. Reflexivity IV. Transitivity A) None B) II and III only C) II and IV only D) I, III, and IV only E) II, III and IV only 8) Assume that a data file has an index consisting of N items, where N is large. If a binary search of the index is used to find an item, the, of the following, which best approximates the mean number of comparisons required to locate a specific index entry? A) (N + 1) / 2 B) N (N - 1) /2 C) (log2N) - 1 D) N log2 N E) (N + 1) / log2 N 9) Of the following, which best approximates the ratio of the number of nonterminal nodes to the total number of nodes in a complete K-ary tree of depth N? A) 1 / N B) N - 1 / N C) 1 / K D) K - 1/K E) Log10 1 / N 10) Consider a disk with the following characteristics: Track size: 10,000 bytes Rotational latency: 10 ms/revolution Block size: 1,000 bytes The maximum transfer rate per track measured in bits per second as is conventional for this disk unit is: A) 400 Mbps B) 8Mbps C) 6,400 Mbps D) 4,250 Mbps E) 10 Mbps References Visible links 1. Hidden links: 12.
Cache (1958 bytes)
csua.berkeley.edu
Science Undergraduate Association The Computer Science Undergraduate Association is dedicated to representing the undergraduate Computer Science student body and associates to the University of California at Berkeley, its representatives, and other related organizations; Our office is located in 343 Soda Hall, located at the corner of Hearst & LeRoy. May___| |May, 2004 | |_S___M___T___W___T___F___S_| | |1 | ||___| |2 |3 |4 |5 |6 |7 |8 | |___|___|___|___|___|___|___| |9 |10 |11 |12 |13 |14 |15 | |___|___|___|___|___|___|___| |16 |17 |18 |19 |20 |21 |22 | |___|___|___|___|___|___|___| |23 |24 |25 |26 |27 |28 |29 | |___|___|___|___|___|___|___| |30 |31 | | |___|___|| Calendar of Events Mon, May 3rd, (6:00 PM) General Meeting/Officer Elections Announcements: * CSUA t-shirts are now available in the office (343 Soda) for $12 each. Baby-doll cuts also available. View the design on front and back. The CSUA Mentoring Program is calling for new students to sign up to be mentored. Register to find out more information about this free program at the mentoring website. Members interested in mentoring should contact jhs as soon as possible. CSUA Officer Meetings: Politburo meetings for Spring 2004 are scheduled for every Monday at 6pm in 337 Soda Hall. New members always welcome. Help Sessions are being offered, open especially to new students. The topics, times, and locations are listed here. We just made a Costco run. If you don't know what this means, stop by 343 Soda to find out. The Constitution has been amended. Many thanks to AMD and the TDA Project. Secure remote logins require either SSH ( Java Client) or S/KEY ( Java Client). User Policy - The Rules * Frequently Asked Questions about the CSUA and Soda * CSUA Constitution * Message of the Day - Including downtime announcements * CSUA Library * CSUA Encyclopedia * Membership application form, in PDF, TeX, DVI, and Postscript. The Mentoring Program * Prospective LSCS Mailing List.