Slashdot Mirror


User: andyn

andyn's activity in the archive.

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

Comments · 25

  1. Re:GOTO still considered harmful on Serious Linux Kernel Vulnerability Patched (threatpost.com) · · Score: 3, Informative

    Guess what! it has nothing to do with OOP emulation. All cleanup in a C program has to be done explicitly by the developer, be it coded in object-oriented, functional, imperative or whatever the paradigm-of-the-week is.

    Furthermore, the way kernel devs use goto for cleanup is one of the ways that actually keeps the code simpler and less prone to errors. There are a few alternatives to do cleanup in complex code:

    1. Don't do error checks. In your average C101 homework it's often assumed that many syscalls cannot fail. Obviously, the absolute minimum required in a real world program is a simple assert that stops the program before it can misbehave. Any real-world program that cannot lose data or crash the whole system such as office programs, databases and kernels obviously cannot do this.
    2. Do an early return and clean up all data so far. Very error prone as the cleanup code has to be replicated in multiple places.
    3. if/do-while(0)-break wrapping of code. Easy as long as there is one tier of resources to allocate. Any more and the function becomes arrow code.
    4. Wrap the constructors and destructors in a macro to emulate RAII. The result is still arrowish, although the cleanup is harder to fail. Not allowed in many projects due to an undeserved loathing of macros.
    5. Split the code into multiple functions. Now you have to pass around the state in function parameters. Having the code split into multiple functions makes the it more prone to logic errors.
    6. Use goto to jump to the cleanup section. All relevant code is kept in the same function and the code between alllocations and frees stays flat and concise.
  2. Re:Hosts file on YouTube Reportedly Bypassing Ad Blockers On Google Chrome · · Score: 1

    B-b-but w-who on earth would want to block Goatse and Tubgirl?

  3. USB Power Delivery? on Android M To Embrace USB Type-C and MIDI · · Score: 0

    Great! Now I can drain my battery even faster!

  4. Am I reading The Onion? on How One Small Company Blocked 15.1 Million Robocalls Last Year · · Score: 2

    ...because that's what I just thought.

    Newsflash! Government pays entrepreneur USD 25 k for coming up with a technological solution for a legislative problem!

  5. Re:Very relevent for small target embedded stuff. on How Relevant is C in 2014? · · Score: 2

    Depends mostly on compiler and toolchain availability on those platforms. You still have Python-capable processors for embedded systems if you can't afford to learn C.

    FWIW, I've been struggling with LPC4300 series processors. The open source toolchain is just so bad that your CPU hard faults on first attempted function call (most likely due to incorrect memory maps).

  6. Oh please. on Researchers Propose a Revocable Identity-Based Encryption Scheme · · Score: 5, Insightful

    having a private key generator do some wibbly-wobbly timey-wimey stuff to generate a secure private key out if it.

    This is Slashdot. Pretty please stop underestimating our skills.

  7. Stop dumbing down summaries, please. on DDoS Larger Than the Spamhaus Attack Strikes US and Europe · · Score: 3, Interesting

    a timing mechanism that underpins a way the Internet works

    But how many LOCs is that? Joking aside, I would have thought that nobody had to dumb down things that much before posting to Slashdot.

  8. Damn market speculators. on Chinese DRAM Plant Fire Continues To Drive Up Memory Prices · · Score: 1

    According to reports, the plant was making GDDR5 chips, used in high memory bandwidth devices like display adapters. This clearly is a perfectly valid reason to raise the prices of DDR3.

  9. Everything is in the cloud. on Happy World Backup Day · · Score: 1

    Had a head crash on my work laptop on Thursday. There was no need for restoring backups in the traditional sense since all company data was on SparkleShare (company internal git repo) and the few personal documents were in Dropbox. I pulled out a new laptop, installed SparkleShare and Dropbox and was good to go.

  10. Re:Dashcams on Moscow Plane Crash Caught On Passerby's Dash Cam · · Score: 1

    there are a lot of Russian tourists this time of year. Most of them do drive responsibly. And I urge you to do so here abroad (we have a pretty decent police who can write accurate reports if there is an accident and are not for sale) as well as home.

    They drive responsibly abroad because breaking the law will get their visa revoked.

  11. Re:Contacting Server... on How Experienced And Novice Programmers See Code · · Score: 1

    Now that you mentioned it, I just noticed that Chrome gave an error message I hadn't noticed before:
    Other users are also experiencing difficulties connecting to this site, so you may have to wait a few minutes.

    The real news, however, might be that someone on Slashdot uses a browser that actively spies its users' browsing habits.

  12. No big news. on Samsung Sets New Guidelines For Alcoholic Beverages · · Score: 1

    Somehow this doesn't come as a surprise, as Samsung announced just a week ago that they'll open a new R&D site at the Aalto University campus in Otaniemi. Samsung would've been bankrupt by the end of the year had they offered the MSc (Tech) undergrads all the spirits they can handle.

  13. Old meets new on BBC Turns Off CEEFAX Service After 38 Years · · Score: 1

    The Finnish Broadcasting Company YLE has adapted the well-aged teletext service for modern purposes by providing real-time Twitter commentary of ongoing muncipal election debates.

    Earlier this year they allowed people to post their own pixel art.

  14. Re:Like the multi-user features on Amazon Debuts Kindle Paperwhite, Kindle Fire HD In 2 Sizes · · Score: 1

    Kindle has a nice idea of how the device can be used in a family, where the parents can control time spent by kids.

    Yeah, books teach kids revolutionist ideas so it's better to reduce their exposure to any potentially dangerous material.

  15. Re:The one true way to allocate white space on EU Calls for Unified Approach to Allocating "White Space" Spectrum · · Score: 2

    4 space indents, no tabstops

    4 is wasteful, only two is needed an gives a nice alignment with the above code.

    That's why you both ought to be using tabstops after all. It lets everyone use the indentation level they are most comfortable with.

    If you worry about crossing the magical 80 character column width limit, don't. Those folks who care about it are the same who use 2 space indentation anyway.

  16. Re:Is it worth it? on Only English Final Fantasy 2 NES Cartridge On Sale for $50K · · Score: 1

    Altho i'm loathe to use the word/admit it

    No you don't. Damn hipsters!

  17. Ubuntu has already done this, sort of on Universal Android Laptop Dock: Microsoft Nightmare, Or Toy? · · Score: 4, Interesting

    Mr. Shuttleworth has already been offering Ubuntu desktop on Android phones for phone vendors. I don't see any reason why this wouldn't work for laptops.

  18. Re:What about Google driverless car? on Software Bug Caused Qantas Airbus A330 To Nose-Dive · · Score: 5, Interesting

    Back in my Finnish Air Force days I talked to a captain who had flown the F-18C in his last three active flight years. He told that when you're straight and level in the Hornet and peek over your shoulder you probably see the ailerons swaying back and forth as the computer tries to keep the plane stable.

  19. EDA software on What's Keeping You On Windows? · · Score: 1

    A certain EDA and simulation software (at home, not at work). It uses OpenGL and is just too heavyweight to be run in a virtualized environment.

  20. Re:news? on MeeGo, Zero To VT320 In Seventeen Seconds · · Score: 2, Informative

    DB9

    ITYM DE9.

  21. Games you want to keep won't be resold. on Why Game Developers Should Shut Up About Used Games · · Score: 1

    I guess I'm repeating the same mantra over and over again when saying that a game worth playing and keeping won't make its way to Gamestop's shelves. However, I have two concrete examples: Operation Flashpoint and its successor Armed Assault.

    OFP with its expansions had a total of three campaigns. Towards the end I found the missions repetitive. Luckily Bohemia had one ace up their sleeve: their creation was almost endlessly moddable despite some shortcomings. Nobody in the community would have sold his disks because skilled modders had created thousands of single addons and dozens of total conversions and were pushing out new stuff years after the initial release.

    ArmA was basically an updated version of OFP with a poor campaign. Still people didn't sell their disks because they already knew the possibilities the game would offer.

  22. Poor ripoffs are nothing new on Spurned Chinese Publisher May Create WoW Knockoff · · Score: 5, Insightful

    Oh, come on. We all know the fact that that most MMORPGs are practically clones of each other anyway...

  23. Real Men don't make backups on ASCII Art Steganography · · Score: 5, Funny

    Real Men don't make backups. They embed their private data into ASCII art and let the world mirror it.

  24. Re:Working sleep mode? on Atheros Hardware Abstraction Layer Source Is Released · · Score: 1

    Draining batteries only while in sleep? Luxury! My old Fujitsu L1300 will drain its batteries in a day even when it has been completely shut down. Removing the battery makes it last for weeks.

  25. Re:So here's all they have to do... on Will China Beat the United States Back to the Moon? · · Score: 1

    All they have to do is go up to the moon and remove the original Apollo lander, the flag, etc., then claim they found nothing there.

    How are they going to remove all the footprints without making it look like a complete forgery?