Saturday, February 23, 2013

Adding Rebounds and Turnovers to Super Shot Search

Todo:

  1. Integrate the new SQL query for turnovers and rebounds into existing Super Shot Search SQL (SSSSQL). (30 minutes)
  2. Display the filtered data on my Super Shot Search (SSS) web site. (20 minutes)
  3. If I get that done in a reasonable time, look into getting the rebound data for all teams in tabular form with a quick query. (30 minutes)
  4. If that gets done, add a UI for it on SSS.
  5. Ignore twitter.
  6. Don't spend more time blogging than coding.

Integrating

I just opened up my usual MySql IDE, MySql Workbench, but then remembered there's a much nicer IDE called HeidiSQL which has table and field auto-completion which should really be a standard for any IDE. So let's install that. (Took 2 minutes to install and configure and run...sweet) Oh cool HeidiSQL even shows the size on disk of the tables in your schemas. Wicked....Looking at the code and I should have commented which is the working piece of code and a data set to compare it too...I'm running some of these queries and they are taking a long time which makes me think I need a new computer...So I think I have a working query but I need to compare it to a game...so opening up a play-by-play, and I'll compare my calculated results with what's on paper. Well I couldn't believe there were no rebounds in this game for Toronto, but I checked  the play by play and there were none. Now checking Buffalo's..they have exactly 1 rebound. Well, that's a large enough sample size to check :).

Rebound times for all teams

This was more interesting to me than adding the UI, so I did this yet. First, a note on performance. I went from a query that was wrong, and took 55 s, to a correct query that took 4 s, to an even better query that takes a half of a second, to a query for all teams that takes 51 seconds (performance will be better on a production database). The obvious clue I missed when designing the query was you just have to check the play immediately before a short or goal: if that play was a shot, and the time is less than 3 seconds, that is a rebound.

What teams got the most rebounds last season?

Rebounds Team
146 Colorado Avalanche
143 San Jose Sharks
140 Philadelphia Flyers
138 Carolina Hurricanes
128 Los Angeles Kings
122 St. Louis Blues
117 Phoenix Coyotes
114 Calgary Flames
114 New Jersey Devils
112 Pittsburgh Penguins
111 New York Islanders
105 Montreal Canadiens
103 Florida Panthers
103 New York Rangers
102 Chicago Blackhawks
99 Winnipeg Jets
94 Minnesota Wild
94 Boston Bruins
93 Ottawa Senators
93 Columbus Blue Jackets
92 Buffalo Sabres
86 Tampa Bay Lightning
84 Nashville Predators
83 Anaheim Ducks
79 Washington Capitals
77 Edmonton Oilers
76 Vancouver Canucks
74 Dallas Stars
72 Toronto Maple Leafs
71 Detroit Red Wings
I don't see much correlation between good teams and getting rebounds...That's all for tonight.

Monday, July 2, 2012

Not on schedule at all

I basically spent a bunch of time messing around with crap I told myself not to mess around with, namely graphics, setting up a virtual server using Windows Azure, playing with that, setting up a local server, exposing that server to the internet, and so forth.

But, here's some things I have decided:

  • All the backend work will be done in c#, because fuck php. If I need to pay for a host that will server up .net mvc or webservices, so be it. I'll just do all the development locally anyhow.
  • I'll use a MySql database.
  • That's as far as I've gotten here.
Tomorrow I might actually write some code!

EDIT: Turns out my host supports Django but it's a bitch to set up: http://www.calebmadrigal.com/django-on-hostmonster/

Was thinking of learning python/django, and that would be useful, but I also just want to get this going as quick as possible. So fuck it, php? I have no idea.

Saturday, June 30, 2012

Wasting time

So I just spent an hour or more doing various things, none of which were productive:

  • Tried to see if my theninjagreg.com was running and if not, why not
  • Wasn't running so attempted to log in to 1and1.com's control panel
  • It wasn't accepted my username and password and not even the reset password dealy worked
  • Called 1and1 and realized it's because they don't support Chrome, wtf
  • Looked into actually paying for a server that would run .Net apps (I love .net btw)
  • Looked into installing mono on the server I get free hosting on
  • Blah blah blah I wasted time I should have spent coding.
I really like .net, that's what I code in at work, but the free hosting I have is a LAMP server, so I guess I'll stick with php for now.

Game of Thrones Video Board Game of Thrones Game

I'm a big fan of Game of Thrones (read all the books twice, watched all the seasons twice), I'm a big fan of global domination games like Risk and Diplomacy, and I'm a medium fan of programming stuff. So I want to put all these things together and create an easy to play online Game of Thrones game.

I know that HBO is working on a MMORPG version of GOT, but I have no interest in that kind of game.

I've started and failed to complete many computer games in the past, and the hardest thing for me on any game is the graphics. So rather than spend hours and hours trying to make things look nice, I'll just get the server side end done well enough and throw together a crappy UI for the time being.

Thursday, November 17, 2011

One goal achieved

Back flip.

Now I guess the hard part will be working up the courage to do it on grass, wood, concrete...

Tuesday, October 18, 2011

2011

Some things I did in 2011.
Here's a video of me doing a front tuck on grass.


Back tuck on trampoline
Me dead lifting 315 pounds, and a great shot of my ass. I don't have a video of the 365 pound one.

Sunday, April 17, 2011

Reflective Serializer for C#

Reflection would have been a nice feature to have when I was writing MFC C++ back in the day. Anyways, here's an easy way to auto serialize a class. Just have it derive from this class:


    public class ReflectiveSerializer : ISerializable
    {
        public ReflectiveSerializer()
        {
        }


        protected ReflectiveSerializer(SerializationInfo info, StreamingContext context)
        {           
            Type t = GetType();
            foreach (FieldInfo fi in t.GetFields())
            {
                fi.SetValue(this, info.GetValue(fi.Name, fi.FieldType));
            }
        }


        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {            
            Type t = GetType();
            foreach (FieldInfo fi in t.GetFields())
            {
                object o = fi.GetValue(this);
                info.AddValue(fi.Name, fi.GetValue(this));
            }
        }
    }


And then add this constructor to the class:


        protected MyClass(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }


That class gets called automatically when serializing. The class will then be automatically serialized, provided all of its members can be serialized.