Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kbd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
34 ms
·
331.
▲
by
kbd
8y ago
This is why Microsoft's Surface line is great. I have the Go and the stand is wonderful. Plus it transforms into a tiny laptop by snapping on the keyboard.
332.
▲
by
kbd
8y ago
> Would s["one"] = 1 raise an exception? Sets don't support indexing, so it would still raise an exception. Dicts do, which is an example of them supporting more operations than sets, which is an example of why (if there
333.
▲
by
kbd
8y ago
I actually think it is obvious what a dictionary merge should do (overwrite keys on the left with keys on the right), but this is besides the point because it's already been determined for {**d1, **d2} In other words, there ar
334.
▲
by
kbd
8y ago
> it’s not super obvious what to do when the keys are equal d1 | d2 | d3 | ... is equivalent to: {**d1, **d2, **d3, ...}
335.
▲
by
kbd
8y ago
If dicts did subclass sets, then sets would be dicts whose values are all None. In other words, your last example would be defined as: >>> s = {'one', 'two'} >>> d = {} >>> d.up
336.
▲
by
kbd
8y ago
Your exact point that for sets, union operator is commutative while for dictionaries it wouldn't be is one of the main objections I foresaw if I ever wrote this up as a PEP. Counterpoint: for numbers, + is commutative but for lists it&
337.
▲
by
kbd
8y ago
> Interestingly enough some languages actually do the opposite. Of course you can represent sets as dictionaries with empty values (ask anyone who programmed Perl). You're supporting my point that dicts logically subclass sets, beca
338.
▲
by
kbd
8y ago
> dict.keys() pretty much does just that... a.keys() | b You're illustrating my point: >>> set(a) | b {'bar', 'foo'}
339.
▲
by
kbd
8y ago
> An alternative to the + operator is the pipe | operator, which is used for set union. This suggestion did not receive much support on Python-Ideas. That's disappointing. It's always been on my Python wish list that dicts woul
340.
▲
by
kbd
8y ago
> "The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon" Except it worked so well in Python and PyPy that in Python 3.7 it was blessed into an official part
341.
▲
by
kbd
8y ago
Given Python's success with its insertion-order-retaining "compact dict" implementation[1], I've wondered why more languages aren't adopting that design into their maps/hashtables. [1] https://docs.p
342.
▲
by
kbd
8y ago
Does any of this work with Firefox on Windows/Linux? It would be nice to have this kind of syncing across all platforms.
343.
▲
by
kbd
8y ago
Yeah... it's ugly as heck but they're clearly trying to avoid new keywords. I hope the TypeScript folks can convince ECMA to adopt normal keywords like they use: https://www.typescriptlang.org/docs/handbook&#x
344.
▲
by
kbd
8y ago
It also applies to things such as using strings as dictionary keys. Immutable strings allows you to use them as keys without worrying about them being modified and breaking things. It's why Ruby encourages symbols as hash keys. I don&#
345.
▲
by
kbd
8y ago
> I admit, my first thought on seeing the title was "What's wrong with xxd?" My first thought too. Then I looked and saw it was nice, and then I noticed it's by sharkdp. He really has a knack for improving on things
346.
▲
Taming the Chaos: Can we build systems that actually work?
(media.ccc.de)
4 points
by
kbd
8y ago
|
0 comments
347.
▲
by
kbd
8y ago
Quick correction, the actual url for Xonsh is http://xon.sh . My understanding is that xonsh.org is an out-of-date unaffiliated mirror that the author of Xonsh doesn't control :(
348.
▲
by
kbd
8y ago
The spam filtering isn't perfect (can't think of any false negatives, but some false positives. I hedged with "potentially" above) but I receive very little spam so I just check the folder when I get one. And this is wit
349.
▲
by
kbd
8y ago
> IMAP and POP are just so inadequate that locking yourself into gmail/whatever is a reasonable choice. Totally agree that email protocols need improvement, but there are other benefits to gmail. I'm always going to want reliab
350.
▲
by
kbd
8y ago
After suffering through Java early in my career I've completely avoided it since then. What parts of Java/JVM do you find indispensable vs the rest of tech?
351.
▲
by
kbd
8y ago
> Java is not as bad as you think. Clojure does takes a little longer though For example, I have a Python script[1] that runs on each command prompt to print status about my current git repository. Just timed it, it runs in .08-.12 secon
352.
▲
by
kbd
8y ago
Posted response here: https://news.ycombinator.com/item?id=18703537
353.
▲
by
kbd
8y ago
> I guess I might ask what this stance is founded on? Kotlin has Kotlin/Native, so I was hoping there might be a similar initiative for Clojure. But, a few reasons: * Startup time * Ability to deploy/share a binary * The JVM ju
354.
▲
by
kbd
8y ago
Are there any plans for a native version of Clojure? I'd rather avoid the JVM if possible, but I suppose the whole ecosystem is dependent on it so that's unlikely?
355.
▲
by
kbd
8y ago
> but a classic one is https://ocsigen.org/eliom/ I didn't know there were any other attempts at a "universal" platform since Meteor. Thanks for sharing! Please let me know if there are others that yo
356.
▲
by
kbd
8y ago
That is not close to the same thing.
357.
▲
by
kbd
8y ago
Yep I have a 'git ap' alias set up for that :)
358.
▲
by
kbd
8y ago
> but this compromise will deliver security and enforcement agencies the powers they say they need over the Christmas period "We need this bill to keep you safe over Christmas" is an obscenely cynical justification to rush this
359.
▲
by
kbd
8y ago
> This is a fantastic demonstration of why i exclusively use git from a command prompt... Thanks for this. I've always felt the same way but haven't been able to put my finger on why. As more things get integrated into my edito
360.
▲
by
kbd
8y ago
It wasn't about Pocket itself but that Firefox was rudely using notifications to advertise to me. So I went back to Chrome, which has never done anything like that.
More ›