Monday, April 10, 2017

Adding some Kaizen to my life



I turned 47 this weekend and decided I should try to improve my life, after all I am getting older and want to be around when my kids grow up. I gained a little weight in the last 10 years, probably between 10 and 15 pounds or so. The best way for me to tackle this weight gain would be to use several small changes. Think of it as Kaizen, if you don’t know what Kaizen is, here is a small definition and the link to Wikipedia.

Kaizen (改善?), is Japanese word for "continuous improvement ". In business, kaizen refers to activities that continuously improve all functions and involve all employees from the CEO to the assembly line workers. It also applies to processes, such as purchasing and logistics, that cross organizational boundaries into the supply chain.[1] It has been applied in healthcare,[2] psychotherapy,[3] life-coaching, government, banking, and other industries.

By improving standardized programmes and processes, kaizen aims to eliminate waste (see lean manufacturing). Kaizen was first practiced in Japanese businesses after the Second World War, influenced in part by American business and quality-management teachers, and most notably as part of The Toyota Way. It has since spread throughout the world[4] and has been applied to environments outside of business and productivity.


The first thing I will do is document all the stuff I eat, I am doing this because if I eat any crap, I will need to document that, so it will force me to really think if I should have that bag of chips or handful of M&Ms today


I will also increase the times I do aerobic exercises

I will not skip my workout days (sometimes it is not my fault, NJ Transit does not always run on time you know) But if I skip a day, I should make it up on a non-workout day

Finally, I should start working on my flexibility, I should work on becoming more flexible, I got kind of stiff over the years



That is all for this post... the first daily post will go out tonight

Saturday, January 21, 2017

If you play FPL Fantasy Soccer, make sure to get the Better FPL extension

If you play Fantasy Premier League soccer/football, then you must get the Better FPL chrome extension.

Better FPL provides you with a set of options to improve your experience on fantasy.premierleague.com. Features such as upcoming fixtures with difficulty, expanded league view and options to disable things such as the confirmation dialog, that interrupts when you want to make a transfer, to name a few.

Here is what the team looks like without the extension



Here is what the team looks like with the extension


Now under each player you will see 5 colored boxes, these represent the difficulty for the next 5 games. Now you can better judge who to leave on the bench and who to field.

And here is what the standing look like without the extension


Adding the extension gives you a lot more, you get live points in the GW(L) columns, you can also see the captain and if that player has played any chips like bench boost, all out attack or triple captain. You can also see the transfer cost, transfers this week and how much money the person has in the bank


So do yourself a favor and add the Better FPL extension, you can get it here: https://chrome.google.com/webstore/detail/better-fpl/oimpiccgpkkjbdligdbcipdcjcklcglm?utm_source=chrome-app-launcher-info-dialog

Tuesday, October 25, 2016

SQL Pass Summit 2016... day 1.... just looking around



This is the second PASS Summit I am attending. I will be in Seattle for 5 days. The first day has been a long day for me. I got up at 3:30 AM even though my alarm was set to go off at 3:55 AM. A car picked me up at 4:30, I got to the airport at 5:10 AM. My Alaska Air flight left promptly at 7 AM, I landed around 10 AM at Seattle Tacome airport.

I went to pick up my badge at the Washington Convention Center around noon. I had some lunch right after I picked up my badge

I had some free time this first day, I decided to go to the Space Needle
When I got to the Space Needle which is about a 25 minute walk or so from the Washington Convention Center, I noticed they also had the Chihuly Garden and Glass exhibition. If you want to see both the Space Needle and the Chihuly Garden and Glass exhibition, make sure to get the package deal, you will save around $8 per person.

I took some pictures at the Chihuly Garden and Glass exhibition. All these glass items below were made by Dale Chihuly, In 1968, after receiving a Fulbright Fellowship, he went to work at the Venini glass factory in Venice. This is the place where he learned to work the way he works today.  You can learn more about all lof this at the Chihuly Garden and Glass website



Chihuly Garden and Glass

Some alien looking things

Colored glass at Chihuly Garden and Glass

Flowers

Glass detail at Chihuly Garden and Glass

Straight out of a sci-fi movie

Here is also a video of some of these glass sculptures



After the Chihuly Garden and Glass I went to the Space Needle
I have been to Seattle 4 times now and have never visited the Space Needle. this time I decided to go for it. First of all, I am not a big fan of heights, second..I am an even smaller fan of heights when it is extremely windy. So I went up there, it was very window and it was the typical crappy cloudy and rainy Seattle day. I took a couple of pictures, but I was scared several time that I was going to drop my phone

Seattle


After the Space Needle, I took the monorail back to Westlake Center Station, at 5th Avenue and Pine Street. From there I went to visit Pike Place Market

Pike Place Market

I also saw this couple, one playing the guitar, the other doing some flamingo dance.


Since I was so jet lagged, I did not even eat dinner, lunch was around the same time that I normally eat dinner at the east coast, I wasn't hungry at all. I will probably be starving for breakfast however.

Back in the hotel I decided to take it easy. I read a little bit and just relaxed...

Here is final video for you. it is a little grainy but it is a timelapse taken from the hotel room while it is getting dark



Of course I woke up at 1:15 AM then at 2 AM. Finally I got up at 3 AM..and that is why you see this post.

Wednesday, September 28, 2016

Sometimes I wish I could travel at timelapse speed

I am probably one of the few people who like the commute when taking a train. The reason I like taking the train is that it gives me time to read. I normally take the train once or twice a week, the train ride itself is only about 35 minutes or so from Princeton to Newark. In Newark I transfer to the path and take that to the World Trade Center station.

So yesterday I was sitting on the train on the way home and decided to take a timelapse video between two station. You can see that video below



As you can see that took about 14 seconds for a 4 minute or so train ride duration. That means if I was to travel at timelapse speed, it would be about 17 times faster. With a timelapse travel speed my commute would be about 2 minutes..... Who wants that, that would mean it would take me a year to finish a book if I only read on the train, However sometimes it is handy, this is especially true when the NJ Transit or Amtrak trains are running late........ which is every day!!

Here are two Google Map images of the two stations to give you an idea where this is all located




If you prefer to see this in Google Maps the go here: Google Maps

I am a big fan of timelapse videos, it is always interesting when you see people in timelapse videos, it;s like watching a bunch of rats or ants

If you like timelapse videos, check out timelapse on reddit if you don't already know about that subreddit: https://www.reddit.com/r/timelapse


Wednesday, August 17, 2016

Finished dead last...how pathetic..

As some of you know, I am part of a premier league fantasy soccer/football league. The new season started last week…. I managed to have the least points at the end of the first match day. I am glad that this is not my real job otherwise I would be in real trouble. What annoys me the most is that I switched out Philippe Coutinho for Roberto Firmino, Coutinho ended up with 15 points while Firmino only had 2 points. Then to rub some salt into the wound, my dear friend Christiaan Baes pointed out the following

Arggghhh.

What can you do, this is just the first week, so hopefully it gets better. Last year I finished somewhere in the middle of the group.

Here is what my team looked like that first week

Not sure why I had Cech instead of Mignolet, lost 6 points right there.
I have made some changes, not too many, I want to keep my wildcard in case some of my players get injured. Btw, you can follow the league here: RealFootball...

 Joining the league couldn't be easier. Simply use this link and you'll be added automatically after you've entered the game: https://fantasy.premierleague.com/?autojoin-code=40704-14764.

Sunday, February 21, 2016

Using twitter from the R console

Lately I have been messing around with R and I decided to check out the twitteR package to see if I can post from the R console. In order to use twitter from the R console, we need a couple of things:


  • Setup OAuth  authentication for twitter
  • Install the twitteR package

Setup OAuth  authentication for twitter
As of March 2013 OAuth authentication is required for all Twitter transactions. If you don't already have a OAuth setup, head over to twitter here: https://apps.twitter.com/app/new

Follow the instructions, once you are done, you will see the following 4 items

Consumer Key (API Key)
Consumer Secret (API Secret)

Access Token
Access Token Secret


Install the twitteR package
Now in you R program install the twitteR package
Once the package is installed, it is time to get busy......


 Load the package by executing the following command


library(twitteR)


Now it is time to setup authentication, you do that by using the setup_twitter_oauth command, below is an example, make sure to replace the keys and tokens below with the values you got back when you setup OAuth on twitter



setup_twitter_oauth("API key", "API secret", "Access token", "Access secret")
[1] "Using direct authentication"

If that is all set, we can send a tweet. To update you twitter status, you can use the updateStatus command, this is very simple to use, you pass your status into the function. Here is what it looks like on twitter

updateStatus('testing Tweeting with twitterR package from witin Revolution R Enterprise')
[1] "DenisGobo: testing Tweeting with twitterR package from witin Revolution R Enterprise"

Here is what it looks like from the console


Of course nobody is doing all of this to update their status. The reason I am playing around with this is because I want to do twitter searches and then store the results in a file or database. So let's do a simple search for the tag #rstats and let's also limit the search to only return 6 results

tweets <- searchTwitter('#rstats', n=6) 
tweets

Here is what we got back, as you can see some of the results end in ...., those have been truncated

[1] "psousa75: RT @rquintino: @Mairos_B #sqlsatportugal session: all about R in #SqlServer 2016 #rstats https://t.co/DHrqIZrz1e"

[[2]]
[1] "millerdl: a quick script to use imgcat in #rstats https://t.co/fpUlgWNX33 https://t.co/AhCCMLewCH"

[[3]]
[1] "diana_nario: RT @KirkDBorne: Useful packages (libraries) for Data Analysis in R: https://t.co/haRKopFyly #DataScience #Rstats by @analyticsvidhya https:…"

[[4]]
[1] "emjonaitis: Hey #rstats tweeps, do you have any readings to recommend on sensitivity analysis? Books/articles/websites all welcome."

[[5]]
[1] "caryden: RT @KirkDBorne: A Complete Tutorial on Time Series Modeling in R: https://t.co/7oI6JKyU4E #MachineLearning #DataScience #Rstats by @Analyti…"

[[6]]
[1] "ArkangelScrap: RT @KirkDBorne: A Complete Tutorial on Time Series Modeling in R: https://t.co/7oI6JKyU4E #MachineLearning #DataScience #Rstats by @Analyti…"


What I really want is to convert the output to a data frame. Luckily the twitteR package has this built in, you can use twListToDF. Here is how to do that

tweets <- searchTwitter('#rstats', n=6) 
twListToDF(tweets)

The output now has a lot more stuff, you can see if it has been retweeted or favorited as well as the latitude, longtitude and more


1                             RT @rquintino: @Mairos_B #sqlsatportugal session: all about R in #SqlServer 2016 #rstats https://t.co/DHrqIZrz1e
2                                                      a quick script to use imgcat in #rstats https://t.co/fpUlgWNX33 https://t.co/AhCCMLewCH
3 RT @KirkDBorne: Useful packages (libraries) for Data Analysis in R: https://t.co/haRKopFyly #DataScience #Rstats by @analyticsvidhya https:…
4                      Hey #rstats tweeps, do you have any readings to recommend on sensitivity analysis? Books/articles/websites all welcome.
5 RT @KirkDBorne: A Complete Tutorial on Time Series Modeling in R: https://t.co/7oI6JKyU4E #MachineLearning #DataScience #Rstats by @Analyti…
6 RT @KirkDBorne: A Complete Tutorial on Time Series Modeling in R: https://t.co/7oI6JKyU4E #MachineLearning #DataScience #Rstats by @Analyti…
  favorited favoriteCount replyToSN             created truncated replyToSID
1     FALSE             0        NA 2016-02-20 20:29:54     FALSE         NA
2     FALSE             0        NA 2016-02-20 20:24:50     FALSE         NA
3     FALSE             0        NA 2016-02-20 20:16:25     FALSE         NA
4     FALSE             0        NA 2016-02-20 20:11:08     FALSE         NA
5     FALSE             0        NA 2016-02-20 20:11:06     FALSE         NA
6     FALSE             0        NA 2016-02-20 20:02:05     FALSE         NA
                  id replyToUID
1 701141750161784834         NA
2 701140474019577856         NA
3 701138356466483204         NA
4 701137026075140096         NA
5 701137018508722176         NA
6 701134750296227840         NA
                                                                            statusSource
1                Mobile Web (M5)
2 Tweetbot for Mac
3   Twitter for Android
4                     Twitter Web Client
5     Twitter for iPhone
6                     Twitter Web Client
     screenName retweetCount isRetweet retweeted longitude latitude
1      psousa75            3      TRUE     FALSE        NA       NA
2      millerdl            0     FALSE     FALSE        NA       NA
3   diana_nario           50      TRUE     FALSE        NA       NA
4    emjonaitis            0     FALSE     FALSE        NA       NA
5       caryden           41      TRUE     FALSE        NA       NA
6 ArkangelScrap           41      TRUE     FALSE        NA       NA


Now that we have a dataframe, let's dump it into a csv file. Below is what the command is to write the output to a csv file

write.csv(twListToDF(tweets), file = "c:/temp/Tweets.csv")


Here is what it looks like if you open the csv file in Excel





As you can see each column is filled with correct data. How about instead of writing it into a csv file, we write the data into a database?  That is pretty easy as well, we need the RODBC package to accomplish that. You can see that post here: How to store twitter search results from R into SQL Server



Monday, February 15, 2016

Started a Today I learned project on Github



I started my own Today I learned project on Github



Today I learned

A collection of concise write-ups on small things I learn day to day across a variety of languages and technologies. These are things that don't really warrant a full blog post. Idea stolen from jbranchaud/til


You can find that project here https://github.com/SQLMenace/til
The reason I did this is because it gives me an opportunity to use Github, all my stuff is usually backend SQL Server code, I also don't do any web or app programming. The reason I like the Today I Learned project is that you can easily see all the stuff that you have learned over time. I will probably mostly add R and Powershell items in the foreseeable future. I am messing mostly with R on my own time and Powershell at work. Once I start diving deeper into SQL Server 2016, I will probably add that stuff as well to my Today I Learned Github project.

What do you think... cool idea or not?


Again, you can find that project here https://github.com/SQLMenace/til