Posts RSS Comments RSS 129 Posts and 246 Comments till now

Archive for July, 2007

A Cup Of Caffeine

Coffee

I was a bit drowsy this morning in the office. So I quickly went to the pantry and took a cup of coffee from the vending machine. No coins are needed for this vending machine, thank you very much :)

 

After a few sips, I felt much better and started to think what does Wikipedia says about Caffeine. It is an interesting article really. Few things that I noted:

  1. Smoking and drinking coffee IS NOT a good combination. Smoking will shorten the duration of the caffeine effect. So if you drank too much coffee and want to sleep, start puffing!! Bad news for those night watchers which I believe most of them drinking coffee and smoking during the night.
  2. It took at most 45 minutes for the body to completely absorb and distribute the caffeine throughout your body
  3. The caffeine will be active in your body for around 4 hours. It might be longer depends on the age, gender and weight. It is also noted that the effect last much longer for children and pregnant women
  4. There has been success effort to purify caffeine and make them in powder form
  5. Taking too much caffeine might kill you. Estimated around 100 cups of coffee needed. And you must drink this 100s cups in very short time (i.e. the hundredth cup should be drunken when the first cup is still in effect). Of course this is slightly impossible, unless of course, when you snort the powder mentioned before! Announced as the first person who presumed dead because of caffeine is not an achievement you know!

A Thought on Splog

A few days back, a trackback was caught and held as a prisoner by Akismet. Since this is the first time I saw a trackback caught by Akismet, I spent a few minutes visiting the blog that sent the trackback.

 

Apparently the blog is indeed a splog. Basically it just grabbed the first 100s words from the blog post and published it there. A link to the original article also added at the end of the post. Quickly I judged the comment as a trackback from splog which the punishment is damnation to nothingness a.k.a. deletion. But after I clicked the Delete button, I pondered whether I judged fairly or not.

 

When I looked that blog for the second time, that blog actually never steal any content. It grabbed some words from the post, the post writer name also mentioned there, as well as the originated blog. It looks more like a blog aggregator than a splog.

 

To think of it, if we stripped out the commenting and digging/burying from Digg and replaced the user submitted summary into machine generated one, I think Digg will not stand out that far from the splog that sent me a trackback.

 

So does this mean we can make a splog, add few widgets, maybe build a mini community, and finally ‘legally’ called it a blog aggregator?

Movie: Harry Potter, The Order of Pheonix


Watched the movie last night at The Cathay with throng of friends (Yasrof and his wife Dhea, Hendra Gani, Buddie, Hafiz, Pak Cik Adi and Bro Hamonangan).

 

Despite the disappointment of few of my colleagues who have watched the movie earlier, claiming that the movie is a really good lullaby material, I was really sure that the movie wouldn’t be a disappointing one. I mean, come on, the original story is so good. It would be really difficult to make the movie become bad.

 

In the end, I did enjoy the movie very much, thank you. So maybe in a way it follows that “Garbage in, Garbage out” postulate. If you already have a really good material, it would need a really major screw ups to make the output bad.

 

On our way out of the theatre, Hafiz shared to us his experience Harry Potter books. Bro Hamonangan also disclosed that he was discouraged by the thickness of the recent books. Then I am throwing my 2 cents, “Well.. I consider myself lazy. I would rather spent 2 hours to watch the movie than spending countless of hours reading the books.”

 

SPOILER ALERT
Lord Voldemort is actually Harry Potter’s alter ego!!!! Oh NO!!!

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

You know that I am just kidding with you right?

Traversing Database Server using SQL SMO

SQL SMO (SQL Management Object) is a collection of assemblies that shipped together with SQL 2005. This collection of assemblies is all that you need to control your SQL Server. Be it SQL 2005, or SQL 2000, you can control/manipulate it programmatically using SQL SMO.

 

Since SQL SMO gave you the ability to treat the database elements such as Table, Database, Stored Procedure, and Trigger as an object, interacting with them should be relatively easy and practical. Additionally, you might want to check out this list of things that make SQL SMO exciting.

 

OK, lets get our hand dirty with the project. The first step would be importing the references into your project. If you use Visual Studio 2005, look for Microsoft.SqlServer.Smo in the list of .NET assembly when you open ‘Add References’ window.
If you already have MS SQL 2005 installed, you can find the DLLs in the SDK\Assemblies folder of your MS SQL 2005 installation folder.
If you don’t have MS SQL 2005 installed in your computer, you might want to download the Express edition HERE.

 

Next, you could use the following code as reference.

using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using System;
using System.Configuration;
using System.Data.SqlClient;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //Assuming that you include a Configuration file to your
            //project and set the key 'DataSource'
            //as the connection string
            SqlConnection conn = new SqlConnection(
                      ConfigurationManager.AppSettings["DataSource"]
            );
           //Instantiate the connection to the server
	   ServerConnection dbConn = new ServerConnection(conn);
	   //Instantiate the Database Server Object
	  Server dbServer = new Server(dbConn);			

          //Traverse the Database Objects
          foreach (Database db in dbServer.Databases)
          {
              if (db.IsAccessible)
              {
                  //traverse the Stored Procedure Objects
                  foreach (StoredProcedure sp in db.StoredProcedures)
                  {
                      foreach (string str in sp.Script())
                          Console.WriteLine(str);
                  }
                  //Traverse the Table Objects
                  foreach (Table tb in db.Tables)
                  {
                      foreach (string str in tb.Script())
                          Console.WriteLine(str);
                  }
                  //Traverse the View Objects
                  foreach (View vw in db.Views)
                  {
                      foreach (string str in vw.Script())
                          Console.WriteLine(str);
                  }
              }
          }
      }
  }
}

 

Make sure in your app.config you have the DataSource key. You can follow this template for the configuration file:



  
    
  

 

Have fun!

One Serius Disease That Affect Your Blogging Habit

Before you imagining any physical disease that affect your body, I am actually talking about a mental-disease disease that will make your blog posting frequency reduced, then reduced more, and finally became non-existent. Of course you can argue that breaking both of your arms will make blogging out of the equation. But in case you did broke both your arms, I just hope for your quick recovery. If I may suggest, your experience during your recovery should become a valuable experience that can be shared with your future blog readers.

 

The disease that I want to talk is the disease of fear. Fearing that everybody already know what you are going to write. Occasionally, I did experience the same thing. This fear did prevent me writing what I have in mind.

 

There was a time when I was in the mood of writing about something. Then I researched about the subject through Google. The sheer amounts of article written about the subject immediately discouraged me. “Why should I waste my time. There are so many similar articles in the Net. I fear that my article will become one of those junks found in the Internet”.

 

Until eZineArticles send me this article. It really helped me to battle the fear and start writing.

 

Now every time I have this kind of fear, I just tell to myself that as long as I put my best effort, well researched it, and being personal, whatever I write will have a unique touch.

 

So if you occasionally infected by this disease, read the the article above. Hopefully it will help you like it helped me.

Pages (2): [1] 2 »

Close
E-mail It
Socialized through Gregarious 42