Better HN
topnewbestaskshowjobs
Log inSign up

chncdcksn

29 karma · joined Apr 13, 2015 (11y ago) · 17 submissions

Submissions

comment 8y ago · link · parent

Purchased one about a year ago. Screen, sound card, and keyboard needed to be replaced on arrival. Replaced the screen and sound card under warranty and sold it disclosing that the keyboard’s spacebar sometimes inserted two spaces on one press. Have Dell’s QA issues on this laptop gotten any better?

comment 8y ago · link · parent

(To preface, I use React/Redux in all of my web applications. I think Redux is great for managing state.)

One thing I’ve never quite understood about Redux is why we are dispatching pure data instead of a function of state. This would remove the need for reducers, since your action _is_ your reducer. Something like this...

https://gist.github.com/anonymous/a5d741c5dec81be61e0aa70820...

Would this come with any drawbacks? I could see a large application having performance issues because of a large number of function allocations, but for small applications I don’t see a downside, just a simpler API.

comment 9y ago · link · parent

Doesn't seem to be working for me in Chrome on Android. I submit the form, the page goes blank, and nothing else happens. Also, a suggestion, the fields rendering in a random order will be very confusing to someone if they are going to be using this multiple times in a row to compare pricing of different EC2 specs. I was very confused when region was at the very bottom the first time I tried to submit the form, then at the very top the second time.

comment 9y ago · link · parent

May be off topic, but did Apple remove their restriction on using a VM in an app put on the App Store? Or was that restriction only for JITs and not interpreters?

comment 9y ago · link · parent

TIL. Thanks!

comment 9y ago · link · parent

I may be wrong, but I don't think JavaScripts from a CDN can access the same localStorage as some JavaScript from another origin. (Source: "Cross-origin data storage access" https://developer.mozilla.org/en-US/docs/Web/Security/Same-o...)

comment 9y ago · link · parent

The big issue using localStorage for authentication token storage is that values are accessible by any JS from the same origin as the JS that sets the value. Example: I bundle my JS and it's dependencies into a single file (bundle.js) using webpack. One of the dependencies in the bundle has malicious JS that sends values in localStorage to a remote server, or uses the authentication token to make requests impersonating the user.

comment 9y ago · link · parent

That's really strange; I received an email today, with the previous emails being on the 8th and on Nov. 22. What is the contents of the emails, and what address are they from? Are they duplicate emails? Sounds like someone impersonating GitLab.

comment 9y ago · link · parent

I'm curious, what was the trick question given to you by Microsoft Boulder?

comment 10y ago · link · parent

You may be interested in Opa (http://opalang.org). I'm unsure how well it abstracts away client/server detection, but from what I understand about it, you have one codebase for both your client and server. I've never used it however, so I can't vouch for it entirely, but it certainly looks interesting.

comment 10y ago · link · parent

Does Rust fit into those specifications? I understand library support is probably not quite there yet, but I was under the impression it could fill the role of C/C++.

comment 11y ago · link · parent

As a student interested in language design and VM programming, this is wonderful. Clean, easy to read code, as well as what seems to be a really well-thought out language. Thanks for this!

comment 11y ago · link · parent

Switch to the master branch. :) it confused me too.

comment 11y ago · link · parent

GitHub is having release download issues, possibly due to this. https://status.github.com/

comment 11y ago · link · parent

A problem I see with this is recognition. A QR code can be printed onto a piece of paper with no further information attached, and even some less-techy people will know what to do with it, because it's clearly a QR code. These drawings are pretty ambiguous, and unless it catches on with the less-techy crowd you'd have to add an attached note "Go download the Meshtag app to read this!", which would probably not happen too often.

They are however, much prettier than regular QR codes. :)

comment 11y ago · link · parent

.then() does create a new promise. Return Promise.reject() in the fulfillment function to reject the new promise.

  somethingThatReturnsPromiseWithoutError()
    .then((res) => {
      return Promise.reject("some error");
    })
    .catch((err) => {
      console.log(err); // => some error
    });
Promise.resolve() and Promise.reject() return a promise resolved or rejected to the value passed in the first argument. Returning a promise in the fulfillment function passed to .then() chains the promises together.

  somethingThatReturnsPromise()
    .then((foo) => {
      return foo.bar;
      // Or if you like it more verbose
      return Promise.resolve(foo.bar);
      // Or pass bar to a function modifying bar that returns a promise
      return modifyBarReturnPromise(foo.bar);
    })
    .then((newBar) => {
      console.log(newBar);
    });
In your case, if you need step1Val in next promise chain, I personally do this, however people more familiar with promises may know of a better way to do it (maybe with something like Promise.all() or Promise.props() in the BlueBird library).

  somethingThatReturnsPromise()
    .then((first) => {
       doSomethingWithFirstAndReturnPromise(first)
         .then((second) => {
           console.log(first + second);
         });
    });

comment 11y ago · link · parent

I'm having the same issue actually. Firefox 37 on Windows 8.1.