Ok, Now I’m Excited!

February 16, 2008 Chris Silivestru Leave a comment

Anyone else looking for to Indiana Jones and the Kingdom of the Crystal Skull? If not, check this out and get back to me….

It’s the first officially released trailer for the film premiering May 22.

Categories: Movies

Adding Tabs to AJAX Tab Container

February 13, 2008 Chris Silivestru 2 comments

I like the AJAX Control Toolkit. It provides a lot of cool functionality that’s great for low/medium weight apps. That said, getting it to do stuff that isn’t straight out of the box can be a pain sometimes.

I use the tab container and I wanted to give the user the option to add a tab to the tab container dynamically at run time. Adding a tab isn’t the problem, it’s adding the content that’s tough.

Adding a Tab:

TabContainerName.Tabs.Add(new AjaxControlToolkit.Tab);

TabContainerName.Tabs[TabIndex].HeaderText = “Whatever you want here”;

The content of each of my tabs involves quite a bit of elements though, each of which need to be replicated and made unique so that I can access them programmatically later on. If you have this problem, you’re faced with writing a reasonably complex control to “extend” the TabContainer control so that every time you add a Tab, it’s a pretty straightforward method call.

OR

You can cheat like me. How many tabs do you need? If you know the max count of tabs, you can load the max number at load time and only make the first one visible. Then, every time the user click the “Add Tab” button (or whatever you have set up to add a tab), you can execute a very simple bit of code to “trick” the user into thinking they’re actually adding a tab.

int numberOfVisibleTabs = 1; //Since you start with one tab

Public void btnClick(blah blah) {

int maxIndex = TabContainerName.Tabs.Count;

for (int i = 0; i < maxIndex; i++) {

if (!TabContainerName.Tabs[i].Visible) {

TabContainerName.Tabs[i].Visible = true;
numberOfVisibleTabs++;

}

}

if (numberOfVisibleTabs == maxIndex)

btn.Enabled = false; //To prevent a null pointer when the user tries to add too many tabs.

}

}

Now remember, I don’t have my code in front of me so I’m writing this with no testing or anything but you should get the idea of what I’m doing. This is a QUICK and DIRTY solution but it works. You can further improve the user experience by putting your tabbed interface in an Update Panel Control so that the postback of each “addition” won’t re-load the whole page.

Categories: Techy Stuff

There’s a Reason Why People Don’t Use VB.net

February 8, 2008 Chris Silivestru 2 comments

It sucks! Probably the most non-standard, childish language I have ever come across.

Here’s a list of the absolute dumbness that is VB.net. If you’ve developed in something other that VB.net, you’ll see exactly what I mean.

Just a few examples:

C#:

  • array_name[element_number]
  • variable = new Integer()
  • list = new ArrayList()
  • public void methodThatDoesNotReturnAnything(Parameters)
  • public String methodThatReturnsString(Parameters)

VB.net:

  • array_name(element_number) –> Roud bracket!?!?!? What the hell?!
  • Dim variable As Integer –> Notice no constructor!!
  • Dim list As New ArrayList –> Again, no constructor!!
  • Public Sub methodThatDoesNotReturnAnything(Parameters)
  • Public Function methodThatReturnsString(Parameters) As String –> VB has 2 different signature styles depending on if the method returns something! Why?

For a full list of differences, checkout this helpful reference.

Categories: Techy Stuff

The Wonders of AJAX

I finally have the privilege to develop a webiste using the AJAX toolkit designed for asp.net. I was so excited! I added references to the System.Web.Extension and System.Web.Extensions.Design binaries, went to the AJAX website and downloaded the Non-Source Version of the AJAX toolkit since I don’t plan to change the functionality of the toolkit itself. I then ran the vsi file and “intalled” AJAX.

Nothing. Ok, so I added the AjaxToolkitControl.dll to my bin folder.

Still nothing. Sometimes Web Developer is kinda finicky so I added all the toolkit controls to my Toolbox, dragged and dropped one of them onto my aspx page. No errors, no warnings.

Build it. STILL nothing.

If you’re like me, you may have spent an hour just trying to figure out what’s wrong. Well, I’ll tell you right here. For an AJAX enabled website, you need several new propertie put into your web.config. (Too many to list here). Unfortunately, they’re not essential to the build process of the site so if you don’t have them, your site may still build fine with AJAX control either not rendering or, when rendered, asking you to locate the source of the control.

Here’s the solution. Ready?

Copy every file except the web.config file. Blow away your entire project and create a new one. Now, magically, there should be an option to create a new AJAX Enabled Website. Choose that and add all your files back in. Voila! It works!

I can’t believe that took me 2.5 hours!

Categories: Techy Stuff

Mah Brothah. He’s… Speshul

My brother sent me this awesome funny pic from lolcats asking which one of us it best describes. Out of self-preservation and self-respect…. I’m going to go with the unimpressed one. You know, the one that seems totally embarrassed by his brother :-)

Twin Olws

Categories: Uncategorized

Yahoo + Microsoft

If you haven’t heard yet, Microsoft has made a bid on Yahoo! for $44.6 Billion. BILLION. Isn’t that more than the GDP of Peru?

You can find the article here.

Categories: Uncategorized

So Close!

I don’t watch football.

I don’t even particularly like football, but every year, I bet on one sporting event all year. You guessed it, it’s the Superbowl. This year, I actually knew more about the Superbowl than most years. For example, I knew it was the 42nd one. I knew who was playing and I knew WHERE they were playing.

Everyone was excited. The audience was divided in half. Half the people I talked to wanted that perfect season to happen, the other half wanted the Giants to win, which in my opinion would make a pretty good movie.  It has Rocky written all over it. The team that goes undefeated and then barely get beat in the last 5 minutes of the game. Ok, so it’s the exact opposite of Rocky, but is still has real potential.

And you all saw it here first. I got dibs!

Anyway, my work always has a Superbowl Pool every year and every year I put down $20. The short version of the story was that if the Giants missed their final conversion kick at the final 2 minute mark, I would pretty much been guaranteed  a $250 profit. And I don’t know you saw the kick but it was pretty close to not being in bounds. Instead, I won nothing because my final score was off by 1. There’s really no feeling like the one when you lose a bet. But, the game was still pretty enjoyable and I got some free drinks and food so it all worked out :-) .

Hope you all enjoyed the game!

Categories: fun

Michael Buble!!

January 30, 2008 Chris Silivestru 1 comment

Ok, for all you “guys” out there who think that Michael Buble is too girly for you, let me tell you that I went to see him on Monday at the Kitchener Aud and it was AWESOME. Horrible dancing aside, he was very entertaining. He sang all of his classics with a few extra ones in there for show and he was really good at incorporating humour into his show. I bet he’s a pretty funny guy.

The girlfriend of course went nuts when she saw him, practically jumping up and down, clapping and foaming at the mouth, but it was pretty cute to see her so excited

The band was really good. Being an ex-swingband player, I like to think I notice the band more than others and they did a fantastic job driving the music. Especially the trumpets. I guess you have to be good to play with Michael.

Now I could go on and on about Michael but everyone knows about him. Ever heard of a little group called Naturally7? Probably not, but they operate out of New York. These guys are awesome entertainers, great singers AND there’s no instruments involved! They sing in a style they cal “Vocal Play” where the voice become the instrument. And let me tell you, if I didn’t see it live and on stage, I would have thought they had a drummer, a base, a flute/trombone/trumpet, an electric guitar, a violin, pretty much any instrument you can think of.

It’s hard to find a clip that does them justice but still, check ‘em out. Anyway, this showcases each of them individually. I didn’t find this one — the Girlfriend did. BTW, this is a direct cam of them performing immediately before Michael Buble.

Also, here’s a music video compliments of my brother.

Categories: Music, fun

Are Ya Kiddin’?

I know Rambo isn’t the most “intelligent” or “deep” movie coming out these days but when Meet the Spartans  beats out an addition to the classic trilogy of Rambo, that should send off country-wide alarm bells. Now, I really don’t know who to blame for this… I really have 2 options.

Option the First: The production companies that fund and approve movies like “Epic Movie” or “Meet the Spartans”.

Option the Second: The people who actually leave their house, drive to theatre and pay their hard-earned cash to view these films.

I’m leaning more toward the second one.

See, I like my movies to have some substance. Anything, really, will do and I thought it would be guaranteed that Rambo would have had a bigger fan pool to draw from than Meet the Spartans. I think that’s what really bugs me…. more and more of these “they’re so dumb they’re funny” movies are being made and I really think that’s putting a pretty big crick in the movie industry’s neck. See, in this metaphor, the movie industry is a person. Get it?

Admittedly,  after all the years of filmaking, writers are probably starting to run out of innovative, thoughtful ideas but I was always raised with the phrase “If you can’t say anything nice, don’t say anything at all”. I think the movie industry can learn something from that.

Categories: Uncategorized

Google and Android

So, here’s the geek part of me coming out a little…

Google just released an SDK for mobile applications. And, since it’s google, it’s free. And again, since it’s google, it’s awesome. Their main page is available here. Not interested yet, uh?

Google has also set aside $10 000 000 for the best apps developed. That’s worth at least taking a quick look, right?

Categories: Techy Stuff