A Hard Problem of Grammar: A formal logic analogue to Nagel’s bat

The hard problem of consciousness, and variations on it, revolves around the difficulty of explaining mental phenomena–I see and smell a rose; I think about my work; I feel pleased by good news–in materialistic terms.
The presumptive barrier to neurophysiological research answering this question is that objective observations which can be made by a researcher — such as, electrical current moving through neurons; a biochemical cascade releases such and such a hormone —
appear to be about completely different things than the subjective experiences of a conscious experiencer.

This objective/subjective gap has also been called a first person / third person gap: how can third person sentences such as “that neuron spiked” possibly relate to a first person sentence such as, “I see red.”

Expressed this way, the problem can be seen through the light of formal languages. This appears to make it provably insoluble. It’s a hard problem of grammar: there is no sound deduction from a set of 3rd person sentences to a 1st person sentence in any formal logic.

If subjective experience could be explained in objective terms, then that explanation—if it were a rational one—would be expressible in formal language. (This is essentially an assertion that some form of the Church-Turing thesis applies not only to mathematics and logic, but to rational discourse more widely, including empirical research).

If so, the formal version of that explanation would have to, at some point, define the word ‘I’ in ‘3rd person’ terms, that is, without relying on any first person noun or verb or other part of grammar. (This is essentially an assertion that some form of the Craig interpolation theorem can be proven for any formal grammar suitable for rational discourse. The Craig interpolation theorem says (more-or-less), that given a set of sentences only about apples, you cannot validly deduce from them any sentence about oranges.)

I assert that any such attempted definition will, on inspection, turn out to be invalid, and hence that the explanation which it supports will also fail. I do of course look forward to being proven wrong.

iTunes Home Sharing doesn’t work with AppleTV when it should

For about a year, I’ve been stumped on iTunes Sharing not working on AppleTV when it worked fine between laptops. Until today, when I accidentally discovered that iTunes -> Preferences -> Sharing -> “Share Library on Network” —which works for computers running iTunes— is not the same things as iTunes -> File -> Home Sharing, which is what AppleTV uses.

Oh well.

http://www.imore.com/itunes-9-shared-libraries-home-sharing

‘bash\r’: No such file or directory. Or, editing unix files on a Windows machine

'bash\r': No such file or directory

What does that mean, you ask yourself? It usually means you are editing *nix script files on a windows system, and then running the files on a *nix machine. For instance in docker, or a VM. Your solution is to use a text editor that allows you to save with unix line endings. `Notepad++` calls it, very reasonably, `’EOL conversion’`. Sublime text calls it `View->Line Endings`.

A further complication if you are using git is that it keeps getting reset back to windows. You could fix this with `git config core.autocrlf false` but that may have other consequences which you don’t want to bother with.

Use a public docker image in AWS ECS

Amazon Web Services carefully explain how to use a private docker image in ECS, the Amazon container service. But fails to mention what repository URL to use for a dockerhub public repository. The answer is … none at all. Just the same as the docker CLI, if you specify just namespace/imagename for a container image, ECS will pull it from dockerhub.

Postgres : Using integrated security on Windows on localhost

…is slightly less straightforward than you might hope, but helpfully more flexible. For MS SQL Server, integrated security implies that windows user are magically also SQL users and that no password or username is needed to login. But also, that you can no longer choose which user you login as. Postgres is more configurable and more complex. You can specify which users use SSPI and which postgres user(s) each windows user can login as. You can specify, for instance, that you are allowed to use SSPI to login as the postgres superuser.

Here is how you can login with integrated security, as the user postgres, whilst still being able to login as a different user with a password.

  1. Locate and open both your pg_hba.conf and pg_ident.conf files. I found them in C:\Program Files\PostgreSQL\data\pg96
  2. In pg_ident.conf add a line to map your windows login to the postgres user named postgres. You can also add other users. Here’s what my lines look like:
    # MAPNAME       SYSTEM-USERNAME         PG-USERNAME
    MapForSSPI     chris@MyMachineName    chris
    MapForSSPI     chris@MyMachineName    postgres

    (In normal unix style, the columns are separated by any amount of space or tab).

  3. In pg_hba.conf, add lines that allow user postgres to login with integrated security, whilst still allowing all other users to login with passwords. Again, you can add lines for other users too:
    # TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
    # IPv4 local & remote connections:
    host    all             postgres        127.0.0.1/32            sspi 	map=MapForSSPI
    host    all             chris           127.0.0.1/32            sspi 	map=MapForSSPI
    host    all             all             127.0.0.1/32            md5
    host    all             all             0.0.0.0/0               md5 
    # IPv6 local connections:
    host    all             postgres        ::1/128                 sspi 	map=MapForSSPI
    host    all             chris           ::1/128                 sspi 	map=MapForSSPI
    host    all             all             ::1/128                 md5
  4. Restart the Postgres service, for instance with a powershell command
    Restart-Service 'PostgreSQL 9.6 Server'
  5. Trying logging in as user postgres:
    • psql -h localhost -U postgres
  6. Trying logging in as some other user:
    • psql -h localhost -U someotherusercreatedwithcreaterole
      and you should be prompted for a password (unless you already mastered the pgpass.conf file)

Logging in without specifying a user name

You might expect that SSPI implies not having to specify a username. You would be wrong. Postgres still requires you specify a username when using SSPI, and, as above, allows you to choose which username.

You can however login without a username—with or without SSPI—simply by creating a postgres user (i.e., a role with LOGIN privilege) with your username. To let that user login with SSPI, you should still have a line in pg_ident.conf to map the SYSTEM-USERNAME yourname@yourmachinename to the postgres username yourname.

Integrated Security in .Net connection strings

Having done the above I can now use either of

"Host=localhost;Database=MyDb;Integrated Security=True;Username=postgres"
"Host=localhost;Database=MyDb;Integrated Security=True;Username=chris"

as a connection string for the npgsql Ado.Net driver

Reference

https://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html and subsequent pages on Authentication methods and the pg_ident.conf file.