NFL Live is a joke

by Jesse 20. November 2008 15:23

I'm sitting here, right now, watching the horrible service known as "NFL LIVE".  They advertise it for sprint "nfl mobile live" and it has made me a firm beleiver in NEVER buying the service, ever.

On paper, its a good deal - they broadcast the game online.  But what they don't tell you is they don't let you watch much of the game, at all.  What do I mean?  I've been watching the Bengals/Steelers game for an entire half.  I've seen maybe a total of 10 plays.  At first I thought it was an injury time out or they were doing something else to kill time -- no, they're not.  It's terrible!!  What's worse, the picture quality leaves much to be desired.  More so, the audio quality sounds like I'm in a sewer pipe. 

They want someone to pay for this junk?  I'm sorry guys, go back to the drawing board and start alllllll over.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

For Extremely Large Values of .01

by Jesse 6. November 2008 08:22

Working with some code, try it yourself, let me know if you get the same result...

Under an event (any event), add the following...

BuildData(0.01, 0.25, 0.01);

Add the following method...

private void BuildData(double start, double end, double step)
{
double current = start;
while (current <= end)
     {
          //I actually have other stuff going on here, but no calcs (one current.ToString() conversion)
          current = current + step;
     }
}

basic hu?  Watch "current" when it transistions from "0.05" to "0.06" -- you don't get 0.06, check this out

 Next step ...

The hell?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

.Net | Coding | Weird

A friend goes it Iraq

by Jesse 28. October 2008 04:51

2 days ago I got an email about a different kind of going away party, a friend of mine, known him for 5 years or so, has been active reserves for a long time but recently switched to full active duty, but just states side.  He's Navy, so that meant driving back and forth between Columbus and Dayton.  About a month ago during a every-other-month get together, he said he's been "put on notice" that his time to jump over into the sand pit could be coming so this wasn't a surprise.

In the email he said we'd have a thing on sunday because he felt he could be gone before Thanksgiving (which, btw, his wife is t3h w00t when it comes to making a turkey) so ok fine, I forward it on to the group.  This morning ...I get this.

Friends -

I regret to inform you that the party has been canceled. The navy would like [him] to be on a transport to Iraq on Sunday, and he will actually be leaving town for San Diego sometime Tuesday, October 28th. 

For those keeping track, that's -today-.  I called him, see how he was feeling about it, how long, etc.  He's excited, 6 months, doing what he wants to do.  I outrightly warned him not to do anything stupid because the last thing I want to hear is he's coming home in a box.  To put this in perspective, he wanted to be a pilot and asked "would you fly with me" if he would get the OK -- I'd do it in a heart beat (mostly to out-fly him!) and even filled out some paperwork if he got it.  Well, he was turned down for that but did get commissioned to be an officer anyway.  Good thing is its a great position.  Bad thing is he will be required to move a LOT -- transports are easy to shoot at.  Granted, most of his movements should be by air ...but that ground comes up fast sometimes.  Damn gravity.

I'm not really worried about him or his ability to handle combat situations (see: being shot at) which he shouldn't see much, if at all, but I do wish, at the least, I would be going with him.  He's got a wife that's not in the greatest health and needs him from time to time ...I don't have that problem.  During the summer, we had talked about the realistic nature that he'd be going off and what I could do around the house, things his wife can't handle.  He insisted nothing (bullshit) but gave in by saying "make sure the mower has oil in it, it needs rebuilt so its eating it after every few runs".   Just the kind of guy he is.  So it looks like I'll be doing some shoveling (snow) and maybe some shrub cutting, lawn mowing and whatever else comes up while he's out playing in the big sand box of the east.  It's the least I can do.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Misc | off topic

The numbers don't add up

by Jesse 27. October 2008 23:21

A friend of mine got pulled over the other day, maybe a half mile behind me.  When I heard the officer gave him a ticket for 78mph, my first response was "no way in hell".  I'm good at math, so I decided to prove it with numbers.  Take notes, you can use this because its math.  Numbers don't lie (if you don't screw up).

Trig teaches us a couple useful things.  First, one of my favorite equations, A2 + B2 = C2 - this tells you the length of sides of a 90' triangle, C being the hypontenuse.  What does this give us?  Everything we need, IDDQD, I win.

When the officer was tagging people, he was outside the far RIGHT lane, not the usual left lane, being head-on with normal, would-be speeders -- this is a fault of the officer I intend to prove with simple math.  There's also a fundamental flaw in lasers - they ONLY measure the velocity of an object realitive to the device, a perfectly straight line (ok, maybe off by a degree or two, but thats neglegable) -- that's why most officers sit in the left side.  I'm going to first establish the area, and some measurements thanks in part to Live Maps.  These are estimates, but a lot safer than actually going out there and measuring Smile

5pm on I71 south bound on the north end is a bit of a mad-house and usually lasts until 6-6:30 (duh, normal rush hour).  People coming out of Polaris heading home, hitting 270/161/etc makes it a bit on the heavy side if you can't get out before 5.  I'd call it modertate traffic - you aren't changing lanes much and when you do, it might take a few seconds to get over.  Not exactly high-speed territory.  More over, the officer isn't going to get a good clean shot to someone that's floating down the highway in the left lane, especially during this time which doesn't play into his favor.

Here's the area.  The officer sits on the far right, he's in the left lane.  He estimates he was about 100yrds ("about a football field") when he got tagged, which considering the traffic volume, I'd say thats possible.  He also estimates he was going around 70, not 78.  Lanes of traffic in that area are about 30 yards wide.  We have our math.  So let's start with using a perfect triangle (which, as you can tell, its not, we'll get to that).

Using our simple math of 1002 + 302 = x2, our math comes out to 105 for X.  So how fast was he going realtive to the 100yard side?  Easy - 78mph / 105 = X / 100.  This number comes out to about 74mph which is a huge thing.  In Columbus (maybe even the entire state), 10 over is two points on your license, under that is only 1 point and that turns out to a difference on your insurance -- they frown on tickets.  Now you could argue he said he was 100 yards away from the officer, and you'd be right, but comes out to about the same, the lower end of 74mph.

But there's a problem.  The road curves off to the left (east) meaning it isn't 30 yards at the base of the triangle.  By my guess, conservatively, it's 50 yards.


 

 

1002 + 502 = X2 comes out to 111.  78 / 111 = X / 100 comes to ~70mph.  Hmm, that's barely over the limit.  And if you again say "well, he said 100 yards" -- comes out to 67.1mph so by my basic, easy math, from where the officer was and the speed he recorded it COULD be anywhere from 74mph to 67.1mph - granted, yes still technically speeding, but NOT 78mph. You could also argue the officer tried to line up the left lane with where he was, which is plasuable, BUT with the heavier traffic ...I don't think that's realisticly possible to aquire a car though the traffic of that volume.  Hmm, maybe I should send this off to mythbusters?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Automotive | Engineering | Government | Law

Why I like sitefinity

by Jesse 14. October 2008 05:57

Currently I'm finishing up another sitefinity project, yay!  I can't disclose (yet) who it’s for, what it looks like, etc (it's sweet, trust me), but I can share my experiences with it and what I've learned.  I really like sitefinity, it's starting to make sense and I can abuse the system in many many ways.  It provides me a good platform, takes care of 80% of the work and leaves me to develop, keeping me from being a plumber.

Getting the inital project in and "Dev Ready" is easy.  How I do it is create the new template project out on a web server (with the full sitefinity install), setup the project name, etc, and allow the wizard to drop the files on the file system, create a virtual directory and prepare the database.  From there, you have three things accomplished: 1, the bits to check into your source control are there and ready on the file system.  2, your common database is now setup and ready for you. 3, you have your QA environment and a place to push your updated code.  What else could you ask for? Smile  I highly recommend using this setup for a project of any size.

Sitefinity is very developer friendly -- no really!  Since it's all built on .net2, there's a comfort that they're user controls; real, honest to god user controls with .ascx extensions that you can open, move things around, etc etc.  Adding a field to the meta data is easy too, A quick change in the web.config, drop in a label or whatever is necessary, match up the IDs, done.  If you need more than that and have to hit the code behind, "Managers" are your friend.  CmsManager, EventsManager, etc will give you what you need.  Knowing those two things, feature development gets crazy fast.  Do more for your client(s) in less time (wow that sounds like salesman speak).  We look like superheroes, clients love their end product, what's not to like?

If you haven't already, may I suggest looking into Sitefinity.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Starting with Sitefinity

by Jesse 14. October 2008 05:10

If you're new to sitefinity's API, I recommend a slight tweak to the common approach.  The "I'll just create a new one" is not always the best route, nor the easiest.  That said, there are times when creating a module totally outside the realm of sitefinity is necessary.  This is learned with experience and knowing what sitefinity does out of the box.  I believe the most important thing to know is everything, EVERYTHING is based off of content.  Everything.  Generic Content is the most basic module to show this, so I will talk in regards to generic content and hopefully cover a lot of ramp up "how do I use this" time.

Each built in module is branched out into 3 places, effectively: The web.config, the ~/sitefinity/ControlTemplates/<module> and the ~/sitefinity/Admin/ControlTemplates.  Within the web.config is an area that will greatly interest you, the <metafields> area.  This allows you to say "you know, that generic content module is great, but I need 1 more thing in there", this is where you set aside a place in the database for it.

Let me stop here for a second.  There's two parts working behind the scenes you may not be aware of: Content and MetaKeys.  MetaKeys are suppliment info that hangs off of Content.  How I've come to understand how sitefinity saves data is this.  When you save a piece of content, its tossed into the database and an ID is created.  From that ID, metakey values are saved so, say you have a content with an ID of 5823 (its not really this, it saves it as a guid) and after that save, your other metakey values get tossed with that ID associated with it.  Effectively, you're saying to the API "hey, this content has this key, give me whats in there for it" and there you have it.

Sound complicated?  Here's were some of the awesomeness comes in.  Within the ~/sitefinity/admin/controltemplates/ there's two controls, ControlPanelInsert and ControlPanelEdit (guess what they do?) and on those user controls, there's a telerik control named ContentMetaFields -- this is where those values are pumped into those keys and vice versa.  "How do I do that?" ...simply keep the ID of the control in the ContentMetaField in line with your metakeys defined in the web.config.  That's it!

Displaying this data has the same approach -- make sure the control IDs line up.  Take a look at ContentViewSingleItem.ascx under ~/sitefinity/ControlTemplates/<module> and drop a label, give it the new metakey ID and there you go!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Lies, damn lies, statistics and polls

by Jesse 7. October 2008 02:51
Non-coding post warning 

With the upcoming campaigns, the news media has been going ape over polls.  This poll, that poll, one showing X, another showing Y.  I ignore all of them, every single one, but with good reason - you can't trust 'em, at all, ever.  Let me take a step back and start explaining why.  This is a multi-part and involves a lot of "high level" science in part, a bit of football too so stick with me on this.

There's a principle (Heisenberg Uncertainty Principle) that states you cannot know the exact location AND direction of a given particle at the same time.  Knowing either influences the other, therefore making it impossible to know the two at the same instant in time.  A great example is building a road.  You can know where the traffic is going before the new road is built but you cannot accurately predict how it will be used nor how it will affect other roads.  Assumptions can be made and a guess can be formed (simulators) but after the system is affected, location is lost, and you know direction.  Shelf this idea for a moment, let me explain why I firmly believe statistics suck and ignore them.

If you had two reports on your desk, one says "this will save X million people" and the other says "this will kill 10000" ...which one would you pick?  There was a research paper that of course, I can't find, that studied this -- it was exactly the same report, one was slanted toward how many lives would be lost vs how many lives would be saved based on a new drug.  By a huge margin, the saving of X million was more desirable than killing 10000, obviously, yet the result is the same (assuming it went to market of course).  Similar, a company that has a revenue of 50 billion that loses 50% of their revenue in one year (taking them to 25 billion) looks very bad, but returning to 50 billion in the next year, a gain of 200% looks awesome.  The net result is still 0.  You can't just look at a number, a percentage and draw a conclusion - there's always more to the story.  Now to bring these two ideas together...

I feel political polls are a tie of Heisenberg's uncertainty principle and statistics.  There's a billion varieties of polls but I'll use the opinion polls in general and point out the lack of accuracy and reliability -- and most importantly, why I think this.  So say you ask 100000 random (ok, seemingly random) people two things, "Do you think the country is going in the right direction" and "Do you think the president is doing a good job" - two very common questions I see on the news a million times over and yes they are similar yet not 1:1 questions.  I would argue that 1st, the first question, more often than not, influences the other and 2nd, it doesn't contain a check/balance.  Example: if you asked "do you think people at your job are using the internet irresponsibility while on the clock?" a check/balance would say "do you abuse the internet at work?".  Further, applying Heisenberg's principle, I feel knowing the answer at that point in time, you cannot assume the influence of that report will not influence the direction it was going, regadless of positive or negative.  Even more unapparent is the influence of asking people the question!  They feel important for that instant - "I took part in a poll, my opinion is valuable".  So twice over you are affecting the system in a manner that will surely skew the results!  Once by asking, another by publishing.  It's like having room for a road (say its packed dirt) and inviting some people to try it -- others will follow even if it wasn't their idea to begin with since there was an influence to the system.

Now let me be clear, I don't have an answer on how to fix this sort of thing, nor is it a perfect theory.  There's a ton of aspects of psychology I could bring into this too, but it might be a bit much for this single post and if you care that much, you'll seek them out (or just message me).  That said, there's one, surefire way to find out.  You have an election.  Just like football (you were wondering when that was coming?) -- just because a team is far better on paper does NOT mean they will win -- that's why you play the game, to find out because there are NO guarantees until after it's over ...then it's fact/history. Smile

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

science

Image resizing ninjitsu

by Jesse 30. September 2008 07:10

System.Drawing.Images has this cool method, GetThumbnailImage which sounds promising on paper until you use it -- then its a disappointment.  It takes a straight int value, which is whatever you come up with, plug it in and bam, you got an image ...that doesn't follow aspect ratio or anything that you might consider useful.  Well, I think there should be an overload on this method, one that DOES keep that aspect ratio, so I created one.  I'm sure others have, but oh well, I like mine.

First off, I came up with a number that was acceptable to handle an image that was big enough to even bother with -- 320x240 is TV resolution, so I thought that was a good start.  I also came up with a number of 100x100 for a good thumbnail size, but those are treated as maximum values, so no resulting value will exceed 100 in either width or height.  I determined finding a percentage was the best way to get this value right, everytime, regardless of how large the image is.  If you take the largest value, divide it out to get a percentage, there's no possible way the other value will exceed 100.  The formula, if you will, ends up being percent = (Desired Size) / (Largest Value) -- I'm off to start setting this up.  Also, other code will determine that the origional file meets our needs -- its larger than any thumbnail we will make and write up some code to do this...

System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(upload1.FileContent);
int width, height;
if (bmp.Height > 320 || bmp.Width > 240)
{ }
else
{
    width = bmp.Width;
    height = bmp.Height;
}

Remember again our thumbnail's desired size is 100x100 max, so technically we could say bmp.Height > 100 and bmp.width > 100 but for practicality purposes, 320x240 is good enough.  Now we need a bit of code to determine percentage.  Note that int will NOT fit the bill on this, so I picked float.  It's precise enough for what we want to accomplish, and leads me to the following method.

private float DeterminePercentageForResize(int height, int width)
{
     int highestValue;
     if (height > width)
         
highestValue = height;
    
else
         
highestValue = width;

     float percent = 100 / (float)highestValue;

     if (percent > 1 && percent != 0)
          
throw new Exception("Percent cannot be greater than 1 or equal to zero");
    
else 
          return percent;
}

the line that says float percent = 100 / (float)highestValue; is where our 100x100 comes in.  You could pull that out into a constant and change it to whatever you want, as long as it is NOT larger than the original.  We also throw an exception that our percentage cannot be 1 (otherwise, whats the point?) and 0 (multiply by 0 == 0, also meaningless and will probably make me angry).  I now have a float value which is actually desireable, because we need to multiply our percentage by the width/height of the original image ... 

{
float percent = DeterminePercentageForResize(bmp.Height, bmp.Width);

float floatWidth = (float)bmp.Width * percent;
float floatHeight = (float)bmp.Height * percent;

width = Convert.ToInt32(floatWidth);
height = Convert.ToInt32(floatHeight);
}

now we pass over our newly created integers into width/height as such ...

System.Drawing.Image thumb = bmp.GetThumbnailImage(width, height, thumbcall, IntPtr.Zero);
thumb.Save(FileLocation + upload1.FileName);

final code looks something like this... (reference reasons, "thumbnailcallback" comes from MSDN from one of their examples)

private void MakeMeAGoodThumbnail()
{

System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(upload1.FileContent);
int width, height;
if (bmp.Height > 320 || bmp.Width > 240)
{
     float percent = DeterminePercentageForResize(bmp.Height, bmp.Width);

     float floatWidth = (float)bmp.Width * percent; 
     float floatHeight = (float)bmp.Height * percent;

     width = Convert.ToInt32(floatWidth);
     height = Convert.ToInt32(floatHeight);
}

else
{
    width = bmp.Width;
    height = bmp.Height;
}

System.Drawing.Image thumb = bmp.GetThumbnailImage(width, height, thumbcall, IntPtr.Zero);
thumb.Save(FileLocation + upload1.FileName);

}

private float DeterminePercentageForResize(int height, int width)
{
     int highestValue;
     if (height > width)
         
highestValue = height;
    
else
         
highestValue = width;

     float percent = 100 / (float)highestValue;

     if (percent > 1 && percent != 0)
          
throw new Exception("Percent cannot be greater than 1 or equal to zero");
    
else 
          return percent;
}

public bool ThumbnailCallback()
{
     return false;
}

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net

Doing social networking right ...and wrong

by Jesse 24. September 2008 23:46

Recently there was a post out on a blog I read on technet asking "to social network or not" and I'd like to take this a step further.  There's no manual on -how-, much less a -right/wrong- way of social networking, but consider this a loose guidelines.  Why?  I'm seeing two groups, right now, using social networking.  One is doing it right, the other, very wrong.  Just my opinion, but hear me out.

As I stated with my response to the technet blog, I've been finding very little or no value in myspace, linkedin and facebook.  I might even take the leap and say facebook and myspace after you are done with highschool/college are effectively worthless.  LinkedIn can have value, but only in certain circles at certain times.  I contriube this to one flaw: they lack -instant- communication.  Instant Messaging (duh) provides this, BUT there's a knee-jerk "who are you" response if you message someone you don't know, but want something from.  Regardless if that something is advice or a date, the inital reaction is more or less the same.  I blame spammers for this mostly.

Many people, mostly non-nerdy people ask "what is twitter for?".  It's the benefits of instant-ish messaging, without the invasiveness.  If you post something up to a friend, and that persons friend sees it, they can look at what you've posted, see the things you talk about/cover and decide to follow you.  You don't have to follow them if you don't want, and vice versa, so its a nice blend.

Now, onto the "right" and the "wrong".  Some organizations have seen this as a useful tool, a way to contact/connect with people they normally wouldn't in a way thats virtually 0 cost and doesn't have to be work related.  I won't name names, but there's two in particular, that are in the same business, if you're in the central ohio area, you know these places, maybe even their employees by name, but one is doing it right, the other is doing it wrong -- here's my humble opinion as to why.  Interactiveness.  It can get into a fuzzy area and let me use an example of non-interactiveness thats the "right way" to help explain this.  Did you know the Mars Pheonix is on twitter?  Usually you get these updates before the media does, which is cool.  Now, notice it is NOT following anyone, at all.  This makes sense.  The purpose is to send out updates to people, not to recieve them, a media outlet if you will.  Why would it?  So this is a good example of "non-interactive" social networking and a special case, since well, they're on mars, I'm not.

Moving back to "right"/"wrong" and that interactiveness - ideally that's what you manifest: conversations, discussions, community, dialog, whatever you want to call it.  Even simple responses of "hey thanks, its nice to see blah blah", something, ANYTHING is better than totally ignoring it.  If you refuse to do this, I say you're doing it wrong, otherwise whats the point of using a SOCIAL networking service of any kind?  It's -social-, not clique-networking.  One of them is kind of a clique, a silo.  Sure, they're there, but they don't follow the average joe (like me), they don't respond to you, they don't do much but talk among themselves, you ain't part of the cool kids crowd ...the other does on every level.  They follow you, message back to you, ask questions "to the world" and take those responses and make them useful to themselves.  They are doing it right.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Wind storm 2008

by Jesse 15. September 2008 04:22

The great thing about Ohio is we don't get all the "extreme" stuff everyone else gets.  Hurricanes, floods, earthquakes, volcanoes, tornadoes, etc we don't get all that much.  Last night, we got some stupid high winds, so much it took down a lot of trees and totally screwed us in the power department.  The message @ AEP (my power company) said that it might be a week before power is restored...and I live near downtown!  We haven't had power since Sunday around 3pm.  Other bonus, one of the big trees finally let go directly across the street, putting a huge stress on the poles in the area.  Look for the big fork in the middle of the picture.

What's better, the guy's house it fell on -- JUST left for vacation last night.  One of the guys has already called him and there's not much he can do.  So, as a funny, we're going to send him this as a christmas card "from your !@#hole neighbors, Merry Christmas!" with a small caption of "you thought the wind took that tree down?"

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

off topic

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Like the description says, at my core, I'm a scientist and engineer.  I came from humble beginnings on a 486DX2 Packard Hell playing doom2 on IPX to in a small time retail shop and got into hardware (ISO layers FTW!) and it was all downhill from there.  I'm infinitely curious about almost everything and always wanting to know.

Some of the stuff I'm currently into/researching...

Sitefinity

Ninject

Subsonic

Java

Currently working on ...
i did the hundred 
and some extra stuff

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's, their brother nor their dog's view in anyway.  At all.  Ever.

© Copyright 2007-2008