Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ajanuary
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
34 ms
·
301.
▲
by
ajanuary
12y ago
Add a checksum that the client uses the validate the message.
302.
▲
by
ajanuary
12y ago
Puzzle Bobble does have symbols for different colours, just like Peggle. I guess they're too difficult to see?
303.
▲
by
ajanuary
12y ago
Using public fields could be a bad idea if on classes that are exposed to third parties because it prevents you from changing it to a calculated field while keeping compatibility. However, this is going to be a very small number of classes.
304.
▲
by
ajanuary
12y ago
So well they mention it in the README ;)
305.
▲
by
ajanuary
12y ago
I'll give an example of a situation where I recently had to write a throttle function that works in the same way as this library. We have a TCP connection down which we need to send (soft) real-time updates about a large data set. Howe
306.
▲
by
ajanuary
12y ago
Adding strings to integers is usually referred to as weak typing, which is a seperate and orthogonal concept to dynamic typing. The runtime of a dynamic language could look at the two types of the values, decide they're different and t
307.
▲
by
ajanuary
12y ago
I can't find it on the site or ios app, only the option to leave now and arrive at a particular time.
308.
▲
by
ajanuary
12y ago
A slightly more realistic example: class Bag(object): def __init__(self, items=[]): self.items = items def add_item(self, item): # check the item is valid self.items.append(item)
309.
▲
by
ajanuary
12y ago
It slightly baffles me there isn't an option to leave at a time in the future. I often need to find out what time I will arrive somewhere when I leave work to send people a time to meetup.
310.
▲
by
ajanuary
12y ago
There was a Healthcare Triage video [0] that talked about this sort of analysis. [0] https://www.youtube.com/watch?v=UF1T7KzRnrs&list=UUabaQPYxxK...
311.
▲
by
ajanuary
12y ago
I've always heard it used to refer to method dispatch, which that wikipedia article also seems to. However, it seems like the Python spec does use it to refer to when variable values are resolved.
312.
▲
by
ajanuary
12y ago
The scoping rules in #4, combined with being able to reference variables before definite assignment, is what leads to the 'variable hoisting' in Javascript. Is #6 really called 'late binding'? That seems like the wrong t
313.
▲
by
ajanuary
12y ago
A better phrase would have been "not entirely open-source".
314.
▲
by
ajanuary
12y ago
The authors JWalk is basically get-in. Lenses, as popularised by Haskell, solve a similar problem.
315.
▲
by
ajanuary
12y ago
On episode 112 of Penn's Sunday School [1] Jay Frank talked a bit about this - that the intro to songs are getting shorter because people can skip easier. [1] http://pennsundayschool.com/episodes/
316.
▲
by
ajanuary
12y ago
Most readers I've come across will let you paste in a url and it will try and discover the feed for you, which beats having to search for it. Obviously having the icon in FF helps you know if one is available.
317.
▲
by
ajanuary
12y ago
There's a runtime overhead of spinning up a bunch of threads that are just going to sit idle waiting for an API response. There are better asynchronous models for that sort of thing.
318.
▲
by
ajanuary
12y ago
Indeed it could be, but that's syntax. The proposal is very careful to talk about semantics; most of the code examples have a disclaimer that the syntax is for illustrative purposes only.
319.
▲
by
ajanuary
12y ago
Much as I dislike it, not everyone uses 'array' to mean a collection with constant time indexing. Lots of people use it to mean an indexable collection. The 'constant' vs. 'almost constant' has been covered by
320.
▲
by
ajanuary
12y ago
To give some more context, 'persistent data structures' is a standard term in the literature. The use of efficient persistent maps in Clojure, and the fact Rich Hickey explains that in most of the early Clojure introductory talks,
321.
▲
by
ajanuary
12y ago
From Wikipedia [1]: a persistent data structure is a data structure that always preserves the previous version of itself when it is modified So when you do an insert, you get back a new array with the inserted value, and the old ar
322.
▲
by
ajanuary
12y ago
The url. The behavior of the box hasn't changed, just what it displays once a page is loaded.
323.
▲
by
ajanuary
12y ago
You can still type URLs into the bar. It's easier to direct them to it because it always has the same prompt text. "Do you see a box that says 'Search Google or type URL?'? Great, type this into it..." The thing tha
324.
▲
by
ajanuary
12y ago
She'll put it in the bit that says "Search Google or type URL". It is in fact clearer now, because instead of having an old url in there, it can have a consistent prompt of "URL goes here". If she doesn't know
325.
▲
by
ajanuary
12y ago
With an omnibar everything you type in your url bar gets sent to the search provider. Lots of people don't like that (I'm personally okay with it, so I use Chrome).
326.
▲
by
ajanuary
13y ago
One difference is that the first one, with a good implementation, will be more efficient because it doesn't need to allocate intermediate strings. I don't think such a micro-optimisation is enough to sway the argument though.
327.
▲
by
ajanuary
13y ago
What do you mean by being easier to internationalize? Do you mean you can lookup the string at runtime and it will then interpolate on that? That's not a safe way for interpolation to work, because then random strings from unsafe sourc
328.
▲
by
ajanuary
13y ago
You can kind of think of it as syntactic sugar over adding strings that desugars at the compilation stage. "abc #{x} def" would desugar to "abc"+x+"def" Because it's happening at the compilation stage, it
329.
▲
by
ajanuary
13y ago
Nothing in Go pushes you towards using a domain specific templating language rather than Sprintf, only education (and culture) can do that. So programmers _will_ use Sprintf, because it's one of the first things they'll have been
330.
▲
by
ajanuary
13y ago
Can you give an example of your last point? A language like Ruby will only perform interpolation on string literals, so there isn't a way (that I know of) for data to inject interpolated strings. Interpolation isn't the same thing
More ›