Tuesday, April 25, 2006

I usually don't post stuff like this, but a friend sent this link, and all I can say is man this gal gets clocked. I'm not sure what led up to this, but it looks like news footage from a court building. If you listen, the clockee mentions something about "THC in her system".

http://video.google.com/videoplay?docid=6640225987281635407&pl=true

Tuesday, April 25, 2006 11:33:05 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 
 Monday, April 24, 2006

So Friday night, I played poker with one of my best friends, in his monthly neighborhood game.

The chips were FLYING! I played pretty conservative (imagine that), and I made a couple of really good lay downs. (They showed me their cards, I love it when they do that - validate my play!) But the best hand of the night, didn't win me a ton, but it was so fun to play.

I started off w Ac.gif4c.gif, I think I was the big blind, everyone folded but one player. So in a spot like this you're really hoping you flop a flush, or at least 4 to the flush. The guy I was playing against was a decent player, but he plays really wild, he loses sometimes, but other times that wild image gets him a lot of chips. So I was cautious to say the least.

The flop came As.gif3s.gif6c.gif Cool, I had a pair, but what if he had an ace, he had to have a better kicker (higher card to break a tie). So I casually bet 2x the big blind. He called (initially he had checked). At least I wasn't check raised!

Fourth street produced Ad.gif Wow, now I had a set. It's pretty unlikely he had an ace now. It's possible, but highley unlikely. I made a really weak bet of just under 2x the big blind, to make it look like I was just trying to steal the pot, he raised me 2x the big blind. I just call, trying to act really weak.

The river put the best card in the deck out there for me Ah.gif Now I know for a fact he does not have another ace, unless these guys are using some sort of weird korean deck of cards or something (pause for laughter). So now he bets 2x the big blind, and I move in raising it 4x his raise. He had put so much money in at that point, and I could not figure out what he had, he called me with Js.gifQs.gif I was a tad puzzled, I figured he had to have a 3 or a six, but oh well. It was a nice pot to win, and I feel like I played it perfectly.

Had I bet any more, I'm sure he would have folded. I was able to get second place, I made a really bad 'all in' bluff at the end against Big Slick, and lost Big Time!

Monday, April 24, 2006 8:08:34 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 
 Tuesday, April 18, 2006

On larger projects, I've had this happen quite frequently. You open a lot of files, set break points, and sometime forget to clear them? Well apprently Visual Studio does not like this. I was debugging today and it was taking like 5 seconds to step through the code, line to line.

I had a hunch that maybe breakpoints were my issue, the file I was debugging, only had one breakpoint, but I went to the debug window, and clicked "Clear All Breakponints" the IDE instantly responded, and it was back to lightining quick again.

File under "stupid" or "obscure".

Tuesday, April 18, 2006 3:01:19 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

Just saw this little tidbit, and I plan to download, and add it to my VS2005 instance at home. A spellchecker for Visual Studio 2005! How freaking cool is that? It will check things like alt tags, html text, captions, etc; it even provides suggestions just like Word. You need to have Office and Visual Studio 2005.

Check it out here.

CropperCapture[5].Jpg

Tuesday, April 18, 2006 1:15:11 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, April 13, 2006

Monday nights, I play poker in a free poker league. We play for points, and most of the people playing in the league play almost every night (man I wish I could do that!). Anyways, here is a fun hand I had happen.

I was acting in late position, I looked at my cards to find 10s.gif, 10d.gif, everyone had folded to me, just the small and big blind to act. The guy in the big blind is an aggressive player, and I was sure if I went all in he'd call with a marginal hand. So I moved all in. The small blind folded, and big blind guy called.

He had As 8d. So I felt good about the hand, I mean it's really close to 50/50, at least he only had one over card. (Wow, I actually just put the odds into an odds calculator on www.cardplayer.com, and I was 71.97% to 27.68% -- the hands would tie less than 1% of the time.)

Anyhow, the flop came:

   10C.gif, 10h.gif, Ad.gif

I think my opponent just saw his ace at first, because he seemed happy until he realized I had flopped quads. Four of a kind! The turn (which was irrelevant, there was no way I could lose at this point) was an 8s.gif, and the river produced the Ac.gif.

So the quads saved me. He had lost his hand a FULL HOUSE, aces full of eights. He muttered to himself, and left the table, a little annoyed I think.

Anyhow, it was one of those really fun hands that will statistically almost never happen.

Thursday, April 13, 2006 1:33:12 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 

I'm digging .NET 2.0! I can say for sure, that it's going to seem like forever waitng to switch over to it at work, but that's ok. So one of the things in .NET 1.1 that was decent, but could use improvement was client uploaded files via the browser.

Enter .NET 2.0 FileUpload Control. Now this may seem geeky, well, I guess if you are reading this you're either a friend, or a geek, so.... The coolest thing about the new 2.0 control is that you don't have to mess around withe MultiPart encded forms. Yep, this baby sits inside a 'normal' <form> tag. Wooooo!

And since it's now a <asp:> control type, you can run validators against it. No more making the user upload a file to determine if it's the correct type, or having to write javascript to check the input box. The really cool thing is that it just works.

Just add the following .aspx code

<asp:FileUpLoad id="FileUpLoad1" runat="server" />
<asp:Button id="UploadBtn" Text="Upload File" OnClick="UploadBtn_Click" runat="server" Width="105px" />

Like I said you can even add Regex, Required Field, etc. validators and set the ControlToValidate argument to the name of your upload control.

Originally, in the codebehind I was doing this:

protected void UploadBtn_Click(object sender, EventArgs e)
{
   if
(FileUpLoad1.HasFile)
   {
      FileUpLoad1.SaveAs(FilePath
+ FileUpLoad1.FileName);
      //Then I was doing a bunch of GDI stuff to work on the image, sized it, and created a new image and saved it.
      //
The problem came when I wanted to delete the original as uploaded above.
      //snip
      
   }
}

Even after getting a handle to the file as an image, from the disk, AND calling the dispose method on the object when I was done with it, I'd still get an exception stating that the file was in use by another process when I was trying to delete the original.

So I talked w/ a guy at work here named Stuart (see blogroll on the right) and he mentioned that it would be good if I could work with it as a stream, instead of having to write it to the disk. So after some playing, I came up with this!

protected void UploadBtn_Click(object sender, EventArgs e)
{
   if
(FileUpLoad1.HasFile)
   {
      //Instead of saving the image, I just assign my variable to the Upload Control's instance of the file as a STREAM.
      System.Drawing.Image imgPhotoResize = System.Drawing.Image.FromStream(FileUploadControl.FileContent);
      
   }
}

Nice! Now there's no file to cleanup when I'm done, all I have to do is save the file from my Image object, and call Dispose() on my instance of that object:

   imgPhotoResize.Dispose();

Thursday, April 13, 2006 8:48:08 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, April 06, 2006

So in diagnosing the problem below, it would have maybe been helpful to see the IIS logs, At the time I was using the built in web server (for development) that ships with VS 2005. It requires that you address it via localhost, on a port other than what IIS uses. I tried to have a firend hit it using my Dynamic DNS service, and he could not. He could hit my IIS instance on port 80.

Later, I did find you could do this: Go to your web application properties, start options, choose use custom server, and then put the path to your web application in. You'll have to go into IIS and setup a site, or virtual directory for your app.

 

Thursday, April 06, 2006 7:33:05 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

So I'm into my second night of VS2005, and .NET 2.0. I'm working on a super secret project with a friend of mine. Hopefully we'll have something fun to show in a month or so. Anyways, I decided why not use .NET 2.0?

So I could just code it in 2.0, the way that I would in 1.1, but what would that accomplish? So I've got a really good book, and I'm teaching myself as I go.

One of the first things in .NET 2.0 that sounded really cool (actually it is pretty cool) is Master Pages. A Master Page is basically a file that you define that you can have other pages visually inherit from. What this means is the 10 pages of our site that all have the same layout inherit from one master page. If we want to move the ads, or switch the navigation, it's one file to edit.

Inside a Master Page, you can define areas that are for content. You then add Content Pages to VS 2005. So here comes the issue I ran into, and it took a while to figure out:

   Issue:
   My Master Page was defined as MasterPage.master. I added a bunch of HTML, added a content
   page called default.aspx that was linked to the Master Page. The default content page had the
   word test in it printed from the codebehind. Every time I debugged into this codebehind call,
   I noticed the Page_Load event was being called twice, and it was never a postback. I messed
   around with AutoEventWireUp in both the Master Page and the Content Page, to no avail.

   Solution:
   
I started removing HTML. When I went back to a blank page, w/ no additional HTML, the page
   events behaved correctly. I finally found this was causing the problem (my bad HTML).

      <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
      
</asp:contentplaceholder>

      <div style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><img alt="#" src="#"/></div>

   
Removing the div tags w/ the inline styles stopped the events from firiing twice. Sure maybe
   it's bad to have inline styles applied to a div, but man I wouldn't expect that type of behaviour.

   I'm going to tackle THEMES and SKINS next, so I'm sure I'll see why soon.

Thursday, April 06, 2006 7:20:17 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 

So I live in a decent neighborhood, it's not like Donald Trump is gonna land anywhere near where I live, but I also don't worry too much about crime, or 'hooligans'. It's kind of like Pleasantville, without the idiosyncrasies that made that movie creepy.

So in a neighborhood plastered with sidewalks, why do people walk down the side of the street? I just don't get it. Here's the capper, yesterday, I saw a woman pushing a baby stroller down the street. When she got to parked cars, instead of using the sidewalk, she walked past the cars in the middle of the street.

I see this many times per week. Walkers, runners, moms. What the hell? I don't get it. Then to top it of you get these awful looks when you drive past them. Can someone explain this to me?

Thursday, April 06, 2006 7:58:52 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Sunday, April 02, 2006

Friday night was a ton of fun. My wife and daughter were out of town, so I hosted a poker game. We had 12 people show up, and it was one of the weirdest poker nights for me in a long time. I dealt most of the night, we ran two tables, each having six players.

I swear that almost every single hand I dealt either had the makings of a flush, or a straight, and a lot of straight flush possibilities. One of the first hands of the night I started off with:

  5s.gif, 6h.gif

A nice little connector I thought, so I limped in to see a flop, which came: 7c.gif, 8c.gif, Kd.gif. Nobody seemed that interested in the pot, so I bluffed at it for 2x the big blind. Two callers. The turn comes 9h.gif. Sweet I've made my straight! So I check. It checks around... damn. The last card Jc.gif. So I bet about five times the big blind. One guy folds, the other raises me the same amount, I call, and loose to a flush. Doh! I didn't even notice it.

Ok, not a big deal, still have plenty of chips. But now I'm gunshy. So a few hands later, I get pocket sevens (7s.gif, 7h.gif). I call the bets and the flop comes 7c.gif, 8c.gif, 9d.gif. Crap. I've flopped a set, but man there's a flush possibility, and a straight draw. So I bet big, 6x the big blind.

Two people call. Crap. Now the Jc.gifcomes off. Great. I check. Two more huge bets. I think I'm so smart and say, "I'm gonna lay this one down...." The river comes off w/ 2d.gifsomething innoculous. The two huge betters reveal their hands, a pair of kings, and two pair! Damn... I made the wrong call again.

That's really not like me.

Ok so I figure, time to recompose myself. Let those two hands go.

So here's where the night got interesting, my neighbor Brent, was just TEARING through the competiion, he had knocked three people out (2 of them rebought into the game, to be knocked out minutes later) then it was time to combine the two tables.

We all played for a while, and two or three people got knocked out. Brent was poised to win the tournamnet, no questions, hands down, when he leaned over to me and said "My babysitter has to leave at midnight, do you think I'd win if I stayed?"

I said, "Dude, you'd have to be a moron to lose with the amount of chips that you have."

He was bummed out because 1st place paid $150 on a $20 entry. So out of desperation, or frustration, he started betting all his chips on every hand, no matter what cards he had. Now this may seem cool, for someone that had a good hand, but the thing to remember in a situation like this is, if you lose the race against a chip bully, you're out of the tournament!

So one of the very last hands before he had to go, Brent moves all in with Js.gifand 6c.gif. Most of everyone folds, but my good friend eric pauses and says "I have a good hand". He's obviously conflicted, but I know the thought, "If I beat this guy, who has to leave, who does not care if he wins this hand, I'd be poised to win this thing".

So Eric pushes all his chips into the pot. Then a few people later, Darren, decides to go all in as well. Amazing. So our seven handed game has the opportunity (for me) to go from 7 players to 4 (if Brent wins since he's leaving). I think I even said aloud, "I don't know why you guys would tangle with Brent, since he's leaving.... he'll probably knock you out of the game."

Well Eric turns over Ad.gif9c.gif (suit is not important in this hand), Darren turns over Ah.gif10s.gif, and Brent turns over Jh.gif6s.gif. Darren is a strong favorite in this situation. The flop came three rags (4d.gif2c.gifQs.gif) so Darren is still in front, then the Jc.gif came on the turn. Brent is in the lead. The only way Darren can win, is to get an Ace, and Eric is pretty much out of the game at this point. The river brings a 6d.gif, giving brent two pair, Jacks and sixes. Eric and Darren are out of the game.

Brent plays a few more hands, and keeps pushing all in... he thinks he's trying to give his chips away, but everyone just concedes folding their cards. I laid down an Ace Jack, that would have won, but I did not want to risk my position. After Brent leaves, it's just four of us now. It would have been very tough for me to make 1st, 2nd, or 3rd. But now, I'm way better off.

Long story short, we played for another hour or so, and I was able to win the match. Another point, when playing a tournament format, make sure that you can stay for as long as the tournament will run, seldom do we ever finish before midnight. I was shocked when Brent said he could not stay later.

Oh yeah my new table I'm building is about 60% complete, here is a shot of the LCD monitor embedded into the table to keep track of the blinds, and run our tournament software.

Sunday, April 02, 2006 11:29:43 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [4]  |