Saturday, June 17, 2017

Summer of code 2017: SyntaxError: Missing parentheses in call to 'print'


As explained in my Summer of code 2017: Python post I decided to pick up Python

I looked at some examples and when I tried to run them I was getting an error

It was a pretty simple print statement

print 'Hello world'

Running that produced an error


Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print 'Hello world'
SyntaxError: Missing parentheses in call to 'print'

It tuns out, the example I was looking at was for Python 2. In Python 2, print was a distinct statement, in Python 3 print is actually a function call. Function calls require parentheses

If I changed the print statement to the following by adding parentheses.

>>> print ('Hello world')
Hello world

Running that worked fine.

Maybe this will help some other poor soul in the future......

Summer of code 2017: Python


I decided to learn/use a language that I don't use for work. I picked Python, I messed around with Python a little 10 years ago or so but decided to give it another shot for 2 reasons.

1) A lot of data scientists are using python in addition to R. Python and R are built into SQL Server 2017, so I might have to support either of these language in the future.

2) My youngest son wants to get into game programming, he will turn 11 next month, he has been messing around with scratch for the past year but wants to do some actual coding this time. I thought Python with pygame would be a good start


So what is the plan?

The idea is to start on Monday June 19th and finish this by August 16, this is 8 weeks, that should be enough to get to a certain skill level

My son has the python book for absolute beginners, he can start on that. Both of us can also watch and download the exercises from Pluralsight

I have already bookmarked the following courses



I installed Visual Studio 2017 yesterday and made sure to add python as part of that install. Here is what it looks like....



I have not used Visual Studio for a long time so I have to also get familiar with this latest version

The idea is also to post several times a week with updates on how it is going, what both my son and myself learned and how it is going in general



Friday, May 26, 2017

Kaizen Day 44, May 25 2017

This post is part of my daily kaizen routine, this is day 44 of that routine



Whenever I plan to go to the city I set my alarm to go off at 4 AM. I will always wake up by myself around 3:57 AM, the alarm will almost never go off while I am still sleeping. Today I woke up at 3:30 AM. I decided to get up...what is the point trying to get another 15 minutes of sleep in

I made myself a cold brew coffee the night before and I drank this between 4 and 4:30 AM

I left the house at 4:30 AM, walked to the train station, this took 40 minutes. I caught the 5:20 train, I read about 30 pages of the book Born to Run by Bruce Springsteen . The train arrived at  Newark at 5:55 or so, got on the PATH train and arrived at the World Trade Center station around 6:20

I then walked to the New York Sports Club gym on Broad street and did 30 minutes of cardio which burned a total of 361 calories





For breakfast I had some yogurt and fruit

I had a apple as a snack

For lunch I had a cheese sandwich and a burrito


For dinner we had egg noodles with homemade bolognese sauce, we had sauteed cauliflower on the side

I had a handful of chocolate chips for dessert




Activity for the day
Total steps:  23,628
Total floors: 34
Total distance: 10,9 miles


Wednesday, May 24, 2017

Kaizen Day 43, May 24 2017

This post is part of my daily kaizen routine, this is day 43 of that routine


I woke up at 5, had my coffee and then rode my bike to the gym. I did a back, bicep and leg workout and then rode my back back home. I was back home by 7:30 AM


Today I had a day off, the plan was to watch Alien Covenant in the morning, in the afternoon I would be watching the UEFA Europa League final between Ajax Amsterdam and Manchester United


For breakfast I had an English Muffin with eggs and bacon



The movie Alien: Covenant was pretty good, a little slow at times but also very suspenseful at other times. I though it was more like a cross between Prometheus and the original Alien movie. The new female star was really good and Michael Fassbender is back as the android*  (don't want to spoil anything here for you in case you didn't see the movie)

Alien: Covenant
Alien: Covenant


After the movie I rushed home, I laid out my Ajax jerseys, you can see them in the pic below

Ajax Amsterdam jerseys from back in the day
Ajax Amsterdam jerseys from back in the day

I then watched the game between Ajax Amsterdam and Manchester United

The game was OK, not too exiting, United's defense was impenetrable, Ajax made too many mistakes with passing the ball around, also there were never players runing free, United did park the bus at times... oh well..there is always a next time


For dinner we had the same as last night since we made it for 2 days: lentils with kale and pasts

Activity for the day
Total steps:  11,866
Total floors: 14
Total distance: 5.5 miles

Kaizen Day 41/42, May 22/23 2017

This post is part of my daily kaizen routine, this is day 41/42 of that routine


I woke up at 5, had my coffee and then rode my bike to the gym. I did a chest, shoulder and tricep workout. I then rode my back back home. I was back home by 7:30 AM

I worked from home today and I spent at least 5 hour on the phone in various meetings.

For breakfast I had eggs, asparagus and spring onions, I also had some bread

Lunch was a cheese sandwich

For dinner we had pasta with ground meat and cauliflower


May 22

Activity for the day
Total steps:  10,010
Total floors: 14
Total distance: 4.8  miles










May 23

Today I didn't do any workout, I did walk the 2.2 miles to the train station when going to work

Spent a good 3 hours on the phone today. I managed to beat my buddy Vlad again in 9 ball at work, he would say I had a lot of luck

For lunch I had a burrito and avocado

Dinner was lentil soup  made with my homemade chicken broth, we also added kale and some pasta to eat.

Had some blueberries, a peach and an apricot for dessert


Activity for the day
Total steps:  19,426
Total floors: 8
Total distance: 8.4  miles







Monday, May 22, 2017

Kaizen Day 41 May 21 2017


This post is part of my daily kaizen routine, this is day 41 of that routine



I decided not to go to the gym today. I got up at 5 AM, had my coffee and went for a 2 hour walk since nobody else gets up before 7 AM anyway

It was a beautiful today, a little nippy but nice and bright



Listened to the how stuff works podcast, the episode was about déjà vu

They also discussed something known as jamais vu , this has also been named "vuja de" and "véjà du"

From wikipedia
Jamais vu (from French, meaning "never seen") is a term in psychology which is used to describe any familiar situation which is not recognized by the observer.
Often described as the opposite of déjà vu, jamais vu involves a sense of eeriness and the observer's impression of seeing the situation for the first time, despite rationally knowing that he or she has been in the situation before. Jamais vu is more commonly explained as when a person momentarily does not recognize a word, person, or place that they already know. Jamais vu is sometimes associated with certain types of aphasia, amnesia, and epilepsy.
Theoretically, a jamais vu feeling in a sufferer of a delirious disorder or intoxication could result in a delirious explanation of it, such as in the Capgras delusion, in which the patient takes a known person for a false double or impostor.[37] If the impostor is himself, the clinical setting would be the same as the one described as depersonalisation, hence jamais vus of oneself or of the very "reality of reality", are termed depersonalisation (or surreality) feelings.

The feeling has been evoked through semantic satiation. Chris Moulin of the University of Leeds asked 95 volunteers to write the word "door" 30 times in 60 seconds. 68 percent of the subjects reported symptoms of jamais vu, with some beginning to doubt that "door" was a real word.[37]

I definitely had this happen to me where I would think a word sounded strange, I also had this happen with a person's name. I still remember the name, it was one of my mom's friend, she was named Mira


For breakfast I had some oatmeal with blueberries

I watched parts of a bunch of English Premier League games today, it was the final day and all games were played at the same time


For lunch I made a salad with red pepper, carrots, asparagus, spring salad, onion and kidney beans

Watched Real Madrid win the Spanish league.


For dinner I made some salsa, grilled some chicken, we also had chips and black beans and corn

For dessert I had a cookie and vanilla ice cream



Activity for the day

Total steps:  13,642
Total floors: 10
Total distance: 6.1  miles


Sunday, May 21, 2017

Kaizen Day 39/40, May 19/20 2017

This post is part of my daily kaizen routine, this is day 39/40 of that routine


May 19th

I woke up at 5, had my coffee and then rode my bike to the gym. I did a chest and tricep workout. I then rode my back back home. I was back home by 7:30 AM



For breakfast I had some yogurt and fruit

Worked from home today, noticed it was bike to work day, since I biked home from the gym, I guess that counts.


Had a cheese sandwich for lunch

For dinner we grilled pork chops, string beans and sweet potatoes


Activity for the day
Total steps:  8,184
Total floors: 12
Total distance: 3.5  miles



May 20th



I woke up at 6, had my coffee and then rode my bike to the gym. I did a back, bicep and leg workout. I then rode my back back home. I was back home by 8:30 AM


Had some eggs with grated potatoes for breakfast

For lunch had some extra pasta that my kids made, pasta was with homemade tomato sauce and strin beans

For dinner we had burgers made from grass fed beef picked up from a farm nearby. With the burgers we had a spring mix salad, we picked this up at the farmers marker

Started to watch the The Wizard of Lies with my wife, a movie about the Bernie Madoff Ponzi scheme




Activity for the day
Total steps:  12,182
Total floors: 23
Total distance: 5.2  miles