Better HN
topnewbestaskshowjobs
Log inSign up

magnusjonsson

137 karma · joined May 24, 2009 (17y ago) · 40 submissions

Submissions

comment 7y ago · link · parent

The PRC didn't exactly cooperate when the UK wanted to introduce democratic measures in HK well before the handover. https://en.wikipedia.org/wiki/Democratic_development_in_Hong...

comment 7y ago · link · parent

China has a lot of vague laws and a history of making up accusations to fit the occasion, with no way for HK judges to examine evidence, and trial with presumption of guilt. This excellent comment on reddit by IosueYu answers the question better than I ever could: https://www.reddit.com/r/HongKong/comments/bvux0z/hong_kong_...

comment 7y ago · link · parent

But people elect the parliament and the parliament electthe PM, so it's OK, there's a chain of accountability to the populace. In HK, the parliament has only 70 seats of the 1200-member committee, and only 35 of those are geographical constituents representing the people, the rest are "functional" constituencies mostly representing businesses). Laws have to be passed by a majority of the LegCo however, and the Chief Executive can be impeached by a 2/3 majority in the LegCo, so the LegCo is still very important. The main tragedy is that only 50% of the LegCo is elected democratically.

comment 7y ago · link · parent

No, Hong Kong should lead the way.

comment 7y ago · link · parent

When I started learning Mandarin (my fourth language) I became totally unable to speak French (my third language) as the Mandarin words would pop up first in my mind. I think by now they've been sufficiently separated in my mind but I haven't had any use for my French so it as atrophied anyway. I'm now learning Cantonese which is similar to Mandarin and I'm only occasionally mixing it up with Mandarin. It seems to me the distance between languages isn't so important, you can mix up any two languages or not. It probably depends more on how much your brain has to rewire itself to acconmmodate the new language?

comment 8y ago · link · parent

Swedish has "nja" (blend of Swedish ja and nej).

comment 9y ago · link · parent

That is not what he said.

comment 9y ago · link · parent

That's an awesome article! Thanks for sharing.

comment 9y ago · link · parent

Actually those are very bad examples. In practice, compilers will produce warnings in all of those examples.

Better examples (of actually useful things) would be things like designated initializers, struct literals, declaring array lengths in args using static, etc.

comment 9y ago · link · parent

FWIW, the Unsafe class is generally much faster than DirectByteBuffer

comment 11y ago · link · parent

This does not do away the distinction between attributes and content -- that attributes are flat strings while content can be nested.

comment 12y ago · link · parent

You can call it a style if that makes a difference. I think there are reasons behind that style, and I think the too minimal standard library is the main reason. The lack of a good package manager until recently may be another contributing reason.

I hesitate to answer your hyperbole about ten variants of equal signs. It's not uncommon for languages to have two notions of equality like ocaml has (or even more): Here's Python for example: http://stackoverflow.com/questions/132988/is-there-a-differe...

To answer your original question of why anyone would prefer to not use startswith: I don't think anyone does.

comment 12y ago · link · parent

It's a problem. Until people have standardized on which 'better standard library' to use, programs will keep building from these too low level building blocks.

comment 12y ago · link · parent

The ocaml standard library is minimal to a fault. It's just enough to implement the compiler itself. For higher level operations like starts_with, you use libraries. The Batteries library for example provides what you want:

    String.starts_with line "+++"

comment 12y ago · link · parent

No syntactic sugar needed. In most lisp pattern matching libraries there are higher level matchers such as "list" etc. Just as the first element of a list is a function or special operator in normal context, in a pattern matching context the first element is a matcher. You can even define new matchers if you want, just like you can define new functions. This makes pattern matching libraries in lisp more powerful than the built-in pattern matching of Haskell and other functional languages.

I just looked at TFA and yes, it's truly awful. It doesn't have to be that way. See e.g. https://github.com/m2ym/optima (a pattern matching library for common lisp). I haven't tried it, but I've tried the predecessor of that library.

comment 12y ago · link · parent

Just keep your supply of rolls in the bathroom?

comment 12y ago · link · parent

What's the software analogy of a factory? Making copies is simple in software so you must have something else in mind?

comment 12y ago · link · parent

Horizontal space isn't.

comment 12y ago · link · parent

(47 choose 39) * 0.5 ^ 39 * 0.5^8 = 0.0000022, so that'd be about 1 in 500000 of all who traded for this long.

comment 12y ago · link · parent

Side remark: Please don't use equality and inequality like that. How can a noun and an adjective possibly be equal? They aren't even the same word class. Just use english "is" and "is not" to connect your nouns and adjectives。

comment 12y ago · link · parent

The constant factor is huge compared to a straight pointer.

comment 12y ago · link · parent

Forth has it right: One data stack and one return stack. Though you could argue that using unsafe languages is the real problem I suppose.

comment 12y ago · link · parent

You are both correct. See http://en.wikipedia.org/wiki/Exponential_distribution

comment 12y ago · link · parent

Suffer can mean "tolerate" sometimes.

comment 13y ago · link · parent

Hmm, the C code and C++ code aren't even solving the same problem, and they aren't using the same data structures. C++ uses inheritance while C uses a union, for no good reason. What in C++ is struct A : B { } is in C struct A { struct B b; }, not some weird union. Of course unions are not type safe.

And in practice, you can come close to the template solution with a macro for the loop. Sure, it will be a little more explicit about which functions are being called, but that's not a bad thing in my book. And, as with the C++, you'll have to build up the equivalent scaffolding and associated code, which I notice is conveniently left out of the C++ examples.h

comment 13y ago · link · parent

Thanks for waking up the whole family with that blip :(

comment 13y ago · link · parent

The corner of a room is probably the worst place you can put a speaker if you care about sound quality. The room resonances will be nasty.

28.

How the Ocaml type checker works | LTU(lambda-the-ultimate.org ↗)

1 points · by magnusjonsson · 13y ago · discuss

comment 13y ago · link · parent

Paywall. But ironically, if you search via Google you can read the article.
12