Professor or student?

I have a friend which is not a best programmer and I could even say he doesn’t like programming at all. He had to develop a small application which has one class named “Rectangle” and performs some operations with rectangles.

I’ve helped him with the project and the final application contained the following lines of code:

class Rectangle
{
    private:
        int x1, y1, x2, y2;
        //... some other fields
    public:
        Rectangle(int x1, int y1, int x2, int y2);
        // ... other constructors and methods
}

The professor looked over the code and said: “You can’t declare two variables with the same name, one as a field and one as a parameter, in the same class. Your code will not compile.”… <Straight face> … and (s)he is [I don't want to disclose (s)he's identity] a university professor… and teaches C++.

Blog news – SkypeGadget 2

I had a busy month and I couldn’t write much on the blog.

However I worked on SkypeGadget 2 and I want to announce that it will be released in October (I don’t know yet the release date). Will include many new features like:

  • history and conference support
  • a new interface
  • new options for displaying and sorting the contact list
  • more to come…

If you want to test it before release just send me an e-mail on contact [at] victorhurdugaci.com.

Find misplaced comments and quotation marks

Many programming text editors automatically format comments, string literals, and other syntactical elements. In more primitive environments, a misplaced comment or quotation mark can trip up the compiler. To find the extra comment or quotation mark, insert the following sequence intro your code in C, C++, C# or Java.

/*"/**/

This code phrase will terminate either a comment or string, which is useful in narrowing the space in which the unterminated comment or string is hidden.

obj->text = "Hello world;
// Some other code
delete obj;

This code will raise an error because you forgot a quotation mark after “world”. Placing the /*”/**/ after that line will close the string literal.

obj->text = "Hello world;
// Some other code
delete obj; /*"/**/

The selected text is now a string literal and you won’t get any compilation error. You have limited the search space for the error.

Chuck Norris LHC Facts

  • Chuck Norris can detect both the Higgs boson and the tehnicolor particles.
  • There is only one particle accelerator more powerfull than LHC: Chuck Norris. Particles just keep running from him, nearly at the speed of light.
  • Chuck Norris can kill Schrodinger’s cat for good.
  • Chuck Norris can produce a chain reaction out of any stable isotope just by roundhouse kicking it in the face.
  • Chuck Norris can sucks vacuum.
  • The Higgs boson will be named “The Norris Particle”.
  • Chuck Norris can kick a charm quark and turn it up-side-down.
  • There is only one Higgs Boson, but after a roundhouse kick from Chuck Norris, it became a whole family.
  • Only Chuck Norris can run faster than the proton beam inside LHC.
  • Chuck Norris is so sexy that he can attracts neutrons, without the help of gravity.
  • Chuck Norris can change the spin of the protons with a single round-house kick.
  • Chuck Norris sucks black-holes dry, without the help of Hawking radiation!
  • Chuck Norris can swallow a whole beam of acccelerated particles just for cleaning his teeth.
  • The LHC was built when Chuck Norris accidentally performed a roundhouse kick at a subway station in Zurich.
  • 13.7 billion years ago, Chuck Norris said: “Let there be Big-Bang”
  • No subquarks particles are known to exists because Chuck Norris didn’t roundhouse kick a quark. Yet. When he decide to do this, LHC will became useless in studying the new physics created by those particles.
  • There is no quadrupoles for controlling the proton beam at LHC. Chuck Norris simply stares at the protons and the Higgs boson pops out.
  • Only Chuck Norris can use the LHC ring to propose. Andromeda said yes, but Chuck Norris kicked her in the face and she was projected 2 millions light-years away.
  • LHC doesn’t bring the Apocalipse. Only Chuck Norris can do that.
  • There are no stable particles. Each and every particle exists as long as Chuck Norris looks at it.

Read the rest of this entry »

How to install SQL Server 2008 in almost 4 hours

The title is not really appropriate. I should call this post “How to get on someone’s nerves”.

After a fresh install of Windows Vista and Visual Studio 2008 I went on microsoft.com and downloaded the Express version of SQL Server 2008 (200 MB).

Started the installer and got a message informing me that I need .NET Framework 3.5 SP1 installed. Ok, no problem  – went on the download site and got a 2 MB installer. It downloaded another 39 MB and then it took more time to install than was needed for Visual Studio 2008 Team Suite, Full Install. And it required a restart; Visual Studio Installer did not.

After this I restarted SQL Server installation. Guess what? Another message saying that I need Windows Installer 4.5. Again, go to microsoft.com, download the installer, install the update – took less time than .netfx 3.5sp1 – and restart.

Finally I was able to start SQl Server installer. Guess what? After the first check I got another prerequisites failure: Windows Power Shell. Go to microsoft.com (again), search for PowerShell, go on the download page, verify that Windows is Genuine, download, install. Now I got no warning for SQL Installer – Yupii! (but not for long).

The setup program installed a few componenents and… another check… this time it couldn’t find Visual Studio 2008 SP1… Go to microsoft (for the fourth time), download an 800 MB iso image, mount it and start the installer. Did I tell you that .NET Framework 3.5SP1 took a lot of time to install? Well, SP1 for VS2008 took almost double.

After 4 hours from the initial tentative of installation I was able to successfully complete the setup…

Google Chrome Review

Google released their first browser: Google Chrome.

Below is a quote from Chrome’s website about their motivation of building a browser – probablly is just a nice invented story, most sure it is marketing behind :-)

At Google, we spend much of our time working inside a browser. We search, chat, email and collaborate in a browser. And like all of you, in our spare time, we shop, bank, read news and keep in touch with friends – all using a browser. People are spending an increasing amount of time online, and they’re doing things never imagined when the web first appeared about 15 years ago.

Since we spend so much time online, we began seriously thinking about what kind of browser could exist if you started from scratch and built on the best elements out there. We realized that the web had evolved from mainly simple text pages to rich, interactive applications and that we needed to completely rethink the browser. What we really needed was not just a browser, but also a modern platform for web pages and applications, and that’s what we set out to build.

So today we’re releasing the beta version of a new open source browser: Google Chrome.

Even though it is a beta version it is quite stable and it has some interesting features. Some of them are described below.

Read the rest of this entry »