Slashdot Mirror


User: flargleblarg

flargleblarg's activity in the archive.

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

Comments · 688

  1. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    Yeah, but it is three lines of C (four if you count the function name/parameter line). So there. Bottom line counts. You asked for a 4-line solution and you got one.

  2. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    Right. Just making a joke. Carry on. :)

  3. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    p.s. You'll need to #include <stdint.h> to get uint8_t and uintptr_t, naturally.

  4. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    Whoops. I forgot to remove ||c<1, which my original solution needed before it was golfed down to this. Code still runs correctly with it, though. Here is the simplified version:

    void *my_memmove(void *d, void *s, size_t c) {
    ... for (size_t x=(uintptr_t)d<(uintptr_t)s?+1:-1,i=x==1?0:c-1;c;c--,i+=x)
    ....... ((uint8_t *)d)[i] = ((uint8_t *)s)[i];
    ... return d;
    }

  5. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1
    Dude. Here is a three-line solution. One statement per line. Passes all your tests.

    void *my_memmove(void *d, void *s, size_t c) {
    ... for (size_t x=(uintptr_t)d<(uintptr_t)s||c<1?+1:-1,i=x==1?0:c-1;c;c--,i+=x)
    ....... ((uint8_t *)d)[i] = ((uint8_t *)s)[i];
    ... return d;
    }

    (Indentation using periods because Slashdot's formatting system is braindead.)

  6. Re: As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    The lineup of people waiting for their own toilet would stretch to the moon.

    Average distance to the Moon is 238,900 miles. Divide this by 774 million and you get 1.63 feet or about 19.5 inches. Math checks out.

  7. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    If you aren't worried about performance simply copy the block to a temporary spot before copying it to the destination.

    Especially when moving several gigabytes up or down by 1 byte.

  8. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    char isn't a byte type. Use uint8_t if you want bytes.

  9. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    If you copy 0-100 over to locations 50-150, then you have to copy backwards, copy the 100 over first, then 99, etc.

    Wrong. You don't have to copy backwards at all in this case. You can copy 50–100 over to 100–150 using a forward copy operation, and then copy 0–49 to 50–99 also using a forward copy operation. No backward copy is needed.

  10. Re:As a C programmer on C Top Programming Language For 2016, Finds IEEE's Study (ieee.org) · · Score: 1

    Almost... but not quite. If dst == src, then return immediately without doing anything. If not, then compare to decide whether to do a forward or backward copy.

  11. Re:..doesnt factor in connection cost. on Subscribers Pay 61 Cents Per Hour of Cable, But Only 20 Cents Per Hour of Netflix (allflicks.net) · · Score: 1

    It also doesn't account for the cost of a TV averaged out over the life of the TV. You need something to watch it on.

    Of course it doesn't account for a teevee. You can watch Netflix on your phone, or your tablet, or your laptop computer, or your desktop computer.

  12. Re:Netflix has a unique and obvious strategy. on Slashdot Asks: What's Next For Netflix? (500ish.com) · · Score: 1

    Yes, I understand all that. (And thanks for spelling it out for people who might not!)

    However, I still think it sucks ass-barf that Netflix only has 26 of the top 250 movies on streaming. It's an unfortunate travesty. Not necessarily their fault, as you point out, but it still totally sucks and is incredibly lame.

  13. Re:Netflix has a unique and obvious strategy. on Slashdot Asks: What's Next For Netflix? (500ish.com) · · Score: 1

    It has some. I wouldn't say it's full. Of the IMDB top 250 movies, at least as of March Netflix had 26 of them. Just over 10%.

    That sucks ass barf. :(
    Man, 10 years ago, Netflix used to actually be good.

  14. Re:Netflix has a unique and obvious strategy. on Slashdot Asks: What's Next For Netflix? (500ish.com) · · Score: 1

    But I know DVDs and mail are so "old school" these days. Perhaps hipsters will bring them back in a couple years.

    I sincerely hope not. 480p content is shit.

  15. Re:TFA is not terribly clear... on Suspect Required To Unlock iPhone Using Touch ID in Second Federal Case (9to5mac.com) · · Score: 1

    No, the moral of the story is don't use your fingerprint as a password.

    My voice is my password.

  16. Re:$3B in 1-2 years for Apple... on Apple To Make $3 Billion From Pokemon Go (theguardian.com) · · Score: 1

    Three billion dollars can do a lot of useful things. It's not a blip even if your revenue is a trillion dollars.

  17. Re:$3B in 1-2 years for Apple... on Apple To Make $3 Billion From Pokemon Go (theguardian.com) · · Score: 2

    $3B is a lot more than just a blip. $1M is just a blip. $3B is significant.

  18. Re:monkey business on Brazil Judge Orders Phone Carriers To Block WhatsApp Message App (reuters.com) · · Score: 2

    As you know, our blockade is perfectly legal.
    https://www.youtube.com/watch?...

  19. Re: The DNC overlords always get their way on Bernie Sanders Endorses Hillary Clinton (cnn.com) · · Score: 1

    Once Ohio went to Obama, and Florida got called for Obama, the election was over Mitt Romney. History could repeat itself in 2016.

    Not likely. Mitt Romney isn't even running in 2016.

  20. Re:So far, I don't on Ask Slashdot: How Often Do You Switch Programming Languages? · · Score: 1

    s/PERL/Perl/g;

    Perl is the name of the language. perl is the name of the binary. PERL isn't anything.

  21. This doesn't seem possible to do accurately through a cellphone camera without some other lighting and/or color reference being present.

    You mean, like, oh, maybe a built-in flash that exists on every smartphone camera?

  22. A cool idea that is incredibly poorly executed on Student Makes 'Shazam For Fonts', a Gadget That Detects Fonts and Captures Colors (theverge.com) · · Score: 1

    Seriously? A dedicated device for this? In 2016? It should just be a smartphone app. No need for separate hardware.

    Lame.

  23. Re:Speak for yourself on Google Ponders About a Chromebook Pro (venturebeat.com) · · Score: 1

    Why would I want to do that? I can use the third mouse button to do that,

    Mouse != Trackpoint

    If you want to be ignorant of superior pointing devices, you can make that choice. Don't call other people dumb just because you prefer an inferior and less productive way to move your cursor.

    Me on my trackpad can run circles around anyone on their trackpoint.

  24. Re:Create? on Google Ponders About a Chromebook Pro (venturebeat.com) · · Score: 1

    Jebus. Wow. Thank you for elaborating on that. Wow. Pretty messed up.

  25. Re:I want a pointing device that doesn't suck ass on Google Ponders About a Chromebook Pro (venturebeat.com) · · Score: 1

    My blood would burn through the raised floor tiles, so ... all right, I'll stay away.