News for hackers. Stuff that matters.

ekke

Re:How to Handle Monetary Values in JavaScript on Tuesday October 30, 2018 @03:44PM (#18340615)

  (1.005).toFixed(2) // Expected rounding to "1.01"
  "1.00"
Re:Micro.blog on Tuesday October 30, 2018 @03:27PM (#18340456)
Hm, re: "ads are everywhere" - is it just me, or are two of the three sample posts in the screenshot content-based ads?

First for the novel Cibola Burn, and third for the app Halide.. the middle post seemingly is a reply to an ad of some book series as well :) Or "influencer" paid content != ads?

Re:Massachusetts gas fires: Another technological tragedy on Sunday October 21, 2018 @11:27AM (#18268478)
This is fascinating. For anyone interested in a slightly odd but unique and in-depth view of Systems design and failure, would like to recommend "The Systems Bible: The Beginner's Guide to Systems Large and Small" by John Gall.

https://www.amazon.com/Systems-Bible-Beginners-Guide-Large/d...

In that section, would like to add recommendations for:

- "Being Geek: The Software Developer's Career Handbook" https://www.amazon.com/Being-Geek-Software-Developers-Handbo...

- "Team Geek: A Software Developer's Guide to Working Well with Others" http://shop.oreilly.com/product/0636920018025.do -- Software engineering teamwork a-b-c. I'd love to work on teams where everyone has read this one.

[edit: 2nd edition of "Team Geek" is titled "Debugging Teams"; having read both, no difference which you get]

Re:‘My Hovercraft Is Full of Eels’ in Many Languages on Wednesday May 09, 2018 @06:40AM (#17028805)
This is HN after all - some version of ES/JS:

  class Eel {
      valueOf () { 
          return 'https://imgflip.com/meme/Bad-Joke-Eel';
      }
  }

  const craftCapacity = 331,
        hovercraft = Array.from(Array(craftCapacity), () => new Eel);
Re:Backdoor injected to NPM express-cookies package on Monday May 07, 2018 @03:08AM (#17010883)
Sure, and at least few more people :)
Re:Backdoor injected to NPM express-cookies package on Thursday May 03, 2018 @07:08AM (#16984865)
NPM guys explain it in the blog today: https://news.ycombinator.com/item?id=16975025
Re:Backdoor injected to NPM express-cookies package on Wednesday May 02, 2018 @10:29AM (#16977185)
And NPM took it down quickly, whew.

Backdoor injected to NPM express-cookies package

Remote code injection vulnerability wild in public npm package, plausible-sounding 'express-cookies' and its dependency 'getcookies'. >10K downloads during April.Vulnerable code: https://npm.runkit.com/getcookies/test/harness.js?t=1525249320108https://www.npmjs.com/package/express-cookies

( Read More... | 15 comments | 58 points | on HN )
Good one!

A naive strategy where they never die, and hopefully stay in prison for slightly less than a few billion years:

One prisoner is the light-counter (Mr C). Others follow a simple pattern - if the light is off, and they have never turned it on yet, turn it on. If it is already on, or they have already ever turned it on, do nothing.

Mr C enters the room, if the light is on, remembers it, and turns it off.

When Mr C has entered the room 99 times with light on, he can say 'Yes' and they are safe.

This can be optimized. How?

Nice photo caption fail: "Minecraft is developed by Swedish company Mojang. Will future games be developed now that Microsoft is closing its borders?"

In the light of: https://mojang.com/2014/09/yes-were-being-bought-by-microsof...

Re:Regex Golf on Friday December 20, 2013 @05:00PM (#6944361)
Got hooked and to 3202, but ca 10-20 more points could be gained according to answers here and there: https://gist.github.com/jonathanmorley/8058871

Kudos to the author of the game, good job.

PS. http://regexcrossword.com/

Re:Regex Golf on Friday December 20, 2013 @04:52PM (#6944296)
390:

  ^[lwp]|fa|r[ro]|[isytd]l|c$|de
Re:Regex Golf on Friday December 20, 2013 @04:50PM (#6944286)
Nice, turn it around for 199:

  ^.{5}[^e]?$
Re:Aren't you tired of using "cd ../" on Tuesday August 13, 2013 @07:12AM (#6205055)
Why not? Because it changes the meaning of '.':

  ~$ echo date > d.sh
  ~$ d.sh
  -bash: d.sh: command not found
  ~$ . d.sh
  06:37:21 EDT 2013
  ~$ alias .='cd ../'
  ~$ . d.sh
  /home$ Is not works!
But another alias with no previous meaning would do well - i use 'up' :)