Slashdot Mirror


User: petermgreen

petermgreen's activity in the archive.

Stories
0
Comments
10,783
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 10,783

  1. Re:== vs =, | vs ||, variable/pointer dereference on A Source Code Typo Allowed An Attacker To Steal $592,000 In Cryptocurrency (bleepingcomputer.com) · · Score: 1

    edit sorry it seems I was wrong about matlab, apparently it does use the C convention. Shows how having to deal with too frigging many languages can leave one confused.

  2. A one character bug? Really?

    "one character typo" can cover a wide range of things. Using = instead of == is probablly the most famous but also generally one of the easiest to spot (modern compilers usually have a warning for it). Using the wrong variable is a big one (not helped by the fact that mathematicians love one-character variable names). Using the wrong logical or comparision operator can be another.

    Unfortunately TFA doesn't say what the "one character typo" was and looking at their github I don't see any one character typos being fixed recently. I do however see a "two character" typo being fixed though ("||" vs "&&"). I also see some == being change to >= but I *think* that is just a case of making a test more paranoid.

    https://github.com/zcoinoffici...

    What about the tests?

    It takes extreme discipline to carefully create test cases that cover every failure case. All too often people only test that the normal case works as it should and fail to test the error handling.

  3. Re:== vs =, | vs ||, variable/pointer dereference on A Source Code Typo Allowed An Attacker To Steal $592,000 In Cryptocurrency (bleepingcomputer.com) · · Score: 1

    Seriously what kind of programmer doesn't expect a single '=' to be an assignment operator?

    A pascal, basic or matlab programmer.

  4. Re:Until on Is IoT a Reason To Learn C? (cio.com) · · Score: 1

    No, with std:: string each time you write something like "a =b" the compiler has to either mess with reference counts (most implementations of c++03 and earlier) or copy all the data (c++11 and later). You can work around that by using references but then you lose the safety advantages of automatic memory management and add an extra level of indirection to accesses .

  5. Re:Some numeric values and basic concepts on Ask Slashdot: What Are Some Things That Every Hacker Once Knew? (ibiblio.org) · · Score: 1

    What is
    signed char c=127 + 1;

    Assuming we are talking about C.

    127 and 1 are ints, so 127 + 1 is 128. int is gauranteed to be large enough that we won't have arithmetic overflow here.

    Converting that result to signed char is where things get interesting. On most systems "signed char" cannot represent the number 128, according to the C standard the results of conversion to a signed type that cannot represent the converted value is implementation-defined.

    Most implementations chose to simply take the 8 least significant bits of the number and re-interpret them as an 8 bit twos complement number, resulting in a value of -128.

  6. The cogent/HE peering spat is only an issue when both ends of the connection were stupid enough to single home with a wannabe teir 1.

    Advertising a route and then blackholing traffic for destinations covered by that route is much worse than simply not providing a route because it also impacts multihomed downstreams.

  7. Re:Timeout on Most of the Web Really Sucks If You Have a Slow Connection (danluu.com) · · Score: 1

    That page is about http 1.0

    1.1 (currently the dominent version) allows connection keepalive and pipelining which were supposed to solve those issues. Unfortunately pipelining has it's own problem. One slow request (large ammount of data, slow CGI script etc) can block the whole pipeline. So afaict most clients use connection keepalive but not pipelining.

    2.0 allows multiple simultanious requests on the same TCP connection but has the downside of being much more complicated to implement.

  8. Re:"But Officer, I don't use social media at all." on US Visitors May Have to Hand Over Social Media Passwords: DHS (nbcnews.com) · · Score: 1

    That's all you'd have to say. What are they going to do

    If border gaurds beleive a foreign visitor is lying they can just send them home. They don't need to prove anything,

  9. Re:Courage. on Mozilla Binds Firefox's Fate To The Rust Language (infoworld.com) · · Score: 1

    But you'll have to link with some library X which is written in C and there are X_alloc / X_free functions you're supposed to call for some opaque pointer. Then you have to add library Y and that's using an older C++ because it can't break compatibility for some reason. Then you use library Z (e.g. Qt) which has its own way of doing stuff totally contradicting everything else. In the middle of all this something leaks and its a mess to find.

    The problem is unless you are going to rewrite the whole stack you still have to talk to those libraries. So the new language just moves the crap out of the language core and into the glue layer that lets you talk between code in your fancy new language and C/C++ libraries.

  10. Re:This could get interesting on Apple Developing Custom ARM-Based Mac Chip That Would Lessen Intel Role (bloomberg.com) · · Score: 1

    Kinda fascinating that a Visicalc file could be transfered from a 5.25 floppy from late '70s early 80s all the way to the latest MAC,

    The file may be able to be transfered but program binaries intended for non-x86 MACs aren't going to run on the latest MACs without a third party emulator.

    while Windows running on X64 can't even handle a 16-bit installer without external support...

    Apple drops support for legacy applications far quicker than MS does.

    Mac OS X was launched as a consumer product in 2001. Intel Macs were released in 2006 with no support for classic mac OS apps, classic support was removed from the powerpc releases of Mac OS soon afterwards.

    Support for rosetta was removed in 2011.

    On the MS side win32 was brought to most customers with windows 95 in 1995. The first 64-bit desktop version of windows didn't appear until 2005 and didn't become common for several years after that.

  11. In any game that requires precise pointing/aiming players using keyboards and mice destroy players using console pads.

    But keyboard/mouse requires a very different setup from console pads. Console pads can be used to play in the lounge sitting on the sofa. Keyboard and mouse pretty much requires a desk. Generally people have their consoles set up in their lounge with their TV, not in their office with their monitor. Most console players aren't going to want to rearrange their furniture so they can play with a keyboard/mouse.

    So if you put keyboard/mouse support into console gaming and let them play with everyone else a handful of hardcore players will set up their console on a desk as if it was a PC and destroy even the best pad users. Letting the minority who have thier console in a "desktop" setup dominate the game is not good for buisness. If you split the keyboard/mouse players into their own group you leave people wondering why they can't play with their friends or wondering why matchmaking never finds anything.

  12. Re:LLVM requirement? on Mozilla Binds Firefox's Fate To The Rust Language (infoworld.com) · · Score: 1

    8GB is recommended and a 2GB absolute minimum is required.

    8GB can be "jammed in" to virtually all desktops and laptops made in the last 5 years, 2GB can be "jammed in" to virtually all desktops and laptops made in the last 10 years.

  13. If you want to keep normal "monitor" DPIs while taking the size to 27 inch or so you end up at about 2.5K pixels wide.

    Now double the DPI so you can render modern apps in high DPI while rendering legacy apps with pixel doubling and you end up at about 5K pixels wide.

  14. Re:Not making enough success on It's Time To Admit Apple Watch Is a Success (imore.com) · · Score: 1

    Reporting requirements specific to public companies are to protect the interests of investors.

    With a public company anything disclosed to investors and potential investors is unavoidablly also disclosed to suppliers, customers and competitors.

    So there is a balance to be struck between disclosing sufficient information that investors can make rational investment descisions and not disclosing so much information that public companies are put at a disadvantage to private companies.

  15. Re:Still using on Seagate Says 16TB Hard Drive To Hit Market Within 18 Months (techspot.com) · · Score: 1

    No really it isn't.

    To read something from a hard drive you have to seek to the right track and wait on average half a rotation for it to come under the head. So a 15KRPM hard drive maxes out at under 500 IOPS. A raid array can help a bit provided the host can queue up enough operations at once that all the drives stay busy.

    15K RPM hard drives have been basically squeezed out by falling SSD prices. The SSDs now offer a comparable cost per gigabyte and far higher performance.

  16. Re:Win10 alternatives on Wine 2.0 Released (softpedia.com) · · Score: 1

    Afaict MS has seen the writing on the wall.

    People are replacing their computers less often and spending less money on each computer. When a computer costs $1000 a $100 or so windows license is tolerable, when a computer costs $200 it is much less so.

    To discourage sellers of low end computers pushing Linux and/or potential purchasers of low end computers buying smartphone like tablets instead, MS has been practically giving away windows for low end computers. That helps to keep people in the windows ecosystem but it further errodes revenue.

    So MS has been trying hard to reinvent themselves. With win8 they tried to push a tablet OS on desktop users, presumablly in the hope that doing so would help them capture the target market. With win10 they seem to be trying to reinvent windows into a platform they can use to push their online services.

  17. Re:Wine on Wine 2.0 Released (softpedia.com) · · Score: 2

    There are several parts to wine.

    One is a big set of libraries that act as substitutes for the windows ones, either implementing functionality themselves or translating it to calls to native Linux libraries.

    Another is a binary loader that knows how to actually load windows binaries into the right place in memory (which is tricky because you have to make sure Linux doesn't put any shared libraries there first) and resolve their imports against both windows dlls and the wine-specific libraries.

    Another is a program that provides a substitute for the windows kernel, allowing programs to talk to each other as-if they were on a windows sytem.

    There is also a reimplmentation of the compatibility layer that allows 16 bit programs to run on 32-bit systems.

    No actual processor emulation takes place but an awful lot of other stuff gets emulated.

  18. Shipping stuff on big container ships is pretty cheap.

    Afaict there are two main advantages to manufacturing in the country you sell in.

    1. Speed, container ships are slow, and aircraft are expensive. Slow shipping means more capital tied up in stock and slower response to market changes.
    2. Protectionism, restrictions and taxes on selling your products can be a real damper on buisness.

    The Toyota case is an example of a response to protectionism. The US government presured the Japanese government into restricting exports of cars from Japan to the USA. So Toyota set up factories in the USA.

  19. Re:What's the point of Western Union? on Western Union Pays $586M Fine Over Wire Fraud Charges (reuters.com) · · Score: 1

    Bank transfers have a few issues.

    1. While in-country transfers are usually free or cheap and easy to perform international transfers are often expensive and awkward.
    2. At least the US and the UK have direct debit systems which work based on bank account numbers and have little security. This makes people reluctant to give out their bank account numbers.
    3. Poor people often don't have bank accounts. This goes double for poor people living in poor countries or poor people living as illegal immigrants in rich countries.
    4. Bank transfers can be slow. This is especially true for international transfers.

  20. Re:Of course... on Samsung Answers Burning Note 7 Questions, Vows Better Batteries (cnet.com) · · Score: 1

    While I agree non-replacable batteries are a pain I don't think user-replaceable batteries would help much in a situation like this. Indeed I think they would have been a hinderance.

    You need to be able to quickly identify whether a phone has a recalled or replacement pack in it. With a non user-replacable battery you just set a firmware flag when the phone is in the service center for battery replacement. With a user-replacable battery you need sufficient smarts in the battery itself to let the host device distinguish between a recalled pack and a non-recalled pack

    And you still have the problem of having to actually make those replacements quickly and in large numbers, which at least according to this press release (which of course may or may not be true) is what left samsung double-screwed and forced them to move from a recall-and-fix strategy to a recall-and-refund strategy.

  21. Re:PHP? That's software engineering nowdays? on Knuth Previews New Math Section For 'The Art of Computer Programming' (stanford.edu) · · Score: 1

    I think the real problem is partial substitutability.

    In both php and javascript if you use a number where a string was expected or a string where a number was expected the program will blunder on. If you are lucky it will produce the right results, if you are unlucky it will produce wrong answers. It is relatively unlikely to produce an error message and if it does that error message is likely to be a long way from where the mistake was made.

    php's separation of the addition and concatenation operators increases the chance that a program will produce the right results despite accidental using the wrong type but it's still a minefield.

    Java is statically typed. A caller can only pass your method the types it was expecting.

    Python is dynamically typed but forbids use of the "+" operator on mixed strings and integers and will never compare a string an an integer as equal. So using an integer where a string was expected or vice-versa is likely to fail fast.

  22. Re:Just a guess.. on Galileo Satellites Are Experiencing Multiple Clock Failures (bbc.com) · · Score: 1

    IIRC Aerospace gets an exemption.

    The problem is that having both leaded and lead-free inventory is a PITA. A small ammount of lead contamination leaking into stuff that is supposed to be lead-free can lead to expensive problems both legally and technically.

    The result is lots of stuff that doesn't legally need to be lead-free nevertheless gets made on lead-free processes. Even if the final assembly is done with leaded solder it is very likely that things like component surface platings will be done with lead-free materials.

  23. The minimum is only 5 units.

    But yeah, few small buisnesses are going to want to bother with the hassle and expense of setting up a volume license agreement. Especially when for the moment buying machines with win10 pro licenses and downgrading them to win7 pro is a viable option.

  24. Re:People agree that Windows 10 has better tech on Microsoft: Windows 7 Does Not Meet the Demands of Modern Technology; Recommends Windows 10 (neowin.net) · · Score: 1

    Intel slaps the "i7" name on everything from dual core ultra-moble processors with a headline clock speed of only 1.3GHz (max turbo is much higher but afaict turbot speeds are not gauranteed) to 10 core high end desktop monsters. So "has an i7" is pretty meaningless to someone who wants to know how much processing power their device has.

  25. If alice trusts the provider to tell her that bob is bob and bob trusts the provider to tell him alice is alice then it's all too easy for the provider to pretend to be alice when talking to bob and pretend to be bob when talking to alice.

    If you care about provider snooping then you need to use tools where you manage your own keys.