Skip navigation

Tag Archives: Google

So I log into Google and go to start a chat with someone and see this:

google

After all the recent security issues, makes ya think about this type of warning!

Dear Google, please unfuck yourself here.

kthxbai.

Since we’re on the topic of bullshit….

Stop the DRM in HTML5
More than 29,500 people have signed.

Hollywood is at it again. Its latest ploy to take over the Web? Use its influence at the World Wide Web Consortium (W3C) to weave Digital Restrictions Management (DRM) into HTML5 — in other words, into the very fabric of the Web. Millions of Internet users came together to defeat SOPA/PIPA, but now Big Media moguls are going through non-governmental channels to try to sneak digital restrictions into every interaction we have online. Giants like Netflix, Google, Microsoft, and the BBC are all rallying behind this disastrous proposal, which flies in the face of the W3C’s mission to “lead the World Wide Web to its full potential.”

So get on over here, read more and sign the petition!

I ran across an odd article the other day and it was about a Mysterious Barge that is supposedly owned by Google.

SAN FRANCISCO — The Coast Guard on Wednesday visited the mysterious “Google barge” floating in San Francisco Bay, but the agency would not reveal anything about the tech giant’s hush-hush vessel.

GTY 186321586

I didn’t think too much of it and figured it would make the tech rounds once there was some sort of public release of details.  Then I ran into a random blog which had some curious postings that really started putting things together.

Data centre in a shipping container:


And earlier in this posting:

Google: Cyberpunk as hell

Slashdot links to Bob Cringely’s usual brand of wild conjecture, this week about Google. But, man, this paragraph plays right to everything that I find exciting about computers:

The probable answer lies in one of Google’s underground parking garages in Mountain View. There, in a secret area off-limits even to regular GoogleFolk, is a shipping container. But it isn’t just any shipping container. This shipping container is a prototype data center. Google hired a pair of very bright industrial designers to figure out how to cram the greatest number of CPUs, the most storage, memory and power support into a 20- or 40-foot box. We’re talking about 5000 Opteron processors and 3.5 petabytes of disk storage that can be dropped-off overnight by a tractor-trailer rig.

Remember that X-Files episode (perhaps one of the ones scripted by William Gibson) with a secret shipping container down at the docks full of busy rack-mount hardware and workstations?

****

So, guess we kinda already know what is in the barge then huh?  Some sick amount of CPUs stuffed into an endless supply of cooling fluid.  Next up, environment report that Google is now the cause of the ocean’s water temperature rise.

What I love about the Internet is the community that happens at times.  I posted my game code up for all to see and review and I received a lot of good feedback.  One guy, Bob, event went out of his way to help me understand classes and wrote up a basic structure for my style of game.

from collections import OrderedDict # for storing menus.

# adjust for Python 2 or 3
import sys
if sys.version[0] >= ‘3’:
getUserInput = input
else:
getUserInput = raw_input

def main():
place = ‘road’ # starting place
while place:
place = places[place].enter()
if not place:
ans = getUserInput(‘enter yes if you want to play another round.’)
if ans == ‘yes’:
place = ‘road’

class Choice:
def __init__(self, prompt, next, description=None):
self.prompt = prompt
self.key = prompt.partition(‘ ‘)[0].lower() # get 1st word of prompt
self.description = description
self.next = next

class Place:
defaultChoice = Choice(”, ‘cycle’, “I don’t understand that!”)
def __init__(self, name, description):
self.name = name
self.description = description
self.choices = OrderedDict()
self.menu = ”

def addChoice(self, choice):
key = choice.key
self.choices[key] = choice
self.menu += choice.prompt + ‘\n’

def enter(self):
print(self.description)
while True:
userChoice = getUserInput(self.menu[:-1]).l

ower()
choice = self.choices.get(userChoice, self.defaultChoice)
if choice.description:
print(choice.description)
if choice.next != ‘cycle’:
return choice.next# create the kingdom
places = {}place = Place(‘road’, ‘You are standing on a road. Nearby is a small house’)
place.addChoice(Choice(‘Enter the house’, ‘house’))
place.addChoice(Choice(‘South’, ‘road2’))
places[place.name] = placeplace = Place(‘road2’, ‘You are standing on a road, surrounded by howling wolves.’)
place.addChoice(Choice(‘Run for your life’, ”, ‘outrun a wolf? ha!’))
places[place.name] = placeplace = Place(‘house’, ‘You are in a small house. There are keys here. A stairway ascends.’)
place.addChoice(Choice(‘Climb the stairs’, ”, ‘your foot breaks a weak riser and you fall to your death’))
place.addChoice(Choice(‘Exit’, ‘road’, ‘you leave the house’))
places[place.name] = place

main() # start the game

I tried running it and get an immediate error.
ImportError: cannot import name OrderedDict

Well, let me do some research into this and see if it’s just a Python version issue because in the code there is something about checking version and using different routines.

Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2

Ah ha, the Docs on OrderedDict say new for version 2.7 whereas I seem to have version 2.6.  How odd though, I thought I was running 2.7 all this time.  Off to Google to find a link/how-to on this.

I found this link, which does include an automated script to do the update for you (this one compiles from source) but experience has shown that such things never turn out exact and I really can’t be bothered to spend hours and hours trying to figure out what went wrong.

Then I found this link, which suggests using a mix of Debian versions, which I know causes bad things to happen.  Besides, Debian Wheezy is now stable and as soon as I get an external HD, I’ll be backing everything up and upgrading my OS, which includes v2.7 of Python.  So, time to wait then I can try this code out.

I will say this though.  From what I read in the above code, I’m not convinced that it will be any easier to program.  It just doesn’t look/feel intuitive enough when trying to debug an error message that might come up.  That and it seems to scream ‘complication’ when the following is to be adhered to.

      The Zen of Python

    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!

Side Note: Why the hell is WordPress suggesting “Pink(singer)” for this post?!?! Also, they suggest ‘transportation’ for just about every, single post I have written for any of my blogs here after the publish phase.  What gives WordPress??  You desperate for some Transportation posts??

This is because of 1 part headache brought on by two parts ‘staying up till 6am to get this weeks project done’.  Don’t worry, an Ibuprofen and a good mug of cold-brewed coffee will clear that up in about 30mins 🙂

The idea of programming is to learn something, then build some code, learn something more, add it to previous knowledge, build better/more elabourate code and so on.  This is something I think is a good process.  And a course that can coax it’s students along with the right methods is one you will never forget.  On the flip side, one that does this but kinda skips over various things with the idea of ‘you can find it online’ really irks me.  I really feel that the progression of learning is NOT linear with the Coursea/RICE University course.  There are major gaps in my understanding of what is happening within the code we are supposed to be writing.  I am getting lots of good help from some of the students who hang out in IRC, for which I am ever grateful.

I’d like to also point that their “Workload: 7-9 hours/week” claim is utter bullshit.  I mean seriously, where do they pull that number from?

This course is designed to help students with very little or no computing background learn the basics of building simple interactive applications.

Right, so here I am, a technician who has been playing with computers for 30 years, designed websites in the early HTML days (so I have a general idea of coding….very general), had fiddled with CSS and WordPress templates and I understand how computers/networks work and yet this course has been nothing but a struggle.  From the time I woke up yesterday till the time I went to sleep, I spent nearly 16 hours on the course.  This was just insane.

I am far from someone who has “very little or no computing background” and having this much hard time?  You think that their course needs a severe overhaul on how they progress their teaching?

Sure, I’m not expecting to be spoon-fed every little piece but when you are forced to program in an environment that is mostly non-standard(meaning most Google results for problem solutions will never apply because of  many restrictions in place.).  I do understand why they use CodeSkulptor, but I feel if you are going to create an artificial environment, you need to be much more involved in the students learning.  Notice I said learning and not helping.  Sure there are many avenues of help, the forums, IRC(sadly under utilized really, people are so missing out), the minimalistic docs they have, the ‘code clinic threads’ and such but that is all reactive.  In order to ask a question, we have to be knowledgeable enough to ask how to do something, not ‘what’ should we be doing.  Also, their assumption of ‘high school’ math requirement does NOT mean ANY high school math.  You have to have that knowledge and have it as recent in at least the last 5 years!  Anything beyond that and you will have a hard time because there is a lot of math in programming.  I highly recommend going through Khan Academy‘s math lessons.  They have an awesome way to track and incrementally increase the parts you are learning.

The instructors themselves have some cool character to them.  When they do their videos, they do them well, I find that they just don’t go far enough.  In my opinion, I think the course should be doubled in length and more time spent on each part.  I am quite fortunate to have as much time to spend on this course as I do.  If I was working a full-time job, I would have dropped out last week when I stayed up to 4am one day.

Do all students have such problems?  No.  One guy from IRC did this weeks memory game assignment in 4 hours.  He spent the rest of the week tweaking it to be pretty and fancy for the hell of it.  He is also one of the best people to help others and I can’t thank him enough.  This also means that since he did it in 4 hours, he is not a beginner to programming either.

After all this, I think that they should either change the course or change the description of the target market for students.  Easier to change the description and create a second course I think.

Now, from here on out, it will get interesting.  See, this week’s project I scrapped my first version of the code I was writing.  That was two days into writing it, getting up to 171 lines of code only to find out that the exact same thing, that works with no bugs, could be done in just 39 lines!  I saw this code and sat there….stunned.  I started over, took some cues and was able to focus on the mouse_handler function(which is the crux of this code) only to find out a day later that it was completely buggered as well.  That was when another kind individual on IRC so graciously spent 7hrs chatting with me to help me get it right and by 6am it was finally done.

Do you still think that 7 – 9hrs of workload is accurate?

Let me also point something else out.  If it takes you 4 hours to learn something, the next time you use it technically take you less time to construct the same code.  So let’s say you can do it again in half the time, 2hrs.  Let us then apply this to my taking 4 days to learn/write a program.  So now I might be able to do it in 2 days.  With the idea that the course is building upon the skills we have learned what do you think will happen in a few more weeks?

  • wk 4: 4 days to program
  • wk 5: 2 days(wk 4 code) + 4 days (wk 5 code) = 6 days
  • wk 6: 2 days(wk 4 code) + 2 days (wk 5 code) + 4 days (wk 6 code) = 8 days
  • wk 7 1 day (wk 4 code, getting better) + 1 days (wk 5 code, getting better) + 3 days (wk 6 code, slight improvement) + 4 days (wk 7 code) = 9 days

Well, ran out of days in the week it seems and missed the deadline.  I didn’t even count the time to watch the lecture and do the quizzes.  This course has so far consumed my nearly every waking moment each week and I am not even close to being a ‘slow learner’.  The way the material is presented simply isn’t enough for “students with very little or no computing background”

 

 

Just saw this:

Welcome to Google’s Python Class — this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. The class is geared for people who have a little bit of programming experience in some language, enough to know what a “variable” or “if statement” is. Beyond that, you do not need to be an expert programmer to use this material.

https://developers.google.com/edu/python/

I’ll have to check it out, maybe if I can get this week’s project done early enough.

Again I keep running into annoying issues with poorly worded problems or answers.

First, the simple one.

I gave up on trying to finish that last ‘practice exercise’ because it was involving some ‘quadratic equations‘.  Those words scare me.  Big equations freak me out because they are so far beyond my level of mathematical comprehension that I simply cannot fathom.  More on that in a bit.  The simple problem is that when things are not consistent, it’s a little weird.  Our project gives us some decent outlines on how to do things without obviously giving us the direct answer.  The first outline says to “Build a helper function name_to_number(name)”  Ok, that’s easy enough for me to understand and figure out.  The second in the list says Next, you should build a second helper function number_to_name(num).  This too is easy to figure out.  For each of our exercises and this project, we are given an outline that gives us even more guidance. (This is a really good idea to help beginners speed along in their process of learning a new language).  The inconsistency happened when the project template has both of those functions outlined in reverse order.  While theoretically this does not affect the outcome of the program I learned, it is still one more thing I have to question because it doe snot seem logical to have code ‘out of order’, regardless of if it affects it or not.

Second, insufficient definitions.

There are a ton of websites that will give you a definition of a piece of code and what it does.  One would expect that official code documents to give thorough, if maybe overly techie in nature.  Well, how wrong this can be.  Allow me to introduce to the random.randrange(start,stop) function.  You might be able to guess that it creates a random number for a given range, and you would be correct.  You might even guess that the ‘start’ is the first number and the ‘stop’ would be the last number.  And you would fail.  Apparently the ‘stop’ means ‘stop before this number’, or at least that was what I was told.  Me, I think it means ‘count this many numbers and then stop.’, which seems much more logical…if you are starting at 0.  Maybe not so much if your range is starting at a higher number.  So let’s see what the Official Documentation says shall we?

random.randrange(start, stop[, step])
Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step)), but doesn’t actually build a range object.

I left out step because I wasn’t using it for my program.  Regardless, this really doesn’t mean anything because it doesn’t really define the code, at best it references an older(?)/different way of doing the same thing.  OK, I’ll bite and look up THAT code then.

random.choice(seq)
Return a random element from the non-empty sequence seq. If seq is empty, raises IndexError.

Ok, this still doesn’t explain what the code means, let alone how to use it.

I would like to also keep in mind that this course is aimed at beginners. o_O

It really is annoying when you have to Google everything.  It’s like people are simply getting lazy.  Well guess what, if I have to Google for most of my solutions, don’t bitch if what I find and USE is not all my own code.  I’ll do my best to follow the honour code they put on each page that you have to check-mark before each submission, but until you have a proper course that gives the students all the resources they need, everything is fair game.

There is more but I won’t bother.

Now, this may sound like the worst course in the world but it really isn’t.  I happen to be only focusing on the challenges I have run into.  I didn’t mention how much I have learned BECAUSE of these challenges.  There are 9 practice exercises, of which only 3 gave me headaches like what I have outlined above.  The rest I was able to  figure out and move on to the next one fairly quickly.  Heck, last week I even wrote a little program to help me figure out some things in this goofy little game I am playing on my Galaxy Tab.  Sure it was not much more than a coded spreadsheet but it was my first real stand alone program that I may expand upon to give it more functions as I learn more.

For those that play Galaxy Empire on their Android (or iOS) device, here’s what I got so far.  The rest of you can stop reading…unless you like looking at a whack of lines of code 🙂

http://bpaste.net/show/SCEawXIgk4BKJnCZ5mW2/