HNHacker News
TopNewBestAskShowJobs

renhanxue

805 karma · joined January 15, 2024

submissionscomments
renhanxue··on Sqlc: Compile SQL to type-safe code
No automated way to do that, I'm afraid. That said, most of the Jet statement builder API maps directly to SQL keywords, so it's usually straightforward. Still, some specific things are pretty awkward (CTE's come to mind).
renhanxue··on Sqlc: Compile SQL to type-safe code
I may be misunderstanding you, but at least for the "to SQL" part I think that's just

  someJetStatement.DebugSql()
All Jet-generated Statement objects have the .DebugSql() method. It returns the generated query as a string with all the bound parameters inlined[0] so you can just print it or grab it with the debugger and copypaste it into your query console.

[0]: that is, it translates the query it'd actually execute, which would look like

  WHERE foo = $1
into

  WHERE foo = 'bound parameter value'
with some rudimentary escaping to avoid the most obvious SQL injection problems (don't use it to actually run queries in production, obviously!!).
renhanxue··on Sqlc: Compile SQL to type-safe code
What I'm saying is there's an unpleasant tradeoff here. If you use Jet (or whatever other query generation library or ORM or what have you), you get back some sort of query object. In order to execute that query object and map the resulting rowset to some golang data structure, you almost invariably have to go through database/sql's API, because the closest thing golang has to something like JDBC and so that's the interface most query generation libraries will use.

If you want to use a database-specific connector API, like pgx for postgres for example, you usually have to roll your own query execution (including parameter binding) and quite a lot of the result mapping too. I'd expect that to be a significant amount of work, but what's worse is that having that convenience done for you is a big reason for using a library like Jet in the first place.

So you're either stuck with the limitations of database/sql, or you don't get to enjoy a lot of the benefits that a mature database library brings. I don't like it.

renhanxue··on Sqlc: Compile SQL to type-safe code
I think the next release is gonna give you a lot of flexibility to write your own helpers that can generate the raw fragments you need. Not as good as having the features built in of course, but it'll do in a pinch.

jOOQ and jOOQ-like API's in other languages are the Right Thing in most cases, IMO. I've worked with very abstract ORM's, I've worked with raw SQL, and I've worked with a lot of things somewhere in between and that's my conclusion.

renhanxue··on Sqlc: Compile SQL to type-safe code
You want Jet [0], as mentioned in another comment. I did an extensive survey of golang SQL interfacing libraries before settling on Jet for our team. It's certainly not without warts, but it's got the correct type of API (query builder that maps directly to SQL) and the struct mapping is pretty flexible.

sqlc lacking support for dynamic query generation is just absolutely baffling. Composition of query fragments is, like, one of the main reasons you use a query builder - it's very hard to do in raw SQL! If you don't need that feature, why are you even messing around with SQL code on the application side? Just write and call stored procedures in the database! People will think you're a time traveler from the 1980's but it works!

Golang's SQL ecosystem is... pretty miserable, really. I mean, I look at what jOOQ can do and I weep at the state of things over in go. In golang everything goes through database/sql because that's the "standard" solution, but database/sql is a huge mess with a long track record of disastrous bugs (like the possibility of accidentally running queries outside of the intended transaction) that makes it very hard to take advantage of feature-rich databases like postgres. pgx (postgres connection library) is actually quite good when you use its native API, but because everything has to go through the database/sql interface it gets pretty crippled with a lot of annoyances (try mapping postgres arrays or jsonb documents into structs and you'll see what I mean).

[0]: https://github.com/go-jet/jet

renhanxue··on Bitten by Unicode
Three Minus Signs for the Mathematicians under the pi,

  2212 MINUS SIGN
  2796 HEAVY MINUS SIGN
  02D7 MODIFIER LETTER MINUS SIGN
Seven Dashes for the Dash-lords in their quotes as shown,

  2012 FIGURE DASH
  2013 EN DASH
  2014 EM DASH
  2015 QUOTATION DASH
  2E3A TWO-EM DASH
  2E3B THREE-EM DASH
  FE58 SMALL EM DASH
Nine Hyphens for Word Breakers, one of them ­,

  00AD SOFT HYPHEN
  058A ARMENIAN HYPHEN
  1400 CANADIAN SYLLABICS HYPHEN
  1806 MONGOLIAN TODO SOFT HYPHEN
  2010 HYPHEN
  2011 NON-BREAKING HYPHEN
  2E17 DOUBLE OBLIQUE HYPHEN
  2E40 DOUBLE HYPHEN
  30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN
One for the Dark Word in the QWERTY zone

In the land of ASCII where Basic Latin lie.

One String to rule them all, One String to find them,

One String to bring them all and in the plain-text, bind them

In the land of ASCII where Basic Latin lie.

  002D HYPHEN-MINUS
- @FakeUnicode on Twitter, with apologies to J. R. R. Tolkien
renhanxue··on Did Sandia use a thermonuclear secondary in a product logo?
> Knowing that the graphic came from somebody who didn't actually know anything, the censors didn't see the need to worry about it.

That is not how nuclear secrets work. The US Department of Energy holds that restricted data (a special kind of classification that only applies to nuclear secrets) is "born secret". That means, even if you come up with a concept for a nuclear weapon completely independently without ever talking to anyone, it is considered classified information that you are not allowed to redistribute. This doctrine is highly controversial and the one time it has been tried in court the verdict was inconclusive, but to this day it is how the DoE interprets the Atomic Energy Act of 1954.

In general this is very precarious to attempt to enforce, of course. If the DoE sues someone because they published their nuclear weapon designs, that'd be seen as a tacit admission that the design could potentially work. Nevertheless they actually did do this at one point (United States v. Progressive, Inc., 1979).

renhanxue··on Did Sandia use a thermonuclear secondary in a product logo?
The author is a historian whose main published work is the book Restricted Data: The History of Nuclear Secrecy in the United States. He isn't very interested in the information itself; he's interested in where it comes from and in the process that led to its release. It's notable not because it contains interesting information, it's notable because it seems like it might represent a radical break with established patterns in US government procedures with regards to restricted data (which is a special and very weird kind of classification that only applies to nuclear secrets).

In other words: the author is interested in the institutions and policies that manage nuclear secrets, not so much in the secrets themselves.

In a different post[0] regarding a fumbled redaction that released similar information about what a warhead looks like, he had this to say:

> It’s also just not clear that these kinds of [declassification] mistakes “matter,” in the sense of actually increasing the danger in the world, or to the United States. I’ve never come across a case where some kind of slip-up like this actually helped an aspiring nuclear weapons state, or helped our already-advanced adversaries. That’s just not how it works: there’s a lot more work that has to be done to make a working nuke than you can get out of a slip-up like this, and when it comes to getting secret information, the Russians and Chinese have already shown that even the “best” systems can be penetrated by various kinds of espionage. It’s not that secrets aren’t important — they can be — but they aren’t usually what makes the real-world differences, in the end. And these kinds of slip-ups are, perhaps fortunately, not releasing “secrets” that seem to matter that much.

> If anything, that’s the real critique of it: not that these mistakes happen. Mistakes will always happen in any sufficiently large system like this. It’s that there isn’t any evidence these mistakes have caused real harm. And if that’s the case… what’s the point of all of this secrecy, then?

> The most likely danger from this kind of screw up is not that enemy powers will learn new ways to make H-bombs. Rather, it’s that Congressmen looking to score political points can point to this sort of thing as an evidence of lax security. The consequences of such accusations can be much more damaging and long-lasting, creating a conservatism towards secrecy that restricts access to knowledge that might actually be important or useful to know.

[0]: https://blog.nuclearsecrecy.com/2021/05/17/how-not-to-redact...

renhanxue··on Did Sandia use a thermonuclear secondary in a product logo?
The author is a historian who has published a book that is specifically about the history of nuclear secrecy in the United States. Not about the history of nuclear tech or nuclear weapons, about the history of restricted data, the special classification grade for the information. How the classification works and what is considered safe to release and what isn't is in itself one of his main research interests.

My impression from his book is that his position on nuclear secrecy is that a lot of it is pointless or outright contra-productive, but that isn't really the point of the blog post. The point of the blog post is that if something has changed about what information is considered safe to release, that is interesting to him. He is more interested in the humans and institutions than in the technology, I'd say.

renhanxue··on The Engineering of Landfills
Some numbers: Swedish electricity production in 2023 was 163 TWh. It's for all practical purposes 100% renewable or nuclear, with a mix of approximately 40/30/20/10 hydro/nuclear/wind/other, where "other" contains 2% solar and the rest is pretty much just electricity byproducts from district heating.

Also in 2023, district heating delivered a total of 53 TWh to customers. About two thirds of this came from waste and biofuels, specifically 47% renewable biofuels (mostly woodchips, bark and other forestry industry byproducts) and 20% waste. The remaining third came from an eclectic mix of inputs such as industrial waste heat (7,5%), heat pumps (5% net, that is after the electricity consumption has been subtracted), exhaust gas condensation (11%), biogas from landfills and compost (2%), fossil fuels (2,5%) and various other stuff. Turns out my info about peat was kinda out of date; it's been almost entirely phased out now.

Average CO2 emissions for the electricity generation was 41g CO2 equivalents per kWh, and for district heating about 55 g/kWh. Countries with less emissions than this do exist, for example Norway and Iceland are down around 30 g/kWh, but this is already better than almost every other country on the planet. US electricity generation for comparison averaged 369 g/kWh in 2023.

So: replacing all of the district heating with heat pumps would be an insanely huge project requiring a massive expansion of electricity generation, and it would have very low return on investment when it comes to reducing CO2 emissions. There is also the problem that heating energy demands are extremely uneven and unpredictable, both over the year and between years. You need a significant amount of extra capacity for very cold days, and even averaged over the year the difference between an average winter and a cold one can on the order of 20%. Just burning stuff works great as a solution for this, it's easy to have capacity on demand. Air-source heat pumps also become much less efficient on very cold days when you need them the most, which is why they're not that popular for heating here (people prefer ground source heat pumps, but those have limitations in densely populated areas because the ground doesn't contain infinite energy).

Also, a side note: the heat generation in district heating plants is extremely efficient compared to electricity generation using combustible fuels. The average efficiency of the heat generation in these plants in 2023 was 96%, and that's before exhaust gas condensation is taken into account.

In other words: there's a reason we are doing things this way.

renhanxue··on The Engineering of Landfills
That is already a thing, and it's being expanded. The Stockholm municipal energy company is already operating what they claim to be the world's largest heat pump facility with a capacity to extract 225 MW of heat from treated wastewater. It first opened in 1986 and has been incrementally expanded over the years. Both the hot and the cold sides of the heat pumps are used; the cold side goes into the district cooling system and is used in e.g. datacenters. Still, this facility has both heat pumps, biofuel furnaces, and as a backup for the rare extremely cold days, resistive water heaters.

It should also be mentioned that Swedish electricity generation is effectively 100% renewable already; it's mainly wind, hydro and nuclear. The co-generation plants mainly produce heating and only a small amount of electricity, more or less as a byproduct.

Waste incineration has a more or less negligible carbon footprint if you look at the big picture.

renhanxue··on The Engineering of Landfills
Nuclear was a thing in the 50's/60's but district heating isn't practical over long distances and nobody wanted nuclear plants in their suburbs.

Renewables we already do burn quite a bit of. But really, quite a lot of household waste is actually renewable too - cardboard packaging, food scraps that didn't end up in the compost, such things. So it's really not that bad.

Waste accounts for about 20% of the total energy required for heating in Sweden.

renhanxue··on The Engineering of Landfills
Would you rather we'd burn peat (which is also sequestered carbon) instead? Because that's what we used to do. We need to stay warm in winter one way or another.

In the 1950's we thought that in the future we'd have nuclear cogeneration plants. There was one such plant (Ågesta) in commercial operation, but it closed in the mid 1970's.

edit: also, to your point about sequestration: it's in actual and literal fact the same people. The Stockholm municipal energy company burns a lot of waste (and also woodchips and other renewables) for district heating. That same company also recently closed a big carbon sequestration deal with Microsoft: https://carboncredits.com/microsoft-and-stockholm-exergi-str....

renhanxue··on The Engineering of Landfills
If we didn't burn waste we'd need to burn something else to stay warm in winter. Currently we supplement the waste with _mostly_ renewables, like byproducts from the forestry industry (e.g. treetops, wood chips, sawdust) and the olive oil industry (olive pits; we import this stuff from the Mediterranean region), but we burn a bit of peat too because there aren't enough reasonably priced renewables. Burning waste really isn't meaningfully worse than burning anything else.

After the combustion we're left with 15-20% by weight in slag; some of this is metal that is recovered and sent to recycling, but the rest is effectively gravel that is used in e.g. road construction and the like. There's also 3-5% by weight of toxic gases captured by the exhaust gas treatment. This is sent to a special facility in Norway that more or less puts it in landfill, although a very carefully managed one.

renhanxue··on The Engineering of Landfills
> Almost all plastic waste in developed countries ends up in landfills, not the natural environment.

Here in Sweden less than 0.5% of household waste goes to landfill. Almost everything is burned in co-generation plants for district heating, with pretty sophisticated exhaust gas treatment. Unfortunately most of the plastic waste that goes into the recycling bins also end up there in the end, with only about 10% currently being actually recycled (mostly it's PET that gets recycled, AFAIK).

edit: My 10% figure is some years old; plastic numbers are actually much better now! These days it's about 35%. For glass, paper and metal the same figures are all around 80% though so plastic still has a long way to go.

renhanxue··on Potential ozone depletion from satellite demise during atmospheric reentry
The Montreal Protocol was nothing short of miraculous. It was the first international treaty to be ratified by all 198 members of the UN (including the Holy See), and it's been called "perhaps the single most successful international agreement to date" by former UN Secretary General Kofi Annan. It's one of history's greatest achievements of environmental policy and international cooperation.

The impact of CFC's on the ozone layer was first proposed in a scientific paper in 1973; the authors testified before the US House of Representatives in 1974 and significant funding was provided to study the problem. The Montreal Protocol was then signed in 1987 despite industry protests that the research was uncertain and there was no crisis that demanded urgent action. This was only 14 years (!) after the effect was first hypothesized. The discoverers of the effect won the Nobel Prize for chemistry in 1995.

I don't expect to see anything even remotely as successful as the Montreal Protocol in my lifetime.

renhanxue··on Högertrafikomläggningen
The trams were already on the way out in the 1950's, they were seen as a thing of the past that were inhibiting the development of the new car-centric urban areas. Several systems closed well before H-day, in the 50's and early 60's. The ones that closed on or around H-day were mainly in Stockholm and in Helsingborg.

In Stockholm, plans had been made as early as the 1940's to gradually replace the tram network with the metro, and that did in fact happen. Today's green and red metro lines do in fact use old tram line alignments to a pretty significant extent (the younger blue line was all new and mostly blasted out of the bedrock deep underground). In 1957 the city council formally decided that the tram networks should be gone by the mid-1970's, at which time most of the infrastructure and rolling stock would have been considered end-of-life. All H-day did was accelerate this by a couple of years. Two suburban lines were kept though and they survive to this day, but at least up until the 1990's their future was kind of uncertain. Things finally changed in the mid-90's, and new light rail alignments started to get built again.

renhanxue··on You can't just assume UTF-8
Yeah. The fantastic python library ftfy ("fixes text for you", https://ftfy.readthedocs.io/en/latest/index.html), designed to fix mangled Unicode (mojibake, of many different varieties), mentions in its docs that heuristic encoding guessers are the cause of many of the problems ftfy is designed to fix. It's magical, by the way.

It has an entire section of its documentation dedicated to why you should not use heuristic charset detection: https://ftfy.readthedocs.io/en/latest/avoid.html#don-t-use-c...

renhanxue··on The unstallable plane that stalled
This is far from universally true. The Saab 37 Viggen fighter jet (which was also the first series produced canard aircraft) is capable of departing from controlled flight into a stalled attitude in no less than five different ways, according to its flight manual:

> If the angle of attack exceeds the permitted limits, some yaw disturbances appear around alpha 25-28°, and at alpha 28-30° there are weak pitch-up tendencies. If the stick is moved forward to counter the pitch-up, the aircraft returns to normal alpha, possibly after overshooting up to alpha ~50°. Note that the angle of attack instrument only shows the area -4° to +26°.

> If the stick movement forward at the pitch-up is too small or is made too late, such that the angle of attack does not immediately decrease, the aircraft departs into superstall or spin. If the pitch-up occurs without aileron input, the departure usually results in superstall. If the pitch-up occurs with any aileron input active, the aircraft is affected by adverse yaw and the likelihood of a spin increases.

In addition to the superstall, the aircraft has two spin modes, in the flight manual referred to as flat and oscillating. The difference is basically the rotation speed and if there are oscillations in pitch and/or roll or not. The recovery is pretty conventional:

> In superstall or spin the pitch authority is good, which eases recovery. Aileron input results in adverse yaw, that is to say rolling right gives a yaw to the left and vice versa. Rudder authority is negligible.

> Recovery from superstall and oscillating spin is accomplished by moving the stick to a position somewhat forward of the neutral pitch position, with ailerons and rudder neutral. To recover from a flat spin, the yawing rotation must be stopped first, which is accomplished with neutral pitch and full roll input in the direction of the rotation ("stick into the spin"). When the rotation has just about ceased, recovery is accomplished with neutral ailerons and the stick somewhat forward of neutral, just like when recovering from superstall and oscillating spin.

In addition to regular stalled attitudes though, the aircraft also exhibits another stalled attitude with autorotation, the "plunging spiral" (sv. störtspiral) which can also be encountered in two variants. I'm honestly not sure how exactly it works aerodynamically. The flight manual says:

> In certain adverse dynamic scenarios, the aircraft can enter an uncontrolled attitude of the autorotating type, here called plunging spiral . The plunging spiral, which can be either right side up or inverted, is considered to be the potentially most dangerous form of uncontrolled flight that has been discovered during the spin tests of aircraft 37.

> The most common form of the plunging spiral is the inverted one. The following attitudes/maneuvers repeatably result in an inverted plunging spiral: 1) somersault into inverted position from oscillating spin (for example while attempting to recover from a spin with the stick fully forward), 2) stalling the tailfin through so-called "knife edge flying". The inverted plunging spiral is characterized by: 1) negative load factor (-1 to -3 G) 2), low nose, 3) very high rate of rotation in the roll axis (≥ 200°/s), 4) high sink rate (≥ 150 m/s).

> Moving the stick back and/or aileron input to either side tends to increase the rate of the roll rotation. The rotation can be stopped by moving the stick fully forward with no aileron input. When the rotation has ceased, the stick is moved back to neutral pitch, and the aircraft recovers to controlled flight.

> The aircraft only departed into a non-inverted plunging spiral on a few occasions during the spin tests. It has not been possible to define any repeatable attitude or maneuver that results in a non-inverted plunging spiral. During the spin tests the non-inverted plunging spiral only occurred on the following two occasions (not repeatable): 1) when recovering from an inverted superstall, 2) when recovering from an oscillating non-inverted spin. The non-inverted plunging spiral is characterized by: 1) positive load factor (+1 to +3 G), 2) low nose, 3) very high rate of rotation in the roll axis (≥ 200°/s), 4) high sink rate (≥ 150 m/s).

> In a non-inverted plunging spiral, aileron inputs have no effect. Instead, the roll rotation must be stopped by pulling gently back on the stick until the rotation ceases. When the rotation has ceased, the stick is moved forward to the neutral pitch position and the aircraft recovers into controlled flight.

renhanxue··on Anatomy of a credit card rewards program
I don't think that's the case outside the US. Sweden here; all of the Amex cards available locally charge a 2% currency exchange fee.
renhanxue··on Anatomy of a credit card rewards program
It's a thing the author of that article does, at least. He's got an article mostly about how to escalate identity theft complaints here that touches on it: https://www.kalzumeus.com/2017/09/09/identity-theft-credit-r...

It's very long so I'll just quote a small bit specifically about the Investor Relations:

> If you cannot route letters to the legal department, go as high up as required. Pro-tip: virtually every major US company has a department called Investor Relations which is trivially discoverable, very well-funded, publicly routable, and very bored during 80% of the year. You can excuse any letter to Investor Relations with: "I am a shareholder in BigBank. I was therefore profoundly displeased when I learned…"

> What’s a well-paid bored professional in Investor Relations going to do with your account information? Nothing? Nothing is a great way to get fired. No, they’re going to open up their internal phone tree or ticketing system and say “I have a letter from an investor which alleges an identity theft issue. Which group handles that? Your department? Great; handle it and call me when you’re done. Do you want it by fax, email, or FedEx?”

For this to work though you've got to present like your position in the stock is in the millions of dollars, even if it's actually like $100. The author of the article has been in the financial industry for a very long time, and has also spent a long time as a Japanese salaryman, so he can definitely pull that off.

renhanxue··on The ü/ü Conundrum
My point was simply that the fact that there are multiple representations of characters that look the same is just a tiny part of the complexity involved in making text behave like users want. It's not that uncommon for people to think that "oh I'll just normalize the string and that'll solve my problems", but normalization is just a small part of quote-unquote "proper" Unicode handling.

The "proper" way of sorting and comparing Unicode strings is part of the standard; it's called the Unicode Collation Algorithm (https://unicode.org/reports/tr10/). It is unwieldy to say the least, but it is tuneable (see the "Tailoring" part) and can be used to implement o/ö equivalence if desired. I think it's great that this algorithm (and its accompanying Common Locale Data Repository) is in the standard and maintained by the consortium, because I definitely wouldn't want to maintain those myself.

renhanxue··on The ü/ü Conundrum
Most applications do not do anything useful with in-band language tags. They never had widespread adoption in the first place and have been deprecated since 2008, so this is unsurprising. If you're using them in your strings and those strings might end up displayed by any code you don't control, you'll probably want to strip out the language tags to avoid any potential problems or unexpected behaviors. Out-of-band metadata doesn't have this problem.

As I said though, if you're in full control and only need to be compatible with yourself, you can do whatever you want.

renhanxue··on The ü/ü Conundrum
> Unicode is, in practice, a system that works the same way for ~every human language except Japanese

This is simply not true. As I've pointed out in a sibling comment, Unicode has a lot of surprising and frustrating behaviors with many European languages as well if you use it without locale data. The characters will look right, but e.g. searching, sorting and case-insensitive comparisons will not work as expected if the application is not locale aware.

renhanxue··on The ü/ü Conundrum
If you mean in-band language tagging inside the string itself, the page you're linking to points out that this is deprecated. The tag characters are now mostly used for emoji stuff. If you only need to be compatible with yourself you can of course do whatever you like, but otherwise, I agree with what the linked page says:

> Users who need to tag text with the language identity should be using standard markup mechanisms, such as those provided by HTML, XML, or other rich text mechanisms. In other contexts, such as databases or internet protocols, language should generally be indicated by appropriate data fields, rather than by embedded language tags or markup.

renhanxue··on 'Super memory': Why Emily Nash is sharing her brain with science
Video game personality Tim Rogers supposedly has HSAM, and described it like this:

> This is a condition which requires me to remember everything that ever happens within my earshot and eyeshot. No: I describe it impressively: it turns life into noise, and it is useless. Please listen to my noise now, because if you do not, who will? I have lost the ability to hear it.

He wrote a semi-fictional essay about it which I always thought was an interesting read: https://medium.com/@108/what-we-might-mean-when-we-say-a-clo...

renhanxue··on The ü/ü Conundrum
Both problems are missing the point: you cannot handle Unicode correctly without locale information (which needs to be carried alongside as metadata outside of the string itself).

To a Swede or a Finn, o and ö are different letters, as distinct as a and b (ö sorts at the very end at the alphabet). A search function that mixes them up would be very frustrating. On the other hand, to an American, a search function that doesn't find "coöperation" when you search for "cooperation" is also very frustrating. Back in Sweden, v and w are basically the same letter, especially when it comes to people's last names, and should probably be treated the same. Further south, if you try to lowercase an I and the text is in Turkish (or in certain other Turkic languages), you want a dotless i (ı), not a regular lowercase i. This is extremely spooky if you try to do case insensitive equality comparisons and aren't paying attention, because if you do it wrong and end up with a regular lowercase i, you've lost information and uppercasing again will not restore the original string.

There are tons and tons of problems like this in European languages. The root cause is exactly the same as the Han unification gripes: Unicode without locale information is not enough to handle natural languages in the way users expect.

renhanxue··on The ü/ü Conundrum
The problem in the linked article barely scratches the surface of the issue. You _cannot_ compare Unicode strings for equality (or sort them) without locale information. A simple example: to a Swedish or Finnish speaker, o and ö completely different letters, as distinct as a is from b, and ö sorts at the very end at the alphabet. A user that searches for ö will definitely not expect words with o to appear. However, to an American, a user that searches for "cooperation" when your text data happens to include writings by people who write like in The New Yorker, would probably to expect to find "coöperation".

This rabbit hole goes very, very deep. In Dutch, the digraph IJ is a single letter. In Swedish, V and W are considered the same letter for most purposes (watch out, people who are using the MySQL default utf8_swedish_ci collation). The Turkish dotless i (ı) in its lowercase form uppercases to a normal I, which then does _not_ lowercase back to a dotless i if you're just lowercasing naively without locale info. In Danish, the digraph aa is an alternate way of writing å (which sorts near the end of the alphabet). Hungarian has a whole bunch of bizarre di- and trigraphs IIRC. Try looking up the standard Unicode algorithm for doing case insensitive equality comparison by the way; it's one heck of a thing.

People somehow think that issues like these are only an issue with Han unification or something, but it's all over European languages as well. Comparing strings for equality is a deeply political issue.

renhanxue··on NASA engineers make progress toward understanding Voyager 1 issue
The Voyager software was updated repeatedly and significantly in flight while the spacecraft were still in their early years. They were very intentionally designed to be patched over the course of the mission. The software as launched was not capable of a meaningful mission beyond Saturn, because for budget reasons that was officially not on the cards at launch (the Voyager name came very late; the program was officially "Mariner Jupiter-Saturn" for a long time). Features like image compression were added in the early 1980's, after Voyager 2's mission extension to Uranus and Neptune had been approved.

Without any inside information on the program, I would expect that a lot of development has been done more or less ad-hoc over the decades, as budgets have allowed and operational requirements demanded.

renhanxue··on NASA engineers make progress toward understanding Voyager 1 issue
>The project was not really designed to reach interstellar space originally.

Not only that, Voyager 2's flyby of Uranus and Neptune in the late 1980's was originally not intended either. As an aside, to this day Voyager 2 remains the only spacecraft to ever have visited either planet, and there are no firm plans for a followup, just some loose ideas about maybe launching something in the mid 2030's. Anyway, doing the Uranus/Neptune part of the mission required extensive software upgrades, which introduced Reed-Solomon error correction and image compression capabilities, among other things - the software as launched would not have been capable of a meaningful mission to Uranus and Neptune.

These days the Voyager program is lauded as an astonishing feat of engineering and one of the most inspiring science and engineering achievements of all time, but in the early 1970's the entire idea was NASA's red-headed stepchild and ended up cut down to a bare minimum. The Grand Tour mission concept (taking advantage of the extremely rare opportunity to visit Jupiter, Saturn, Uranus and Neptune in a single mission) was pitched as early as 1965, and by the early 1970's there were plans for launching four spacecraft, two bound for Jupiter-Saturn-Pluto and two bound for Jupiter-Uranus-Neptune. These were referred to as TOPS, Thermoelectric Outer Planets Spacecraft. But then people started complaining that it might cost a billion dollars (Apollo had cost $25 billion) and the whole thing became intensely political. Quoting from Voyager: The Grand Tour of Big Science (https://www.nasa.gov/history/SP-4219/Chapter11.html) by Andrew J. Butrica:

> Further complicating matters was Senator Clinton P. Anderson (D-NM), champion of the Los Alamos nuclear weapons laboratories and an enthusiast, until his retirement in 1973, of the development of a nuclear rocket engine called NERVA. As chair of both the Senate Aeronautical and Space Sciences Committee and the joint Atomic Energy Committee, Anderson provided NASA and the Atomic Energy Commission over $1.4 billion, about $500 million of which was spent in Los Alamos, for the development of the NERVA engine, which, Anderson held, was ideally suited for exploration of the outer planets, as well as for more advanced missions. Anderson worried that NASA and the OMB were shifting money from NERVA to fund Grand Tour. When the NASA budget came before Anderson's Aeronautical and Space Sciences Committee on May 12, 1971, his committee voted five to two to reduce Grand Tour's budget, while an amendment to increase NERVA funding passed. Werner von Braun worried that ardent congressional interest in NERVA would force a loss of Grand Tour in favor of a NERVA that had "no place to go."

> Meanwhile, NASA was trying to include Grand Tour as a new start in its 1972 fiscal budget. The Friedman report moved the Office of Management and Budget (OMB), in March 1971, to ask NASA to study simpler, less costly spacecraft alternatives to TOPS. The OMB also attempted to delay the Grand Tour start-up to fiscal 1973.

> (...)

> As NASA prepared its fiscal 1973 budget, rumors spread that the "budget pinch" was going to affect planetary programs deeply and that the reduction of the Grand Tour payload from 205 to 130 pounds was "a likely fact of life." Furthermore, Grand Tour now began to compete for funding with the latest NASA human program: the Space Shuttle. The fiscal 1973 budget request NASA submitted to the OMB on September 30, 1971 included both Grand Tour and the Space Shuttle. Throughout the autumn of 1971, several press reports presciently reported Grand Tour's vulnerability to a possible elimination or reduction. On December 11, 1971, James Fletcher, NASA administrator since April 27, 1971, learned from White House officials that Nixon was prepared to approve the shuttle program and that Nixon would not let NASA simultaneously fund the shuttle and the full TOPS Grand Tour in the 1973 budget or in subsequent fiscal years. Fletcher had to decide which was more important: Grand Tour or human flight.

Fletcher chose the shuttle, and what could be squeezed into the budget was an extension of the Mariner program to visit Jupiter and Saturn only. For budget reasons the spacecraft development was kept in-house at JPL rather than contracted out, and at JPL the dream of the full Grand Tour was still alive:

> Despite the limited aim of the Mariner Jupiter-Saturn, the mission had the Grand Tour launch window, that rare planetary alignment, and the engineers at JPL still had every intention of building a spacecraft that would last long enough to visit Uranus and Neptune. This intention was not emphasized; however, it was stated that a Mariner Jupiter-Saturn spacecraft might continue to Uranus if its mission at Saturn proved successful. The scientists working on the project knew that Mariner Jupiter-Saturn was going to go to Uranus and Neptune, too. As Bradford Smith, Leader of the Imaging Team, explained: "We understood at the time the enormous potential of this mission, that it could very well be one of the truly outstanding if not the most outstanding mission in the whole planetary exploration program."

Also for budget reasons, the spacecraft were limited to mostly reusing existing technology. Getting reprogrammable computers (without which they could never have been kept alive in the way they have) required a separate budget grant from Congress:

> Despite the reliance on extant technology, some money was set aside to develop new technology. Congress and the OMB approved an additional $7 million to the Mariner Jupiter-Saturn appropriation for scientific and technological enhancements. Part of that appropriation went to develop a reprogrammable onboard computer, which proved vital to maintaining Voyager 2 as a functioning observatory in space. Without properly functioning hardware, no science could be conducted.

In the end only Voyager 2 was launched on the full Grand Tour trajectory that would allow visiting all of Jupiter, Saturn, Uranus and Neptune; Voyager 1 was launched on an easier and much faster trajectory that would take it only to Jupiter and Saturn. Even then, the official decision to extend the Voyager 2 mission to Uranus was only approved in 1980.

Human spaceflight and its enormous appetite for money has always been a huge threat to actually exploring the solar system beyond Earth orbit, and we should be very glad we got even the very diminished Voyager program that exists today.

← PreviousPage 3 of 4Next →