Wednesday, October 16, 2024

How to update file types in Linux Mint

I have spent the last few hours trying various things to update the .odin file type associations in Linux Mint.  Here is what I found that actually worked.

Open /usr/share/mime/packages as root.

Create a new file called your-file-type.xml.  The one I created is: x-odin.xml
(The "x-" follows an established pattern for programming source code.)

Inside this file, have text similar to the following, but with your information replacing the bits in color:

<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="text/x-odin">
    <comment>Odin source file</comment>
    <generic-icon name="OdinO"/>
    <glob pattern="*.odin"/>
  </mime-type>
</mime-info>


The "glob pattern" line is where you associate the file extension.  "*.odin" means any file ending with ".odin".

Place various sized versions of the icon you want to use in the various size folders in: /usr/share/icons/theme-name/mimetypes.  In my case, that's /usr/share/icons/Mint-Y/mimetypes.  Make sure the icons are all named the same as the whatever you use in the generic-icon-name line above.  .png files seem to work well, but make sure you create a large one, and then scale it down to the various sizes (16, 24, 32, 48, 64, 128 pixels).

Once you've done all that, open a terminal in the /usr/share/mime/packages folder and type (replace x-odin with your file name):

    sudo xdg-mime install --mode system x-odin.xml

    sudo update-mime-database /usr/share/mime


Once the system has finished updating, behold your newly associated file type with its lovely, hand-crafted icon.  Now, all you have to do is associate the file type with a program to open it.  That's done by right clicking on an appropriate file, selecting "open with", "other application", choosing the proper application, and then clicking on "set as default".

That's all you have to do.  Why is it this convoluted?  I'm guessing historical reasons, as in they made it up as they went along.  Simple is much, much more difficult to achieve than complex.

Sunday, October 13, 2024

Space-X did it!

Just a few minutes ago, millions of people watched Space-X launch Starship, recover the booster with 'Mechazilla', take Starship up to orbit, then drop it back down for a soft landing in the water precisely on target.

They did it.  The crazy geniuses actually did it.

Remember this day.



Saturday, October 12, 2024

The four types of programming languages

There are four types of programming languages.  I'm not talking about the religious differences between object oriented, procedural, and functional languages.  I'm talking about something more fundamental - syntactic structure.  The vast majority of computer languages (excepting esoteric or very primitive ones) fall into the four camps of ALGOL, LISP, APL, and Forth/Joy.  These differ based on how you read and understand the code.

Note:  Examples are not necessarily valid code in these languages.

ALGOL:  Left to right (left or right associative based on what makes sense, usually), prefix (except infix operators like '+' and '*'), inside out.  These are the procedural languages most programmers are familiar with.

    command(arg1)
    command(arg1, arg2)
    command(arg1, arg2, arg3)
    command-a(arg1a, command-b(arg1b, arg2b), arg3a)
    add(1, 2 * 3)
    if (3 > 2) then {print("true")} else {print("false")}


LISP:  Left to right (no associativity), prefix (always), inside out.

    (command arg1)
    (command arg1 arg2)
    (command arg1 arg2 arg3)
    (command-a arg1a (command-b arg1b arg2b) arg3a)
    (add 1 (* 2 3))
    (if (> 3 2) (print "true") (print "false"))

    

APL:  Left to right (right associative), prefix or infix, inside out.  It's easier to read right to left.

    command1 arg1
    arg1 command1 arg2
    there are no 3 or more argument commands in APL
    arg1a command-a arg1b command-b arg2b
    1 add 2 x 3            this is the same as 1 add (2 x 3)
    
3 > 2 ⍳ ⎕  ← "true" ⋄ "false"            I got this from an AI prompt.  APL is weird.


Forth / Joy:  Left to right (usually no associativity), postfix (usually, unless it's immediate, which looks like prefix or infix).

    arg1 command
    arg1 arg2 command
    arg1 arg2 arg3 command
    arg1a arg1b arg2b command-b arg3a command-a
    2 3 * 1 add
    Forth:  3 2 > if "true" print else "false" print then
    Joy:  3 2 > ["true" print] ["false" print] ifte


The ALGOL (procedural) family of languages make regular use of syntactic sugar to make reading the code easier.  The annoying-to-learn syntax is what makes it more readable, and programmers spend much more time reading code than writing it.  That's part of why they have mostly conquered the programming world, despite the niche technical superiority of the other language styles.  



Wednesday, October 2, 2024

What is woo-hoo?

Scientific woo-hoo is the propagation of nonsense.  It is the belief in magic, draped in the robes of science.  The Copenhagen interpretation of quantum physics has done more harm to science than even the global warming cash and power grab.

Woo-hoo is the belief that particles don't have properties until a scientist measures them.  They really believe this, because they have been carefully trained, for generations, to not think.  (Don't believe me?  Look up the history of rogue waves in the ocean.  Despite sailors knowing about them for millennia, they "didn't exist" until scientists finally documented one hitting an oil platform in 1995.)

Woo-hoo is the belief that math is more real than reality, that models are more important than observation, that the map really is the territory, that doctrine is more important than thought.

Woo-hoo is the belief that a particle in a superposition is actually in multiple states and multiple places at the same time.

Woo-hoo is the belief that in a double split experiment, a single photon splits itself into multiple existences, some traveling slower than the speed of light while others travel faster, so it can interfere with itself along the way to the detector.

Woo-hoo is the belief that entangled particles don't have properties until a scientist measures one of them, then the other instantaneously becomes something as well.  This is the belief that if you flip a coin and see heads on top, the bottom suddenly and magically becomes tails.  The belief that if you take a pair of shoes, randomly place them in separate boxes, and mail one box to China, that box will suddenly and magically contain a left shoe the instant you open the other box and find it contains the right shoe.

Woo-hoo is the ongoing experiments to see if a particle quantum tunneling through a barrier teleports or moves faster than light.  The reality is so much more simple.  The particle tunneling its way out of a barrier does so because at that random instant, the barrier isn't there.  A tunnel momentarily opens up through sheer Brownian chance.  The particles and fields comprising the barrier have randomly moved and changed in such a way that the barrier is no longer a barrier at that particular time and place.  If you shake a box of ping pong balls long enough, while looking through a pair of holes on opposite sides of the box, there will eventually come a moment when you can see clearly through the box because all the balls are randomly not in the way.

Woo-hoo is believing that black holes really are singularities of infinite density, with alternate universes inside them.

Woo-hoo is actually believing the 'many worlds' hypothesis is in any way scientific.

Woo-hoo is the uncritical belief that Bell's theorem disproves local realism, despite Bell's inequality being obviously based on a strawman argument.  (Bell "proves" that triangle waves are not identical to sine waves, that straight lines are not curves.  The fact that nobody ever suggested they were somehow seldom gets mentioned, and those who do quickly lose their jobs and voices in the industry.  Pour encourager les autres.)

Woo-hoo is the unquestioning belief that the expansion rate of the universe randomly changes over time, never asking how or why.  So many questions left unasked - how would the rate change everywhere, evenly, at the same time?  If this is a real effect, and I am by no means assured it is (there are a lot of adjustments made to observational data), then it is the most definite proof of the existence of God I have ever seen.

Woo-hoo is strangling science through magical thinking.

Sunday, September 29, 2024

Spacetime, again

I dislike repeating myself. However, the contradictions at the heart of modern physics annoy me even more.  I despise all the self propagating woo-hoo and lack of thought.

The basic principles of spacetime: 

1) There is no such thing as negative (anti) energy. Some forms of energy are opposites, but all are energy.

2) Proper time is potential energy. (This is well modeled in particles as imaginary spin. Anti-particles have the opposite spin.) 

3) The energy density at every point is a constant. (upper limit = Planck, lower limit = 0) 

4) Spacetime is the field governing motion. (Particle motion is a perpetual, localized wave. This creates blue and red shift all by itself.) Note that none of these simple principles violate observations. 

There are no contradictions, no infinities, no singularities. Black holes are not singularities, they are hollow shells of maximal (Planck) energy density surrounding an area of zero potential energy.  Space is flat (Euclidean), (proper) time is imaginary, spacetime is hyperbolic (because when you square an imaginary number, you get a negative real number).

Saturday, September 21, 2024

The contradictions at the heart of physics

Modern physics is broken because physicists have been carefully taught to not think.  I mean this quite literally.  "Shut up and calculate" is the prevailing model of the universe!

Let us take something simple - the uncertainty of knowledge.  Okay, maybe it's not that simple.  But it should be.  Quantum physics states quite plainly that all information is locally hidden until a measurement is made.  It actually goes further to say the information doesn't exist until the measurement is made, but that's a separate idiocy for another time.  Quantum physics also states that, due to Bell's inequality, local hidden information is impossible.  The vast majority of physicists take both of these propositions to heart without any critical reflection whatsoever.  Thus, they internalize contradictions as part of their formal training.

Please forgive my repeated rant here against Bell's inequality.  In his papers, Bell carefully sets up a straw man argument, then knocks it down.  Thus, using his paper as proof, you can make the most outlandish claims - that entangled particle pairs cannot contain hidden information (even as the information must be hidden due to the probabilistic nature of the quantum wavefront), that the particle pairs communicate instantaneously over great distances when you finally do measure them, and that there is no such thing as local realism.  These claims are only possible due to the nonsensical nature of Bell's inequality.

What is the problem with bell's paper and its famous inequality?  What is the inequality?  In summary, Bell showed that sawtooth waves are not identical to sine waves.  Shocking, I know.  Where do the sawtooth waves come from?  He made them up with mathematical sleight of hand.  There has never been the slightest indication that any particle acts in any way like a sawtooth wave.  And yet that's what Bell uses to claim that entangled particles must communicate instantaneously, and that there is no such thing as local realism.  I'm quite serious.  Go read the paper yourself, and marvel at the hubris used to create the straw man sawtooth particle.  Then cry that it has been taken very, very seriously indeed by generations of scientists.


By the way, I'm not the first to notice this.  Some scientists have complained about it since just a few years after the paper was published.  However, these men seem to share similar fates in having their funding mysteriously cut off after announcing that the emperor has no clothes.  And those who spend tens of millions of dollars proving the tautology (waves act like waves) win Nobel prizes, thus reinforcing the power of "woo-hoo" politics in modern physics.  Shut up and calculate!

Tuesday, September 17, 2024

Closures

In programming, a closure seems to be this mystical thing.  There are endless reams of research and obscurely technical explanations of what a closure is and how they work.  I hate, loathe and despise needless complexity.

A closure is a function to be used later, which uses some of the data currently available, packaged together.  Enclosed, if you will.

So, in Listack terms, if you have a data stack, and a function to be used later that depends on the current state of some of the data, you package together the data with the function for later use.  This is a closure of the function over the data.  So, if you have a function that will depend on two data objects, you write:

        rest_of_stack data1 data2 \.func 3 .enlist >block  

which produces:

        {data1 data2 .func}

When the later time finally arrives, you simply invoke the closure.

        rest_of_stack {data1 data2 .func} .eval

We could even make a procedure to create closures.  Note that most of the procedure is purely for error handling.

    def: "make_closure" [Seq, Int]
    {    # will make a closure over n data items and one sequence
        dup < o     # the closure can't contain fewer than no data items
        iff {
            drop drop 
            "Closures may not have a negative number of arguments" .set_err
            exit
        }
        dup > (depth - 3)     # must have enough items on the stack
        iff {
            drop drop 
            "Stack not deep enough for number of closure arguments" .set_err
            exit
        }
        1 .+  .enlist >block        # the actual closure: {d1 d2 d3 ... dn seq}          
    }

    def: "make_closure" [Block, Int]
    {    # could also be:    \.eval swap 1 .+ .make_closure
        swap >seq swap .make_closure
    }    # could have used dip instead

    def: "make_closure" [Word, Int]
    {    # a b \func .dip --> a func b
        \>seq .dip .make_closure
    }    # could have just repeated the original definition, but where's the fun in that?