how to be popular on google

September 28, 2005 under Computers, Internet, Programming

You have to offer something that people will want to read, watch, use or listen to. Rants and ramblings on the price of gas/what you ate for supper last night/that weird smell that’s following you around and pictures of your ear probably won’t cut it. I think I’m on to something. People using Google are doing so on computers. Many computer users are also software developers or, in some manner, hackers (not the malicious kind). So to bring this up again, my C# code example for retrieving a computer’s/router’s external IP address (link) has become a fulcrum for this site ‘o mine.

http://www.google.pt/search?hl=pt-PT&q=retrieve+
external+local+ip+c%23+isp&meta=

http://www.google.com/search?q=unix+how+get+external+
nat+command+line&hl=en&lr=&client=safari&rls=en&start=30&sa=N

http://www.google.ca/search?hl=en&q=c%23+WebRequest+
%22external+ip%22&btnG=Search&meta=

http://www.google.com/search?hl=en&q=get+
router+ip+address+in+C%23

Within the past five days, these four Google queries have brought people to my site; ChrisBellini.com is the first result on two of the queries and sixth on the other two as of today. These are not the first of these queries; they’ve been happening since I originally posted my code. I’d like to think I’m helping fellow software developers who are faced with a similar task that I was and not script kiddies hoping to go down in infamy as a virus/worm/phisher/trojan/rootkit creator. Anybody think that a post about ethics in computing and programming will boost my Google Rankings? Meh. I’ll probably just submit it to Code Project and go back to talking about everything and nothing at all. 😛

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 2 »

me * 2

September 26, 2005 under Life

I recently received email from a Christophe Bellini from France who stumbled upon my website by chance. That in itself seems pretty kewl, but add to the fact that both of our father’s names is Victor as well. Trippy stuff. What are the odds of that happening? Maybe…

For m = total number of possible first names in the entire world, n = total number of possible last names in the entire world, and B = the odds of someone being named Chris Bellini and having a dad named Victor:

B = (1/mn) * (1/mn) = 1/(mn)^2

Assuming I can remember anything at all from classes like Finite Math and Stats, those are small odds which ever way you look at it. If my math is way off, feel free to correct me. Like I said, it’s been a while 😉

PS: Greetings to my facsimile in France 😀

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 1 »

i'm just a regular expression kind of guy

September 15, 2005 under Computers, Programming

Thus far in my young career, I’ve had to parse a lot of data. The data in question is usually a mish-mash of numeric and non-numeric data such as “N120 X3.243 Y0.2 Z0.1 A90 B0” (in this case, I’m talking about G-Code). For most tasks, I have to write code to extract either one or a few of the values, and optionally manipulate and change them to something else. For the most part, I stuck with tokenizing and anazlyzing the data using the tools that were available to me, given the language I was using at the time. When worse came to worse, I wrote my own routines to look for and extract what I needed. And then one day, I stumbled across regular expressions (aka: regex or reg ex). The power that they offer when faced with an ugly parsing task is phenomenal. I’m still not 100% comfortable with the syntax and it’s a tad more difficult when there are different regex engines, many with their own nuances and gotchas. As such, the regex implentation in the .NET Framework is slightly different than, JavaScript‘s implementation, which is slightly different than Python‘s and everybody wants to one-up Perl, but they’re all extremely similar on the whole. Up to this point, when I’ve written regex’s, they’ve been pretty simple and I’m usually either testing for an occurance or extracting a substring.

Yesterday, I finally tried a search and replace, regex-style. I had to go through a lot of phone numbers in a format like “Phone: (xxx)xxx-xxxx” or “Tel: (xxx)xxx-xxxx” and so on. I needed to convert them to something like “xxx-xxx-xxxx”. Replacing it was easy and here’s how I did it with VBS:

' Purpose: Format phone numbers like xxx-xxx-xxxx
'       I: phone number combined with other text, formatted
'          like (xxx)xxx-xxxx
'       O: phone number formatted like xxx-xxx-xxxx
Function FormatPhoneNumber(strPhoneString)
    Dim objRegEx          ' WSH RegEx object
    Dim objMatches        ' Matches object
    Dim strOldPhoneNum    ' extracted phone# in old format
    Dim strNewPhoneNum    ' phone# in new format

 
 
    ' Init the return value to an empty string
    strNewPhoneNum = vbNullString
 
    ' Bail on this record if the phone number is blank
    If (strPhoneString = vbNullString) Then
        FormatPhoneNumber = strNewPhoneNum
        Exit Sub
    End If
 
    ' Pull the phone number out from the format it's
    ' currently in (Ex: "Phone: (xxx)xxx-xxxx") and
    ' format it like this (Ex: "xxx-xxx-xxxx").
    Set objRegEx = New RegExp
 
    objRegEx.Pattern = "\((\d{3})\)(\d{3})-(\d{4})$"
    objRegEx.IgnoreCase = True
    objRegEx.Global = True
 
    Set objMatches = objRegEx.Execute(strPhoneString)
 
    If (objMatches.Count <> 0) Then
        For Each Match in objMatches
            strOldPhoneNum = Match.Value
        Next
 
        strNewPhoneNum = objRegEx.Replace(strOldPhoneNum, _
                                          "$1-$2-$3")
    End If
 
    ' Cleanup
    Set objRegEx = Nothing
    Set objMatches = Nothing
 
    ' Return the formatted phone number
    FormatPhoneNumber = strNewPhoneNum
End Function

Obviously, I had to group the digits of the original phone number into three groups so that I could reuse it in the Replace() method. Handy indeed 🙂

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

pearl-kinney

September 12, 2005 under Music

Amazing. Absolutely amazing.

Last night, Pearl Jam and Sleater-Kinney put on a brilliant show at The Aud. It all started unexpectidly when Eddie Vedder came out on stage while the house lights were still on with nothing but an acoustic guitar and performed a rendition of the Beatles’ “You’ve Got To Hide Your Love Away”. Following that, he introduced Sleater-Kinney. The Aud was just beginning to fill up as S-K took to the stage but that was fine with me. They stuck mostly with songs from One Beat and the new album, The Woods. Dena and Nat weren’t really into S-K and I didn’t really expect them to be; not really part of their musical palette (I’m still amazed, after all this time, that I managed to get Dena to like the Pixies and such). So they spent most of their set buying PJ merch. I, on the other hand, did enjoy S-K‘s performance and concluded that they have much more of a “kick” live than on their recordings. Speaking of kick, Carrie Brownstein was pulling off some impressive Bob Pollard-style kicks. Corin Tucker name dropped “the K Dub” (local vernacular for the combination of the cities of Kitchener and Waterloo), so they obviously did their homework, which was nice to see. They ended their set with a rocktacularly long jam-style version of “Let’s Call It Love”.

By the time Pearl Jam made their way onto the stage, the The Aud was packed. The crowd was varied to say the least; old people, young people, really young people, preppies, jocks, indie geeks, alterna rockers, cougers, old metalheads (in Timmins, these people were known as “tekkers”), princesses, Canadians, Americans…basically everyone and anyone. I thought they would open fast, but they took it slow with “The Long Road” from Merkin Ball, which I didn’t immediately recognize (it’s been a while) . I enjoyed all of the new stuff, particularily “Save You” from Riot Act. But strangely, it didn’t really hit me until I heard the famous opening bass line from “Jeremy” that I was actually seeing Pearl Jam. I was instantly transported back to highschool, doing homework on the floor of my bedroom with Ten blaring on my wimpy Sanyo stereo. And then when they kicked off their second encore with “In My Tree” from No Code, I instantly recalled being at Pat‘s house the day that No Code was released, trying to sell the fact to Pat, Lee Hannigan, Kevin Chellew or anybody that would listen how amazing of a song that “In My Tree” is.

Eddie was suprisingly talkative thoughout the evening. Maybe the bottle of wine that he kept at his side had something to do with it 😉 Of course he leans to left, so he did a lot of praising of Canada’s policies, as most US bands tend to do when they’re here. He got in digs against Bush and US foreign policies as often as he could. For some reason, he chose to pick on Edmonton (all in fun, of course) and played to the Kitchener crowd, who replied with chants of “Eddie, Eddie”. In a wry display of on-the-fly wit, Eddie came back with “What? Is that a nickname for Edmonton that I’m not aware of?”. Clever 😉 Prior to the first encore, Eddie introduced us to Luke the Uke (his ukelele). And Mike McCready was a mad man. He was all over the stage, in the crowd and playing his guitar behind his head; I didn’t expect that kind of energy at all but it was great to behold. To me, they looked exactly like a “professional” rock band should. They did everything right. It’s akin to comparing NHL and AHL players and PJ proved that they were part of the NHL of rock. Speaking of hockey, Eddie even managed to name-drop Luc Robitaille and Chris Chelios.

For the last two songs of their second encore, they turned the house lights back on in The Aud. I thought this was a nice way to end the show, as you can see everything; the band (of course), all of their gear and their entire crew. Very kewl.

To add a little bit of geekiness to this, PJ offer digital bootlegs of all of their concerts on this Canadian tour – somewhat like the Pixies did last fall. However, they are only available as 192 Kbps MP3 downloads instead of a conventional CD, but they’re available within a few hours after the show ended. All of this is done using a Java Web Start app that handles purchasing and downloading. Also included in the downloads are a slew of JPGs from the concert. All of this is only $10, which I think is a good deal.

Overall, PJ‘s performance was top-notch. They culled material from all of their albums and even reached into some b-sides and soundtrack stuff from Big Fish. I was hoping to hear some new material from their upcoming album, but they didn’t play any for whatever reason. I wasn’t disappointed in any way, though. For a band that chose to do things their way, forgoing any marketing and having two recent albums that barely caused a blip commercially (I think Riot Act is superb) it didn’t show last night. They had those of us in audience in the palm of their hands for the entire evening.

Here’s PJ‘s setlist from last night: The Long Road, Last Exit, Animal, Save You, Do The Evolution, Given To Fly, Loveboat Captain, Corduroy, Insignificance, Gimme Some Truth (John Lennon cover), Faithful, Jeremy, Even Flow, Leatherman, Habit, Blood, Soon Forget

1st Encore: Can’t Keep, Man Of The Hour, Elderly Woman Behind The Counter In A Small Town, Daughter/W.M.A., Black, Alive

2nd Encore: In My Tree, Indifference, Betterman, Baba O’Riley (Who cover), Yellow Leadbetter

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 2 »

arms raised in a 'v'

September 11, 2005 under Music

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

katrina and the waves

September 10, 2005 under Politics

I avoided saying anything about this because it distracts from the actual tragedy that Hurricane Katrina has caused for those in Lousiana and Mississippi, but…

It seems to me that everybody is finding something wrong with everyone else and choose not worry about the immediate tasks at hand which should be cleanup, helping those in need and rebuilding the affected areas. People need to get their noses out of the air and quit waving their index fingers at everyone else. A national tragedy happens and people treat it as an opportunity to campaign and push their political views and slander those with opposing views. Save that crap for your next election. Sheesh.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

we rocked sudbury

September 5, 2005 under Life

Dena and I spent the Labour Day long weekend up in Sudbury. We went with my parents to visit my uncle Valerio and my aunt Norie, whom I haven’t seen for quite a while and I don’t get to see often. It was also Dena’s first time meeting them. We also took Dena to Science North, since she had never been there before. She was mostly interested in the flying squirrels and butterfly habitat and didn’t care too much for the robots and Segway, but she definitely had fun. She tasted her first glass of Northern Ale. It was also the first time in a while that she got to experience driving on northern Ontario highways that are built on top/around/through the Canadian Shield. We also had to visit Laurentian University because my dad wanted to see the newly-built medical school building. That university has become much larger since the last time I was on its campus.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

it really whips the llama's ass

September 2, 2005 under Computers, Software

Winamp 5.1 was released today!

Winamp now has a built-in podcast client. Up to this point, I was using iPodder to download from podcast feeds and then I’d listen to them in Winamp. I found that a bit clumsy, but now those days are gone. I came ever-so close to switching to something with built-in podcast support like [GASP] iTunes but I didn’t. There was no way in hell I was going to install that bloated mess of a media player that, for whatever reason, is very geek chic to have on your computer…even for Windows users! I’ve been a faithful Winamp user since the v1.x days and will continue to be one, as long as they don’t mess with what made Justin Frankel‘s app great in the first place. The first tune I listened to with Winamp was a live version of Skinny Puppy‘s “Testure” in MP2 format-yes MP2, not MP3-that I downloaded at a blistering 28.8Kbps. And now that there’s built-in podcast support, which is known as SHOUTcast Wire, the llama-whippin’ fun is even better 🙂

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »