Slashdot Mirror


User: romons

romons's activity in the archive.

Stories
0
Comments
378
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 378

  1. Re:Duff's Device on Ask Slashdot: What Do You Consider Elegant Code? · · Score: 1

    Duff's Device

    This is an old assembly code trick. I've seen it on microcontrollers, back to the early 80s for a fast 'strmove' routine. You know, nothing in computer science is new. The guys in the 50s and 60s discovered (nearly) every useful algorithm. See Knuth.

    I have been playing with python recently (in the last couple of years,) and have noticed what people call 'pythonic' code. Mostly, it appears to mean compressing the code into as few statements as possible, using tricks like list comprehensions. Get rid of loops, use recursion and comprehensions. I used to find recursion (particularly tail recursion) extremely elegant, but I've been burned way too many times by programmers misunderstanding code that is too complex. So, instead, my choice for elegance is code that can be understood by a monkey. Short, concise functions that don't try to do too much, but are written in a way that they are generally useful. Consistent variable naming. Lots of use of library routines instead of 'do it yourself' functions that may or may not be faster than the debugged and optimized version in the library. If I can read a program and understand it without writing anything down, that is elegant. I've seen algorithms that could make your head explode layed out in a simple, efficient way that made it nearly impossible to break it later with a bugfix. I've also seen fairly simple algorithms implemented in 10 pages of C in a single function, with comments warning that the function was too hard for mortals to understand (you know who I'm talking about, Pratt)

  2. Re:Um, right. on Don't Help Your Kids With Their Homework · · Score: 1

    I graduated in math from berkeley, and yet seem to have forgotten simple things like cramers rule. Not too surprising. However, I found that helping kids with math or science was most successful when we worked together to figure out the answer. If I just knew the answer, they wrote it down and forgot it. If I knew the answer, and tried to explain the reason behind the formula, the kids zoned out. The times I was able to help was when we BOTH didn't really know the answer, and had to go through the book, or think hard about what was really going on in the question.

    I never helped with history, geography, or english, of course, since they were ahead of me in those topics by the time they were 9.

  3. Re:Whatabout we demand equal time of our views ins on Creationists Demand Equal Airtime With 'Cosmos' · · Score: 1

    Lets keep separation of church and state intact. Remember, nobody expects the spanish inquisition!

  4. Re:Religion... on Religion Is Good For Your Brain · · Score: 1

    A thinking person should investigate religion, but not necessarily buy into it.

    Why? Why care about religion?

  5. Re:Whatever on Religion Is Good For Your Brain · · Score: 1

    Too bad there isn't a way to start a church of atheism, that has the same benefits (tax relief, community support) that a church has. I like the idea of social benefits, but dislike the idea that I need to submit to some mythical granddaddy in the sky to get them.

  6. Re:And... on 70% of U.S. Government Spending Is Writing Checks To Individuals · · Score: 1

    Yes, it's true that lots of them work at restaurants and other service jobs this way. I'm not denying that. They're basically the tier above the day laborers, because working at McDonald's is much more reliable work than day labor. But there's also lots of day laborers and others working under the table.

    Don't forget, those people paying taxes in ARE receiving benefits, since their income is reported against someone else's SSN, so they're free to claim no income and apply for benefits (WIC, etc.).

    From wikipedia:

    Professor of Law Francine Lipman [56] writes that the belief that illegal migrants are exploiting the US economy and that they cost more in services than they contribute to the economy is "undeniably false". Lipman asserts that "illegal immigrants actually contribute more to public coffers in taxes than they cost in social services" and "contribute to the U.S. economy through their investments and consumption of goods and services; filling of millions of essential worker positions resulting in subsidiary job creation, increased productivity and lower costs of goods and services; and unrequited contributions to Social Security, Medicare and unemployment insurance programs."[57]

  7. Re: I, for one, do welcome that test on New Blood Test Offers Early Warning for Alzheimer's Onset · · Score: 1

    FYI, no link between aluminum and alzheimer, despite lots of research.

  8. GMO people on Genomic Medicine, Finally · · Score: 1

    I hope people so helped will be labeled. I don't want to marry a GMO person.

  9. Re:which he at first found "abominable", on Einstein's Lost Model of the Universe Discovered 'Hiding In Plain Sight' · · Score: 1

    The Higgs field would have put a smile on his face. It amazes me that his first wife never got any recognition. It is impossible to do what Einstein did alone. Wondering if Max Plank saw that.

    She got the proceeds from his nobel prize as part of a divorce settlement. However, there is little evidence that she was instrumental in any real discoveries. Here is an overview: http://arxiv.org/pdf/1204.3551...

  10. Re:If you don't like it.... on Jewish School Removes Evolution Questions From Exams · · Score: 1

    reply to this post by stating clearly that you hereby sell your soul to Satan for the price of a bag of Cheetos. If you have balls you will also include in this deal the souls of everyone in your family.

    Oooh, I want to play! I hereby sell my soul to Satan for the price of a bag of Cheetos. Can I get free shipping on that?

    Wait, that means 'souls' can buy real stuff. They are just like bitcoins! Is there an exchange rate?

  11. Re:The monks of Mount Athos on Low-Protein Diet May Extend Lifespan · · Score: 1

    Eskimos ate mostly whale blubber and seal blood, and did quite well. They were amazingly healthy until they started eating sugar, at which point they started getting diabetes like everybody else.

  12. Re:Unregulated currency on Bitcoin Exchange Flexcoin Wiped Out By Theft · · Score: 1

    The United States of America has 314 million people with a near 100% literacy rate, a highly educated workforce, diversified economy, and 5,000 nuclear weapons. What does bitcoin have?

    They have a cool logo!

  13. Re:Why? on The Next Keurig Will Make Your Coffee With a Dash of "DRM" · · Score: 1

    Yes. Seems there is a theory concerning the apoptosis of cells, in which antioxidants disrupt the normal pathways, keeping cells alive that are better off dead. This explains the fact that smokers who take beta carotine tend to die of lung cancer more often than those who do NOT take it, which was discovered in the late 90s, I believe*. The smoking probably generates cancer cells that may or may not die, but antioxidants keeps more of them alive long enough to get a foothold.

    Throw away your vitamins. They are not helping you, probably do not contain what you think they do, and may actually be harming you. Throw them out now. Don't wait until you have finished the bottle. Food has all the vitamins you need (unless you are vegan, in which case you need to eat some eggs or drink some milk once in a while to get B12.)

    * http://www.ncbi.nlm.nih.gov/pu...
    http://www.ncbi.nlm.nih.gov/pubmed/19876916

  14. Re:Regulation of currency on MtGox Sets Up Call Center For Worried Bitcoiners · · Score: 1

    Recent statements by Warren Buffet suggest that, in his view, most people would be better served by putting 90% of their wealth into the Vanguard SP500 fund, and keeping 10% in cash/short term t bills. He is setting this up for his wife in his will.

    Here is the article

    The best way to win is not to play, at least the stupid games most investors play. Avoiding 'rookie moves' isn't possible for most people. For the most part, they aren't smart enough, don't have the education, and don't have fast enough access to information. This same advice has been around since Bogle started Vanguard.

  15. Oh no! on The Spy In Our Living Room · · Score: 1

    They can locate me IN MY OWN HOME! They know when I'm GOING TO THE BATHROOM! They can listen to me EAT PIZZA!

    1984 all over again. Er, well, you know what I mean. The horror!

  16. Re:This is actually good news on MtGox Files For Bankruptcy Protection · · Score: 1

    cry for more government, more regulation and more fascism.

    Measured amounts of government regulation is what separates us from Lord of the Flies scenarios. There is simply no basis in fact to equate reasonable bank regulation meant to prevent outright fraud with fascism.

    Are you new here?

  17. Re:This is actually good news on MtGox Files For Bankruptcy Protection · · Score: 1

    I was going to rate this +1 humor, but seem to have been swamped with people who aren't getting the joke, and are voting you insightful. Morons. They just don't get your clever satire, do they? I mean, saying that the failure of the exchange that handled 70% of the world's bitcoin traffic is a good thing is so obviously idiotic that nobody with a brain could take it seriously.

    I've also enjoyed your other satiric posts on bitcointalk. Very very clever stuff.

  18. Re:Ha ha on MtGox Files For Bankruptcy Protection · · Score: 1

    Why do people care what the exchange value of bitcoins are? I mean, I never care what the exchange value of USD are to Yen, because I never use Yen. Just always use bitcoins for everything. You can do that, right? Or, are bitcoins just a new tulip?

  19. Re:Because... on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    Banning GMOs doesn't only affect Monsanto. Labeling GMO means less GMO food will be produced. That means Monsanto will suffer a tiny setback, but it won't hurt them as much as you seem to think.

    If you believe, like I do, that GMO foods are probably a good thing on balance (probably better than huge amounts of chemical insecticide, which shows up in the water tables), then less of them is a bad thing for public health.

  20. Re:Why single out Whole Foods? on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    Only one word to say: 'costco'. Best prices, better meat, no bullshit. In fact, I do all my grocery shopping at costco. They make their profits on their membership fees, and not their markups. This is a reasonable exchange, since I can pay for an executive membership with the money I get back every year from the American Express card they use as a membership card. They have bacon too.

  21. Re:Why single out Whole Foods? on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    +1 informative.

  22. Re:Why single out Whole Foods? on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    Yes, but the stuff you mine was never exposed to the pollutants that are found in the sea today. It was sequestered a long time ago.

    Where does salt come from?

  23. Re:God on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    As to whether a proof of any sort of "god" is even possible, well first one has to settle on a particaular definition of the word, which means many things to many people.

    Here is a proposed definition. How about a guy who "Knows when you are sleeping, knows when you're awake, knows when you've been bad or good, so be good for goodness sake?". Doesn't that about cover it?

    Proof of god is then predicated on the appearance of presents on Christmas. As we all know, presents do appear under the tree on Christmas. Therefore, god exists. Q.E.D.

    PS: It is better than Descarte's proof, which is that, basically, god is perfect, to be perfect is to exist, therefore god exists. I didn't invent analytic geometry, but I think my proof is much better than his.

  24. Re:God on Whole Foods: America's Temple of Pseudoscience · · Score: 1

    The really spooky view is that we are in some kind of simulation. In that case, if there was a 'cosmic debugger' in action, modifying the world we live in outside of time and space, you might see strange behavior, discontinuities, things that you couldn't really explain using the laws of the simulation. This is really what the religious believe, expressed in a different way. God can't be made of the same goo we are made of.

    Another view would be that these myths were invented to describe technology that was not understood at the time. This is the ancient aliens 'hypothesis'.

    Both views are probably nonsense. There is a much simpler view. People make up things all the time. In particular, people make up myths to get and hold power over others. We also make up stories to explain things we don't understand. Every religion has a creation myth, but how could they know it? All knowledge is invented. Reality is far too complex to understand; we model it to predict the future, but how well is that going in your life? The models we have are crap, which means that, really, our inventions about reality are all primitive religions. We will never really understand what is going on, because it is simply too hard. The more we see, the more complicated it gets.

    So, who knows if whole food is good for you? Not me. Probably not you. I just read that 'scientists' have decided that antioxidents inhibit the natural facility of cell death in cancer stem cells, thus explaining why Finnish smokers who took vitamin E died more frequently from lung cancer. I've also read that fat is not really bad for you, like every nutrition poster I've seen since the 2nd grade has said in bold letters. We trust people to give us advice about what we should do, when they don't know, and really can't know, either. The recent scandal is that much of our research is based on flawed statistical models (using the 'null hypotheses' idea incorrectly), and is thus not reproducible.

    In particular, cancer research has some flaws. As a cancer survivor, this troubles me, to say the least. Should I eat fruits and vegetables, or a 'caveman diet', or restrict sugar, or will I get a 'wheat belly', or should I just ignore the entire thing and drink milkshakes made with high fructose corn syrup so my 'cell death facility' will work properly? Nobody really knows, and if they know, it probably doesn't apply to me for some reason they don't know.

  25. Re:Dangerous recursion! on Stack Overflow Could Explain Toyota Vehicles' Unintended Acceleration · · Score: 1

    Also, microchip hardware stacks wrap around (surprise!). For a PIC16F683, the stack holds 8 return addresses. If you push a 9th element, it will go into location 0... You also need to keep another software stack if you want to save registers or allocate local variables.

    From section 2.3.2 of the data sheet:

    The stack operates as a circular buffer. This means that after the stack has been PUSHed eight times, the ninth push overwrites the value that was stored from the first push. The tenth push overwrites the second push (and so on).

    also

    Note 1: There are no Status bits to indicate stack overflow or stack underflow conditions.

    I've seen example code from microchip that uses this to avoid returning from interrupts. They just handle the interrupt and reenable interrupts, and then busy loop at the end of the interrupt routine, waiting for the next interrupt to take them to the top of the routine again.

    Somebody was on drugs when this was designed.