Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sdevlin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
57 ms
·
211.
▲
by
sdevlin
14y ago
Good point, I'm not very familiar with Scala. I think Clojure may also have this limitation.
212.
▲
by
sdevlin
14y ago
Decent explanation, but I have a couple quibbles. First, the term "tail recursion" is overly narrow. This transformation should apply to all tail calls, not just recursive ones. This is useful, for example, in families of mutually recursive
213.
▲
by
sdevlin
15y ago
Ha, I'm wrong. I thought you could set the referer with setRequestHeader on an XHR. Mea maxima culpa.
214.
▲
by
sdevlin
15y ago
The referer header can easily be forged. The whole point of a CSRF attack is to turn a user's credentials against him.
215.
▲
by
sdevlin
15y ago
It's not that the referer header is not "enough". "Enough" implies that it falls somewhere on the scale of trustworthiness. It's user input. Don't trust user input.
216.
▲
by
sdevlin
15y ago
Your intuition is telling you that you should shoot for 50% so that you can divide the search space in half regardless of the outcome. A right or wrong answer will eliminate half of the possible remaining words. But right and wrong guesses
217.
▲
by
sdevlin
15y ago
Yeah, you may be right that the full generality of the pattern is not appreciated. For what it's worth, I think most commonly used languages can implement some form of the context function in my example.
218.
▲
by
sdevlin
15y ago
People have posted a lot of examples in a lot of different programming languages. What they show is that all you really need to build this idiom is first class functions (or some approximation thereof). (It also shows that the title is not
219.
▲
by
sdevlin
15y ago
C#'s 'using' statements allow this kind of pattern for types implementing IDisposable. It looks something like this (might be a little off): using (var file = File.Open("foo.txt")) { ... }
220.
▲
by
sdevlin
15y ago
I think so. Wirth called out Fortran's lack of pointers, records, and recursion. You have (or can fake) all of these things in assembly. Recursion is particularly important for building a compiler, since much of it involves manipulating tre
221.
▲
by
sdevlin
15y ago
So they had three tools to choose among. One was broken, one was wildly unsuitable, and one was unpopular. They chose the second for (apparently) purely cultural reasons. I think it's not so surprising that they ran into problems. Don't dis
222.
▲
by
sdevlin
15y ago
These bindings are only for M-x. This is still useful (M-x is really common), but it's not a full replacement for all meta bindings.
223.
▲
by
sdevlin
15y ago
This is something that's nice about ML-family languages. Data is not "nullable" by default. If you want to introduce that possibility, you need to wrap it in some form of "option" type - and you're forced to deal with the consequences of th
224.
▲
by
sdevlin
15y ago
There is also the top level reversed() function that takes some sequence and returns a reversed iterator.
225.
▲
by
sdevlin
15y ago
Since some people are posting macros (including some intentionally malicious ones), it is handy to know the -E compiler flag for debugging purposes. This will run only the preprocessor on the given files and print the result to stdout. (N.b
226.
▲
by
sdevlin
15y ago
It's not really having null that's bad. What's bad is making types nullable by default. More often than not, null is not a valid value for a variable (in my experience - YMMV). This is a common source of errors. Some languages (I'm thinking
227.
▲
by
sdevlin
15y ago
Thanks for the feedback, guys. I'm going to go with gharbad's suggestion and do plain text combined with a PDF via LaTeX.
228.
▲
Ask HN: Plain Text Resumes?
4 points
by
sdevlin
15y ago
|
5 comments
229.
▲
by
sdevlin
15y ago
I think you're correct. His interior function is still just another closure around the original var i . Also, this feels like piling on, but I think the original (intentionally erroneous) example would print '5' repeatedly rather than '4'.
230.
▲
by
sdevlin
16y ago
It seems like you could say that about any sufficiently powerful construct. Sharper knives require better judgment to be used safely. This is why we often give novices rules of thumb like "don't use macros" or "don't use goto." I've seen so
231.
▲
Namespacing in JavaScript
(javascriptweblog.wordpress.com)
3 points
by
sdevlin
16y ago
|
0 comments
232.
▲
by
sdevlin
16y ago
We could simply add a getTemplate() method, but then we'd be adding methods to the public interface solely to allow testing, which is not a good approach. It seems like his solution does this anyway by exposing the supplant functi
233.
▲
by
sdevlin
16y ago
This comment would be more helpful if you gave him some specific criticisms. What did you have to think about? How could he fix it? Kilimanjaro, it seemed pretty straightforward to me.
234.
▲
by
sdevlin
16y ago
I write C# code in Visual Studio every day at work, and I've got some thoughts. Microsoft writes nice tools, and they all work well together. It's a truly integrated environment up and down the stack. And for the simple cases, it's great. I
235.
▲
by
sdevlin
16y ago
Yeah, you can simulate that stuff with lambdas. For that matter, you can simulate function calls by following conventions in assembly language. That's what I meant by "awkward/difficult". Surely you'd concede that you're happy to have synta
236.
▲
by
sdevlin
16y ago
Lisp dialects afford you more powerful tools for abstraction. Whereas most languages provide abstraction at the function level, Lisp allows for syntactic abstraction via macros. Think of constructs like the if-statement that only evaluates
237.
▲
by
sdevlin
16y ago
Not sure I catch your meaning, but, since it's server-side, the iPhone OS never runs it.
238.
▲
by
sdevlin
17y ago
I'm going with a group of old friends. Unfortunately, I couldn't get tomorrow off, so I'm going to miss most/all of Friday's stuff. Still, I'm really excited. This is my first time going, but one of my friends has been before, and he speaks
239.
▲
by
sdevlin
17y ago
Why _hot_ water? And how hot?
240.
▲
by
sdevlin
17y ago
I'm in the same boat. Could you post a link to said group, if it's not too much trouble? EDIT: Found it. For any looking: http://groups.google.com/group/hn-chicago
More ›