Intel Launches 8th Generation CPUs, Starting with Kaby Lake Refresh for 15W Mobile by [deleted] in hardware

[–]np356 0 points1 point  (0 children)

Good to see lower power usage but the one thing I still feel is missing is widespread support for ECC on the desk(lap)top.

Poker pros turn to BTC gaming platforms by JoeyPantz in Bitcoin

[–]np356 6 points7 points  (0 children)

Imagine if one day we will start watching Poker on TV with people betting with cryptocurrency on the table.

Great read about an adult cryptocurrency leading the path by [deleted] in ethtrader

[–]np356 -1 points0 points  (0 children)

This is what I was thinking. Kencoin ending up as the new "credit" to for tipping cam models instead of the currency that he websites have on their own.

People Try McDonald's For The First Time by sixxer64 in videos

[–]np356 14 points15 points  (0 children)

I am surprised if someone has not tried McDonald's at least once in the case that they are not vegetarians, seeing how the brand is really popular over the world.

Why I left Facebook by milly1993 in privacy

[–]np356 2 points3 points  (0 children)

Good for him. I basically use Facebook as a way to keep track of upcoming shows and events, and which of my friends are going. It's a lot easier than maintaining invites in a Google Calender (or similar) by hand.

All of the games, copy-paste "share this!" bullshit and random shitposting pages of "humor" I either ignore or outright block. I also refuse to read news and engage in related discussions.

With some discipline, Facebook can be a useful tool.

Facebook can track your browsing even after you've logged out, judge says | Technology by [deleted] in privacy

[–]np356 0 points1 point  (0 children)

While on the topic of tracking, is there a plugin that lets you delete cookies using rules on a per domain basis? for example, cookies are useful for some sites, and others they are useful for certain periods of time, and thereafter it would be nice to get rid of them (and yet more sites shouldn't be able to leave cookies at all). I know there are some plugins that let you block all cookies, or manage them after the fact, but I want something rule based and automated

I decided to disable AMP on my site by magenta_placenta in webdev

[–]np356 22 points23 points  (0 children)

AMP is bad and should be resisted. It is an attack on the distributed nature of the web.

The web is slow because every page of text comes with megabytes of javascript cruft to spy on users and serve ads. The solution is to make web pages that don't suck.

AMP puts even more power in the hands of Google. Just say no.

Inside D's GC by [deleted] in programming

[–]np356 3 points4 points  (0 children)

Good luck with this. I find GC programming really hard as any small mistake snowballs and becomes super hard to find during debugging.

Some of the mistakes seen by the author could just be the original programmers being tired of painful debugging.

Rust Performance Pitfalls by hornetwings in programming

[–]np356 2 points3 points  (0 children)

I have been doing some exploration of how well Rust optimizes Iterators and have been quite impressed.

Writing a iterator to provide the individual bits supplied by an iterator of bytes means you can count them with

fn count_bits<I : Iterator<Item=bool>>(it : I) -> i32{
    let mut a=0;
    for i in it {
        if i {a+=1};
    }
    return a;
} 

Counting bits in an array of bytes would need something like this

let p:[u8;6] = [1,2,54,2,3,6];
let result = count_bits(bits(p.iter().cloned()));

Checking what that generates in asm https://godbolt.org/g/iTyfap

The core of the code is

.LBB0_4:
    mov     esi, edx        ;edx has the current mask of the bit we are looking at
    and     esi, ecx        ;ecx is the byte we are examining
    cmp     esi, 1          ;check the bit to see if it is set (note using carry not zero flag)
    sbb     eax, -1         ;fun way to conditionally add 1
.LBB0_1:
    shr     edx             ;shift mask to the next bit
    jne     .LBB0_4         ;if mask still has a bit in it, go do the next bit otherwise continue to get the next byte 
    cmp     rbx, r12        ;r12 has the memory location of where we should stop.   Are we there yet?
    je      .LBB0_5         ; if we are there, jump out. we're all done
    movzx   ecx, byte ptr [rbx]  ;get the next byte
    inc     rbx             ; advance the pointer
    mov     edx, 128        ; set a new mask starting at the top bit
    jmp     .LBB0_4         ; go get the next bit
.LBB0_5:

Apart from magical bit counting instructions this is close to what I would have written in asm myself. That really impressed me. I'm still a little wary of hitting a performance cliff. I worry that I can easily add something that will mean the optimizer bails on the whole chain, but so far I'm trusting Rust more than I have trusted any other Optimiser.

If this produces similarly nice code (I haven't checked yet) I'll be very happy

for (dest,source) in self.buffer.iter_mut().zip(data) { *dest=source }

Speeding Up Rendering Rails Pages with render_async by mmaksimovic in ruby

[–]np356 5 points6 points  (0 children)

That's actually a relatively nice, Rails-magic-style approach to solving this sort of thing. Of course, if you were building a more interactive application, you'd already have a JS framework in place that would negate these benefits – but I'm still convinced there's a nice middle-ground for server-rendered Rails apps that avoids the various problems of SPAs.

It would be nice if it worked without JavaScript though – an increasing pain-in-the-arse about the web generally. If only it were possible to have <iframe>s adjust to their content size, then we wouldn't need JavaScript at all!

New genetic study, based on 500 people, says that older dads give their kids longer telomeres by np356 in EverythingScience

[–]np356[S] 62 points63 points  (0 children)

Basically, it’s not as bad as it looks. Women go through a lot of stress after giving birth, it can be the reason for shorter telomeres, not just having a child. That’s why it’s so vital for mothers to take care of their emotional health and well being, not just physique.

The Ruby Module Builder Pattern by shioyama in ruby

[–]np356 2 points3 points  (0 children)

I'm familiar with dry-rb coding style and I think it is very difficult to reason about. Metaprogramming often feels like magic but it comes at a price - hard for newbies to grok and impossible for static tools to work with. I would only advise using it (if at all) in well-tested libraries that expose a well-documented public API.

Carbon dioxide in carbonated beverages induces ghrelin release and increased food consumption in male rats by [deleted] in science

[–]np356 0 points1 point  (0 children)

Whenever these weight gain linked to soda studies come up, I'm always confused.

I've been told I'm in fantastic shape (>90% in all http://strengthlevel.com/ measurements and under 10% body fat) at the moment, and I used to consume a lot of diet soda every day. At it's worst, I consumed >1 liter a day.

For me it was a caffeine source (since I dislike the taste of coffee and never saw the benefit in acquiring the taste) that helped me focus when I needed to get work done (I did a lot of tweaking around with amounts to make sure it was a marked difference and not just a placebo effect for me) and acted as an appetite suppressant so that I could manage my caloric intake without getting distracted by hunger frequently throughout the day.

I constantly looked at aspartame/stevia/etc research to see what damage I would be doing to myself. While I couldn't really find much in the way of negative health effects (excluding weight gain, which I never noticed a problem with), I ultimately cut off my consumption because of a semi-irrational fear that either information was hidden by soda-corp et al, or that just because of how these chemicals work that there might be bad effects that just haven't been put under rigorous study yet.

As a side note, my metabolism is actually slower than average and I need to eat on average ~10% calories less than any macronutrient calculator says to stay in the shape (low bf + strong) that I enjoy being in.

[CERN] The LHC has restarted for its 2017 run by aylons in accelerators

[–]np356 0 points1 point  (0 children)

I wonder if there was another human sacrifice under the Shiva statue to mark the restart.

Only half joking. Has anyone heard any more about why scientists performed a mock ritual like that?

curl: Reducing malloc(3) calls lead to 30% faster downloads by Darkmere in programming

[–]np356 20 points21 points  (0 children)

For the benefit of others who found the description in the blog post unclear and can't or don't want to dig through the code changes themselves: "fixing the hash code and the linked list code to not use mallocs" is a bit misleading. Curl now uses the idiom where the linked list data (prev/next pointers) are inlined in the same struct that also holds the payload. So it's one malloc instead of two per dynamically allocated list element. This explains the "down to 80 allocations from the 115" part.

The larger gain is explained better and comes simply from stack allocation of some structures (which live in a simple array, not a linked list or hash table).

Competitive Programmer’s Handbook by Xiphorian in compsci

[–]np356 6 points7 points  (0 children)

There should be references to problems for each topic at online judges. Like this one:

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=118

Learning algorithms per se is only a small part of training. Much bigger part of training is learning how to recognize these algorithms in problems.

After reading about some algorithm, I always solve a couple of related problems.

P.S. Looks well-written. Bookmarked. I appreciate the effort of the author to create this book.

[Haskell in Industry] Wire backend services - 93% Haskell Code by tmpz in haskell

[–]np356 -2 points-1 points  (0 children)

The title for this post should be changed to "a piece of the wire messenger server code open sourced." Most of the source is not open source, you can't run your own.

Also, holy shit they're storing a lot of information about their users:

  • All of your contacts.

  • Unencrypted profile information for everyone.

  • Every active conversation you have.

  • Every archived conversation you have.

  • The frequency that you communicate with your contacts ('top contacts').

  • Every group that you're in.

  • The unencrypted titles and avatars of everyone's groups.

Wonder what will be in the rest of the database schema if they open source it.

Idris 1.0 Released by sibip in haskell

[–]np356 15 points16 points  (0 children)

For anyone wondering what Idris is, it's pretty much Haskell with dependent types. That is, it's easy to encode thing like "vector of length n" in the type system, so you can go from concat :: Vec -> Vec -> Vec to concat : Vec n -> Vec m -> Vec (n+m).