Computer SW Languages - Berkeley CSUA MOTD
Berkeley CSUA MOTD:Computer:SW:Languages: [C_Cplusplus(415) | Functional(50) | Java(479) | JavaScript(43) | Misc(385) | OCAML(7) | Perl(431) | Python(35) | Ruby(5) | Tcl(7) | Web(166) ]
Results 151 - 216 of 216   < 1 2 >
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2017/09/21 [General] UID:1000 Activity:popular
9/21    

2012/11/7-12/18 [Computer/SW/Languages] UID:54526 Activity:nil
11/7    If I don't need to print for a few months, do I need to keep adding
        new ink to inkjet printers to prevent them from drying and clogging
        heads? Or will it just magically work once I add in new ink
        in a few months?
        \_ The nozzles will clog. Print a test sheet every couple weeks.
           Or remove the cartridges and put cellophane tape over the nozzles,
           like they were out of the box.
2012/9/24-11/7 [Computer/SW/Languages, Computer/SW/Unix] UID:54484 Activity:nil
9/24    How come changing my shell using ldapmodify (chsh doesn't work) doesn't
        work either? ldapsearch and getent show the new shell but I still get
        the old shell on login.
        \_ Scratch that, it magically took my new shell now. WTF?
           \_ probably nscd(8)
2012/7/29-10/17 [Computer/SW/Languages] UID:54447 Activity:nil
7/23    Hey mconst, check this out:
        int main()
        {
            int i_value   = 16777217;
            float f_value = 16777217.0;
            printf("The integer is: %d\n", i_value);
            printf("The float is:   %f WTF????\n", f_value);
            printf("Their equality: %d WTF?!?!?\n", i_value == f_value);
        }
        Isn't it peculiar?
        \_ "%f" expects a double argument, not a float argument.  -- !mconst
2012/7/23-29 [Computer/SW/Languages] UID:54443 Activity:nil
7/23    Hey mconst, check this out:
int main()
{
    int i_value   = 16777217;
    float f_value = 16777217.0;
    printf("The integer is: %d\n", i_value);
    printf("The float is:   %f WTF????\n", f_value);
    printf("Their equality: %d WTF?!?!?\n", i_value == f_value);
}
        Isn't it peculiar?
        \_ "%f" expects a double argument, not a float argument.
2017/09/21 [General] UID:1000 Activity:popular
9/21    

2012/6/9-7/20 [Computer, Computer/SW/Languages] UID:54415 Activity:nil
6/9     I have a pair of Levi's jeans newly purchased (gift) and they are
        so damn thin I am afraid they might rip just going into the drier.
        WTF has happened to Jeans in the last few decades and which brand
        has the highest thickness to cost ratio?
        \_ I've been wearing Kirkland jeans from Costco for a few years.
           Quality-wise, including thickness to cost ratio, has been very
           good.  Style-wise, I can't tell.
           \_ http://www.ehow.com/list_7222998_jeans-older-men.html
              \_ Sadly, I actually find this appropriate for me.  -- PP
        \_ I spend $100 on Banana Republic jeans and they are reasonably sturdy.
           Even those have gotten thinner over the years.
        \_ I spend $100 on Banana Republic jeans and they are reasonably
           sturdy. Even those have gotten thinner over the years.
        \_ I like Diesels. Great quality denim (good feel+endurance)
           but you'll have to spend $$ on em. Totally worth it though
           as they look great. Get the made in Italy ones. I've worn some
           for about 2-3 years straight so amortized cost is low.
           \_ If you majored in computer science at Berkeley, and have to
              worry about the amortized cost of your pants, then somewhere
              along the line something has gone horribly, horribly wrong.
        \_ Arizona Jeans through JC Penney's Big and Tall: durable,
           comfortable, and, let's face it, you probably need the room.
2012/5/17-7/20 [Computer/SW/Languages, Industry/SiliconValley] UID:54391 Activity:nil
5/17    Anyone have the guts to short Facebook out of the gate?  I think it's
        overvalued, but at this point it looks like there are enough
        suckers to float this castle in the air for quite a while
        \_ I don't think you can find the shares to short yet. I am long
           personally, but only with 200 shares. It is a moon shot kind of
           stock.
           \_ how are you doing FB lover? har har har
              \_ Not very good so far. I am holding for the long term.
2012/4/23-6/4 [Computer/SW/Languages] UID:54365 Activity:nil
4/11    This looks like something that Nick Weaver writes ("if you're in
        CS for money, you're most likely an incompetent engineer"):
        http://techcrunch.com/2012/04/07/when-code-is-hot
2012/4/23-6/4 [Computer/SW/Languages, Politics/Foreign/Asia/China] UID:54364 Activity:nil
4/12    USA! USA! USA! We ranked #11!
        http://www.businessinsider.com/hackers-the-best-all-come-from-one-country-2012-4
2012/3/15-6/1 [Computer/SW/Languages, Computer/SW/OS/Windows] UID:54340 Activity:nil
3/15    Why does MS put double-quotes around the '8' in Windows Server 8, like
        the following?
        - Windows 8
        - Windows Server "8"
        \_ Because when they didn't do it, code didn't see the '\0'
           and went over?  Looks better than '8','\0' *shrug*
2011/2/13-4/20 [Computer/SW/Languages/JavaScript, Computer/SW/Languages, Science/GlobalWarming] UID:54037 Activity:nil
2/13    Prototype based programming/delegation (not the pattern).  anyone
        use this at all in real world?  Does it really solve the problem of
        OOP brittleness?
2010/8/29-9/30 [Consumer/Camera, Computer/SW/Languages] UID:53939 Activity:nil
8/28    Hi, anybody printed a photo image to a big plotter?  Something like
        36"x36"?  I'm wondering how many megapixels the image need to
        have in order for the print to "look good".  There is a rule of
        thumb?  Like 6 megapixel is good for X size print.  10 megapixel
        is good for Y size print.  Thanks.
        \_ You don't need that many more megapixels for much bigger prints,
           because people tend to view bigger prints from farther away.
           \_ exactly. Pixel peepers are stupid. Anything beyond 20MP,
              is mostly a waste anyways.
        \_ Try thinking of it in terms of dpi on the final print.  Is 150dpi
           good enough?  If so, then you need a 29 megapixel image for 36"x36"
           (36 * 150)^2 = 29,160,000.  The resolution of the printer can also
           limit the quality of the printed image, so make sure the plotter
           can handle your target resolution.  If you're doing this with a
           plotter, presumably you're not trying to produce a photorealistic
           image anyway.
2010/8/12-9/7 [Computer/SW/Languages] UID:53921 Activity:nil
8/12    Judge Walker denies Stay. Prop 8 null and void from next Wednesday:
        <DEAD>ecf.cand.uscourts.gov/cand/09cv2292<DEAD>
2010/3/7-30 [Computer/SW/Languages] UID:53743 Activity:nil
3/7     My sister is graduating soon with a decree in information management.
        She was orignally CS, but couldn't cut the math, so her GPA sucks.
        However, she has had a couple of internships and did fine.  She did
        desktop support at RockYou and is currently doing web programming
        at UC Santa Cruz, but they can't keep her on after graduation.
        Anyone got any jobs?  She wanted to be a network admin, but right now
        she'll take anything. Probably work cheap too.  -jrleek
        \_ Where does she want to work (geographic location)?
           \_ She was hoping to get out of the states, but she's not picky.
              She currently lives in Santa Cruz.
              \_ out of states to... Canada? Mexico? Can you be more specific?
                 \_ Preferably somewhere English or Japanese speaking, those
                    are the languages she knows.  She's not picky here
                    either, although Afganistan is probably out.
2009/4/5-5/3 [Computer/SW/Languages, Computer/HW/Drives] UID:52801 Activity:nil
4/5     Tuesday at 10:00PM I will be taking down Soda temporarily to migrate
        disk arrays.  This is an expected part of our move to the new server.
        The downtime should be minimal - I'll be remounting /home read-only
        for an hour or so while I run a final mirror over to the new array
        and then will reboot Soda onto the new array. The final migration
        will come at a slightly later time - this is in preparation for
        moving mail handling.

        We apologize for the inconvenience.
2008/2/20-22 [Computer/SW/Languages] UID:49202 Activity:moderate
2/20    Does anyone else think that the new http://sfgate.com web site sucks?
        Did they _really_ have to redesign the old one, which seemed just fine?
        \_ Be boring like me and use this instead:
           http://newsbuffet.org/sfchronicle.htm - danh
        \_ I hate this facet of the WWW. People redesign just to look like
           they are doing something and be 'fresh'.
           \_ you think that's limited to the WWW?
              \_ No, but it's more annoying than when, say, the grocery
                 store decides to move the aisles around.
                 \_ The problem is that in the grocery store, the person who
                    is moving the aisles around is a grocer who knows his
                    customers.  On the Web, redesigns are often controlled
                    by people who have no clue what web customers need.
                    Particularly when the web site has a print publication
                    side; print design and web design are two completely
                    different things.  It's like having the grocery aisles
                    laid out by someone whose only experience is in
                    warehousing.  -tom
                    \- often when groceries move stuff around they are
                       doing it to sell more stuff, not for customer
                       convenience. lots of research on the path people
                       take thro stores, effect of placement, getting
                       paid for placement etc.
                    \_ On the other hand, sometimes there is value when a web
                       site bears some resemblence to the print publication
                       side.  Old-fashioned print subscribers will feel more
                       comfortable using the web site.
                       \_ Having the web site bear resemblance to the print
                          edition, and having the web site be usable, are
                          not mutually exclusive goals.  But you need to
                          have a real web designer in charge of the project
                          if you want to reconcile them.  -tom
                          \_ Good luck finding a 'real web designer'.
        \_ Lipstick on a pig.
2008/2/8-11 [Computer/Companies/Ebay, Computer/SW/Languages] UID:49097 Activity:nil
2/8     When do we usually get the 1099-INT from PayPal? It's already
        February and I still don't have mine.
        \_ If you got less than $10 in interest, you don't get a 1099-INT.
           But since PayPal is a money market fund, it's probably a
           1099-DIV. I'm not sure what the rules are on that.
2008/2/7-11 [Computer/SW/Languages] UID:49084 Activity:low
2/7     Hi I'd like to learn Flash. I have no UI experience but I just want to
        learn for the sake for curiosity. I just want to create something that
        is interactive and fun, and don't care about scalability/extensibility/
        reliability/efficiency/blah-blah. What language is Flash most similar
        to and how easy/difficult is it to get started (e.g. "hello world")?
        -kchang
        \_ I had to learn Flash from scratch on the job a few years back.
           I found the tutorial that came with Flash to be amazingly
           informative for the basics, and the following website had everything
           I needed for programming in ActionScript (Flash's programming
           language): http://www.actionscript.org/resources/articles
           From zero to this in a few months:
           http://www.csua.berkeley.edu/~erikred/ecosystem_game_now.swf
           \_ Cute.  Except my whale ate my seal which wasn't good for the
              seal.
              \_ Thanks. I wanted to add Japanese whalers, but my boss
                 objected for some reason.
        \_ I've never done flash but I seem to remember that actionscript
           is pretty damn close to JavaScript.
2007/12/13-19 [Computer/SW/Languages, Computer/SW/Unix] UID:48796 Activity:nil
12/12   Why do I get an error about /etc/tabset not existing when I type reset?
        Is reset no longer the command to use to clear the screen ?
        \_ Try 'clear' like normal people. Or Ctrl-L if your shell supports it.
2007/11/28-12/6 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages] UID:48708 Activity:nil
11/28   T gold indicator forms rare double sell signal
        http://www.minyanville.com/articles/gold-T-mr/index/a/15012
        \_ This is the funniest thing on the motd. Thanks.
           \_ Agreed. This is superb.
2007/10/31-11/2 [Computer/SW/Languages] UID:48502 Activity:nil
10/31   X11 question. If I set XUSERFILESEARCHPATH in my .cshrc and source
        my .cshrc then my app finds the app-defaults file I want. If I do a
        setenv in the shell then my app cannot find it. Why will this work
        when the variable is set in my .cshrc and not at the prompt?
        \_ look at how your apps are started.  Do they spawn from your
           shell (if so they're resetting their environment).  If they
           are started by something else (i.e. your desktop) you need the
           setenv set before the desktop starts. -ERic
2007/10/17-18 [Computer/SW/Languages, Recreation/Media] UID:48354 Activity:nil
10/17   Have you seen the print ads for the new Bionic Woman tv show?
        Are the main characters breasts as huge as they look, or is it
        a trick of the light?
        \_ Take a look:
           http://www.fitnessmodelsmagazine.com/MICHELLERYAN.htm
2007/7/20-22 [Computer/SW/Languages] UID:47350 Activity:nil
7/20    Does anyone here know anything about the quality of the
        software product/programming team at a company called
        Permabit (http://www.permabit.com Are the brilliant hackers,
        goobers, or somewhere in between?  Thanks.
2007/7/13 [Computer/SW/Languages] UID:47289 Activity:nil 66%like:47283
7/13    bull scores double kancho
        http://news.yahoo.com/photo/070713/481/f04561bb3d2e4c869c591e641a16cf3a&g=events/lf/070607sanferminbulls;_ylt=AjZ0AaXW7wKzuB5opCApOaJbbBAF
2007/6/18-21 [Computer/SW/Languages/JavaScript, Computer/SW/Languages] UID:47003 Activity:moderate
6/18    Is this the end of the line for Chomskyan grammar?  The strange
        language of the Piraha
        http://www.newyorker.com/reporting/2007/04/16/070416fa_fact_colapinto
        \_ Their notion of color makes more sense than ours, I think.
           Daniel Dennett talks a lot about this phenomenon, how seemingly
           atomic concepts in our language aren't really. -- ilyas
        \_ Chomsky: brilliant, or just good at getting on the rolodexes of
           anyone needing a linguistic expert?
           \_ dunno, but I read the article, I don't think you did.
           \_ You should read the article, it's really interesting.
              \_ I did, sorry! I thought it was really interesting, too.
        \_ Amazing article.
2007/4/13 [Computer/SW/Languages, Computer/SW/Security, Computer/SW/Unix] UID:46294 Activity:nil
4/13    Can someone w/ root fix this:
        $ ls -l /dev/null
        crw------- 1 root csua 1, 3 2007-01-25 19:41 /dev/null
2007/3/21 [Computer/SW/Languages] UID:46043 Activity:moderate
3/21    I just saw a double penetration XXX video for the very first time
        and it is sick sick sick. I completely understand the humor
        behind goatse where it is so dumb that no one in the world could
        possible enjoy that stuff. Double penetration however is another
        story and people actually like that kind of crap? I don't
        understand what kind of sicko would find anal penetration appealing.
        It stinks and is unsanitary. Secondly, I don't understand
        why two men would ever want to double penetrate a vagina since
        you're going to touch each other's penis and share fluids. Like
        anal sex it is disgusting and unsanitary. I can't believe how
        much crap there is on the internet, and why people like that stuff.
        \_ them's what makes horse races.  (no pun intended)
2007/2/10-13 [Computer/SW/Languages/Java, Computer/SW/Languages] UID:45707 Activity:nil
2/10    http://uncyclopedia.org/wiki/Design_Patterns
2006/10/3-5 [Computer/SW/Languages, Industry/Jobs] UID:44643 Activity:kinda low
10/3    My manager and the project manager refuses to have a project plan
        (i.e., schedule).  Instead, they opted to track progress via bugzilla.
        Now my manager wants to know when we can release the product.  I
        told him that we really need a schedule to know that.  He then placed
        the blame on me for not having a schedule.  How would you respond to
        this? -abused employee
        \_  http://csua.org/u/h35
            \_ Let me counter with something more useful:
               http://csua.org/u/h37
        \_ It sounds like you are the technical lead.  The PM is the PM, and
           your manager is just a middle manager.  As the technical lead, you
           should obtain whatever data you can from above on what the
           schedule requirements are (this can even be just a "complete by"
           date), and create an implementation plan according to any dates.
        \_ Just do your own project management. I have often had to do this
           at various points in my career when my bosses were idiots. This
           also helps make you ready for the jump to the next level, if
           are so interested. -ausman
        \_ This is a pretty standard problem.  Check out the author
           Steve McConnell, and browse through his books Code Complete,
           Software Estimation and Rapid Development.  Trust me, you are
           not alone.  There are plenty of good discussions and data out
           there to help you deal with bad software management. --peterl
           there to help you deal with bad software managers. --peterl
        \_ You made a mistake on day 1 when you knew you needed a schedule
           and didn't make one.  Next time just make a schedule.  Print it
           and email it to your manager.  At that point it becomes his
           problem if he doesn't like it or it doesn't fit business needs.
           For your current situation, you can either flip him off and get
           another job, or you can take the mature approach, tell him it isn't
           about finger pointing but team success, blah blah, and sit his
           dumb ass down to write a real schedule from the point you're at now.
           \_ He was adamant about not having a schedule.  He made it clear
              that he did not believe in it.  He has tried it and it has
              failed every time.  I don't mind working on a schedule now,
              but knowing him, I know he will then turn around and say
              that's something I should have done at the beginning.  So
              instead of being praised for taking the initiative, I will
              get blamed for starting it late.
              \_ Yeah, a lot of incompetent and/or inexperienced software
                 managers behave like this.  I would suggest browsing through
                 those books, or similar ones, that I mentioned.  If your
                 manager is unwilling to make changes and continues to blame
                 you even after you discuss professional engineering standards
                 with him, then you'll probably have to transfer, quit, or
                 bring it up with his bosses.  Feel free to email me if you
                 want to talk about this further.  --peterl
              \_ In this case, if he didn't want a schedule, you should have
                 showed him an implementation plan, but one without dates.
              \_ Wow, that sucks.  What I have learned (the hard way) to do
                 with shitty managers who refuse to follow common good
                 practice or make bad calls is to send them an email spelling
                 out what they told me to do and ask them to confirm.
                 "So, Bob, just wanted to make sure we're on the same page and
                  you don't want a formal schedule for this project."  The
                 smart ones get the message.  The dumb ones will fail and
                 blame you no matter what.  If your manager really is that
                 dumb then sometimes quitting (or finding a new job in the
                 same company if the place is big enough) is the only answer.
                 It still sounds like your situation might be salvagable but
                 I'd have my resume up to date just in case.  BTW, according
                 to my tech recruiter friend there are lots of jobs now but
                 no one applying for them.
                 \_ I tried that.  I think my manager falls into the later
                    category.  I would send out minutes and he always later
                    claims that I shouldn't dwell on what we decided before--
                    as a startup, we need to be nimble and adapt.  Bottom
                    line is, regardless what I do, I am always wrong, even
                    if it were his bad decision.
                    \_ Just go get another job then. There are plenty out
                       there right now.
                    if it were his badi decision.
2006/9/14-16 [Computer/SW/Languages] UID:44382 Activity:nil
9/14    I forward a lot of spam to /dev/null, and I just got this error:
          Message from syslogd@soda at Thu Sep 14 17:07:54 2006 ...
          soda procmail[16442]: Error while writing to "/dev/null"
        Ummm, what kind of error does one get while writing to /dev/null?
        \_ the kind one gets when something stupid involving soda, it's
           MTA, its ridiculously huge mail queue, and everything between
           that and user's inboxes does a "chmod go-wrx /dev/null"
           --Jon, evil alumni trying to clear all the undelivered email.
2006/8/25-28 [Computer/SW/Languages, Computer/SW/Compilers] UID:44149 Activity:nil
8/25    Why are iterators "superior" or more recently popular over the
        traditional method of using  for loops and indexing?
        \_ I guess it's because you can change an array to some other data
           structure (linked-list, tree, ...) without changing the loop code.
           \_ This is a limitation of your language, not the concept of looping
        \_ They handle multithreaded use cases better.
           They hide implementation details.
           You can pass iterators around between functions and they do
           what you want witout much hassle.
        \_ Traditionally doing pointer comparisons is faster than
           dereferencing by index. (Good compilers probably will
           transform the latter for you for simple data structures like
           arrays, though.) Also, they're simply an abstraction that
           better describe what you're trying to accomplish
           (reverse_iterator) or what your needs are (const_iterator).
2006/8/17-19 [Computer/SW/Languages, Recreation/Humor] UID:44048 Activity:nil Cat_by:auto
8/17    http://www.madore.org/%7Edavid/programs/unlambda
        The Unlambda Programming Language. Your Functional Programming
        Language Nightmares Come True. The act of learning Unlambda is oh
        so boring and meaningless and you just want to kill yourself. In
        another word, it is like being in grad school.  -kchang
2006/8/11-14 [Computer/SW/Languages, Computer/HW/Drives] UID:43969 Activity:nil
8/11    Double Agent's release date announced (Oct 19):
        http://forums.ubi.com/eve/forums/a/tpc/f/2771048463/m/6961091964/p/1
2006/3/31-4/1 [Computer/SW/Languages, Computer/SW] UID:42569 Activity:nil
3/31    Growing Dragons:
        http://tinyurl.com/lqk5c (economist.com)
2006/3/7-9 [Computer/SW/Languages] UID:42123 Activity:nil
3/7     Say I use http://mpix.com to print out my digital pictures. Say I have a
        really large picture, 3000x2000 and I print only a 4" print instead
        of poster size. How many DPIs will mpix's printer print? I'm trying
        to gauge the quality of their prints vs. my 600dpi printer before
        I decide to get anything from http://mpix.com. ok thx
        \_ yeah, it's much better to ask an unanswerable question on the MOTD
           rather than spend 29 cents to see for yourself.
        \_ We don't know what printer http://mpix.com uses.  Costco uses Noritsu
           QSS-3111-1.  Anyway, DPI is not the only factor to quality.
        \_ Why don't you contact them?. Ask "what PPI will you print".
           It should print at whatever size the PPI * number of pixels ends
           up being. I don't know anything about mpix but it's common sense.
        \_ For what it's worth, an amateur photographer I know (used to
           work on iPhoto) uses mpix and speaks highly of them.
2006/2/25-27 [Computer/SW/Languages] UID:42002 Activity:nil
2/24    Has anyone ever used a nonblocking sendile with the glib Main
        Event Loop?  Both the file and the socket are set to O_NONBLOCK,
        but we can't figure out how to get a watch to watch both file
        descriptors.
2006/1/31-2/2 [Computer/SW/Languages] UID:41608 Activity:nil
1/27    I have a file I want to stream to a socket.  (Read file, write
        socket)  A loop that copies 1K at a time seems a bit silly, is
        there a way to directly stream it?
        \_ sendfile(), if you don't need to be terribly portable. -gm
           \_ Perfect, thanks.
        \_ netcat is ideal for this, its as simple as:  nc < file
2006/1/9-12 [Computer/SW/Languages/Java, Computer/SW/Languages] UID:41303 Activity:nil
1/9     I'm using Java's
        BufferedImage.getRGB(int, int, int, int, int[], int, int);
        to read in a whole image for manipulation.  According to my profiler
        it looks like this method is allocating a ridiculous number of objects
        ... on the order of 7000 per call for standard-size jpegs and pngs.
        I am reading back the whole image anyway.  Does anyone know a way to
        load standard-format images in Java without creating a bajillion
        objects?
2005/12/9-11 [Computer/SW/Languages, Computer/HW/CPU] UID:40938 Activity:nil
12/9    Does anyone know if there are FOSS diff tools that are somewhat
        syntax-aware? E.g., it would understand that comments and whitespace
        don't matter (well, for languages where it doesn't), and that
        expressions can span several lines but still be the same? It doesn't
        even have to be smart enough to strip redundant sets of parentheses
        or anything. Thanks.
        \_ Compile the code and "cmp" the binaries. :-)
        \_ Canonicalize the sources and diff those, e.g. run through a
           pre-processor and auto-indenter?  Or, get your hands on MOSS,
           depending on what you're trying to do?
2005/11/1-2 [Computer/SW/Languages, Computer/Theory] UID:40394 Activity:high
11/1    Teaser: write an algorithm for finding prime numbers.
        \_ boolean isPrime(int x) { return true; }.  It correctly identifies
           any prime number as being prime.  And boy is it fast.  For
           non-prime number use boolean isPrime(int x) { return false; }
           which works JUST AS FAST!  Note that sometimes users may have
           problems with the package because they use the wrong function
           for a given piece of data.  Morons.
           \_ That doesn't answer the question. Try this instead:
              int findPrime() { return 37;};
        \_ How about an algorithm for getting other people to do your
           homework for you?
        \_ Here's a homework hint: go look up the strict definition of
           "algorithm".
           \_ Al Gore does more of that bizarre swaying thing. I don't think
              he has much rhythm at all.
        \_ Are you new to math or new to programming?
        \_ Are you new to asking homework questions on the motd?
2005/10/27-29 [Computer/SW/Languages, Computer/SW/Unix] UID:40293 Activity:nil
10/27   http://news.yahoo.com/s/ap/20051027/ap_on_bi_ge/earns_oil
        Exxon Mobil, Shell Post Record Profits
        \_ Exxon first U.S. company to have $100 billion in quarterly sales!
           USA USA USA!
2005/9/24-28 [Computer/SW/OS/FreeBSD, Computer/SW/Languages] UID:39858 Activity:low
9/24    Hi, I'm finding myself having to convert network order
        to host order for uint_16 as follows, is there a cleaner way?
            src = buffer[2];
            src = src << 8;
            src += buffer[1];
        \_ man htons
        \_ Uhm, I don't think your way is even correct.
           1. Do you really mean to use 1-based array indices?
           2. You're always storing the most-significant-byte in the
              position of the least-significant-byte. (Note that this is
              irrelevant to whether your host is big- or little-endian.)
              Simply writing src = buffer[0] << 8 | buffer[1] should be
              sufficient.
              \_ I thought network order was LSB first?  So it should be:
                 src = buffer[1] << 8 | buffer[0]
                 \_ You thought wrong.  Do some homework.
           \_ If you are overlaying a buffer onto the short, that is
              inherently endian-dependent. Use htons, duh.
              \_ He's not overlaying a buffer onto a short.  He's reading it
                 into a buffer first.  When he reads it out of the buffer
                 with shift and bitwise operators, the endianness of the host
                 is irrelevant. (And I'm not suggesting not to use htos, I'm
                 just saying that what he wrote originally was wrong.)
                 \- "is there a cleaner way" ... gee, ya think?
                    if this is for work, have them buy you all the stevens
                    books. if they will only buy you one, probably get
                    STEVENS: Network Programming v1. I have the 2nd ed but
                    I am sure the edition++ is fine if not better eventhough
                    STEVENS -> dead. This is "the standard". oktnx. --psb
                    STEVENS -> dead. Like VAX BSD 4.2/4.3, this is "the
                    standard".  oktnx. --psb
2005/9/21-23 [Computer/SW/Languages, Computer/SW/Editors/Emacs] UID:39784 Activity:nil
9/21    Dear motd loser who posted "Female wants to keep last name, male
        wants her to take his, marriage this summer, what do you do" guy:
        http://csua.com/?entry=17194
        Did you ever resolve the issue and how?
        \- to the guy: she gets to keep the name ... since it is hers.
           but since you are buying the ring, you get to choose between
           DIAMOND and DIAMEL. --not debeers
           \_ if the man hyphenates his last name, then the kids can have
              the same hyphenated last name too!

emacs user was here
\- you may wish to use:
(defun next-line (arg)
  "Move cursor vertically down ARG lines.
   ... If at the end of the buffer, it will add up to
  next-line-max-inserted-newlines newline characters to
  allow moving to the next line."
  (interactive "p")
  (if (= arg 1)
      (let ((opoint (point)))
        (forward-line 1)
        (if (or (= opoint (point))
                (not (eq (preceding-char) ?\n)))
            (if (< (- (point)
                      (save-excursion
                        (skip-chars-backward "\n")
                        (point)))
                   next-line-max-inserted-newlines)
                (insert ?\n))
          (goto-char opoint)
          (next-line-internal arg)))
    (next-line-internal arg))
  nil)
\_ Just add (setq next-line-add-newlines nil) to your ~/.emacs.
   \- the above lets you pick how many blank-lines are ok. i set to 2.
      i find this more useful than the binary option.
2005/9/12-14 [Computer/SW/Languages, Computer/SW/OS/Windows] UID:39641 Activity:nil
9/12    http://www.pagerealm.com/tc2k
        http://www.custom3dgraphics.com/flash/hiphurts.html
        \_ That's pretty dang funny.
           \_ It is, though I almost feel like I'm a victim of this just by
              sitting through this.  --dbushong
2005/9/2-3 [Computer/SW/Languages, Computer/SW/SpamAssassin] UID:39462 Activity:nil
9/2     Is it possible to set up an auto-reply on cusa account?  How to do it?
        Create a .auto-reply file?
        \_ man vacation
          \_ follow the vacation man, my test account get an auto-reply
             containing "|/usr/bin/vacation
                        (reason: Command line usage error)"
        \_ man procmailex
           \_ thanks procmail auto-reply worked for me.
              \_ How is your loop detection?  -tom
2005/8/20-22 [Computer/SW/Languages, Computer/SW/Languages/Misc] UID:39200 Activity:nil
8/20    Anybody know if QuickBooks pro can export plain-text invoices?
        \_ What do you mean by "plain-text"?  Export for printing it, or
           exporting it using some kind of script to grab the data?  You can
           export it to a shitty PDF, or print it out as a text file.  Or you
           can set up a report that reflects only the data in that invoice, and
           export that to an Excel spreadsheet, or to a PDF, or to a text file.
           And finally, you can unlock the Debug menu and actually export an
           invoice to IIF, which is a text format of sorts.  But not sure what
           would actually suit you out of all of these, if any.  -phale
           \_ Export to plain text that I can easily paste into an email.
              \_ Probably printing it to a text file would work best then.  Try
                 printing an invoice, and then in the print dialog you should
                 be able to save it to a text file instead.  Perhaps a quicker
                 thing to do for pasting to an email is run a transaction
                 journal report for the invoice, then export that report to
                 Excel, and then copy and paste the text from the spreadsheet.
                 I'm not sure which one will be better looking.  -phale
                 \_ Thanks.
2005/6/19 [Computer/SW/Languages] UID:38189 Activity:high 76%like:38198
6/19    Programming Jobs Losing Luster in U.S.
        http://www.nytimes.com/aponline/technology/AP-Tech-Job-Decline.html?pagewanted=print
        \_ Oh darn.  You mean those opportunistic little shits who clogged up
           all of my project groups in CS classes aren't around anymore?  Cry
           me a fucking river.
        \_ is there a CSUA password?
           \_ No, some dumbass disabled it.  Just use http://bugmenot.com.
2005/6/1-3 [Computer/SW/OS/Windows, Computer/SW/Languages] UID:37928 Activity:nil
6/1     In order to improve the performance of your machine, please add the
        following in your .cshrc file in all of your accounts:
        ping -s http://www.microsoft.com 50000 > /dev/null &
        \_ I would, but after your last speed tip my computer can't see any of
           my files, so I think it should slow down and maybe it will be able
           to see them.
        \_ What is port 50000?
        \_ http://csua.com/?entry=32148
2005/5/11-12 [Computer/SW/Languages] UID:37619 Activity:nil
5/11    Since when have the articles on http://nytimes.com been double spaced?
2005/5/3-4 [Computer/SW/Languages] UID:37493 Activity:nil
5/3     "It sure beats computer programming because it's flexible, and I get
        to be outside," he said, refering to his new dog poop job:
        http://news.yahoo.com/s/nm/odd_pooperscooper_dc
2005/4/6-7 [Computer/SW/Languages, Computer/SW/Security] UID:37084 Activity:high
4/6     My banks, brokers and credit card companies are promoting paperless
        statements.  If I tell them to stop mailing me paper statements, and
        later there's a gitch on their computers, will I be in a disadvantage
        proving my case with prinouts from their web pages compare to if I
        have their paper statements?  I'm trying to see if it's a good idea to
        stop the paper statements in my mailbox in order to avoid ID theft.
        Thx.
        \_ Can you ask them whether they can somehow sign their statements
           that they send to you (x.509 cert, pgp, etc.?)  What's the
           situation on digital signing/non-repudiation in the US right now
           anyway?  Even if there's no precedent or legal basis for it, it
           might still be better than just an occasional email or web page
           printout.  If you're worried about ID theft from paper statements,
           there are easier ways of doing it (credit card slips, for example.)
           You could just get a PO box too.  If your bank is putting info that
           could be used to compromise your authentication details on paper
           statements, find a new bank.  -John
           \_ All my bank and credit card paper statements have account numbers
              on them.  I think stealing mail from my mailbox at the front of
              my house in broad daylight is very easy.
           \_ my friends in comp security all say digital signature and
              non-repudiation is a non-issue.  the courts don't care and will
              accept all kinds of strange records if presented w/ an
              avidavit/oath of truth.  hell, fax'd signatures are enough,
              and anyone can forge one of those.  records are the starting
              point for deliberation, not the endpoint.
              \_ It's an issue in countries with a proper legal framework, and
                 with banks that give a rat's ass (American banks are
                 notorious in that regard, and for not paying a lot of
                 attention to proper authentication.)  Will a paper statement
                 serve as proof in court in case of a dispute?  I'm asking
                 because you're essentially trusting their record keeping
                 (such as transaction serial #s, etc.) to verify the
                 authenticity of the documentation.  -John
        \_ I think you should do a risk assessment of using the bank's
           record keeping vs. your own and see which is more likely to fail.
           \_ Yes my record is more likely to fail, but that's not the issue.
              If my record has a mistake, the bank is not going to go by my
              record to determine how much I have left in my account.  But if
              the bank record has a mistake, the bank will most likely go by
              its record unless I can prove otherwise.  Now my question is:
              does a printout from a web page as good a proof as the fancy
              paper statement from the bank?
              \_ I think you'll find neither of them can prove a balance.
                 the record of transactions is useful so you can ask for
                 details on any transactions that occured which are not
                 in your records, e.g. reconciliation of accounts.
        \_ I filed a small claims lawsuit and needed to print out a statement.
           8 months passed between when I filed for the claim and when the
           trial's gonna happen. That month I tried to print out bank
           statements but it said "Sorry we only go back to 6 months." I
           had no choice but to delay the trial date. What a drag.
        \_ I think if you care about these sort of things, then you should
           keep the paper copy. I do the same thing for the very same reason.
2005/3/30-31 [Computer/SW/Database, Computer/SW/Languages] UID:36981 Activity:very high
3/30    Is there a school that has an uglier website than Cal?
        http://www.berkeley.edu
        \_ There are plenty of schools with ugly websites.  Generally,
           one of two things causes a bad university web site:
           1) The process gets taken over by people who are only familiar
              with print publications, and they think the web site is like
              a print publication.
           2) The process gets taken over by bad corporate web designers who
              think Flash is great.
           Berkeley's situation is #1. -tom
        \_ http://www.stanford.edu
           \_ <DEAD>stanford.edu<DEAD> doesn't work.
        \_ http://www.florida.edu
        \_ http://www.texastech.edu
        \_ I would argue we have a worse website than Stanford.
           \_ Ya get what ya pay for.
                \_ Why do you all hate cal so much? Why didn't you just
                   work harder to get into a better school back when you
                   had a choice? Regardless, why don't you share with us
                   an attractive university website? Or do you only know
                   how to mock?
                   \_ I (and I imagine others) DID get into "better" schools.
                      We/our parents couldn't afford them.
                        \_ Then be bitter at yourself, for not being able to
                           work while in school. You have no right to be such
                           whiny bitter bitches if you attend(ed) Cal.
                           \_ Wow, you need to loosen up and get the stick
                              out of your ass. It's pretty common for
                              students and alumni to mock their own school.
                              It's part and parcel to having a sarcastic
                              sense of humor that exists in decent
                              institutions of higher learning such as Cal.
                              Anyway, Cal's fine. I doubt you can get a
                              much better education somewhere else. In
                              terms of price/education ratio it's the
                              best deal on the market.
                                \_ No, I agree with you about the humor and
                                   all. It's only that the anti-Cal sentiments
                                   on this motd are pretty strong and frequent
                                   so I just wanted to comment. Sure I don't
                                   think Cal was perfect, but I still do believe
                                   it is an outstanding university.
                              \_ How do you measure the quality of education
                                 a school provides?  As someone in the business
                                 of hiring the product of schools, I tend to
                                 measure the quality of a school by the quality
                                 of the graduates (which is of course unfair,
                                 since I do not take into account the quality
                                 of the incoming students, but just the
                                 graduates).  However, just measuring by the
                                 the quality of the graduates, Cal is far from
                                 the head of the pack.
                                 \_ You have a self-selecting sample. You
                                    remind me of the recruiter at BofA who
                                    said that I must be bad at math because I
                                    had average grades in math. Nevermind
                                    that the people with a 3.8 in math are
                                    trying to get tenure at Princeton instead
                                    of applying to work at BofA. Cal grads
                                    compete very well overall.
                                    \_ Well, I don't think I self-select in
                                       the sense you mean.  It's somewhat
                                       unlikely that I would see nth quartile
                                       students from other schools and (n-1)th
                                       quartile students from Berkeley.  Cal
                                       new grads just aren't that competitive
                                       compared to new grads from other "good"
                                       schools (mit, the farm, caltech, or
                                       even utaustin (just 1 interview trip
                                       there, but I was impressed)).  If it's
                                       a sop to your school loyalty, I found
                                       CMU students were even worse for what
                                       I was hiring for (EE, not CS, with some
                                       knowledge of circuits and transmission
                                       lines).
                                       \_ *YOU* don't self-select. The students
                                          do. Maybe your project did not
                                          attract the best, because it was not
                                          interesting. Perhaps Cal students
                                          are not strong at that one particular
                                          field and you are over-generalizing.
                                          I *do* know that Cal turns out an
                                          awful lot of graduate students who
                                          do top notch work, as well as the
                                          standard doctors/lawyers/businessmen.
                                          At my work, I don't come across a lot
                                          of good Cal grads either, but that's
                                          because I am in aerospace and Cal
                                          has no department. Schools like
                                          Purdue, UT, and MIT dominate there.
                                          What it says about the average Cal
                                          student is absolutely nothing.
                                          \_ So you're claiming that some
                                             difference in Cal students cause
                                             them to be somehow uniquely less
                                             interested in the companies I'm
                                             hiring for.  I find this claim
                                             incredible.  Perhaps you would
                                             explain what is so different with
                                             Cal grads (vs. MIT, Caltech,
                                             'fraud, UTAustin etc.)?  I've
                                             already specified what I look for
                                             in new grads (EE, some circuits
                                             and transmission line).  Could
                                             any EE program that doesn't cover
                                             some circuits and transmission
                                             line be considered a "good"
                                             program?
                                             \_ Completely possible, for
                                                example, if the jobs you
                                                are hiring for are in
                                                another state from CA. However,
                                                what I am saying is that you
                                                are probably not evaluating
                                                the *best* students from *any*
                                                of the schools. After that,
                                                it's not given you are comparing
                                                second quartile to second
                                                quartile or, if you are, what
                                                exactly that means.
                                       \_ Of course the average MIT student
                                          is better. Their incoming scores are
                                          higher on average (as you state).
                                          However, for same level of
                                          achievement I find Cal students
                                          better than those from, say,
                                          Stanford. Also, I hired a guy from
                                          Caltech as smart as all hell but who
                                          is a terrible employee who has to
                                          be told what to do all of the time.
                                          He's been close to fired several
                                          times now for incompetence. There
                                          are other ingredients to success than
                                          being book smart.
                                          \_ I found Caltech grads to be
                                             impractical (in the sense that
                                             they spend too much time arguing
                                             over and working on the optimal
                                             thing rather than the good enough
                                             thing).  They are very good once
                                             you've slapped them around enough
                                             to break them.  Small sample size
                                             of only 2 though, so definitely
                                             ymmv.
                  \_ I guess it depends what you mean by "better school".
                     I think Cal was a lot of work for minimal reward. By
                     that I mean not that the rewards are small, but that
                     the work was large. It would have been easier to go
                     to "lesser schools", learn less, and do less work.
                     Heck, the main appeal behind Stanford is not that it
                     is "better" but that you can do less and still get
                     a 3.2+ GPA while also having a name on your resume
                     that people care about (and fewer alums from that
                     school in the workforce because of the size).
                     However, you pay $100K+ for that honor.
2005/3/10 [Computer/SW/Languages] UID:36618 Activity:high
3/10    Online hunting (real animals are killed):
        http://sfgate.com/cgi-bin/article.cgi?file=/c/a/2005/03/10/MNGHOBN6LT1.DTL&type=tech
        http://www.live-shot.com
        \_ How long before we can do that in Iraq?
2005/3/9 [Computer/SW/Unix, Computer/SW/Languages] UID:36593 Activity:high
3/8     Favorite shell colors?
        White on black: ...
        Black on white: ..
        \_ Does it still count as black on white if you have transparency
           turned on in Terminal.App, but its primarily black text on a
           "white" background?
        \_ And here I read this question about what color shell I should
           wear under a suit.  I thought the choices were egregious.
        Multicolor on anything: .
        Amber on black: .
        \_ Amber sounds nice, how do you set that?
           \_ I use RGB 255,160,0  ...like old monitors.  --op
        \_ Me too -- RBG 189, 174, 81 with about 30% transperancy
           on the black background. Cursor and highlight text dark and
           light blue, respectively.
        \_ Amber reminds me of the old 80x25 monochrome days.
        Green on black: ..
        Yellow on black: .
        Yellow on black: ..    (Yellow on black has a very high vis. contrast.)
        \_ light gray on black: .
        Wheat on black: .
        \_ tan on dark green: ..
           \_ heh, i think that's the default i started out with that
              eventually led to me using wheat on black -pp
        SGI colors - white on midnight blue: .
        Back in Black: .
        Asian on White: .
        Blacks on Blondes: .
2005/2/27-3/1 [Computer/SW/Languages, Academia/Berkeley/CSUA/Motd] UID:36447 Activity:low
2/26    I've been a slashdot reader for longer than I care to admit, but I'm
        wondering about other sites out there that maybe have a higher signal
        to noise ratio, and/or are more programming-focused.
        \_ It's called CSUA MOTD if jwang did a better job nuking political
           trolls. Email jwang@csua.berkeley.edu if you want him to do a
           better job.
           \_ Fuck you and die, motherfucker.
        \_ The CSUA motd, of course!
           \_ And a double dumbass on you, too!
2005/2/18-20 [Computer/SW/Languages] UID:36234 Activity:moderate
2/18    To show I am a better man (and christian) than ilyas, here is a
        solution to the hw question asked yesterday (maximum contiguous
        sequence).  Pass 1: coalesce adjacent elements of the array A
        into blocks with the same sign (dropping 0) by summation into array B,
        meanwhile keeping track of their range in array A .  Finding the max
        of the array B during this pass as well.  Pass 2: starting at the
        max block, extending up and down the array B (and hence A), finding
        the max stretch.  You have to prove that it works and it is linear. :)
        \_ anti-semite alert!!!
           \_ I don't think ilyas is Jewish
              \_ No, he's either Tzimisce or Silverfang lupus theurge.  Aren't
                 you paying attention?  *sheesh*
                 \_ mislycanthropy alert?!
        \_ Doesn't this give 4 instead of 5 for  A = B = (4, -8, 3, -1, 3)?
        \_ What's wrong with you dude? We solved this already in one pass.
           Just stop already.
           \_ Was it O(n) or O(n^2)?
              \_ One pass, O(n). I don't see what's the big deal. Keep a
                 running count of the "current sequence", and the value/index
                 where it was highest. The "current sequence" is over if
                 (count + next) < next. Store the best sequence as you go.
                 \_ Except that doesn't work. -- ilyas
                    \_ Counterexample? You may call me stupid rather than lazy.
                       Although being anonymous helps me in either case.
                       \_ Think of one yourself.  Lazy bitch. -- ilyas
                          \_ I choose to think I'm right and you're stupid.
                             \_ Let me know what you get on your homework.
                                  -- ilyas
        \_ cool!  christians rule.
        \_ Not only have you encouraged the deadly sin of Sloth in the original
           poster of the question, but you have succumbed to the deadly sin of
           Pride yourself (by posting something that doesn't work).
           You -> Hell.  It's trivial to see that starting from the max block
           can fail to work. -- ilyas
           \_ You just succumbed to the deadly sin of Stupidity for getting
              trolled again.
              \_ Nay, for ilyas knoweth not what he does.
2005/2/18-19 [Computer/SW/Languages, Computer/SW/Languages/Misc, Recreation/Humor] UID:36232 Activity:nil Cat_by:auto
2/18    A parent's primer to computer slang
        http://www.microsoft.com/athome/security/children/kidtalk.mspx  -John
        \_ "Was this information helpful to you? Yes"
           \_ "Please tell us more:"  "omgwtfbbq" -geordan
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
                   8-5+1-1+100
                   \_ 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"
                      correctly.
                      \_ 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
                   8-5+1-1+100
                   \_ 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"
                      correctly.
                      \_ 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
           index.
           \_ 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
                                   behavior.
                                   \_ 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
                                               details....
        \_ 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
2004/12/8-9 [Computer/SW/Languages, Computer/SW/Languages/C_Cplusplus] UID:35217 Activity:kinda low
12/8    When people say null string or empty string in C, does it mean a char
        pointer that's NULL, or a char array whose first char is '\0'?  Thanks.
        \_ Both, because it's essentially the same. However, I think they
           probably mean the latter. I assume you mean a pointer pointing
           to NULL, and not a pointer which is NULL, which makes no real
           sense.
           \_ What's I'm thinking is that for "char *str", it can be either
              "str == NULL" or "str[0] == '\0'".  So you're saying that for the
              former, there is no string; and for the latter, there is a string
              but it's a null/empty string.  Correct?
              \_ Possibly, but if you were to malloc a string and assign
                 its lvalue to *str's rvalue then str==null means that
                 you are checking to see if you lost the rvalue for the
                 str. So theoretically the string could still exist if
                 it hadn't been probably freed and you'd have a
                 memory leak. For the latter if you created an automatic
                 character array the memory stays assigned to str regardless
                 of terminating it at the beginning. There is no way to
                 release the memory for an automatic variable unless you
                 do something really wonky. So neither really checks for
                 a lack of a string. The former checks to see if the pointer
                 is pointing to a string, the second checks to see if the
                 first char of a string is the terminator.
        \_ The latter.  "Empty string" is a better term to use than "null
           string".
           \_ I always assumed that an empty string is a string that exists
              but is empty, ie "", and that NULL string refers to the case
              where the string pointer is NULL.  /me shrugs
              \_ Typically you see this as char* p = NULL.
                 p is a char pointer.  p points to NULL.
        \_ If the term uses "string", that means it's NUL-terminated.
           Therefore it means "".  A char* that's NULL is a null pointer.
           But probably prefer "empty string" for clarity.
           \_ You mean a char* that points to NULL. a char* that is NULL,
              well, that doesn't exist. Since an array is passed like
              a char* in C, a string which is "" is essentially the
              same a char* pointing to NULL.
              \_ Err, yeah.  I think you might want to rethink that position.
              \_ What?  The previous poster's explanation and terminology
                 was correct.
              \_ char* cptr = NULL; // null pointer
                 char* cptr = ""; // empty string (== "null string" (?))
                                  // "" is \0 in memory.
                 Those aren't the same. You can deference the empty string.
2004/12/7-8 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages] UID:35200 Activity:low
12/7    Optimization time: gprof shows 310k calls to a certain constructor
        (a very simple, very important object that is often stack-allocated
        into large arrays- eg "MyObject msgs[1000];").  Rather than calling
        the constructor 1000 times, is there a way to have a special array ctor
        that's called (once) and zeroes out the array en masse?  TIA.
        \_ Geezus, why are you constructing 310k objects? Make a static array
           of objects at the beginning of runtime.
           \_ I am, when possible.  It's a realtime system (= no dynamic memory
              allocation) so e.g. several queue objects have to buffer
              about 15k messages statically.  The rest are open to optimization,
              but a specialized array constructor (if it exists) would be nice.
              (nb: by "nice" I mean "not at all critical")
              Oh, and if it helps for those in a similar situation: MyObject
              contains a couple small arrays; it's much faster to zero these out
              manually with a for loop than with memset(). -op
              \_ Man, I hate people like you. Why didn't you give the complete
                 environment information in the first place? What type of
                 RTS system are you using and in what form factor? How much
                 total RAM do you have and what form is it in? And why the hell
                 are you using an OO language for small RTS apps?
                 \_ Sorry, I was just curious if C++ had a specialized ctor for
                    objects created in an array; I didn't realize I was creating
                    a tone of urgency.  Anyway, system is not resource-
                    constrained at all (P3 in a VXI chassis, 512M ram, etc) &
                    I'm coming to the conclusion that I can't just define
                    MyObject::MyObject[] ().
                    \_ Yes you can, you can overload new[].
                       \_ Ok, this might be helpful; can you elaborate?  What
                          would the constructor declaration look like?
       \_ If you want the array zeroed out without any object construction
          occuring, there are a few things you can do:
          (1) Create a default constructor which doesn't do anything
          (2) Overload new[] as suggested above to accomplish this
          (3) Allocate the space for the array using malloc or calloc instead
              of new and then use placement new to do the construction.
              Specifically, placement new lets you construct an object into
              a memory location you have allocated yourself.  The benefit of
              this is that your program would only need to spend time
              constructing an object when you want to put it in the array
              instead of when you allocate the whole array.  -emin
2004/12/7 [Computer/SW/Languages, Computer/SW/Unix] UID:35192 Activity:high
12/7    I'd like to run a program and save the output to a log file
         while still seeing the program output on stdout.  I tried using
         the tee command as in "foo.exe | tee mylog.txt" but tee only
         seems to print to stdout every once in a while instead of when
         foo.exe generates a line of output.  How do I save output to a file
         while having every new line of output sent to stdout?  Thanks. -emin
         \_ The problem is not in tee, but in foo.  By default, the stdio
            library produces output a line at a time if it's outputting
            directly to a terminal, but buffers its output in large chunks
            otherwise (see "man setvbuf").  When you pipe foo's output to
            another program, it's no longer outputting to a terminal, so it
            turns on its buffering.  The easiest cure is to create a fake
            terminal for it to run on: ssh -t localhost foo.exe | tee mylog.txt
            I know, it sucks.  The default buffering really ought to be
            smarter, or at least configurable.  --mconst
          \_ foo and tee BOTH buffer, don't they?
               \_ Tee actually never buffers its output.  Even if it used the
                  default stdio buffering, though, it wouldn't be a problem
                  here since it's outputting directly to a terminal.  --mconst
                \_ what about foo | cat | tee mylog.txt?
                   \_ That won't help anything.  foo is still writing to a
                      pipe.
                      \_ The mconst has spoken.  Woe to those who will not
                         listen.
       \_ You have to redirect stderr to stdout. In bourne-like shells,
          foo.exe 2>&1 | tee log
          In csh derivatives, I think it's something like
          foo.exe |& tee log
       \_ Another possibility you might explore is using 'screen' to run your
          process, with screen logging to a log file. SCREEN RULES!!
       \_ "Sounds like a virus.  Reformat and start over."
           \_ Advice like this will destabilize your computer for years to come
2004/12/6 [Computer/SW/Languages] UID:35182 Activity:high
12/6    Is there any way to place/enforce DRM on an application written in a
        scripting language, short of having it "phone home" to decrypt itself
        each time it runs?
        \_ Die.
           \_ I dislike DRM as much as the next guy, but I'm still curious.
              No need to be a knee-jerk jerk.
              \_ Depends on what you mean by "enforcing". There is no way
                 to produce uncrackable DRM without an external control
                 mechanism or the aid of the hardware. If you just want to
                 make it harder, you can use those scripting language
                 to bin programs and then apply an executable encrypter
                 or successively more complicated schemes, but with enough
                 work, it's still crackable (and there are some very
                 enterprising crackers out there).
        \_ Yes.  Will it be cracked in minutes?  Maybe.  Hours?  Most likely.
           Days? Without a doubt.  The fundamental problem with all DRM
           mechanisms is that, at some point, you give the user the decryption
           key.  At that moment, you (the DRM vendor/fascist content owner)
           lose.  This is true regardless of how obfuscated your mechanism for
           transmitting the key is.  Aside from their hard-on for extracting
           (even more) money from consumers by granting themselves new rights
           that don't exist under conventional copyright law, one of the
           reasons content industry execs bought into DRM was that they were
           too technically clueless to recognize that the ``give the user the
           key'' flaw that is inherent to all DRM systems.  The empirical
           evidence of numerous trivially cracked DRM systems (hold down the
           shift key, use a black sharpie on the edge of the CD, etc.), and
           the 20/20 vision of hindsight has made their obvious `Whoopsie'
           clear to them.  The DMCA and the continuing legal onslaught is a
           crass and sorry attempt to use to law to patch over a gaping
           technical hole.
           -dans
           \_ You sir, are a moron.
              \_ Care to expand on that?  What are the flaws in his argument?
        \_ Use rot26 encryption, anyone who cracks it will be violating
           the DMCA and you can ask the feds to put them in jail!
           \_ Crap!  Merely by reading this sentence I violated the DMCA!
2004/11/11-12 [Computer/SW/Languages, Computer/SW/Mail] UID:34825 Activity:moderate
11/11   Simple question I suppose, but this happened to me with an ISP in
        Japan. Have two email accounts set up.  First account has forwarding
        to the second account.  The 2nd account recently set up a vacation
        reply. So mail arrives in first account, is forwarded to 2nd account,
        which in turn generates vacation reply, which the first account gets,
        it forwards that email, another vacation response is generated and
        received, etc, etc.  Pandemonium ensues.  The ISP called it a
        denial-of-service attack and is threatening to cut off service.  But
        this was an honest mistake (2nd account is used by a colleague and he
        set up vacation response on his client without telling me.)  Question:
        would any other ISP (or Soda) have been able to prevent this, or at
        least stop it before it brought down their system?
        \_ a reasonable vacation reply mechanism would implement loop
           detection headers and/or duplicate message-id checks (as should
           any other auto-responder).
           \_ Not to mention keeping track of recipients.  Your first
              ISP should also have some kind of reasonable loop detection.
              Tell them both that the gaijin tech gods have spoken and that
              they should get /<l00 or we'll whip out the black ships. -John
           \- Thanks for the replies.  Should these checks have been
              implemented on server software, client software (maybe there is
              a setting for "reply once"?), or both?
              \_ basic rule of computing: never trust clients, never rely on
                 clients to do the right thing.  your isps are both stupid.
                 \_ Not even a 'trust' question--this is basic mail server
                    config 101.
                    \_ I was making a more general statement about all client/
                       server relationships, not just mail.
           \_ But isn't a vacation responses a separate piece of e-mail
              similar to when the user does a reply, instead of a re-route of
              the original?  How does loop detection help in this case?
              \_ It should not be similar; it should have a Precedence: junk
                 header, among other things.  And as noted above, the vacation
                 program should keep track of recipients.  -tom
              \_ it should notice its own message sent  back to itself and
                 not reply.  this would solve OP's problem.  you are right
                 that this might not help two vacation systems in a volley,
                 but that is caught by not sending vacation notices to the
                 same recipient within some time period, e.g. a week.
2004/11/5-7 [Computer/SW/Unix, Computer/SW/Languages] UID:34712 Activity:high
11/5    Anyone with biology fu happen to know whether there are any theories
        out and about on 'junk' DNA being a form of ad hoc error correcting
        code for mutation robustness? -- ilyas
        \_ google for exons introns error-correct, e.g.,
           http://post.queensu.ca/~forsdyke/introns.htm
        \_ human DNAs are persistent because of the redundancies in it. They
           estimate that over 80% of the DNA doesn't actually do anything.
           \_ isn't this thinking actually being overturned now? I seem to
              recall reading an article in Sci Am or Discover that supposed
              "junk DNA" may not be so junk afterall.
              \_ Ah, okay. Found it. Scientific American, Nov. 2003. Article
                 titled "The Unseen Genome: Gems Among The Junk"
                 \_ I would be interested in reading this.  Would you please
                    help make that easy by putting it online?  --PeterM
                    \_ http://www.sciam.com
                       \_ I, perhaps immorally, was hoping to see the article
                          without paying.  Perhaps I'll simply go
                          visit the library.  --PeterM
                          \_ Communist bastard. -- ilyas
        \_ On a related note, LBL scientists delete a bunch of junk DNA
           from mouse genome.  Mouse is fine.
http://www.llnl.gov/llnl/06news/Employee/articles/2004/10-22-04-newsline.pdf
           link:tinyurl.com/6pvp3
           \_ Ah, but if you do that to a whole population of mice, what would
              be the effects on their decendants in a few generations?
              \_ They will create a web site called "freerepublic4mice.com"
                 and make laws outlawing gay marriage among mice
                 \_ You know...I'm not sure how I should feel about this
                    subthread.                   -mice
                    \_ Are you a gay mouse or do you have genetic mutations?
                       \_ Well, I'm not gay.      -mice
                 \- I strongly recomment the book GENOME by Matt Ridley.
                    It's a little out of date [as observed above there has
                    some recent work on junk dna, including at places like
                    LBL] but anythign is this field will be going out of date.
                    --psb
                        \_ partha what do you do at LBL?
2004/10/31-11/1 [Computer/SW/Languages, Computer/SW/Unix] UID:34472 Activity:low
10/30   How do I prevent variable substitution within double quote in tcsh?
        The manual says I can quote it with backslash but the following
        does not work:  echo "\$ "
        \_ There is no way to prevent variable substitution within double
           quotes in tcsh.  Usually it's easiest to use single quotes;
           failing that, the best you can do is echo "foo"\$"bar".  --mconst
        \_ echo "blah"'$'"blah"
2004/10/28 [Computer/SW/Languages] UID:34402 Activity:moderate
10/28   Gah! HOw do I keep spamassassin's files from putting me over
        quota? I have STFW. I spent a couple hours, actually. I lack
        sufficient clue to find the answer.
        \_ Add a 'rm -f LSPAM' line to your .login.
           \_ What does that do? I don't know of an "LSPAM" file.
              \_ Um, if you never see LSPAM files, never mind.
           \_ Does this mean someone else is using ifile?
              \_ Guilty as charged.
                 \_ Wow.
        \_ Link the following files in ~/.spamassassin to /dev/null
           (using ln -s):
                auto-whitelist.db@ -> /dev/null
                bayes_journal@ -> /dev/null
                bayes_seen@ -> /dev/null
                bayes_toks@ -> /dev/null
           \_ Hmm. Maybe I'm asking too much, but is there a way to stay
              under quota that doesn't involve crippling bayesian filtering?
              I don't get why I'd be the only person whose bayes_* files are
              going over quota. I just haven't heard what people are doing
              about it given sa's populariry.
              \_ You aren't the only one. I asked for a quota increase.
                 It's not like it's a lot of space.
              \_ Google for Mail::SpamAssassin::Conf, and look at the
                 following configuration settings:
                 bayes_journal_max_size
                 bayes_expiry_max_db_size
                 bayes_auto_expire
                 bayes_learn_to_journal
                \_ Alrighty. The trouble is answers web-wide are good for the
                   quotas on particular systems. I would like some suggested
                   values for these items (which all go into .spamassassin/
                   user_prefs for others trying to learn from this thread) that
                   are good for soda.
        \_ I have all these files like bayes_toks.expire7965 that I am pretty
           sure I did not used to have. What is going on?
           \_ http://csua.org/u/80t
2004/10/21 [Computer/SW/Languages, Computer/SW/Languages/Misc] UID:34265 Activity:nil
10/21   My digital camera (canon powershot) doesn't have the functionality
        of adding date/time at the bottom right hand corner of every picture.
        And I develop the pictures at Costco and their machines do not print
        date/time at the back of the paper.  I really do not want to use
        software and manually open up each file and add the date/time
        into the pictures.  Too time consuming.  Are there other printing
        services that will print the date on the back of the pictures?  Or
        some software that will automatically add the date in.  Like some
        programs will create thumbnails on all jpgs in a directory and name
        them appropriately.  Thanks.
        \_ I suspect ImageMagick could do this if there's some way to extract
           the timestamp from the EXIF data.  ImageMagick is great for scripted
           image manipulation but I don't know how to extract EXIF data with
           it or any other program. -dgies
        \_ I use Imagemagick's convert wrapped in a shell script to do
           "thumbnailing"
2017/09/21 [General] UID:1000 Activity:popular
9/21    
Results 151 - 216 of 216   < 1 2 >
Berkeley CSUA MOTD:Computer:SW:Languages: [C_Cplusplus(415) | Functional(50) | Java(479) | JavaScript(43) | Misc(385) | OCAML(7) | Perl(431) | Python(35) | Ruby(5) | Tcl(7) | Web(166) ]
.