News for hackers. Stuff that matters.

matdes

Re:Requiring vs. Browserifying Angular on Wednesday July 09, 2014 @01:59PM (#8011224)
Maybe Angular needs to take a more constricted approach and integrate naturally with something like browserify.

You are correct that you should be writing your actual angular code in those separate files. And doesn't it make sense that the export of a controller file is an injectable controller? None of this "dependency injection via a string which gets turned into a reference to real code later"

Re:The New Haskell Homepage on Wednesday July 09, 2014 @01:50PM (#8011141)
" λ 5 + 7 12 :: Num a => a What the christ? The 12 I get. Got it. The colons? Not sure. I think it's just a dumb separator. Num is type! What the hell is a => a? I have no idea."

:: means "the stuff after this is the type signature"

Normally, a type signature can be as simple as something like

'x' :: Char

which is the type signature of the character 'x'. Looking at the type signature of 12 shows two parts "Num a =>" and "a". This can be read as "it returns a generic type `a` that must be an instance of the type class Num", which sounds really complicated but isn't.

The "Num a =>" is a type class constraint on the returned type "a". Type classes are basically like interfaces, they set up constraints and methods that need to be implemented for that type, analogous to how in other languages a class can implement an interface. For example, the Eq type class mandates you define the (==) and (/=) methods for that type, analogous to how something like the interface Comparable in Java requires you to define the compareTo method.

Thus the concrete type "Integer" is an instance of type class "Eq" because it implements those (==) and (/=)

Num is an example of a type class, just like Eq. But Num requires you to define a few more methods

  class Num a where
  (+) :: a -> a -> a
  (*) :: a -> a -> a
  (-) :: a -> a -> a
  negate :: a -> a
  abs :: a -> a
  signum :: a -> a
  fromInteger :: Integer -> a
So all of the things you think of as "numbers" are all types that implement "Num", e.g. an Integer, a Float, a Double.

So going back, "12 :: Num a => a" means 12 can be any type which implements Num, which is really just a fancy way of saying "this number can be cast into any numeric type". You can perform this casting manually!

  λ (5 + 7) :: Integer
 12:: Integer
  
  λ (5 + 7) :: Float
  12.0:: Float
And the moderators of HN can still choose to use their discretion to remove certain articles, without necessarily banning an entire news outlet.
Re:Ask HN: What Books Are You Reading? on Monday June 30, 2014 @07:46PM (#7968403)
Capital in the 21st Century by Thomas Piketty Learn You a Haskell A Wizard of Earthsea by Ursula K LeGuin
Re:Is TDD Dead? on Friday June 27, 2014 @12:35PM (#7954838)
> Whenever I tried to learn TDD, it only seemed relevant for back-end testing (eg REST APIs). But is there anyone left who is strictly a back-end guy? Most programmers now bill themselves as full-stack app developers, and probably spend at least half their time working on the front-end/UI.

yes?

> So what does it mean to write functional tests? I'd argue that writing modular React components is a form of functional testing. Devcards[1] is similar, and looks to me exactly like what would be considered functional testing. These two workflows feel much more natural than testing UIs methods like automated selenium browser interactions to generate screenshots.

no.

Re:Cargo, Rust's Package Manager on Tuesday June 24, 2014 @04:41PM (#7940488)
MRI still doesn't follow semver but core doesn't really give a crap.
Re:Goodbye Heroku on Monday June 23, 2014 @10:59PM (#7935996)
I mean, I guess? I would question that business and processing model heavily, though. Most sustainable business models show growing from some kind of smaller MVP to a larger full-featured application.

Significant overhead costs to go from nothing to steady-state instantaneously would be enough to scare me.

Re:Lotus, a web framework for Ruby on Monday June 23, 2014 @07:17PM (#7935365)
the concept of a model is not at all tied to a data access pattern unless you subscribe to model = ActiveRecord::Base inheritor in the Rails world.

Model is a well-defined term in the domain-driven design world, as in "Domain Model"

Re:Lotus, a web framework for Ruby on Monday June 23, 2014 @07:14PM (#7935356)
uhhhhhh, I don't know if that's true.

Lotus was never a ruby web application framework. Guess Apple's going to have to change the name of Swift because of that other programming language, amirite?

Re:Goodbye Heroku on Monday June 23, 2014 @07:04PM (#7935313)
At that point, don't you have enough scale, money, and need to actually hire an ops person?
Re:Gittip, Year Two on Wednesday June 04, 2014 @02:09PM (#7847156)
http://www.derailingfordummies.com/derail-using-anger/

c.f. "You are hurting your cause by being angry"

try to be less of a trope.

Re:Gittip, Year Two on Wednesday June 04, 2014 @04:49AM (#7844625)
heavy eyeroll if this is supposed to be a "hidden" jab at tech feminists.
Re:10 Most Common Rails Mistakes on Tuesday June 03, 2014 @07:00PM (#7843207)
helpers are awful

embrace OO

Re:Runnable – jsfiddle for everything on Monday June 02, 2014 @02:09PM (#7834879)
The service looks great, I just wanted to comment: when I opened the page, my immediate thought was "is this done by Heroku? This page looks a lot like heroku"
Re:Follow up to the investigation results on Monday April 28, 2014 @06:11PM (#7663459)
uhhh no. no they don't, necessarily. I guess if your only definition of rape is the screaming sexual assault in an alleyway trope, of course you'd think that.
Re:Follow up to the investigation results on Monday April 28, 2014 @06:08PM (#7663446)
> You can't just rewrite git history without having everyone in on it.

umm...I've got something to tell you...

Re:Results of the GitHub Investigation on Monday April 21, 2014 @05:48PM (#7624171)
Gitlab is a FOSS self hosted alternative to github.
Re:Dropbox for Business on Wednesday April 09, 2014 @01:48PM (#7560897)
not in the slightest.
greenspun's tenth rule?
Re:Hexagonal Architecture Guidelines For Rails on Tuesday March 18, 2014 @02:22PM (#7423874)
absolutely absolutely this. Patterns don't suck. Implementing patterns in Java sucks. Ruby's got a lot of fantastic things going for it, and duck typing means you don't have all the ceremony of defining and implementing interfaces.
Re:Hexagonal Architecture Guidelines For Rails on Tuesday March 18, 2014 @01:57PM (#7423696)
I hear this often but when the frack do you ever interact with a raw tcp api or a 0mq bus that's existentially the same application as your web app??
Re:The Only Interview Question That Matters on Saturday February 01, 2014 @07:59PM (#7164269)
that whole 10x 50x bullshit is a myth.
Re:She's a beauty and a geek: Supermodel is a coder on Monday January 20, 2014 @11:58PM (#7093556)
lol, okay. whatever u say, bro.
Re:She's a beauty and a geek: Supermodel is a coder on Monday January 20, 2014 @11:12PM (#7093381)
so mr. egalitarian, I'm so blind-I-only-see-ability.

You're telling me, with no question, if you were to see this woman in the middle of the street, you would think she could absolutely be a coder?

You're telling me if you saw her at a conference, you would think she was there as an expert, and not to find a husband, or was part of the booth babes or help staff?

You're telling me if you saw her on the roster to speak at a conference, you'd think she got it because of her prowess and intellect, and not because she dolled up?

Re:Unix Command Lines and Relations on Sunday January 19, 2014 @01:59AM (#7083687)
is anyone using this particular blog's interpretation as production code??

No. And if you actually go to the link to the original question, you'll see that cat doesn't exist.

Last, I would disagree that `cat file` is equivalent to `select * from table`, his argument makes the comparison that `cat file` is equivalent to `table` itself, or `load data into table` which needs to happen before any relation can be performed against it.

Re:How Jason Bourne Stores His Bitcoin on Sunday January 19, 2014 @01:57AM (#7083681)
Re:Unix Command Lines and Relations on Saturday January 18, 2014 @09:02PM (#7083107)
I agree, but I think it was intended to provide each piped command performing a single relational operation.
Re:Tuts+ Premium Account Security Compromised on Tuesday June 26, 2012 @01:35PM (#4163101)
I alerted them to the fact that their passwords were in plaintext a YEAR AGO. I got a response email on June 29, 2011 saying:

"Thanks for reporting the issue of plain text passwords to us. It's how passwords are handled with the membership software we use for Tuts+ Premium, which isn't extremely well coded and something we want to rebuild from scratch. In the mean-time our dev team will be hacking the software to bring password security up to the best practices we advocate on our Tuts+ sites, like Nettuts+."

Not only was this issue brought up to them, they stated very clearly that they were working to bring their password security up to best practices. In a YEAR, they couldn't hack on a password hash or rebuild their plugin from scratch?

If anyone knows if there is a lawsuit pending that could use my email as evidence, please let me know.