Saturday, June 24, 2017

Summer of code 2017: Python, Day 7 Collections: tuple, str and range


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

This is officially day 7, today, I looked at Collections in Python, here are my notes

Tuples


 A tuple is a heterogeneous immutable sequence


  • A tuple is delimited by parentheses
  • Items in a tuple are separated by commas
  • Element access in a tuple is done with square brackets and zero-based index t[index]
  • To get the number of elements in a tuple, use len(t)
  • Iterate over a tuple by using a for loop


Here is an example of what I described above

>>> t = ("Denis", "looks", "at", "tuples", 1, 66.100,5)
>>> len(t)
7
>>> t[2]
'at'
>>> t[6]
5
>>> for item in t:
 print(item)

 
Denis
looks
at
tuples
1
66.1
5
>>> 


  • Concatenation of tuples with + operator
  • Repetition of tuples with * operator


Here is an example of the  + operator as well as the * operator


>>> t = ("Denis", 1, 66.100)
>>> t + (3,2)
('Denis', 1, 66.1, 3, 2)
>>> t * 5
('Denis', 1, 66.1, 'Denis', 1, 66.1, 'Denis',
 1, 66.1, 'Denis', 1, 66.1, 'Denis', 1, 66.1)
>>> 

Tuples can contain any type of object
You can nest tuples
You access inner elements by using chain square-brackets indexing

>>> t = (("Denis", "looks") , (1,2), (5.1, 6.1))
>>> t[2][1]
6.1
>>> t[0][1]
'looks'
>>> t[0][0]
'Denis'
>>> 


Min and max functions can be used

>>> z = (1,2,4,7,9)
>>> min(z)
1
>>> max(z)
9

You don't need parentheses when creating tuples, you can ommit them

>>> x =1,4,7,9
>>> min(x)
1
>>> max(x)
9
>>> x
(1, 4, 7, 9)

However when printing the tuple to the console, the parentheses are displayed


Swapping
a, b = b, a is the idiomatic Python swap
Here is what it looks like

>>> x = 'ice'
>>> y = 'cream'
>>> x, y = y, x
>>> x
'cream'
>>> y
'ice'
>>> 

Tuple(iterable) constructor to create tuples from iterable series of objects

>>> tuple("abcdefg")
('a', 'b', 'c', 'd', 'e', 'f', 'g')
>>> 

This can be handy to find the min and max character from a string

>>> x = tuple("abcdefgdddzyyyaaa")
>>> min(x)
'a'
>>> max(x)
'z'
>>> 

To test for membership, you can use in and not in

>>> x = tuple("abcdefgdddzyyyaaa")
>>> "z" in(x)
True
>>> "m" in(x)
False
>>> "m" not in(x)
True
>>> "z" not in(x)
False
>>> 

And that's it for tuples

str

I will use str and string interchangeably in this post
a str is an immutable sequence of Unicode characters

len
Len gives you the number of characters in a str

>>> s = "abc"
>>> len(s)
3
>>> s = "  b  "
>>> len(s)
5
>>> 

As you can see, spaces are counted unlike the LEN function is SQL Server where spaces are trimmed from the end and start of a string

You can concatenate strings by using the + operator but just like in other language this is not efficient because it will create a new object

>>> s ="Den"
>>> s += "is"
>>> s
'Denis'
>>> 

What you should do is use join

Here is an example where we concatenate is to the string y

>>> y ="Den"
>>> ''.join([y,'is'])
'Denis'

As you can see Denis is printed to the console

Partition
The partition() method divides a string into three pieces around a separator: prefix, separator, suffix
In the code below, you can see that firstname and lastname have the values we want after we used partition with the separator

firstname, separator, lastname= "Michael:Jackson".partition(':')
>>> firstname
'Michael'
>>> lastname
'Jackson'

Use an underscore as a dummy name for the separator, this is also used by the many Python tools

>>> firstname, _, lastname= "Michael:Jordan".partition(':')
>>> firstname
'Michael'
>>> lastname
'Jordan'
>>> 

Format
Use format() to insert values into strings, replacement fields are delimited by { and }
Here is an example

>>> 
"My name is {0}, {1} {0}".format("Bond", "James")
'My name is Bond, James Bond'
>>> 


Range


A range is an arithmetic progression of integers, you can specify where to start, where to end and what the step is. A range is half-open, start is included but stop is not

ConstructorArguments Result
range(6) stop 0, 1, 2, 3, 4, 5
range(6, 10) start, stop 6, 7, 8, 9
range(10, 20, 2) start, stop, step10, 12, 14, 16, 18

Here is what it looks like in the console, range(5) will hold numbers between 0 and 4

>>> x = range(5)
>>> x
range(0, 5)
>>> for item in x:
 print(item)

 
0
1
2
3
4
>>> 



Here is what it looks like in the console, range(0, 10) will hold numbers between 0 and 9

>>> x = range(0,10)
>>> for item in x:
 print(item)

 
0
1
2
3
4
5
6
7
8
9



Here is what it looks like in the console, range(0, 10, 2) will hold numbers between 0 and 9, but because step 2 was supplied, it will be on the numbers 0,2,4,6 and 8

>>> x = range(0,10,2)
>>> x
range(0, 10, 2)
>>> for item in x:
 print(item)

 
0
2
4
6
8
>>> 




That it is for today..I will continue with collections and I will look at list, dict and set

Thursday, June 22, 2017

Summer of code 2017: Python, Day 5 Objects


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

Today is officially day 5, today, I looked at objects in Python, here are my notes

if you do something like this

x = 1000

Python creates an int object with a value of 1000, x now points to this object with a value of 1000
if you now do this
x = 500

Python will not change the value of the object from 1000 to 500 but will instead create another object with a value of 500 and z will now point to that object. The garbage collector will destroy the object with a value of 1000. This all happens because in Python objects are immutable, they cannot change


If you assign  1000 to x, then assign 500 to y, then assign x to y, both are pointing to the same object. You can prove that by using the id() function

In this example below, you will see that after we assign x to y, bot x and y point to the same object with id 50127440


>>> x = 1000
>>> y = 500
>>> y =x
>>> y
1000
>>> x
1000
>>> id(x)
50127440
>>> id(y)
50127440
>>> 


What if you have two variables and assign the same value?

>>> a = 1
>>> b =1
>>> id(a)
499688544
>>> id(b)
499688544
>>> 


As you can see, those also point to the same object

You can also us is to see if 2 objects are the same, so if you do x is y, you will get back True or False


>>> x = 5
>>> y = 5
>>> x is y
True
>>> 



If you do math against a variable, the id will also change

>>> z = 5
>>> id(z)
499688672
>>> z +=2
>>> id(z)
499688736
>>> 



With list it works like this

if you have a list d [1, 2, 3], now you add list e with the values of list d, now both d and e are [1, 2, 3]. If you now modify the list for e to be [1, 1000, 3],  both  e and d are now [1, 1000, 3]. This is because you modified the list object from [1, 2, 3] to [1, 1000, 3] and both d and e point to this list object

Here is what it looks like in IDLE

>>> d = [1, 2, 3]
>>> d
[1, 2, 3]
>>> e = d
>>> e
[1, 2, 3]
>>> e[1] = 1000
>>> e
[1, 1000, 3]
>>> d
[1, 1000, 3]
>>> e is d
True
>>> 


What will happen if we create 2 lists with the same values by assign the values to each list. Now the values are the same

>>> f = [1, 2]
>>> g = [1, 2]
>>> f == g
True
>>> f is g
False
>>> f == f
True


With integers, both is and  == return true

>>> x = 1
>>> y = 1
>>> x == y
True
>>> x  is y
True
>>> 


The is operator determines equality of identity, == determines equivalence


So even though people call these object variables in Python, these are really named references to objects


I also learned about the dir built-in function

Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object.

The default dir() mechanism behaves differently with different types of objects, as it attempts to produce the most relevant, rather than complete, information:


  • If the object is a module object, the list contains the names of the module’s attributes.
  • If the object is a type or class object, the list contains the names of its attributes, and recursively of the attributes of its bases.
  • Otherwise, the list contains the object’s attributes’ names, the names of its class’s attributes, and recursively of the attributes of its class’s base classes.


So for example if we call dir on the math object, it will return all the functions available

>>> import math
>>> type(math)

>>> dir(math)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh',
 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 
'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 
'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 
'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'pi', 'pow', 'radians', 
'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']
>>> math.pi
3.141592653589793
>>> math.pow(2,4)
16.0
>>> 

So this is a quick way to get all the available methods/functions from a class

Tuesday, June 20, 2017

Summer of code 2017: Python local help files


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

I noticed that Python ships with a help file in chm format ( Compiled HTML Help)



Microsoft Compiled HTML Help is a Microsoft proprietary online help format, consisting of a collection of HTML pages, an index and other navigation tools. The files are compressed and deployed in a binary format with the extension .CHM, for Compiled HTML. The format is often used for software documentation.


I haven't used a chm file since SQL Server 2000 within Query Analyzer. I prefer these files over online files for multiple reason

You don't have to be online to access the help file, you can be coding in a cave without connectivity and you can still pull up help

You can bookmark pages you want to get back to over and over again, these will be in the favorites tab



There is an index tab, this is like the back of a book, it is in alphabetical order and you can quickly find stuff
I typed in string, hit enter and saw the following


Then I clicked on method and was presented with the page you see



Do you use the local help file or do you use the online documentation?


Monday, June 19, 2017

Summer of code 2017: Python, Day 2


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

Today is officially day 2

I decided to do a lunch and learn today and continue with the PluralSight course: Python Fundamentals

The course continued with Strings. Strings are very similar as strings in other languages

Here are some of the notes for myself of what I learned today


You can use single or double quotes with strings

Universal Newlines, you can use "\n" and it will be a newline on all platforms, this is also part of PEP 278

Multi-line strings are created by using triple quotes

For example

>>> x = """fdfdfdf
dfd
fdf
df
dfdf"""
>>> x
'fdfdfdf\ndfd\nfdf\ndf\ndfdf'
>>> 

As you can see, when the console prints the string, you will see the \n escape characters

Here are some of these escape characters

Escape SequenceMeaningNotes
\newlineBackslash and newline ignored
\\Backslash (\)
\'Single quote (')
\"Double quote (")
\aASCII Bell (BEL)
\bASCII Backspace (BS)
\fASCII Formfeed (FF)
\nASCII Linefeed (LF)
\rASCII Carriage Return (CR)
\tASCII Horizontal Tab (TAB)
\vASCII Vertical Tab (VT)
\oooCharacter with octal value ooo
\xhhCharacter with hex value hh



Escape sequences only recognized in string literals are:

Escape SequenceMeaningNotes
\N{name}Character named name in the Unicode database
\uxxxxCharacter with 16-bit hex value xxxx
\UxxxxxxxxCharacter with 32-bit hex value xxxxxxxx




Formatted String Literals
A formatted string literal or f-string is a string literal that is prefixed with 'f' or 'F'. These strings may contain replacement fields, which are expressions delimited by curly braces {}. While other string literals always have a constant value, formatted strings are really expressions evaluated at run time.

Here is an example

>>> name = "Denis"
>>> f"He said his name is {name!r}."
"He said his name is 'Denis'."
>>> 

Strings are unicode and encoded in UTF-8

After strings, the course continued with bytes, lists, dictionaries and loops




Modularity
This was the next part of this course
Named functions are defned with the def keyword

def function_name(arg1, argn):


For example

>>> def sumvalues(x,y):
    return x + y

>>> sumvalues(4,5)
9
>>> 

If you use a return without a value, the function will return None, but remember that None is not printed from the REPL

If you were to save this function into a file and then import it, it would execute immediately

Python has special attributes that start and end with double underscores, we will look at __main__ and  __name__

'__main__' is the name of the scope in which top-level code executes. A module’s __name__ is set equal to '__main__' when read from standard input, a script, or from an interactive prompt.
A module can discover whether or not it is running in the main scope by checking its own __name__, which allows a common idiom for conditionally executing code in a module when it is run as a script or with python -m but not when it is imported:

Here is an example of that

>>> 
def sumvalues(x,y):
    return x + y

    if __name__ == "__main__":
        sumvalues(x,y)

>>> sumvalues(1,2)
3
>>> 

More here: https://docs.python.org/3/library/__main__.html


I also learned about setting up a main() function
Command line arguments are accessible via sys.argv



This module also covered documenting your code by using docstrings. 
Docstrings are standalone literal strings which are the fist statement
of a function or module


If you have this function

>>> def fib2(n):  # return Fibonacci series up to n
    """Return a list containing the Fibonacci series up to n."""
    result = []
    a, b = 0, 1
    while a < n:
        result.append(a)    # see below
        a, b = b, a+b
    return result
Now if you do a help(fib2) command, you will see the following

>>> help(fib2)
Help on function fib2 in module __main__:

fib2(n)
    Return a list containing the Fibonacci series up to n.

>>> 


I feel I need to spend more time with __main__ and __name__.  
I will do that the next couple of days

Sunday, June 18, 2017

Summer of code 2017: Python, Day 1


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

Today is officially day 1... but I really started yesterday

I decided to start with the PluralSight course: Python Fundamentals

This course is presented by  Austin Bingham and Robert Smallshire

This is the description for that course

Python Fundamentals gets you started with Python, a dynamic language popular for web development, big data, science, and scripting. What’s so great about Python? Python is powerful. The Python language is expressive and productive, it comes with a great standard library, and it’s the center of a huge universe of wonderful third-party libraries. With Python you can build everything from simple scripts to complex applications, you can do it quickly, and you can do it with fewer lines of code than you might think possible. But for many people those reasons take back-seat to something more important: Python is fun! Python’s readable style, quick edit-and-run development cycle, and “batteries included” philosophy mean that you can sit down and enjoy writing code rather than fighting compilers and thorny syntax. As your experiments become prototypes and your prototypes become products, Python makes the experience of writing software not just easier but truly enjoyable. In the words of Randall Munroe, "Come join us! Programming is fun again!"

Long integers
Python supports really long integers, most languages I worked with support up to 64 bit integers

In Python you can store 2 to the power of 900 in an integer without a problem

That looks like this in scientific notation

8.452712498170644e+270

Or if you were to print this out as an integer

8452712498170643941637436558664265704301557216577944354047371344426782440907597751590676094202515006314790319892114058862117560952042968596008623655407033230534186943984081346699704282822823056848387726531379014466368452684024987821414350380272583623832617294363807973376

That is 271 digits

Here is what it looks like in the console

>>> x = math.pow(2,900)
>>> print ( int(x))
84527124981706439416374365586642657043015572
16577944354047371344426782440907597751590676
09420251500631479031989211405886211756095204
29685960086236554070332305341869439840813466
99704282822823056848387726531379014466368452
68402498782141435038027258362383261729436380
7973376
>>> print ( len(str(x)))
22
>>> print ( len(str(int(x))))
271
>>> 




Python Enhancement Proposal (PEP)

Python's development is conducted largely through the Python Enhancement Proposal (PEP) process. The PEP process is the primary mechanism for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python.

And index with all the PEPs can be found here: https://www.python.org/dev/peps/

PEP number 8 Style Guide for Python Code is an important one, all Python developers should keep that in mind. In this PEP you will see that you should use spaces not tabs for indentation, You should use 4 spaces per indentation level.


Zen of Python

This is another PEP, the Zen of Python is PEP number 20

The Zen of Python is a collection of 20 software principles that influences the design of Python Programming Language, 19 of these are written down, you can see them by entering the statement import this in the Python interpreter


>>> import this
The Zen of Python, by Tim Peters

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!
>>>

That output is the Zen of Python


None

The equivalent of NULL in languages like c#, Java or SQL Server in Python is None

If you assign the None value to a variable and then tried to print it, you won't get anything back

You can however check if a variable has no value by checking for None


>>> y = None
>>> y

>>> 
if y == None:
    print("is none")
else:
    print("is none")
    
is none


I also messed around and struggled to install PyGame, at the end it was pretty simple, you can read that here:  Installing Pygame on windows



Installing Pygame on windows

As explained in my Summer of code 2017: Python post I decided to pick up Python. As explained in that post my son wants to do some game development. with Python you can use Pygame to do game development.

My first attempt to install Pygame didn't end well, the instructions I found were to were to download the pygame wheel file, rename the .whl file to .zip. After that extracting the files into a folder. Then you had to move the header files into the \Python36\include folder. Another thing I had to do was moving the pygame folder and the pygame-1.9.3.dist-info folder into the \Python36\Lib\site-packages folder

After that was done, I got some strange errors, something about init() missing (AttributeError: module 'pygame' has no attribute 'init')


Another option was to use pip

I tried that

C:\Users\dgobo>pip install pygame
Collecting pygame
  Downloading pygame-1.9.3-cp36-cp36m-win_amd64.whl (4.2MB)
    100% |████████████████████████████████| 4.2MB 234kB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.3

I still had an error after this was done

I noticed that pip installed Pygame into the following folder

\anaconda3\lib\site-packages


Hmmm... what is anaconda and why did pip install Pygame there?

I then navigated to the Python directory, instead of pip install pygame I did python -m pip install pygame

C:\Python36>python -m pip install pygame
Collecting pygame
  Using cached pygame-1.9.3-cp36-cp36m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.3


That did it, after that ran, I had no errors anymore

So all you have to do is..run pip from python, not by itself

Hopefully this will help someone if they run into this issue


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 though 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

Friday, May 19, 2017

Kaizen Day 37/38, May 17/18 2017

This post is part of my daily kaizen routine, this is day 37/38 of that routine


May 17th

Got out of bed ad 5:10 AM today, had my coffee and listened to some podcasts. Left the house around 5:45 AM and ran for about 40 minutes
Had some yogurt and fruit for breakfast. Walked the 2.2 miles to the train station and hopped on the shuttle to work

Had a cheese sandwich for lunch

For dinner we had pasta with bolognese sauce


Activity for the day
Total steps:  25,687
Total floors: 7
Total distance: 12.1 miles





May 18th

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. It was a beautiful morning, here is a pic I took around 6:20




I then walked to the New York Sports Club gym on Broad street and did shoulders as part of my workout. I also did 24 minutes of cardio which burned a total of 301 calories





For lunch I had a Mediterranean rice bowl




Today it was 91 degrees fahrenheit or 31 degrees celcius, I am so glad I can wear shorts in the office. Meanwhile my team members from Denver had snow..crazy weather...


Dinner was meatless chili

Had also some ice cream for dessert

Activity for the day
Total steps:  24,465
Total floors: 21
Total distance: 12.8 miles

Wednesday, May 17, 2017

Kaizen Day 36 May 16 2017

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

Today I did not do any workout.  I walked the 2.2 miles to the train station, hopped on the van to get to the office



Today I learned

Gated check ins
We had a meeting today, we talked about builds and someone mentioned Gated Check-in
I had never heard of this term before today, so I went to look it up. I found it on the msdn site: TFS 2010 – An Introduction to Gated Check-in 
When this trigger is selected for a build definition, any check-in that is made to a file that is mapped in the associated workspace will trigger a verification build. If the build succeeds, the changes will be submitted to the repository. If the build fails, the changes are not allowed to be submitted and must be fixed and resubmitted.

Shaking the tree
This term I heard while listening to the dotnetrocks podcast  episode Enterprise Angular and Azure with John Papa

What that means is basically removing dead code from your project, any code that is not used is removed


I had an avocado and a burrito with cherry tomatoes  for lunch

On my walk home from the train station, I noticed a USPS truck that was broken down. Just as I was passing it, this tow truck showed up. I took a picture of it





Dinner was a bean soup made with chicken broth, string beans, zucchini, spinach and tomatoes.

Activity for the day

Total steps:  18,523
Total floors: 9
Total distance: 8.6  miles