Month: March 2018

A short tutorial on Python

So I did a little Fahrenheit to Celsius conversion program in Python.

x = int(input(“Enter Temp in F: “))
if (x>=212):
print (“It’s boiling out there, at 100C”)
elif (x<=32):
print (“It’s freezing out there, below 0C”)
print (“The temperature in C is:”)
print ((x-32)*(5/9))

So let’s take it line by line – I put in a couple things where if the Fahrenheit temp is at 212 or above or below 32 it’ll say it’s either boiling or freezing.

First line:
x = int(input(“Enter Temp in F: “))

It says set the variable X with the value of the input from keyboard.

This block uses If statements to test whether the variable x is <=32 (Less than or equal to) or x >= 212 (Greater than or equal to)
And print is obvious – boiling at 100C or Freezing at 0C.

The above is just fluff. The real meat is here

print ((x-32)*(5/9))

That says take the value of x minus 32 then multiply that result times (5 divided by 9). Then the print displays the temperature in Celsius.

You see all I ever did with python is modify scripts. But now I have a grasp of it beyond that.

A Treatise on Thinking

Someone and I were discussing the morass that infects congress and the presidency in the United States and how people can consistently be counted on to vote against their own self interest.

That got me to thinking. There’s a reason why this is so and some theoretical on my formation of this post.

How it got that way is Republicans of course – education policy is keep them just smart enough to push a pencil or push a button, but not enough to think about how they’re getting fucked at every turn. For an example, how many schools still teach civics? It was on the way out when I was younger – my political awakening happened early on as my family was heavily political and I’ve met pretty much every mayor the city has had plus governors, senators, etc. I know how the game is played and never want to be a politician – wouldn’t mind owning a few someday though.

Now in our discussion today I said it’s not so much because thinking is hard, but because it’s hard to reconcile what you know to be truth against the bovine effluent of others. You know both of us have met numerous millennials – my experience in the I.T. world had told me that most people are in fact sheep. But then in our social life there are millennials whose idea of cool is a mirror in a vintage clothing shop. Yeah, I weep for the future.

But it’s not all gloom – we can in fact tell people it’s ok to think as long as you can accept the rabbit hole that some people can go down. It’s a bit like how sausage is made. And some people are very squeamish about stuff like that – including blood which never really bothered me.

And I term it as gumption, like getting up and learning something new. I do that regularly. And people even some of the millennial generation – they do have it like I do. I know that sometime thoughts can go into the dark recesses but that’s the fun of it.

In fact what brought this up was a question on a Quora forum – what would you send back to the past. I thought for a bit and said either a Bible in the local vernacular or Darwin’s Origin of Species in very same local vernacular. Just imagine what effect that would have some 2000 years later.

StackSkills – Studying Deeper Python

So I’m going from the beginning on Python. Haven’t used it some time. But it’s always good to have.

I note – all of the presenters seem to be from the Indian continent. I do wish they’d allow commenting because I’d ask they normalize the volume on the presentations.

And if you’re wondering what Python is – it’s a language and I see lots of parallels with the C language and with BASIC of all things. Interesting. It’s used a lot on the web and in fact my exposure to it came from Zope/Plone.

Frontline: Bitter Rivals Iran and Saudi Arabia

So if you haven’t been hiding under a rock you have some awareness of two things.

First – Islam is split among two main lines – the Sunni and the Shia. And the kicker if you will is what the true difference is between those two groups. It’s the order of succession after the prophet back in the 7th century. Yeah – 14 centuries and they still can’t settle that difference.

And PBS Frontline is doing a nice job – showing that Iran and Saudi Arabia are fighting proxy wars in Syria, Yemen and of course the U.S. was in Iraq, Afghanistan. You get the idea.

I think I know why all this is happening. You see it wasn’t until pretty much modern times that sectarian violence erupted in the Middle East and Persia. I think the U.S. does in fact have blood on its hands as we’re the ones who supply Saudi Arabia with advanced weaponry and the House Of Saud has been beating the hell out of Yemen  – why – because there’s a Shia group there who poses a threat to access to the rest of the world should push come to shove.

But I think the ultimate battle whether they’re prepared or not will be Saudi Arabia vs. Iran. Why do I see that? Because the destruction and deaths will be such that OPEC would be shattered, that there won’t be any resistance throughout the Middle East, Persia et al. Just look at Syria and Yemen for crying out loud, they’ve essentially been bombed back into the stone age.

And what is the long view on this – so the U.S. and it’s pal the UK can send our corporations in there to run roughshod over what remains to extract the last bits of oil. That’s what is pushing sectarian violence ahead.

And if I can to my Muslim brothers and sisters – hash out the difference and learn to live with it. Because if you don’t you’re going to find yourselves pounding sand.