HNHacker News
TopNewBestAskShowJobs

ratboy666

226 karma · joined May 17, 2013

submissionscomments
ratboy666··on Investigating the Performance Overhead of C++ Exceptions
Converting an exception into a return. Which loses the "have to deal with it; cannot ignore it" property that made the exception valuable.

"The key takeaway here is that an exception cannot be ignored or forgotten; if we have an exception, it must be dealt with."

If converted to simple "C style" status returns -- it is only 5 times slower (11.5ns vs 57.5ns) -- and can be ignored and forgotten.

In the associated slide deck, boolean valid() must be used before value. In this case, this is just as unsafe as C return codes. A C++ exception is always considered an lvalue, meaning that union is initialized, but I am not sure what reading the other side results in (I don't think that this is allowed).

My take on this? Please use an exception if you mean an exception (for C++). If it is too slow (which I consider unlikely), please deal with it some other way (I would suggest a status return).

ratboy666··on “Abrupt thaw” of Arctic permafrost releasing more CO2 than predicted
I would wonder why. Why would wildfires get worse because of climate change?

Wildfires need an accumulation of fuel. Climate change could produce the fuel, but that would be a process of decades. Indeed, bad fires in 1975 -- 45 years later there is enough fuel.

Which would mean that the mechanism would be: climate change -> growth of fuel -> burn.

ratboy666··on Animation shows the temperature change by country from year 1880 to 2019
Very nice animation! Data is suspect, though -- US 1937 should be bright red, not pale yellow. 1937 had record heat wave in US.
ratboy666··on Australia wildfires: 500M animals and plants killed as glaciers turn black
Maybe not true:

https://www.ncbi.nlm.nih.gov/books/NBK232323/

ratboy666··on Australia wildfires: 500M animals and plants killed as glaciers turn black
https://www.sciencedaily.com/releases/2010/11/101102131108.h...

Indicates that baseline is 2T/year/human (in Spain).

840lbs to 6710lbs (resting to active) exhalation. Which means, not below 0.5T/year/human. We are at 20T/year/human here in Canada -- but, of course, at 8953 trees/human, with each tree absorbing 48lbs of CO2/year, Canada absorbs 215T/year/human (carbon negative in Canada by 195T/year/human).

What action would you like? Carbon tax? We have that. Eliminate oil production? Working on that (no pipelines being built, tar-sands bitumen not being sold to anyone but the US).

https://www.oecd-ilibrary.org/sites/9789264279612-en/index.h...

Personally, I prefer not to freeze, so burn natural gas to heat my house. Really big country, need transport.

I imagine that I could use wood heating could be used - 2 cords per season should be sufficient (6 to 20 trees, depending on diameter - 8 to 14 inches). I previously (20 years ago) converted all wood burning to natural gas, but could convert back. I no longer own enough land for my tree needs but (afair) 2 acres for food, 4 acres for fuel, so 6 acres of land of be sufficient for my needs.

This would reduce my carbon footprint, but would be more polluting -- which would you prefer?

ratboy666··on BitBar: Put the output of any script on your macOS menu bar
argos extension for Gnome 3. Compatible with BitBar
ratboy666··on A new cycle-stepped 6502 CPU emulator
Back in the late 70s, I did the bring-up of a Z80 system. I coded an EPROM (2708) with 1KB. Wrote a very small bootstrap monitor that did not require RAM to be operational. Drove a serial terminal (autobaud on CR entry). Display/Set memory and Go to address. Just enough to enter a memory test and a disk bootstrap, which was then added to the EPROM. So, there are examples of "zero RAM" programs. With no stack, use a single level of subroutine - LD DE,ret addr, LD HL,subroutine, JMP (HL), and at the end of the subroutine: LD HL,DE and JMP (HL) did it. The EPROM had to work on both 8080 and Z80 CPUs. The code had to be small, because it was manually entered into an EPROM programming device. Fairly common stuff back then... I enjoyed this kind of work. No debugger, no safety net. The code had to be simple, understandable, and work. However, these days I still don't use debuggers (much). This may be slowing me down; not sure about that.
ratboy666··on BitBar: Put the output of any script on your macOS menu bar
Argos is very useful. I use it to mount/unmount external drives, display power consumption, control VPN, a simple application launcher. Argos claims compatibility with BitBar. Argos claims to support JavaScript Gnome Shell execution -- I have no reason to doubt this (as Argos itself is a JavaScript Gnome Extension). I highly recommend Argos for Gnome 3 users.
ratboy666··on Apocalyptic Claims About Climate Change Are Wrong
The article states that fewer people die of natural disasters. If you want to go to a pre-industrial state, I certainly support your decision. But, please, do not condemn billions of people to death.

Of course, I will call out you "climate shifts ... make many places less habitable". Name one. Anywhere on the planet.

ratboy666··on Apocalyptic Claims About Climate Change Are Wrong
"Halting climate change"? Please -- the climate changes. It has ALWAYS changed. To think that we can "halt climate change" is hubristic.
ratboy666··on The impact of direct air carbon capture on climate change
Thanks for your comments. A bit of fresh air. Really, I don't think that demonizing CO2 is the objective. Demonizing oil and other petrochemicals seems more likely. I think we are in a CO2 drought -- we know the planet (including corals) had an explosion of life at the 700+ ppm CO2 level.
ratboy666··on Farmers sue German government over climate change failures
I imagine that the "consensus" has been proven, sure.

"scientific consensus" is not a thing. Also, "proven time and time again"? Just to let you know, water vapour is a much larger contributor.

Sure, sue because the Government lied. Why don't you vote them out? Can you sue them?

ratboy666··on Judge Gives E-Cigarette Makers 10 Months to Seek FDA Review
Nicotine reduces stress and anxiety, and stabilizes mood. In that context, nicotine may be a useful drug for some people and help them function better.

Nicotine gum may improve short-term memory. Nicotine may account for why smokers are less likely to develop Parkinson's disease.

ratboy666··on Judge Gives E-Cigarette Makers 10 Months to Seek FDA Review
Juul is supportive of this -- and Juul is funded deeply enough (by Altria -- Marlboro, over 12 billion) to be able to go through the FDA review. Pretty much all the independents cannot. This means that the vaporizer business will be completely ceded to "big tobacco". Please don't say "e-cigarette", say "vaporizer" instead. Really would appreciate that.
ratboy666··on California has a new law: No more all-male boards (2018)
Of course, this doesn't (arguably) matter. In California, persons are allowed to change gender. At some point, Senate Bill 179 can be used to align government documentation, but that doesn't need to happen.

So, prior to a board meeting: "Who is female?". Ok, we are covered.... Don't know what happens after the meeting, but that doesn't matter. For the purposes of the law, the board is not "all-male". Anyone who disagrees can then be taken to court, for discrimination.

That is how I would play this. Just good fun.

FredW

ratboy666··on The global population pyramid
Historically, you are wrong.

Custody of Infants Act 1839. Prior to this, men both "made the money" and received custody of the children.

https://en.wikipedia.org/wiki/Custody_of_Infants_Act_1839

FredW

ratboy666··on Visualising per Capita CO2 Emissions – Criticise the US and Canada, Not China
Not remotely true -- the climate would still change. The question is "Is climate change a problem?".

Personally, I don't like the idea that the expression of some latent genes may produce this monster:

https://www.thestar.com/news/2009/02/04/croceating_snake_was...

Which is only possibly if the temperature goes up considerably. Which means that my answer is: "Yes, some climate change is a problem". From the perspective of the giant snakes, the answer is the same: yes, climate cooling is a problem. Go figure, the same answer on any change. On the contrary, climate staying the same? Trees are, in general, happier if there is more CO2. There are lots of trees -- if they had a "vote", I'm pretty sure they want more CO2. So, in favour of warming.

All of this (our needs, snake needs, tree needs, etc) makes for a very interesting and complex problem.

What I don't understand is "climate change advocacy". Given that the climate changes, is that advocacy for more change? Less change? And how is this a "tool for oppression"? I live in Canada -- we have a carbon tax, which is oppressive.

Can you clarify a bit?

Thanks in advance FredW

ratboy666··on Visualising per Capita CO2 Emissions – Criticise the US and Canada, Not China
First, how many trees per capita are there:

https://www.washingtonpost.com/graphics/world/tree-density/?...

From this, we determine that Canada has 8953 trees per person.

Next, how much carbon does each tree sink:

https://projects.ncsu.edu/project/treesofstrength/treefact.h...

48 pounds of carbon per tree, per year.

Which means that, in Canada, 214.8 tons of carbon are sequestered annually per person.

Canada's people generate 15.7 tons of carbon per person (or, as the linked article puts it, about 4 times the global average).

http://www.changeyourcorner.com/articles/034.php

So, Canada is STILL "carbon negative" -- in a major way.

So, there is one example. In North America, even.

FredW

edit: added "per person" to usage, change But to So in conclusion.

ratboy666··on The structure of the special type of DOS files called directories (1998)
Choice of E5 for a deleted entry:

#1 E5 is a "sync byte" it cannot be rotated and mis-interpreted: E5 E5 E5 ... can be used to synchronize a bitstream. Note that floppy discs are read bit-wise.

#2 Empty 8" floppy discs came pre-formatted with E5 written everywhere.

#3 05 is a "control-e" in "extended 8 bit ASCII (IBM encoding)". E5 was a usable character.

With CP/M, the disc bitmap was produced when the disc was "loaded". All directory entries were scanned, and the allocation bitmap was produced. A freshly formatted disc would have E5 fill, and thus would have no files. MS-DOS had a separate allocation table, which was also the file linkage table. So, the strategy of a fresh E5 filled disc being taken as empty no longer works. But, the key of a deleted entry having E5 as the initial character was still used.

Hope this helps.

ratboy666··on Family spaghetti of programming languages
Sure, but COBOL:SNOBOL is like Java:Javascript
ratboy666··on Why I'm usually unnerved when modern SSDs die on us
The Apple ][ disk encoding was not done to allow "for a few extra sectors per track". Since the Apple ][ did not have a disk controller, the encoding from magnetic flux to bits was handled in software. A 1Mhz 6502 cannot handle the "standard" encoding (things like M2FM) in software as the disc was rotating. Woz's encoding allowed the encoding.
ratboy666··on CLI: Improved
I am not sure how this would work. rsh/ssh may be involved. I wouldn't even know how to express:

ssh carthoris ls /mnt/media/Movies | grep Spider

(this is just an example). Note that in this example, we have two processes running on two different machines. Indeed, the OSs and systems on these machines may be, um... different. Indeed, I routinely include "cloud" machines in pipelines. Indeed, with ssh, the -Y (or -X) option can introduce a GUI to a part of the command.

I have wished that shar was part of SUS. Also, I find that "exodus" is useful (across Linux anyway -- the systems have to be "reasonably" homogenous). https://github.com/intoli/exodus

ratboy666··on WordTsar – A Wordstar clone
Always had a soft spot for WordStar. Last version used was WS 3. Took WordTsar for a spin... Fast comments: Seems to be missing N (non-document edit -- used that for editing program source). ^KH (hide block) is ^K> Not sure why (WS 4?). ^JH0 is missing (get rid of help). As are the other help levels. No pure console display. And its big. 16M for GTK3. One file, though, which is very nice. (compare to the original, 81536 bytes).

Congradulations! Very nice work

ratboy666··on Microsoft: The Early Days (2000)
The original Word for DOS had a user interface (for command selection) similar to MultiPlan, which was (similar) to VisiCalc.

Windows was not yet a thing.

ratboy666··on APL deserves its renaissance too
How is GNU APL not there? It is standards compliant, 99.9% pure APL2 (per ISO standards), and is actively maintained (bugs and issues are usually turned around in a day or two). It performs quite well, and can be easily extended. I have even added memmap vectors to it to achieve even more performance (and to begin GPGPU integration).

GNU APL also supports a library version (libapl.so) which allows APL2 to be incorporated into other applications via C ffi. This is my primary use case -- interactive development followed by delivery via libapl.so.

ratboy666··on Completely Silent Computer
No. A vacuum doesn't transmit heat at all. The chips will get very hot. Liquids (generally) transfer heat better that air. You can completely immerse your computer in 3M Fluorinert. That will transfer the heat. Then, cooling fins to transfer the heat into the environment.
ratboy666··on SQLite Query Language: upsert
Since sqlite uses fossil for its scm, I thought that fossil drove the web site. It does for fossil.

https://www.fossil-scm.org/index.html/doc/trunk/www/index.wi...

ratboy666··on A History of APL in 50 Functions
It is trivial -- mostly, and for IBM APL2 and GNU APL. I have quoted the GNU APL manual below. Note that J, K, etc. are richer, and have different rules. APL is standardized (ISO), but GNU APL attempts to be IBM APL2 and ISO compliant (ISO/IEC 13751:2001).

Note that each (¨) is an operator -- there is no ambiguity.

      ⍴¨(1 2 3)(1 2)(1 2 3 4 5)
  3 2 5
which (I suspect), you would rather

each(rho, ((1 2 3) (1 2) (1 2 3 4 5)))

So -- your example would be (better)

transpose(take(each(index, x), x))

Quoting the GNU APL manual:

"There are 4 APL symbols / ⌿ \ and ⍀ that can be functions or operators, depending on their context (i.e. depending on the APL tokens left of them). Neither the ISO standard nor the otherwise excellent IBM APL2 language reference manual explain the rules that decide whether, for example /, should mean ’function compress’ or ’operator reduce’. In simple cases the meaning of / is obvious: +/B means ’operator reduce’ while 1/B means ’function compress’. "

" an become more complex if index brackets or parentheses are involved. The algorithm used in GNU APL for classifying / and friend is (simplified) this:

   1.  / ⌿ \ and ⍀ are tokenized as operators

   2.  Scan the tokenized statement from left to right to find / ⌿ \ or ⍀

   3.  If a / ⌿ \ or ⍀ is found, go backwards until a constant, or a function, or a user-defined name is found: 3a.  if a constant, a function, or a user-defined name is found then →4 3b.  if ) is seen then skip over it, That is, a parenthesized expression is entered.  3c.  if ] is seen then skip until the corresponding [ is found, That is an index list or axis is skipped over.  3d.  otherwise: SYNTAX ERROR

   4.  decide the role of / \ ⌿ or ⍀ based on the kind of token that was found in 3a: 4a.  function: leave / as operator as initially tokenized 4b.  constant: change / from operator to function (compress) 4c.  see below

   This works fine except in case 4c.  which cannot be resolved at ⎕FX time.  For this case we introduce the following convention:

   A user-defined name is assumed to be a function (and hence / is an operator) unless the name (and nothing else) is enclosed in parentheses. For example:

       A  / B    ⍝ A is function, therefore / is operator

      (A) / B    ⍝ A is value, therefore / is function

   This rule is moderately compatible with ISO and APL2; in APL2 (A) would be redundant parentheses so in that case there would be a small incompatibility between GNU APL and IBM APL2.
"
ratboy666··on A History of APL in 50 Functions
From GNU APL --

      )help ≢
    monadic function: Z ← ≢ B  (Tally)
    Returns the number of elements in the first dimension of B.

    dyadic function:  Z ← A ≢ B  (Not match)
    Returns 1 if A has not the same shape and ravel as B.
But, this is a dyalog expression (which is not an ISO standard APL). Still, the symbol meaning is pretty much the same.
ratboy666··on A History of APL in 50 Functions
Reads left to right. Executes right to left.

APL doesn't have precedence rules. 5 times 4 plus 1 is 25 (1 plus 4) times 5. Turns out reading left to right works.

So the tree is trivial.

← PreviousPage 4 of 7Next →