HN user

aktiur

116 karma
Posts0
Comments43
View on HN
No posts found.

Pre-python 3.2, the format used for representing `str` objects in memory depended on if you used a "narrow" (UTF-16) or "wide" (UTF-32) build of Python.

Fortunately, wide and narrow builds were abandonned in Python 3.2, with a new way of representing strings : current Python will use ASCII if there's no non-ASCII char, UCS-2 –UTF-16 without surrogate pairs — if there is no codepoint higher than U+FFFF, and UTF-32 else.

See this article for a good overview of the history of strings in Python : https://tenthousandmeters.com/blog/python-behind-the-scenes-...

It actually depends!

`bytes.decode` (and `str.encode`) have used UTF-8 as a default since at least Python 3.

However, the default encoding used for decoding the name of files use ` sys.getfilesystemencoding()`, which is also UTF-8 on Windows and macos, but will vary with the locale on linux (specifically with CODESET).

Finally, `open` will directly use `locale.getencoding()`.

In 3.1 it was the default encoding of string (the type str I guess).

No, what was used was what sys.getdefaultencoding(), which was already UTF-8 in 3.1 (I checked the source code).

At that time, the format used for representing `str` objects in memory depended on if you used a "narrow" (UTF-16) or "wide" (UTF-32) build of Python.

Fortunately, wide and narrow builds were abandonned in Python 3.2, with a new way of representing strings : current Python will use ASCII if there's no non-ASCII char, UCS-2 –UTF-16 without surrogate pairs — if there is no codepoint higher than U+FFFF, and UTF-32 else. But that did not exist in 3.1, where you could either use the "narrow" build of python (that used UTF-16) or the "wide" build (that used UTF-32).

See this article for a good overview of the history of strings in Python : https://tenthousandmeters.com/blog/python-behind-the-scenes-...

strings having an encoding and byte strings being for byte sequences without encodings

You got it kind of backwards. `str` are sequence of unicode codepoints (not UTF-8, which is a specific encoding for unicode codepoints), without reference to any encoding. `bytes` are arbitrary sequence of octets. If you have some `bytes` object that somehow stands for text, you need to know that it is text and what its encoding is to be able to interpret it correctly (by decoding it to `str`).

And, if you got a `str` and want to serialize it (for writing or transmitting), you need to choose an encoding, because different encodings will generate different `bytes`.

As an example :

>> "évènement".encode("utf-8") b'\xc3\xa9v\xc3\xa8nement'

>> "évènement".encode("latin-1") b'\xe9v\xe8nement'

Does it not come down to the usual "cathedral vs. bazar" opposition? SQLite, for which Fossil was originally built, lists 3 persons on its developers page and looks pretty much like the definition of a "cathedral", whereas git was built by Linus Torvalds for Linux, which is the prototypical bazar project.

It makes sense when you have a small team of people that know the project very well to record everything, and they can easily maintain stringent standards, like never committing anything that breaks the tests.

Whereas for a big project that involve thousands of people mailing patches around, some of them first time contributors, you'd rather make sure that what ends up in the immutable log has is clean enough.

Ever read a good book, or played a video game, and known that you have to stop now but thought "I'll just read another chapter / play one more turn"?

I would say that's basically how addiction manifests itself: even if you know that you're dealing with substance abuse, come on, one more time won't matter, will it?

And then there's also the comfort aspect: you're getting back from a hard day's work, you're feeling tired and cranky, you do deserve something nice, don't you?

N.B.: I'm not saying that not being able to drop the book or stop playing that game IS addiction, just that substance addiction might feel the same way.

N.B. 2:And I'm not talking here about the medical aspects of withdrawal, because that's not the thing an addict would usually experience (withdrawal would only happen because you're trying to stop or cannot get access to the substance you need).

Question regarding Iodine-131: is it still being generated inside the spent fuel / nuclear waste in Chernobyl? From what I could gather, Iodine-131 is mostly a fission byproduct, and is not present in any of the 4 decay chains[1].

If none is still being generated, there should not be any significant quantity left considering it has a half-life of only 8 days.

[1] https://en.wikipedia.org/wiki/Decay_chain

"They take ID photos of 1856 Chinese men [...]. Half of these men were criminals."

Because half of the general male population is criminal, of course.

The accuracy rate would be very different with a training/testing sample that takes the base rate of criminality into account.

In France, juries are involved only for cases defined as "Crimes" (the American equivalent would be felony, but it's much more restrictive), such as murder and rape, especially violent thefts and war crimes. And even in these cases, their role is much less important than in the US for two reasons :

* the 6 jurors (9 in appeal) decide the case alongside 3 professional judges whose influence is often decisive during the jury's deliberation (and in any case they always carry 3 votes)

* there's no need for an unanimous decision: 6 votes are necessary for any conviction (8 in appeal)

Numba is indeed pretty impressive, but you're not comparing exactly the same thing with this code.

In the Numba case, you're basically modifying the image in place: it means no allocating a new array, no full copying. However, your pure-numpy code basically creates a new array (the result of np.dot) before copying it back entirely in image.

If you write the two functions so that they both return a new numpy array and do not touch the original one, the time difference drops from 4 times faster to 2.5 times faster. That's still an impressive difference, but at the loss of a bit of flexibility.

https://gist.github.com/aktiur/e1cddee8f699ded49824

N.B.: numpy.dot does not use broadcasting, i.e. it does not allocate a temporary array to extend the smaller one. The function handles n-dimensional arrays by summing on the last index of the first array, and on the second last of the second array.

More generally, for an image im with shape (width, height, channels) and a square transformation matrix M of shape (channels, channels), you can do :

  res = np.dot(im, M.T)
It will work with affine transformation as well if you add a 1 component to every pixel. It will also work with higher dimensional images if I'm not mistaken.

Keep in mind that the specific rules of the media chronology legal regime are set through interprofessional agreements. The specific delays for VOD services were added in 2009 and are mostly the result of an attempt by incumbents to protect their market share against internet entrants. The state agency (Conseil National du Cinéma) is actually pushing for a shorter period for subscription VOD (24 months), but only for actors involved in "French artistic creation" (basically all of them except Netflix).

All of this may seem hard to understand from a foreign perspective, but you have to realize that numerous rules apply to cultural industries in France. For example, channels must respect a minimum ratio of French movies and series in their programming. They also have an obligation to invest 3 % of their turnover in funding european and French movies. Thus, these French actors feel that Netflix's foreign status allows it to escape these obligations and they resent what they see as an unfair competition.

In the specific case of France, there are at least two reasons:

- there is a stringent legal regime ("media chronology") that sets compulsory delays for publishing a movie on alternative mediums after it has got into theatres : publishers have to wait 4 months to get DVDs out, free TV channels won't be able to screen the movie before 30 months, and VOD subscription services have to wait 36 months (!)

- Moreover, exclusivity on the national territory is a common practice for TV series, and a lot of the popular ones have been sold to major TV channels. Ironically, Netflix had already signed such a contract with Canal+, a French channel, for its signature series House of Cards, which is thus not available on the French version of Netflix !

It just shows it is too difficult and expensive to break the system given the prize value and the constraints put on what are acceptable attacks.

Any system can be proven secured by such a contest if you limit acceptable attacks to the parts where you know the system is the strongest... but a real attacker will always aim at the weakest part.

And then there is NASA (apparently) using Sanskrit for AI: http://www.vedicsciences.net/articles/sanskrit-nasa.html*

This is a hoax. The article reproduced there does exist though: it was published in an artificial intelligence journal in 1985 and made no reference to NASA, except for the fact that the author worked at the NASA Ames Research Center. You can find it there: http://www.aaai.org/ojs/index.php/aimagazine/article/view/46...

A quick search on internet for "sanskrit nasa" shows that all occurences are either copies, extracts or translations of this article taken out of its context. The belief that NASA has used sanskrit seems to come from this internet echo chamber.

I could find no reference about it on any NASA website, nor any other articles written by this Rick Briggs. I was able to find only one other article on sanskrit and AI, quoting the one by Briggs, dated to 1987: http://www.cedar.buffalo.edu/~srihari/papers/KRIS87.pdf

It was not a civil judgment but a public one handled by an independant administrative authority with the power to pronounce sanctions (French public law is separate from both criminal and civil law and includes administrative law).

It is not so much about free speech: the two guys have been fined for publishing incorrect information about the financial situation of a bank. It is more about financial regulation than free speech. I'm not so familiar with american law, but I'm pretty sure you got related situations (for example concerning the handling of sensitive financial information, or insider trading, etc.)

Disregarding the question of the reality of what they've been accused of, the fine against Mish is illegal considering the right of defendants to translation and an interpretor has not been respected. This decision will be very probably striken down by any real judge that get her hands on this case.

It is a peculiarity of French administrative law. It's not a court that fined Mish, but an Autorité Administrative Indépendante (AAI or independent administrative authority, but I'm sure you did not need the translation) with the power to fine people (there are only a few).

Basically, if he appeals, it will very probably be overturned by a proper judge. Another AAI in charge of the regulation of the telecommunications sector got striken badly by a decision of our Constitutionnal court (no less) which suppressed its power to pronounce sanctions, judging the protection of the rights of defence was not effective. It's going to end the same way here I would say.

[dead] 13 years ago

I think the real point is in the last part of the article

"TL;DR “Why There Are No Women on Twitter’s Board, and So Few in Technology” was a really shitty article and as a community we should strive for higher quality writing and thinking."

I think he's right, and articles like the one posted yesterday are really damaging and only serves to reinforce stereotypes.

[dead] 13 years ago

It's basic spam in French (translation: "Can you really earn money from home?")