Berkeley CSUA MOTD:2005:February:17 Thursday <Wednesday, Friday>
Berkeley CSUA MOTD
2005/2/17 [Computer/HW/Memory] UID:36209 Activity:nil
2/17    I have an early 12" powerbook g4, with a 867MHZ cpu and officially
        max ram of 640M.  It was soon replaced by something with higher speed
        and 1.12G max ram.  I saw some memory chip sites that implies I can
        put a 1G chip in the rev A model I have as well.  Can anyone confirm
        or refute this?  tia.
2005/2/17 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:36210 Activity:high
2/17    I need to write some code using sockets that will work on both
        Windows and LINUX.  Ideally, I'd like to just use the standard
        POSIX sockets and have the code work on both platforms.  Based on
        info from MSDN, it looks like this is possible but I'd like to
        ask people on the MOTD if they've encountered any inconsistencies
        or other issues doing things this way.  Thanks.  -emin
        \_ It mostly works, except for a few little things (WSAStartup,
           closesocket, ioctlsocket, etc.).  As long as you're not doing
           anything complicated, a few #defines are all you need.  --mconst
        \_ What language?  (I assume C or C++.)
           Which compiler on Windows?  Which on Linux?
           What are your library options?
           \_ Sorry, language=either C or C++ is fine, compilers=Visual C/C++
              on Windows and gcc on LINUX, library options=whatever I need
              to get it to work, but preferably standard stuff.  Thanks. -emin
              \_ I recommend wxWidgets (formerly wxWindows).  It's got sockets
                 and should compile on both platforms without source code
              \_ Someone else recommended sdl_net a while ago, but beware: it's
2005/2/17 [Politics/Domestic/California, Reference/Tax] UID:36211 Activity:high
2/17    "No, the philosophy, as I recall, was that if you earn
         money, you deserve it (note "earn" in the the meritocratic
         sense.)  And are not wealthy, and don't work for money,
         you do not deserve it.  -John"
        \_ ok, few Q's. 1) what if you won the lotto, is that meritocratic?
           2) suppose you simply got lucky, say during the dot-com days and
           got 5 million dollars even though the poor bozo around you worked
           just as hard, is that meritocratic? 3) suppose you inherited an
           apartment building and all you do is you hiring someone else to
           manage it for you, and you get good and consistent income from
           that. Is that meritocratic? 4) suppose your ancestors left great
           wealth to you and the wealth "self-generates" with minimal input,
           is that meritocratic?
           Lastly, for each of the question, if the answer is no, should the
           solution be to redistribute the wealth via brute force?
           \_ Are you asking what John thinks, what we (other random motd
              posters) think or what Ayn Rand would have thought?
              \_ asking what everyone thinks, just a survey, not expecting a
                 right wrong answer, just want to understand what and why you
                 guys have certain opinions. open ended question ya know  -pp
           \_ (1) Yes.  You invested, you got lucky.  Question the system if
              you will, not the winner's right to the money. (2) Yes.  Life
              is not fair, sorry.  If he's starving, you may take a moment to
              think about whether you have an ethical burden to help him or
              not, but this is your prerogative. (3) Yes.  It's capital.  It
              was earned at some point by someone, you received it through
              legal means. (4) Yes.  See (3).  Of course I'm ridiculously
              stretching the meaning of "merit", but I fail to understand
              the source of all the resentment directed at those with money
              obtained through legal means?  I always thought the American
              ideal (compared to some wacko European marxists I know) was not
              "hey, he's not supposed to have that", but "hey, how can I get
              that as well".  And if you're going to quote me, do me the favor
              of correcting my ass grammar, would you please?  -John
              \_ I don't resent the wealthy.  I do think that wealth reaches
                 the point of diminishing returns fairly rapidly, and that
                 it is better for the society for a billion dollars to be spent
                 on, say, public health care, than for Bill Gates to be worth
                 $51 billion instead of $50 billion.  -tom
                 \_ I don't know what the exact endowment of his foundation
                    is, but it's accomplishing exponentially more than the
                    same amount of money would in the hands of, say, NIH
                    bureaucrats.  Yes, if you rely on private charity you
                    can't guarantee the flow of money from the hands of the
                    wealthy, but it's also pretty obvious that, without the
                    choice of what to do with the money (hence the idea of tax
                    deductions, I guess) the money would go somewhere else
                    (i.e. a Cayman account) pretty quickly and nobody would
                    benefit from it.  -John
                    \_ The argument you just made--you can't tax the rich
                       because they'll just hide the money--is a lot different
                       than the one you started this thread with, don't you
                       think?  -tom
                       \_ (a) I didn't start the thread, (b) I didn't say you
                          can't tax the rich, I objected to the idea of
                          taxing the rich out of principle (as in "because
                          they're rich and we're not") and (c) I'm pointing
                          out economic realities which any society trying
                          to come up with a usable and just taxation model
                          must consider--that enforced equality is bunk, that
                          exorbitant taxes will be seen as theft (rightly imho
                          but that's just a subjective opinion) and that very
                          often private disbursal of funds is more effective
                          than government spending.  -John
           \_ Having read only Atlas Shrugged, I would say that Ayn Rand would
              reply as follows: (1) No. Lotto is theft. (2) Possibly, depends
              on what you did vs. what others did.  Did you create value? Did
              your work translate into $$? Or was it plain dumb luck? (3) Yes.
              Capital begets capital. It's smart investment. (4) Yes. See
              previous.  Although, given Ayn's philosophy, she would likely
              say for (3) and (4), that if the previous generation earned the
              money via superior intelligence, ability, etc., they would most
              likely also have trained their progeny to be "men of ability,"
              who would be able to further the family line.  Ayn believed in
              what John says above, and also believed that certain ppl had
              inherent qualities that made them "men of ability," and that they
              knew hard work, were intelligent and capable, and would thus
              naturally rise to the top in a meritocracy - a system that
              rewarded those who earned money, and not those who didn't.
              \_ I have also only read Rand's fiction, just Atlas Shrugged and
                 The Fountainhead. I am having trouble seeing where you get
                 (1) from.  I don't remember gambling being mentioned in
                 either book.  Personally, I agree with "no. lotto is theft",
                 but where's the evidence that Rand did?
                 \_ Privately run lotteries would not be considered theft.
                    Whether a publically ran lottery would be something Rand
                    agrees with is not a question I know the answer to.  In
                    some sense the question is moot because government ran
                    lotteries make, rather than lose, money.  She certainly
                    wouldn't say it was 'theft', she might possibly say this
                    sort of thing lies outside the juristiction of government.
                      -- ilyas
        \_ Wealth becoming concentrated in the hands of a small minority
           of richer and richer landlords is a phenomenon seen in the
           dynastic cycle of China.  Usually, when a new dynasty is
           founded, land is redistributed to make it more equitable, and
           taxation would be working well, then as the years passed by,
           wealth becomes concentrated in fewer and fewer number of
           richer and richer landlords.  Wealth begets wealth and these
           landlords gain power and can bribe local officials or become
           officials themselves, and through corruption, they don't pay much
           taxes, and the central government starts having problem collecting
           taxes, and the tax burden goes increasingly to the small farmers,
           and the dynasty weakens and eventually fails.  This
           phenomenon was well observed and documented in China's history and
           they even have a term for it.  A little simplistic, and probably
           not entirely relevant to the modern world, but it's something to
           think about.
           \_ Very astute and accurate observation.  Equally interesting is
              to chart out what happens to healthy economies and societies
              when the rabble finds that it can help itself to the wealth
              of its prosperous members at gunpoint in the name of
              democracy and equality (French revolution, Soviet revolution,
              Zimbabwe, Uganda under Idi Amin, etc.)  -John
              \_ The idea is that if the problem the poster above you
                 mentioned is not dealt with, it may eventually lead
                 to the problem you stated.
                 \_ Also completely accurate--however it's an fascinating to
                    compare upheaval-type attempts to redistribute wealth to
                    more gradual ones (viz. growth of tax systems in western
                    countries since 1700.)
                    \_ Yes, the gradual ones are known as 'boiling the frog.'
           \_ Of course, there is also a Chinese proverb that says wealth
              doesn't survive past 3 generations.  BTW, what is the chinese
              term that describes the phenomenon you described?
              \_ I only remember the second character is "tian2" as in
                 farm land.
        \_ I wonder how Marx and other various famous political theorists
           would respond to this question.
        \_ Take my girlfriend.  She just got her master in human
           resources from a above average school.  She is very capable and
           driven and I am sure she will do well in her career.  But
           because she is a foreign student, doesn't have any US working
           experience,  and also her English is not very
           good at all, after a few months of job search, all she got was
           a $47000 offer from a tiny company in the middle of nowhere.
           So she called up her wealthy and successful cousin who knows many
           wealthy and successful people, and viola, she got a $80000 job with
           nice annual bonuses of $20000+.  Now, people say most job offers
           are made through networking, but do you think this is meritocratic?
           \_ I don't.  I think networking is evil, and I don't do it
              professionally myself. -- ilyas
              \_ no wonder you don't have a job.  -tom
              \_ isn't academia very political as well? I get to know a few
                 people, write mediocre papers, submit to conferences in which
                 your buddies or your professor's buddies are chairmen of, and
                 get published? How about DARPA and NSF funding, don't
                 professors shmooz a lot to get those funding?
                 \_ Yes, academia is extremely political. -- ilyas
                 \_ Yes, academia is extremely political and schmoozy.
                    However, past a certain point, in academia (as in industry)
                    results speak for themselves without any of the crap.
                      -- ilyas
        \_ "Behind every great fortune there is a crime." -Honore de Balzac
2005/2/17 [Computer/Networking] UID:36212 Activity:nil
2/17    IP/UDP question. How do packet sniffers work? The OS takes care of
        low level ethernet card stuff and filters out UDP/TCP before they even
        redirect those packets to applications, so how do sniffers by-pass
        this mechanism? I'm asking because I'd like to write a sniffer in
        Java and I'm not even sure if Java can specify low level ethernet
        frame details and by-pass the filtering/classification process. ok thx.
        \_ In unix you put a card into promiscuous mode (look at how tcpdump
           does it.)  Unter Windows look into NDIS--it only allows "raw"
           access to the if for some drivers/hardware.  This is why there are
           no good passive wifi scanners under Windows (correct me if I'm
           wrong, please.)  -John
2005/2/17 [Computer/SW/Security, Politics/Domestic/President/Bush] UID:36213 Activity:high
2/17    Bush warned 52 times before 9/11 attacks:
        \_ we are constantly warned of an attack from Al Qaeeda,
           it's going to happen, what are you doing about it?
           \_ Heed the warnings and order up a full complement of armed air
              marshals.  Oh wait, we only did that after 9/11, right?
              \_ You missed the point. There is no way to know which method
                 Al Qaeda will use to attack us. They might not use planes
                 at all. They have just threatened attack. So how do you
                 stop them?
                 \_ did you read the URL?  yes, the whole thing.
                    \_ Did you read my post? Yes, the whole thing. I'm
                       Al Qaeda. I tell you I am going to "attack the USA".
                       What will you do about it? The point here is that
                       Bush would get the blame in that instance, but what
                       can he do about it, really? The instance in the
                       article is specific. I am talking about a general case.
                       \_ You increase security and alert law enforcement.  You
                          take it as an actual problem and work to increase
                          human intelligence.  You look at the outgoing
                          administration's thoughts on the matter and develop
                          a strategy.  You don't go back to crawford to "clear
                          brush".  If it had been a priority issue, maybe the
                          FAA would have said yes when NORAD asked them if they
                          wanted an intercept on the off-course flights.
                       \_ Yes, I read your post, the whole thing.
                          I got your point, a long time ago.
                          You missed my point.
                          Your point is obvious to everyone.
                          My point, the same one in the article, is not.
                          That's why I asked you if you read the whole URL.
                          Had we heeded the warnings and ordered up a full
                          complement of armed air marshalls prior to 9/11,
                          we might not have had a 9/11, or at least had
                          competently placed security to afford a chance.
                          And, you still haven't said whether or not you've
                          read the entire URL, which was my question.
                          -- If you really did, maybe you wouldn't have wasted
                          your words on me.
                       \_ You are talking about a general case that did
                          not exist.
                          \_ It exists at this very moment and as such is
                             more pertinent than what someone did or did
                             not do 5 years ago.
2005/2/17-19 [Academia/Berkeley/CSUA/Motd] UID:36214 Activity:high
2/17    jwang, you are one persistent sunavabitch. do you have anything
        other than partially nuking motd especially ones on politics as your
        primary hobby? everything ok with your life lately, ala gf, job, etc?
        if you need help just ask cuz i'm concerned about you.  libraries?
        Personally, I couldn't care less what their problems are.
        \_ Some people are just assholes.  Are you concerned about the personal
           lives of the rightwing assholes who want to censor books from
           libraries?  Personally, I couldn't care less what their problems
        \_ The motd should be for CS-related questions. At least that's
           what the rules are. All political-related crap belong in a
           Yahoo groups, or whatever.
        \_ Oh wow.  You and kchang should get married by an SF mayor and
              have beautiful adopted children. -- ilyas
           \_ First of all, fuck you.  Second of all, many of the people who
              provide detailed useful technical advice on the motd are the
              same people who are the most active in the politics threads.
           Take away the politics, sex, humor, and random cultural
              discussions and you take away the interest factor that brings
           people back to the motd.  I predict that the dickheads like you
              who don't seem to care about anything but CS are also the people
           with the least to contribute technically.
        \_ The rules regarding posting to motd are readily available from
              the csua website.  Your interpretation is actually neither
              justifiable from the rules or by established policy.  motd is a
              justifiable from the rules nor by established policy.  motd is a
           community that has certain social norms.  Dictating what those
              norms should be based on your own predilections independant of
           the standards of the majority of the people in the community is
              egocentric and stupid at best.  If you don't like the standards
              of the motd community, then I suggest starting your own forum
              somewhere else in usenet: registering your very own domain is
              quite affordable these days, and I suspect hosting a single
              world-readable file would be no big deal.  You could even set up
              your very own world-readable file here on soda and post the path
              here on motd. In short, there are many solutions to your problem,
           here on motd. In short, there are many solutions to your
           both technical and social, but you seem to have chosen the most
            egoistic and childish one of the bunch.  Perhaps you should
              reevaluate your participation here.
        \_ nice troll, you got 40 lines of response to a sarcastic
                 comment.  -tom
           \_ Could you please post these rules?  You can't, because that
           go at this thread.  But yeah, I readily I admit that
           part is not in them.
           \_ Hi jwang! Thanks for responding.
        \_ You know, I'm not jwang and I do this.  Are you sure you're writing
           to who you think you should be writing to?
           \_ Why don't you just search and replace from his name to yours
              then, asshole?
           \_ I've logged jwang doing it also.  That you also do it doesn't
              imply jwang doesn't or that he's not more egregious than you
              are.  - !pp
              \_ Sometimes motds need to get nuked.  Sometimes you need to
                 get laid and go away.
              \_ I've also seen it, repeatedly, for most of the past year.
2005/2/17 [Recreation/Dating, Politics/Foreign/Asia/China] UID:36215 Activity:high
2/17    "As Girls 'Vanish', Chinese City Battles Tide of Abortions"
        Whatever happened to a woman's right to choose?  Why aren't we all
        up in arms about this?
        \_ Chiense police come to beat the shit out of you right now!!!11
        \_ Just wait till their son grows up and tries to find a
           woman. Ignorance is best paid this way.
           \_ Only if he joins the CSUA.
           \_ You don't need to wait.  This is already a problem at present.
        \_ S. Korea the same problem, although not nearly so severe, since
           you can still have as many babies as you want there.  They
           outlawed doctors telling the sex of the baby to parents before
           birth completely.  This seems to have improved things.  The
           current birth rates are more or less back to normal, although
           the 20 year olds are out of wack.  It also meant that my wife
           really wanted to know the sex of our daughter before she was
           born just because she couldn't if she was in Korea. -jrleek
           \_ So, what sex _was_ your daughter?
           \_ same for Taiwan, and India.  The problem should slowly
              go away as a country industrializes.
              \_ The answer is technology. If you could offer couples to
                 chose any baby's sex, FOR FREE (subsidized by the gov),
                 would this problem still exist?
                 \_ huh?  most of them would choose "male" at this
                    point in time, which would be a problem.
                    A simple solution would be to offer some artificial
                    incentive for giving birth to baby girls, such as
                    say $3000 bucks.
                    say $3000 bucks.  I don't understand why China
                    doesn't do something like that.
                    \_ 40 million unmarried men = nice "peoples" army
                       \_ coming to beat the shit out of you RIGHT NOW@%5!1
                       \_ All coming to steal our women...
                          \_ SERVES YOU WHITE MEN RIGHT! -Hoyt Sze
                    \_ In a way, that kinda sounds like slavery.
2005/2/17 [Computer/HW/Printer] UID:36216 Activity:high
2/17    Any recommendations for a decent digital point and shoot?
        \_ The SD300 is a great little camera. I just bought one in Dec and
           it's done a great job. Canon also just announced the SD400 and
           SD500 as well. -shac
        \_ Canon S500, totally love it
        \_ Canon SD10 or 20 (as simple as it gets, and girls go gaga over it).
           \_ These don't have optical zoom.  SD300 does, and is still pretty
        \_ Nikon Coolpix 3200.  Runs on 2 AA batteries.  -- yuen
        \_ How much larger is a Canon S60/S70 than an S500? I haven't seen any
           in person. In other news, the new Digital Rebel XT looks like hot
           shit. I'm glad I didn't go for the 300D rebates.
2005/2/17 [Uncategorized] UID:36217 Activity:moderate
2/17    I have a Henckels forged paring knife and a while back I accidentaly
        bent the last 1" of blade about 5 degrees while cutting some frozen
        food.  Do you think a professional knife sharpener could fix this?  The
        cutting edge itself is fine (except for the slight bend).
        \_ Sounds to me like you damaged your knife while using it for
           something it wasn't meant for.  You can always try to get it
           replaced or repaired, but don't be too offended if you get
           turned down.  Henckels paring knife is what, $30-40?
           \_ I know I can get another one, but this one works fine so I can't
              justify throwing it away.  It'd just be nice to have it
              'good as new'.
        \_ Henckels are expensive but can't you just get a replacement
           knife (not the entire set) just by itself?
           \_ Certainly, but that's ~$45.
           \_ Certainly, but that's $35.
        \_ I don't see why not.  Pliers -> bend, then fix whatever bits were
           marred in the process.
           \_ Or just wrapped it in a towel, then bend.
        \_ doesn't henckels knives come with lifetime warranty?
           \_ Yes, but would this sort of damage be covered?
2005/2/17 [Politics/Foreign/MiddleEast/Israel] UID:36218 Activity:low
2/17    Abbas takes a hard line against terrorism by killing "collaborators."
        \_ Sharon just runs over his collaborators with a bulldozer.
2005/2/17 [Science/GlobalWarming] UID:36219 Activity:high
2/17    2005 Motd Prediction Time Capsule. In 1, 5, and 10 years, we'll
        look back at this very motd entry via the archiver and see how
        accurate our predictions have been. Go ahead and put your prediction
        (science, politics, anything). Make sure to put your name so that
        we can give you proper credits. Here is my first prediction:
        \_ In 2015, I will be ten years older.
           \_ If you live that long.
        \_ By 2015, the world will be 5 degrees hotter due to industrialization
           of 3rd world countries giving out greenhouse gases           -junior
         \_ In the year 2015, people will have completely forgotten about
            this post.
            \_ Sadly, I think the post below proves you wrong.
                \_ that is an illustration, not a proof. You can't prove a
                   prediction wrong at CURRENT TIME unless you can prove
                   that you have the ability to see the future.
                   \_ What makes you think I CAN'T?
        \_ How's this for totally wrong predictions back in 1999?
           \_ Oh my god, that's pathetic.
        \_ I predict that Isrealis and Palestinians will be killing each
           other, that the president of the United States will be a moron
           and that people will flame each other on the motd. -psb fan #7
        \_ I think the only safe prediction is that your predictions
           will be wrong.
        \_ soda will morph into a massive supercomputer which will take
           over the world.
        \_ I predict that in 2005, China will be the leading consumer of grain,
           meat, coal, and steel!  It will use more of these resources than the
           United States does!
        \_ By 2015, energy problems will become our #1 problem, with global
           warming & pollution running close behind.  There will be more
           world hunger, high food prices and water shortages.  There will
           probably be some big resource wars going on, and inflation in
           the US will either be over 5%, or there will be 5% deflation,
           or it will swing wildly between the two points.
2005/2/17 [Computer/SW/Languages/Perl] UID:36220 Activity:high
2/17    This *has* to exist: I'm working w/ a text file that uses ascii #2
        for record separators and ascii #1 for field separators.  Is there
        a utility that will print out these ascii values for me, so I can
        (for example) use them with command line awk and perl scripts? Ex:
        fs=`atoi 1`
        perl -pi e's/(.*)$fs(.*)/$1$fsfoobar/g' myfile.txt
        Also, what would the actual perl syntax be for what I'm trying to
        do with the above command?  Platform is OS X.  TIA
        \_ perl -002 -a -F'\001' -lpi -e '$_="$F[0]foobar"' myfile.txt
           OK, this sets in the input record separator to #2 (instead of
           newline), sets the field separator to #1, strips the \002 from the
           input and readds it on output (-l) and autosplits into @F on \1
           \_ What about a function that just prints an ascii code -
                printf("%c", atoi(argv[0]));
              would be fine, it just seems ridiculous that this doesn't
              already exist.
              \_ In most shells, you can press ^V before a keystroke and have
                 that keystroke inserted literally, without being interpreted
                 by the shell. Thus, ^V^A would produce a literal ^A (ASCII
                 code 0x01), and ^V^B would produce a literal ^B (ASCII 0x02).
                 Alternatively, try fs=`echo -ne '\001'`. -gm
                 \_ Ah, that works very well, thank you.  I also
                    discovered the perl function chr, which takes an int
                    and returns the associated ascii character.
              \_ I think you meant argv[1], there, buddy.  Anyway, it's
                 trivial, so why don't you write it?
                 \_ You're correct, and yes it's trivial, but so is the
                    command "yes" which repeatedly prints out "y" forever.
                    The thing is, I need to have other people run this
                    script for me, and I don't want to waste their time
                    with "ok, now run gcc -o asciify asciify.c" if asciify
                    already exists.
2005/2/17 [Computer/Networking] UID:36221 Activity:low
2/17    Is there a reasonably priced alternative to SBC DSL around campus?
        SBC has been very unpleasant. Please answer via email - jnat.
        \_ I am using Cyberonic. Free installation. 1500/~700kbps.
           terrible tech support but you probably won't need it. $50/month.
        \_ A friend recently told me he had good luck with in
           the south bay - cheaper than SBC, uses their lines.  Would be
           interested to hear if anyone else has experience with them...
           \_ I used dslextreme in The City and would recommend them to
              others. Sometimes they have DNS problems late at night
              (unannounced maintenance, I assume) but they are pretty
              reliable and super cheap. -ausman
2005/2/17 [Computer/SW/Languages] UID:36222 Activity:insanely high
2/17    Quiz: What is an optimal algorithm for finding a contiguous sequence
        in an array that when added will yield the greatest sum, where the
        array contains both positive and negative numbers?
                \_ -5 1 -2 8 -5 1 -1 100 -3 where the greatest sequence is
                   \_ Do you mean the greatest sequence of five numbers?
                      The greatest sequence is just all the positive numbers
                      if I understand your concept of "sequence"
                      \_ The numbers must be adjacent, and the length of the
                         sequence is arbitrary. -!op
                         \_ The algorithm to solve this is still linear time.
                            Email me if you want the solution.  Hint:
                            partition the array into 3 sums. -- ilyas
              I ask again, do you partition the array into lumps of -/
              positive and negative blocks, and go from there? Mine I think
              works but requires you to do so first.
              \_ No.  I ask that you email me for a complete solution, because
                 I want to make sure this isn't homework. -- ilyas
        \_ This is trivially linear time. -- ilyas
           \_ No it's not.  Assuming you're looking for the contiguous subset
              of the input which has the largest sum, there are around N*N/2
              possibilities, and a simple 2-pass linear search is not
              gauranteed to find the right answer.
          \_ does your algorithm first repartition the array into a sequence
             of alternating positive and negative integers?
             \_ Look, maybe you didnt state your problem correctly, but as
                stated, the problem is easily solved by going through the array
                once, and putting all positive numbers into the sequence.
                  -- ilyas
                \_ don't be a moron, obviously he means a contiguous sequence
                   in the original array.  -tom
                   \_ Maybe he meant 'greatest increasing subsequence.'
                      Sequences have nothing to do with adjacency.
                      Obviously indeed.  You seem really smart, tom. -- ilyas
                      \_ It *is* obvious that op is not asking "what is
                         the set of numbers which adds up to the greatest
                         sum, given a set of positive and negative numbers"?
                         You seem really stupid, ilyas.  -tom
                         \_ That much is clear from my reply: 'you probably
                            didn't state the problem correctly', etc.  What
                            you seem to be missing is that there are multiple
                            interesting problems he may in fact be asking that
                            all involve arrays and sequences.  I am not sure
                            why I am wasting my time explaining this to you.
                              -- ilyas
                            \_ Wow, I didn't realize you meant that in
                               "This is trivially linear time" -!tom
                \_ -5 1 -2 8 -5 1 -1 100 -3 where the greatest sequence is
                   \_ Do you mean the greatest sequence of five numbers?
                      The greatest sequence is just all the positive numbers
                      if I understand your concept of "sequence"
                      \_ The numbers must be adjacent, and the length of the
                         sequence is arbitrary. -!op
                         \_ The algorithm to solve this is still linear time.
                            Email me if you want the solution.  Hint:
                            partition the array into 3 sums. -- ilyas
        \_ Add all the positive numbers in the array and return that.
           In other words, maybe you want to define sequence, or give us
           more information.
        \_ What is the optimal algorithm for finding the hottest, best match
           for a long-term monogamous heterosexual relationship?
        \_ Not sure this is right.  But take a running total.  Mark the array
           index when the total is the lowest.  Mark the array index when the
           total is the highest.  The sequence starts with the number after
           the first array index, and ends with the number at the second array
           \_ This greedy algorithm fails. -- ilyas
              \_ Usually you provide an example.
                 \_ For instance what happens when the lowest cumulative sum
                    is after the highest cumulative sum?  If you constrain the
                    former to appear before the latter, it's not a global
                    max/min anymore, etc.  Lazy bitch. -- ilyas
                    \_ Let's add one more feature.  Track the highest single
                       positive value.  If the highest single positive value
                       is greater than the sum of the sequence, then the
                       final answer is just the single value.
                       "Lazy bitch"?  Dude, what's wrong with you?
                       \_ This still doesn't work.  You didn't address the
                          problem of min occuring after max. -- ilyas
                          \_ Yeah.  I was a little eager to post originally.
                             Sigh ... but if the global minimum running
                             total occurred befored the global maximum running
                             total, I'd be schweet.  Again, though:
                             "Lazy bitch"?  Dude, what's wrong with you?
                             \_ It's the price you pay for not thinking of a
                                counterexample yourself.  Lazy bitch. -- ilyas
                                \_ Dude, you need to stop with the anti-social
                                   \_ And you need to stop being lazy.  We
                                      all could use improvement.  I thought
                                      I was being eminently reasonable in both
                                      providing the requested counterexample,
                                      and gently chiding the sin of sloth,
                                      which, as our Christian friends will tell
                                      us, is deadly. -- ilyas
                                      \_ You must play a Silverfang. Probably a
                                         a theurge, I'd guess.  Nowhere else
                                         would you see a combination of cryptic
                                         utterances, arrogant stubbornnes,
                                         and haughty condescending
                                         intellectualism all wrapped around a
                                         core of inflexible superiority bound
                                         together by a completely unapologetic
                                         nigh impregnable psyche.  Bravo -- I'm
                                         impressed.  Now, the question is, are
                                         you this way in real life, or are you
                                         just giving motd a non-stop
                                         demonstration of your rp abilities?
                                         I'd guess the latter, but I'm sure
                                         there are motd denizens that would
                                         disagree with me.    --!pp
                                         \_ Paolo says I am Tzimisce. -- ilyas
                                            \_ In this context, that's quite
                                               a compliment -- though perhaps
                                               somewhat backhanded iir all the
        \_ Seems like you can just keep a running count. If your next number is
           bigger than your count would be by adding it, then you remember your
           previous sequence if it's the biggest so far and start a new one.
           You'd also have to keep the high point of the current sequence.
        \_ Okay, I think this works.  It's a two-pass solution.
           Pass 1:  Take the running total solution.  Find the array index
           where the minimum running total occurs.  Find the index for the
           max running total.  If the min occurs before max, the sequence is
           between the two.
           Pass 2:  If the min occurs after the max, then find the index of
           the max after the min.  The sequence will occur between the min
           and and the new max.
           Edge cases should be straightforward.
           \_ This doesn't work either.  The point of 170 homework is that
              you prove the thing works. -- ilyas
2005/2/17 [Computer/Companies/Apple, Computer/HW/Memory] UID:36223 Activity:nil
2/17    I need to buy a computer for photo-processing.  Currently, on a 3 GHz
        P4, it takes Photoshop ~1min. to open up a 5-6MB raw file, and even
        longer to do any processing.  Are any PC-clones comparable to Apple's
        Power Mac's in terms of photo-processing power?  A Dual PowerMac1.8
        w/1GB RAM, and 20" screen is $3300.  Top-of-line PC's are much cheaper.
        Suggestions? Advice? TIA.
        \_ If you buy the G5 w/o the stock ram and just buy 1 GB of RAM
           from fry's you can easily save $300 or so. Also, if you are price
           conscious get the Dell 20" wide-screen lcd rather than the Apple,
           you will save $300-$400 there as well.
           Couple of other options to save money on a G5:
           1. buy from amazon -> no tax
           2. find a friend who is still in school and get a student discount
           3. find a friend who has a apple employee purchase program (sun,
              cisco, lockheed, &c. have such programs)
           4. get a refurb from (I've bought several w/o any
           If you want to stay on PC, perhaps you may want try a dual proc
           board (PS on Mac is optimized for dual proc, probably is on pc
           as well), perhaps a dual opteron w/ a 9800 or a X800.
2017/09/19 [General] UID:1000 Activity:popular
Berkeley CSUA MOTD:2005:February:17 Thursday <Wednesday, Friday>