Learntofish's Blog

A blog about math, physics and computer science

Archive for December, 2011

Inspiring advice from Marissa Mayer

Posted by Ed on December 27, 2011

Watch the inspiring commencement given by Marissa Mayer below.  She is vice-president for search products and user experience at Google.

 

Advice from Marissa Mayer:

1. Find something you are really passionate about.

2. “It’s not what Zoon knows but how Zoon thinks”
Knowledge is not as important as the ability to view things in a different way.
Become a good problem solver instead of a memorizer.

3. Find the smartest people you can and surround yourself with them.

4. Find allies rather than adorers.

5. Find the courage to do things you are not ready to do.

6. Find places where you are comfortable.

7. Help other find things. Be an information foundtain.

Posted in Education | Tagged: , , | Leave a Comment »

Fear Is the Mind-Killer

Posted by Ed on December 27, 2011

 

After having watched the video above one of the youtube commenters posted something interesting:

I must not fear.
Fear is the mind-killer.
Fear is the little-death that brings total obliteration.
I will face my fear.
I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing.
Only I will remain.

I looked it up and found out that it’s from Dune, also known as Litany against Fear.

Posted in Education | Tagged: , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 10

Posted by Ed on December 26, 2011

This is the continuation of the Python OOP tutorial. Today I want to describe how you can use Python in Eclipse by installing PyDev. Here, I will assume you have Eclipse installed and some familiarity with it.

Eclipse is a wonderful IDE known to Java users. I like it because of its auto-completion feature, e.g. if you use the dot operator on Read the rest of this entry »

Posted in computer science | Tagged: , , , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 9

Posted by Ed on December 25, 2011

This is the continuation of the Python OOP tutorial. Today I want to talk about private variables and methods.

Private variables
Consider the class below. It describes Read the rest of this entry »

Posted in computer science | Tagged: , , , | Leave a Comment »

Bell’s theorem easy explained

Posted by Ed on December 21, 2011

Bell’s theorem states that quantum mechanics is not compatible with a theory of local hidden variables. In other words quantum mechanics can not both be (i) local and (ii) realistic (see also the wiki entry on principle of local causality) where with realistic I mean Counterfactual definiteness. Here are a few sites with an easy to understand explanation of Bell’s theorem.

1) Spooky Action at a Distance – An Explanation of Bell’s Theorem
by Gary Felder
This article is easy to understand and only basic mathematics is used.

2) Does Bell’s Inequality rule out local theories of quantum mechanics?
Updated May 1996 by PEG (thanks to Colin Naturman).
Updated August 1993 by SIC.
Original by John Blanton.
This article is more Read the rest of this entry »

Posted in physics | Tagged: , , , , , , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 8

Posted by Ed on December 11, 2011

Update (03 Jan 2012):
When I wrote this tutorial I erroneously assumed that call by value and call by reference also exist in Python. However, I learned today that this is not the case. In Python you have something called call by object reference meaning:
– The value of a reference is copied. Keep in mind that the value of a reference is an address (see further reading down below).
– Everything in Python is an object, even integers. For example, b=1 means an object with value 1 is created (right hand side) and b (left hand side) is a reference to that object. Try this in the Python-Shell:

>>> b = 1
>>> id(b)
505497992
>>> b = 3
>>> id(b)
505498024

With id() you can check the address of b. You will notice that b has another address after the “assignment” b=3.

See my post: Call by Object Reference (Call by Sharing)

The section below was written before I knew about call by object reference.
—————————————————
 

This is the continuation of the Python OOP tutorial. Here I want to talk about the difference between call by value and call by reference. Besides, I’ve already explained something similar using C++ here.

Example 1 – Call by value:
Consider this code Read the rest of this entry »

Posted in computer science | Tagged: , , , , , , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 7

Posted by Ed on December 10, 2011

This is the continuation of the Python OOP tutorial. Last time we addressed modules. Here, I want to talk about a special expression. When reading other people’s modules you may encounter this expression at the end of their module:

if __name__ == "__main__":

Let’s write a module (in other words: a Read the rest of this entry »

Posted in computer science | Tagged: , , , , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 6

Posted by Ed on December 10, 2011

This is the continuation of the Python OOP tutorial. Here, I will talk about modules in Python.

Before I address modules I want to Read the rest of this entry »

Posted in computer science | Tagged: , , , , , , , , , , , , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 5

Posted by Ed on December 10, 2011

This is the continuation of the Python OOP tutorial. Here, I will talk about inheritance. The general syntax is:

class DerivedClass(BaseClass)

Example:
Last time (in part 4) we wrote a Vehicle class that allowed us to create objects with Read the rest of this entry »

Posted in computer science | Tagged: , , , , , , , , , , , | 3 Comments »

Python: Difference between print and return

Posted by Ed on December 9, 2011

When I began programming I was confused by the difference between print and return. Here, I want shed some light on the difference.

Consider the Read the rest of this entry »

Posted in computer science | Tagged: , , , , , , , , , | 3 Comments »