Tag: Python

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.

What does it take to become a computer programmer

So this thread on Slashdot got me to thinking.

A few years back I was doing program reviews for the State Department of Education. It was an eye opening experience I’ll tell you that. By and large most of the teachers I had interacted with were on the ball, but there were a couple that had I the ability, I would have terminated immediately.

One was a class in which they were learning about the Microsoft Office suite. A laudable goal I suppose. But me being the never happy with the minimum type had a sour taste on this review.

Why? Because on the day we were there the class was working on a payroll spreadsheet. But what really caught my attention was the fact they were using a tax lookup sheet, a physical piece of paper that showed the tax for a given amount.

So I asked the teacher if she had anything planned to use VBA or Visual BASIC for Applications.

The teachers answer was that you needed all sort of math to program a computer and my response was “If you have a semester of Algebra I you can get by.”

In fact I’ll clarify, all you need to do is understand Boolean logic.

There are several constructs in Boolean:

AND
OR
XOR
NOT

Believe it or not, you learned about this in Algebra I. Yes you did, because Boolean math aka Logic is part of it.

I’ll take it one by one. But first know that for an evaluation to be true the conditions particular to the operation need to be met.

In the case of AND, both inputs need to be true in order for the output to be true.

In the case of OR, only one or both of the inputs need to be true for the output to be true.

In the case of XOR (Exclusive OR), only one of the inputs can be true, not both, for the output to be true.

In the case of NOT, the input is inverted. If a true condition is the input the output is false.

As for mathematics themselves, if you know about integer operations such as modulus, absolute value, and a few other tricks you have the skill set to learn a programming language.

All you have to do is learn the syntax of a programming language. The BASIC language is fairly forgiving. But PHP, Python, and a whole slew of languages, even the overly verbose COBOL use plain English in most cases.

Sure, in some there are constructs like:


if(a && b = 1)

Which translates to do something “if both a and b are true”.

Yeah that simple.

A loop:
for(a=0,a<=10,a++)

Translated that means execute a loop using variable a as the index. Continue to run the loop while a is less than or equal to 10. The final part that ‘a++’ says to increment a.

Simple.

That’s C style above.

BASIC is even easier.

if x=y then

Whatever follows the ‘then’ keyword is executed if the test x=y evaluates as true.

So let’s say x=1 and y=1 – that would evaluate to true because X=Y.

The for loop:

for i = 1 to 100

Use variable i as your index variable. Loop through until 100 loops.

Hope that demystifies programming just a little bit for you.

Mea Culpa on Udacity

I had posted before where Udacity wasn’t working at all. I couldn’t drop courses, see the videos, etc. despite trying via multiple different browsers.

If you read my post about Problem Solved then you know I replaced my WiFi card on my computer.

I’m happy to report that Udacity now works. So I’ve re-registered for CS101 – Building a search engine. They’ve also added a number of new courses such as those marked with an ‘*’ are ones I wish to attend, a ‘**’ is one for which I have registered:

CS101 – Building a Search Engine(**)
CS212 – Design of Computer Programs
CS253 – Web Application Engineering (*)
CS262 – Programming Languages (JavaScript and HTML) (*)
CS373 – Programming a Robotic Car(*)
CS387 – Applied Cryptography(*)

It’s definitely going somewhere. I love it. The new CS101 starts tomorrow. This time I’ll be able to do it because I don’t have a network card stuttering along.

So my apologies to the team at Udacity. I look forward to the class!

Tech: So much for Udacity

I may have mentioned that I signed up for Udacity courses. It’s a site spearheaded by Sebastian Thrun, the Stanford professor involved with the autonomous vehicles in both the DARPA challenges.

I signed up for CS101 which is their intro Python class that will ostensibly give the skills to build a search engine. I know a bit of Python already and was really looking forward to this in order to expand my Python skills.

I also signed up for CS373 – Writing code for an autonomous car. That takes the Python even further.

But even though my logon works on Udacity, I cannot access any of the course content. I tried using Firefox 3.6.22, 3.6.27, and 10.0.2 with no success. IE8 also failed to load course content and so too Google Chrome 17.0.963.56m.

So maybe it was my computer itself, nope. Other flash and javascript based sites work just fine.

So I fired off an email to their support people. I told them that in IE8 it would not load. They shot back with this:

This is a common problem if you have any of the following running: adblock, flashblock, noscript, httpseverywhere. In order to view the site you must have these disabled.

Now note I had said IE8. They probably looked in their apache logs and found I’d tried to access with Firefox.

So I decided to try it from my cell, and the Safari based browser there cannot access the Udacity course content.

The last email I sent them was that I’l revisit Udacity in a few months once their javascript code straightened out.

I can’t fault them too much, if you hit the Udacity site you see they put the Beta tag right on the header. So I’ll check back in a couple of months to see if things have leveled off.