Dealing with Time.. Be Careful!

Dealing with time is something crucial that we need to a pay very close attention to it. I like the aphorism  that say " Time is like a river. You can’t touch the same water twice", This is very true statement and I am having it in front of me every single minute in my every day.

In my past days I wasted many days doing not useful things. I have a guilty feeling because of that and I hope if I can go back to fix that. But there is no Time-Machine that will get me back to that time to fix my mistakes. I hope if I can have a time-machine that will lead me to correct my mistakes I made in the past. I learned that in the hard way while I could learn it in the easy way if I listen to my father or teacher when they were telling me about an Arabic aphorism that says "Time life like a blade, if you did not kill it; it is going to kill you" meaning if you did not utilize your time in a very useful things, this will fire back on you after a while.

These days, I am trying to utilize every single minutes in my day and optimize my life for that. Well, I admit this is very hard but I would not make the same mistake as the old days. One thing that trigger me to write this article is a discussion I have with one of my family members about the impotency of time and how we should deal with it.He wanted to spend most of his time playing games and at coffee-shops. I was totally against this while he was trying to convenes me with his thought which I was totally disagree on them.

I believe you have to do funny things and spend time with family and friends but that does not means wasting the whole holiday days doing such a stuff. Playing Computer games , gambling , and spend the whole night with friends is not the best thing that you can do during holidays. For me, I need to balance between spending time with family/friends and reading and enhance my knowledge.

I would love to hear from you on this topic, Please share your thoughts on this topic by commenting on this article

Outsourcing What and When?

Outsourcing becoming part of the core business of any successful business these days, one of the very nice articles I read couple of weeks ago was about outsourcing. It is explaining the outsourcing in a very good way and explain what to Outsource and when to do that. The subject of this article was "Outsourcing: What and When?" I strongly recommend to have couple of minutes reading this site.

Date different in SQL server Vs Oracle

 

While setting back in my chair today and thinking of the power that MS tools giving to us , I decided to do a very small compare of things I can do in SQL server and how can I do the same thing in Oracle.

I decided to do a very primitive operation on both DBs… something is very silly. Just to get the differences between 2 dates in Weeks. This is very easy thing

In SQL Server I could do that in single line of SQL Statement

SELECT DATEDIFF (ww, ’03/20/1983′, ’11/03/2010′) DiffInWeeks_SQLServer

While I could do the same operation in Oracle by a long equation comparing with the one I have for SQL Serer:

SELECT   (to_date(’03/20/1983′,’mm/dd/yyyy’)  – to_date(’11/03/2010′,’mm/dd/yyyy’) 

             )  / 7.0) DiffInWeeks_Oracle

FROM DUAL;

 

I still like working on Microsoft platforms.

How Can I Enhance the Performance of .Net Application?

The performance of any system is considered as a key part of the requirements that client usually ask for implicitly. The poor perform application is most likely going to be failed because of that even if it is doing lot of very cool functionalities.
Recently I read an interesting article about this topic published on CodeGuru. They highlighted couple of key actions that is easy to be implemented and they are almost effortless but at the end those actions will improve the overall performance of you application by better utilization of server CPUs.
They depending on the fact that the CPUs we have these days is much sophisticated that previous days and we need to take benefits of that. I strongly recommend reading this article

Substring Java Script function (left and right)

There is no built in functions inside Jscript to extract left or right substring from specific string… the following functions are customized to do so..

function LeftSubString(stringValue, length)
{
if (length <= 0)
    return "";
else if (length > String(stringValue).length)
    return stringValue;
else
    return String(stringValue).substring(0,length);
}

function RightSubString(stringValue, length){
if (length <= 0)
    return "";
else if (length > String(stringValue).length)
    return stringValue;
else {
     var iLen = String(stringValue).length;
     return String(stringValue).substring(iLen, iLen – length);
    }
}

Reading Data from Excel by using SQL Statements & ODBC

In many cases I had to query data from excel sheet with large number of records … of course I can do this by using filtering feature from MS excel, many developer prefer writing sql statements instead of using filtering feature built into MS Excel. Using Sql statements to query data from Excel sheet will make developer life easier. You can load this sheet into DB server then query it using the ordinary tables, actually this is not the optimum solution for this case.. You can query excel sheet without load it into DB server.

By using ODBC you can query excel sheet’s data without loading it into DB from inside Query analyzer or MS Sql Management studio…. It is very simple query and u can even filter by writing your own WHERE condition.

To query data form MS Excel 2003 you can use the following Select Statement:

SELECT *

FROM OPENROWSET(‘Microsoft.Jet.OLEDB.4.0’, ‘Excel 8.0;DATABASE=FileNameWithPath.xls’,

‘Select * from [Sheet1$]’)

And form MS Excel 2007 you can use the following select statement:

SELECT *

FROM OPENROWSET(‘Microsoft.ACE.OLEDB.12.0′,’Excel 12.0;Database=FileNameWithPath.xlsx;HDR=No;IMEX=1’,

‘select * from [Sheet1$]’)

For example:

Suppose you have an excel sheet with 3 columns; firstName,lastName and Email.And this sheet is stored at C:\Filename.xsl on your hard drive… to query this file:

SELECT *

FROM OPENROWSET(‘Microsoft.Jet.OLEDB.4.0’, ‘Excel 8.0;DATABASE=c:\filename.xls’,

‘Select * from [Sheet1$]’)

How to know SQL Server version and Service Pack(SP)

Many time I stuck with a question… what is this DB Server version and what Service pack is installed on it? What is the easiest way to know DB edition? I asked this question to a friend of mine and he gave me the following simple Select statement that answered my questions.

SELECT SERVERPROPERTY(‘productversion’) AS version

, SERVERPROPERTY (‘productlevel’) AS SP

, SERVERPROPERTY (‘edition’) AS DbEdition

 

I hope you will find it useful 🙂

Contenet Management System (CMS)

What is CMS?

    Computer management system (CMS) is computer software that is used to create, edit and publish contents of websites. Typically, CMS is used to store, control, versioning and publish industry-specific documentations such as manuals, guides, articles…etc. CMS’s users are supposed to edit and publish content of his own site without involving any technical resources. CMS system mainly contains 2 subsystems, which are: Content Management application (CMA) and the content delivery application (CDA).

What is Content Management Application (CMA)?

      This subsystem allow content manager or content author, who have no technical background on HTML editing , to create, edit, delete content from website with no need for any technical resources.

What is Content Delivery Application (CDA)?

      This subsystem is responsible about rendering the content that already managed by CMA on user’s browser.

CMS Features:

  1. Store documents, videos and other type of electronic files.

  2. Publishing feature of CMS allows users to choose a template from a pre-defined set of templates adopted by organization, as well as using wizards and other tools to manage web site contents. Format management feature of CMS is responsible about how to render documents into HTML or PDF formats.

  3. Versioning feature of CMS allows users to update contents without losing the old contents. This feature enable users to get back to old contents any time and even restore it back to website as well as keep tracking of changes had been done on website contents.

  4. Searching feature of CMS allows users to search for website contents by using keywords. This means that CMS system should indexes all data and website contents.

  5. Identify the main users and their roles within CMS system.

  6. The ability to assign specific security permission for a specific document.

  7. Define workflows, tasks and even events messaging so that author of the content got notified of any change.

Why do you need CMS?

     When your organization has a public website or an intranet site and this site has grown over the time. And much of the content of this site start being out-dated or inaccurate and you can’t find things. As well as you have to update the content of this site periodically with no need for technical resource. You start lost tracking of pages on your website.

Actually these problems are natural when you are using manual tools to edit your site… manual tools like Dreamweaver, Frontpage..etc.

CMS system is specifically designed to solve all of the above issues.

Benefits from using CMS:

  1. Make editing your site easier and straightforward.
  2. Your site will have a consistent look and feel.
  3. Improved site navigation.
  4. Increased security.
  5. Reduced duplication of information.
  6. Greater capacity for growth.
  7. Reduced site maintenance costs.
  8. Keep track of site changes.
  9. Support your business goals and strategies, by improve Sales and user satisfaction as well as make communication with public more efficient.

Search Issue when using Visual Studio 2003 on Windows Vista Operating system

A couple of days ago, I faced a small issue when I tried to search specific value inside VS 2003 solutions while I have MS Windows Vista OS installed on my PC…. Doing searching will cause VS 2003 to be hanged and stop responding.. I overcome this issue by Disable Visual Themes for VS 2003.. To do so please follow the following steps:

  1. Right click on VS 2003 shortcut

  2. On compatibility tab , make sure to check "Disable Visual Themes" check box

  3. Click on OK button..

Now , You can enjoy Searching your VS 2003 solution.

Autocomplete (IntelliSense) While Writing SQL Statements; How Nice is SQL Prompt

As a .Net developer who using Visual Studio from early morning till late evening, I like the way MS designed the IntelliSense feature there. and I was so disappointed because there is no such a feature while you are using SQL Server Management Studio.

In version 2008 of SQL server Management Studio, MS solved the IntelliSense issue there but that was specifically if you are connecting to SQL Server 2008 backend engine.But I still need to use this feature while I am using SQL server 2000 and 2005 SQL server engines.

I found a very good software from Red-Gate called SQL Prompt, this software is doing a very nice job for me and solved all of my issues related to IntelliSense.

I have been using this software for 3 years till the moment I am writing this article, and I am still believe on it and if I start writing SQL statement without using it, I feel my life like a hell.

For me the IntelliSense feature of  SQL Prompt is much better than the one that MS developed on SQL server 2008. and Red-Gate is keeping enhancing it and making it much better everyday.

Code snap it on SQL prompt is amazing and saving my time a lot. You can define a keyword and its related SQL statements, once you type this keyword and then tab out, SQL Prompt will place the related SQL statements for you. For example, if you type “ssf” and tab out, SQL prompt will replace it by “SELECT * FROM “

As a conclusion, I would strongly recommend to you to use it during your daily development day.