October 10th, 2012

green leaves

Trying to learn Python, or shaving the yak

I had some aggravating fun with intro to JavaScript codecademy, and I'd heard good things about Learn Python the Hard Way, so I thought I'd take a crack at Python.

I do not guarantee that this account has every precious, annoying detail.

Collapse )
I'm supposed to have Notepad++ with Powershell. I don't know why this is better than the Python Command Line which came with the language, and which isn't working any better than PowerShell.

Powershell is apparently something like unix, but not exactly. Apparently, Powershell is a useful tool for wrangling Windows machines and/or breaking them.

I try to download modules for Powershell, but I have to be able to sign things.

I'd already downloaded Python2.7.3.
If after you install it python still isn't recognized then in powershell enter this: [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User")

and now when I type python at the prompt, I get a copyright notice and how to access help and such.

At some point in all this, I come up with "The horrible thing about computers is that they almost work".

However....

Learn how to make a directory in the Terminal. Search online for help.

Learn how to change into a directory in the Terminal. Again search online.

Nothing that I've found works. Now I know that if detailed instructions include "search online for help" I should cue ominous music. The people who wrote the instructions don't even have a good link.

I have just discovered that PowerShell for Dummies exists. Also, Codecademy has an intro to Python. I'm still curious about why I can just download perl and have it work, but Python is encased in shifting concrete-like layers of mishegos.

This entry was posted at http://nancylebov.dreamwidth.org/553529.html. Comments are welcome here or there. comment count unavailable comments so far on that entry.
green leaves

Hyperspheres: Something weird, interesting, complicated that I don't need to understand in detail

Spikey Spheres:

Suppose you have four equal circles in a box that they just fit into, and you're interested in the largest circle you can fit in the middle.....
That means that in 4 dimensions the sphere in the middle will be of radius (square root of 4) - 1 , which is 1. The central sphere is the same size as the spheres around it.

That's odd, but it gets even more interesting.

In 9 dimensions the central sphere is of size (square root of 9) - 1 which is 2. Remember, that's the radius of the central sphere, so the diameter is 4. That's the size of the containing box. The central sphere actually touches the sides of the containing box.

But wait - it gets better.

In 10 dimensions the central sphere is of size (square root of 10) - 1 which is about 2.162. The diameter is about 4.325. It pokes out the sides (and top and bottom, etc) of the "containing" box.

In fact it's not just the central sphere that gets more spikey, the surrounding spheres are also getting spikey. Each corner sphere's volume is getting smaller (as a proportion of the enclosing cube) as the dimensions go up. So it's not just just the sphere pokes through, it's also that there's more space for it in the first place.

You can also think of the corners of the cube being spikey, and the spheres are therefore packed away into the corners, leaving loads of space.

Somehow we have to see the central sphere as "poking out between" the surrounding spheres. It's almost as if a sphere in high dimensions isn't smooth, and round. It's almost as if it's somehow "spikey."


This entry was posted at http://nancylebov.dreamwidth.org/553945.html. Comments are welcome here or there. comment count unavailable comments so far on that entry.
green leaves

What's that got to do with the price of free range beef in Philly?

So I go to the farmer who'd got really good beef at phenomenal prices ($7/pound for most roasts), and practically nothing is below $9/pound.

I ask politely, and he says that the subsidies for grain are what's doing it. Even though he doesn't feed grain to his animals, they've driven up the price of land so much that it's affecting him. I'm not sure how, maybe by way of what he has to pay for loans.

I want those subsidies gone. They might have felt reasonable after the depression, when the big deal was making sure people got enough calories. However, it's turned into a monster, and I expect the same thing would happen if there were subsidies for fruits and veggies, "organic" food, free range meat, and/or locally grown food.

This entry was posted at http://nancylebov.dreamwidth.org/554065.html. Comments are welcome here or there. comment count unavailable comments so far on that entry.