Berkeley CSUA MOTD:2000:March:18 Saturday <Friday, Sunday>
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2000/3/18-20 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:17795 Activity:high
3/18    Rookie C++ question: Is the following circular situation allowed -
        defining a ClassA with a member variable that is a pointer to an
        object of ClassB, and also defining ClassB with a member variable that
        is pointer to an object of ClassA.  If it is allowed, how do I go
        about with the #include, #ifndef, etc.
        \_ not to forget to mention that many data-structs use this
           circular pointer of classes of different types (red-black trees)
           so it wouldn't make sense to design one of the most versatile
           languages without this feature.
        \_ Yes, it's allowed.  You need to do a forward declaration for the
           classes that haven't been defined at the point where you're using
           them.  For example:
                // A.h
                class ClassB;
        No preprocessor pain is necessary.  This works for reference members
        as well. And they don't have to be in separate files.... This works
        too:
                class ClassA {  ClassB *pB; };
                // B.h
                class ClassA;
        Good luck... -mogul
                class ClassB {  ClassA *pA; };
           No preprocessor pain is necessary.  This works for reference
           members as well. And they don't have to be in separate files....
           This works too:
                class ClassB;
                class ClassA { ClassB *pB; };
                class ClassB { ClassA *pA; };
           Good luck... and sign your frickin' name, punk! -mogul
           \_ Hehehe!  Thanks for the answer!  It's kind of embarassing
              to put my name when it's such a dumb question.  I know
              there is function declaration, but didn't know about
              class declaration, having always used the #include, #ifndef
              stuff.
           \_ real men use "typename" for forward decls. or something. -ali
              \_ Whatever.  Real men know when to use typename.  And that's in
                 template functions and classes when the type name might not be
                 easily derived as such.
              \_ real men use real languages that don't have this sort of BS.
2000/3/18-21 [Politics/Domestic/President/Clinton, Politics/Foreign/Asia/China] UID:17796 Activity:insanely high
3/17    Taiwan election results in.  So far, no missiles are firing.
        Let's hope it stays that way.

THREAD SUMMARY: "Asian cultures have plagued our fragile planet for many
        centuries. They should all be eliminated as soon as possible."
        \_ Let the ethnic cleansing in Taiwan begin.
        \_ It takes a few minutes to warm up the missiles, hit the button,
           fly over the water and get Wolf Blitzer out of bed to report on it.
        \_ We (the US) should just tell those STINKING PIG-SUCKING RED COMMIE
           CHINESE BASTARD MOFOS in BEJING that if they don't butt out of
           Taiwan's democracy, we will bomb them into the stone age. As I
           are trying to cosy up with thier kind in RED CHINA at the cost
           see it the whole problem is Clinton-Gore are COMMIES and they
           are trying to cozy up with thier kind in RED CHINA at the cost
           brainwashed by that COMMIE scumback JFK. And the reason that we
           of the good decent hardworking liberty loving people of Taiwan.
           In some ways you can hardly blame Clinton, after all he was
           brainwashed by that COMMIE scumbag JFK. And the reason that we
           have all of these problems anyway is because Truman didn't
           let MacAurthur take on RED CHINA in the 50s.
           \_ I thought the real reason is that Eisenhower didn't let Patten
              take on USSR to wipe out communisum altogether right after
              Germany surrendered in WWII.  -- yuen
              \_ HAHAHAHHAHAHA.  Take on USSR?  Silly child, don't fight a
                 land war in Russia.
                 \_ That's the impression I got from a movie.  Yeah, Napoleon
                    lost a land war in Russia too.  -- yuen
                 \_ Why not?  - Mongolian, descendant of Subedai
                 \_ Why not?  - WWI Kaiser
           \_ Dumbass, the USSR would have declared war if the U.S. attacked
                      Russia is no longer commie.  -- yuen
              China. It would have been a nuclear war that the U.S. would
              have "won" solely cuz the U.S. had more nukes at the time
              But the world would only now be emerging from the nuclear
              holocaust that follows.
                \_ Bullshit.  China and USSR were not allies.  Not even close.
                   Why do you think both have huge numbers of men on both
                   sides of their mutual border?  Partying?  Duh.
                   \_ If they are not allies, why did USSR send all those
                      technical advisers to commie China?
                   \_ Yes, but Russia will side with China to take advantage
                      of the situation if US goes to war with Chian, even
                      though Russia is no longer commie.  -- yuen
                      \_ Russia is neither more nor less commie than it was
                         the last 75 years.  Russia has and always had a
                         criminal, dictatorial government.  It doesn't
                         matter what the government calls itself.
        \_ As a Chinese-American, I have to say, those Chinese in the
        People's Republic are a bunch of fucking punks.  Agreed...
        We should have done more to crush Mao at the very beginning.
        But what can be said...it wasn't in the U.S. interests to bother
        with it at the time.
           \_ Traitor. The U.S. has this unfounded fear that China wants
              to challenge the U.S. - that's not true. They aren't that
              stupid, but if you believe those dumbass Republikans
              China is going to be next evil threat then stop buying
              Made in China stuff - almost all of it helps the PLA get
              stronger. It's a fit of irony that you really can't.
              It's further irony that everyone is ignorant about
              the self-determination of a population when they claim
              to be from a country who extols the values of democracy.
              The Chinese are not Americans, whether through ignorance
              or not, they are much mroe comfortable with auhtoritarian
              governments than you are.Leave them be.
                \_ You mean the unfounded fear based in part on various top
                   level Chinese government officials stating in public that
                   war with the US is inevitable?  Chinese like being slaves?
                   That includes the democratic Taiwanese?  We should just
                   stand around with a thumb up our collective butt while the
                   communists invade Taiwan because they're "much mroe
                   comfortable with auhtoritarian governments" than non-Chinese?
                   That has got to be one of the fucking dumbest things on the
                   motd all week.  I won't even go into the racism thing beyond
                   the simple mention of the obvious.
        \_ The future is always in our interests today.  Vision.
        \_ Well, Mao kicked our ass at the very outset.
           See Korea, North & South
           \_ as a Korean, I'd have to say "Fuck Mao!"
           \_ No, we didn't fight the real war we could have.  It was politcal
              stupidity, not military inability.  Pick up a book sometime.
              \_ Politics is part of waging war.  Pick up a book sometime.
                 \_ Twist in the wind, baby.  Keep twisting those words.  One
                    day you'll meet someone dumb enough to believe you.
              \_ We can win the Korean war.  We can crush Mao by nuking
                 China.  However there is no way we can liberate China
                 from Mao for KMT at that time.  The support for CCP is
                 too high at that point in time, and it would be like
                 10 Vietnams.
                 \_ Actually when Chiang had the advantage in 1947,
                  Stilwell and Marshall pressured Chiang to compromise
                  with Mao, giving the Communists much needed time to
                  build up their forces. Had Chiang kept pressing at
                  that time, who knows.
                 \_ Didn't need to free China from Mao but still could have
                    had a full and complete military victory in Korea.
                    \_ Not if the Ruskies get dragged in.
                        \_ Or space aliens from the planet Nemik, but that's
                           about equally likely.
                           \_ Why is it not likely?  Russia and Commie
                              China are on good terms then, and Russia
                              is an ally of North Korea too.  It would
                              be a huge loss of credibility for the
                              Ruskies if they let their two running
                              dogs be defeated.
                                \_ Russia & China allies? HAHAHAHHAHAHAHHAA!!!
                                   Don't be a ditzoid.  Only in the last 3-6
                                   months have they even begun to start to
                                   pretend to not hate each other.  No one was
                                   launching nukes over Korea.  That's the
                                   second dumbest thing on the motd all week.
                                   \_ Really?  I thought MacArthur wanted to
                                      do just that (launching nukes).  You can
                                      laugh as hard as you want, but it would
                                      not cover up your ignorance.
                                        \_ He wanted to nuke the Chinese.  The
                                           Russians hated the Chinese and still
                                           do.  Why exactly would the Russians
                                           risk total destruction because we
                                           nuked their hated neighbor?  You are
                                           the ignorant one.  The idea that the
                                           Russians would risk everything to
                                           help their post-nuked enemy is so
                                           wildly ridiculous that I feel you
                                           must be trolling me.  -been trolled
                                           \_ Very simple, if the Russians
                                              let North Korean fall, and then
                                              let Red China fall, they may as
                                              well give up communism and
                                              disassemble the USSR there and
                                              then, rather then 50 years
                                              later.  It's called
                                              the USSR version of the dominoes
                                              theory.
                                              \_ You made this up.  They don't
                                                 have their own version of the
                                                 domino theory.  Nice try
                                                 though.
                                                 \_ They may not have a name
                                        for the theory, but it remains that
                                        they understood that to let North
                                        Korea and Commie China fall, they
                                        may as well disassemble the USSR
                                        and give up communism.  As much as
                                        they distrust Mao, a US supported
                                        Chiang-Kai-Shek China sharing
                                        the world's longest border with
                                        them would be much more disastrous
                                        for them.  You need to learn how
                                        to think from your adversary's point
                                        of view.  It's the first step out
                                        of idiotdom.
        \_ Don't fight a land war in Asia.
                \_ That's what nukes are for.
        \_ Don't pull out a gun unless you intend to shoot someone.
           Don't point a gun at someone unless you intend to kill them.
           If you dont have the resolve, then someone is going to
           wrestle that gun away from you, shove it up your ass and
           demonstrate the correct result.
           \_ USA! USA! USA!
              \_ corporate stooge.
                 \_ Huh?
              \_ It's that kind of blind USA chanting that gets this
                 country into wars it starts but cant finish.
                 \_ If Hanoi Jane and the rest of her Berkeley spawned ilk were
                    put in chains and electric chairs where all traitors
                    belong, it'd be less of a problem.
        \_  The problem with the U.S. fighting wars is that if one examines
            the historical record, public sentiment for wars that "drag out"
            too long are highly unpopular.  If Washington hadn't gotten
            lucky that one winter, the U.S. wouldn't exist because people
            were about to lay down their guns and quit.  Anti-war feelings
            were even strong in a popular war such as WWII.  And Vietnam...
            Vietnam was a war of attrition that required huge numbers of
            troops to fight a land campaign...and although the U.S. and
            South Vietnamese scored an overwhelming victory in the Tet
            offensive, the U.S. got fucked politically b/c to Americans,
            it never seemed that the war was going to end, even though
            we might've scored a military "victory" in a few years time.
            When the chips are down, Americans are only in as long as
            it looks like we're winning.
            \_ Uhm, I think the draft (forcing people to go and fight in a war
               against their will) had more to do with the unpopularity of the
               war than its perceived duration.  Also, you speak of lengthy
               wars being unpopular with Americans as though only Americans
               experience this, which is at best an inaccurate generalization.
            \_ Washington?  The "people were about to lay down their guns and
               quit" is not the public.  What the fuck are you talking about?
               This is a total lie.  The problem GW had is that his army was
               too small, inexperienced, ill equipped, and underfed to fight a
               real war with the local school yard bully much less a foreign
               super power.  There were no Clintonesque opinion polls being
               taken on an hourly basis or focus groups being used to determine
               if the fight should go on.  WWII?  Anti-war?  Are you fucking
               insane?  Have you ever met _anyone_ alive during that time in
               this country who wasn't a foreign agent?  Vietnam?  Sure, go
               ask Traitor Hanoi Jane why Americans were spitting on their own
               at the airports.
            \_ I think you're getting us confused with the French.
               USA is #1!  USA! USA! USA!
            \_ It's a matter of acceptable losses. If the PRC is willing
                to suffer any number of casualties to take Taiwan,
                and the USA isn't, then quite simply, the PRC will win.
                \_ 2 mil casualties suffered on the PRC side in Korean War
                   vs the 60K on the U.S. I think you can safely say they
                   are very much willing.
                \_ Win what?  Taiwan?  Doubt they can take Taiwan without us
                   directly interfering.  They lack the logistical support
                   required to move half a million+ men over the straight and
                   then to keep them supplied.  The only thing the PRC can do
                   to the US is nuke a few west coast cities (SF comes to mind
                   as a fantastic target).  The response with be to glass in
                   their entire population.  There won't be a PRC or anything
                   resembling civilization after that and they know it.  There
                   is *nothing* the PRC can do but rattle their sabers.
                   \_ The PRC has the ability to both move and supply the
                      troops necessary to conquer Taiwan. They do not have
                      the ability to do so in the face of the US Navy. So
                      the question is: will the US commit an act of war
                      against China in order to keep Taiwan free? It is
                      not a military question, as Taiwan is fully capable
                      of killing the few soldiers that would make it past
                      the Navy. Is it worth it to make our allies in Asia
                      feel comfortable and alienate the largest emerging
                      market in the world? Of course, China is thinking the
                      same thing, knowing that the attack if pointless if
                      we intervene. So it is in the US's best interest to
                      make it seem that we will, even though I believe that
                      Clinton would back down if pushed to the wall.
                      \_ Clinton will back down because he's a traitor and the
                         Chinese have already bought him off.  This has nothing
                         to with the will of the american people.  This is all
                         about Clinton's treason against this nation.
            \_ My point exactly...unless the U.S. is willing to go toe to toe
               with a country that has this fucking psycho "we will
               win at all costs" mentality, the U.S. will back down.
                \_ Clinton will back down because he's a traitor and a Chinese
                   stooge and his lack act of official cowardess and treason
                   will be to abandon Taiwan.
        \_ Three things:
           paper -
                   Without which, you would be going blind hand copying
                   texts on bulky and unwielding papyrus, performing self-
                   flagellation when you made an error, in a damp, dark
                   monastery.  That is, if you are part of the upper-class
                   intelligentsia.  If you are a poor illiterate serf ...
           gunpowder -
                   Without which, the civilized world will still be plagued
                   by cycles of nomadic expansions, with no answer for the
                   nomad's superiority in horsemanship and archery.
           compass -
                   Without which, America will still be populated by Indians,
                   which depending on one's point of view, may be a good or
                   bad thing.
           And these ungrateful pigs want to nuke us after exploiting and
           colonizing us for centuries!
        \_ Summary: PEOPLE DON"T KNOW THE FUCK WHAT THEY"RE TALKING ABOUT.
        \_ Real summary: China has the military might to wear down and take
           over Taiwan if the US doesn't intercede.  Clinton, the traitor
           that he is, will sacrifice Taiwan to the Chinese for the sake of
           the children rather than pull a Kennedy/Cuban Missile Crisis on
           them and force them to back down.  Good bye democracy in Taiwan.
           Good bye US credibility to our allies anywhere in the world. Hello
           to the rest of the world taking advantage of the new depths of US
           weakness and inability to protect our allies or be taken seriously
           on anything for many years to come.  I'm voting for Bush, not
           because I'm a (R).  I'm not.  But because Gore is already dirtied
           with foreign money, most of it Chinese and will lead to 8 more
           years of treason in the Whitehouse.  I couldn't care less about
           the President fucking some pig girl in the Oval Office but
           Clinton/Gore's foreign policy, bought off with foreign money,
           is treasonous.  (The Russians have nothing to do with this thread
           and were a side issue full of mis-stated history and conjecture).
           \_ MOTHER RUSSIA WILL RULE YOU ALL!!@@@~!!!
           \_ Clinton is my hero!  The question is:  Are you better off
              now than you were 8 years ago?  Who told you Clinton will
              back down if commie China tries to bully Taiwan?  Clinton
              will give the commies a swift kick in the butt.  Who
              ordered the carrier battlegroup to sail close to Taiwan's
              shores and scare the red China bully when they started
              firing missiles into the sea?  Clinton is better than
              Bush (the father) when it comes to China.
              \_ I'm better of today than 8 yrs ago, but not because
                 of that COMMIE SOB Clinton. It was Reagan who restored
                 America's greatness and his policies are the ones that
                 are directly responsible for our prosperity. Clinton
                 fortunately was more interested in screwing around with
                 unattractive women than the economy and let Greenspan (a
                 Reagan appointee) keep the Reagan boom going. If it comes
                 to a armed Taiwan-RED CHINA conflict, Clinton will side
                 with his friends the RED CHINESE COMMIE SCUMSUCKERS and
                 will look the other way while democracy is stopped out.
                 We need a real KICK-ASS President like John McCain rather
                 than a ASS-SUCKER president like Clinton. Washington,
                 Lincoln, TR and Reagan would have dealt with the RED CHINESE
                 rather than being bought out by them like Clinton-Bore.
                 \_ Yeah, yeah, yeah.  The only thing Reagonomics did was
                    that even in today's good economy and ample tax
                    revenues, 25% of the federal budget goes into servicing
                    the national debt.  I sure would prefer to have that 25%
                    in my bank account instead.
2000/3/18-19 [Computer/SW/Languages/Perl] UID:17797 Activity:high
3/17    Been RTFM, but I can't figure this out in Perl: How do I search
        a string for a specific pattern, eg. [0-9][0-9]/[0-9][0-9],
        and return just that pattern to another variable?
        \_ No need to make it personal:
           $str =~ /([0-9][0-9]\/[0-9][0-9])/ ; $v = $1 ;
           \_ $str =~ m|\d{2}/\d{2}|; $v = $&;
           \_ You are telling me it took less effort to write this motd question
              than to look this up?
                \_ It's not a trivial thing to look up.  -tom
                \_ I was reading the camel book. I still haven't come across
                   where it says matches go to $1. But thanx to the person
                   who answered!
                   \_ You must not have read very far. Its on page 28 of
                      the pink camel book.
                      \_ Oh fuckin' spare me.  Like anyone except nweaver
                         can memorize the whole book or is willing reread the
                         goddamn thing for something that may or may not be
                         near the beginning.
                                \_ I'm not nweaver, but I've been using perl
                                   since v3.0 and I did perl programming for
                                   a living for several years before moving
                                   to java/c++ and now back to c.
                         \_ s,nweaver,mconst,g
                                \_ yes, he's more nerdy than smart.
                         \_ Get real.  This is totally trivial.  This is one of
                            the first perl-ish things I learned.  -not nw/mc
                        \_ So exactly how advanced does a question have to
                           be so it can be asked on the motd without flames?
                           Heck, if a question is hard, it shouldn't even be
                           asked cuz we're all so smart here. This question
                           may be trivial or basic to some, but not to
                           everyone. Telling the guy he's stupid for not being
                           able to find it in the book is pointless & childish
                     \_  It can't be helped...no matter how intelligent they
                         may be, you have to remember that at heart, too many
                         csua-ers are immature egomaniacs...*sigh*
                        \_ It's easy to look up if you know what it is.  If
                           you don't, what do you look up?  "pattern matching"
                           is a huge topic.  -tom
                           \_ It's only one chapter.  Read it.
        \_ or, another way: ($v) = $str =~ m/($pattern)/;
           if you couldn't find this in the manual, you didn't look --
           it's one of the basic features of regular expresions.  it's
           also easy to find in the camel book.  or : 'perldoc perlre'
           -kurtz, working with perl now, though i'd rather use java or c
                \_ It apparently wasn't spoon fed enough from the book.
        \_ Oh, yes, "perldoc perlre" should be so obvious to a new perl user.
2000/3/18-19 [Computer/SW/OS/Windows] UID:17798 Activity:high
3/17    Mcafee VirusScan now requires Internet Explorer 4.0 or above.
        This is the end of the world.
        \_ And I feel fine.
        \_ Don't you listen to Microsoft? Internet Explorer IS a part of
           the operating system.  Don't let those LINsUX freaks tell you
           that IE'S JUST A USER PROGRAM MAN.
           \_ all user programs are slaves to the MCP. who believes
              in users anyhow?
        \_ That isn't as bad as QuickBooks 2000.  It requires IE 5.0!
           Makes me sad that I actually helped develop the product -phale
        \_ How can it run in ie4.0?  Isn't ie5.0 mandatory and without which
           you don't have a fully functional OS?
           \_ Even with IE 5.0 you won't have a fully functionaly OS.
              To get that on your PC, you need to try http://www.sun.com or
              http://www.kernel.org or http://www.freebsd.org
              \_ NO WAY MAN. UNIX IS LAME. WINDOWS IS RAD MAN. WINDOWS
                 IS THE STANDARD OS. USE WINDOWS.
2000/3/18-19 [Uncategorized] UID:17799 Activity:high
3/17    Vermont was better than Utah.  Fuck yourself.  At least mine had
        something to do with fags in a real state.  There's no reason to
        report anything from Utah.
        \_ Well, this was about the most context-free posting I had
           ever seen on the motd.  What the hell are you talking about?
           \_ They're probably playing around with context free languages.
              State : Utah { $$ = new Fuck(Yourself,in,@1); }
                    | Vermont { $$ = new Have(GaySex,tjb); }
                    ;
Berkeley CSUA MOTD:2000:March:18 Saturday <Friday, Sunday>