ostso | 13 years ago | on: Canonical asks desktop users to “pay what you think Ubuntu is worth”
ostso's comments
ostso | 13 years ago | on: Fizzbuzz, Interviews, And Overthinking
ostso | 13 years ago | on: Actually, you don't understand lexical scope
def foo():
x = 5
def bar():
print x
def baz():
x = 6
print x
bar()
baz()
print x
Which prints 5, 6, 5. If baz tried to print x before assigning, it would be an UnboundLocalError.ostso | 13 years ago | on: Practical functional programming in JavaScript
On the other hand, that also applies to foldl1 and {max,min}imum{,By}, so it's probably not the reason.
The reason is probably that in JavaScript you can just say a[0] to get the first element element of a.
ostso | 14 years ago | on: Everything You Wanted To Know About Caching
ostso | 14 years ago | on: The Y combinator in Javascript
If you just want a clear definition of a fixed-point combinator, you might as well use a non-strict language like Haskell, which doesn't require you to eta-expand g. Here's one recursive definition of fix in Haskell:
fix f = f (fix f)
This is probably the clearest definition you could ask for of what a fixed-point combinator actually is (other than something like "fix f = f (f (f (f (f ...", which is more difficult to give to a computer).Here's another one, which closer to what you gave in JavaScript (this is what you'll actually find in the Haskell standard libraries):
fix f = let x = f x in x
(Of course, due to type-checking, it's non-trivial to define the actual non-recursive Y in Haskell; you usually have to resort to using some type-level recursion. But in an untyped non-strict language you could define it easily enough.)ostso | 15 years ago | on: Scala One Liners
1. map (*2) [1..10]
2. sum [1..1000]
-- sum = foldl (+) 0
3. any (`isInfixOf` tweet) wordlist
4. fileText <- readFile "data.txt"
fileLines <- lines <$> readFile "data.txt"
5. mapM_ putStrLn . map (\i -> "Happy Birthday " ++ if i == 3 then "dear NAME" else "to You") $ [1..4]
6. (passed, failed) = partition (>60) [49,58,76,82,88,90]
7. -- I avoid XML so I don't know what library you'd use here.
8. minimum [14, 35, -7, 46, 98]
-- minimum = foldl1 minostso | 15 years ago | on: The Basic Laws of Human Stupidity
There are no perfect bandits, let along a society full of them. Scenarios like "If all members of a society were perfect bandits" are hypothetical and don't really translate to any actual human society that you could imagine. Even so, they're useful for illustrating concepts.
ostso | 15 years ago | on: Yahoo Just Pissed Off The One Group They Shouldn’t With Delicious Closure
ostso | 15 years ago | on: PG on the cover of Forbes
ostso | 15 years ago | on: Ask HN: What do geeks in Palo Alto do on weekend nights?
Regardless of whether it should be legal or not, "positive discrimination" is still discrimination.
ostso | 15 years ago | on: Ask HN: What is Gravity?
ostso | 15 years ago | on: Terminal Tips and Tricks For Mac OS X
1. Change your layout from "USA" to "USA International (AltGr dead keys)". Then use right-alt+key to make various special characters (you can look at what each character does at "Show Current Layout").
2. Enable the "compose key" -- I use the Menu key for this -- which is described at http://sivers.org/compose-key (it's simple to enable: Keyboard Preferences→Layouts→Options→Compose Key Position). Both of these are customizable, so you can add your own combinations if you want.
There are some other ways:
3. Ctrl-Shift-U in a GTK+ text input to enter a code point, as you said.
4. Alternative input methods that let you type special characters in in various other ways, such as LaTeX names, if you prefer that.
ostso | 15 years ago | on: Ask HN: Good or bad idea? Using a domain that starts with 'the'.
ostso | 15 years ago | on: Jeff Bezos to Princeton's class of 2010 :"We are What We Choose"
ostso | 15 years ago | on: Zed Shaw has Left Dropbox
Is this a Heinlein reference?
ostso | 15 years ago | on: Google researcher says friend groups may give it a window to best Facebook
ostso | 15 years ago | on: Where does a tree get its mass?
ostso | 16 years ago | on: Ask PG: Vim shortcuts for navigating HN?
ostso | 16 years ago | on: A Person Paper on Purity in Language - Douglas Hofstadter
Huh? Singular "they" has little to do with "one" -- it's used as an alternative to "he"/"she" when the gender is unknown (like the Finnish "hän", for instance).
It may or may not be artificial, but what would you use instead?