Real Time Web Analytics

April 6, 2010 2 comments

Awesome! once you register in http://getclicky.com you’ll take advantage of real time tracking your web site’s traffic.
Also you can display its stats on your web site as a widget.
Free account provides only tracking of one web site.

Format Your Code to Publish on Web

When we write code such as C# to publish on our blogs or web sites, it’s better to format it using CSS and HTML instead of screen-shot the code. this provides copy and paste functionality.

The best way is to automate the process of formatting the code. Most of forums, blogs and web sites provide some specific tags to format your code, but if no we need to find a work-around to achieve this.

After a quick search on the web I found web site which provides such functionality for C#, VB, T-SQL, ASPX, XML and HTML along with options such as line numbers, alternate line background and embed style-sheet.

You can also download .Net Source Code for this application and extent the functionality. for example I needed to format my code with Inline CSS style.

Also there are some helpful tools such as Markdown

Happy Styling…

Categories: General Tags: , ,

Tweet to Email

April 6, 2010 2 comments

My friend Ali Bin Yahia has taken a good step to extend Twitter functionality. Ali published his new web site Tweet to Email which will enable Twitter users to send tweets to their Non-Twitter friends.
Tweet to Email enables its users to add groups. each group of them would contain a list of emails and tagged by predefined hash tags such as #TM1.
You need to add your Twitter Id to your Tweet to Email profile and to add the right hash tag to your tweet.
Tweet to Email checks Twitter every 2 minutes. Messages would be sent based on Twitter Id and the Hash Tag mentioned in the tweet.

Tweet to Email

Categories: General Tags: ,

C# – Reverse Strings

April 6, 2010 1 comment

Sometimes we might need to reverse string letters order. unfortunately, String class in .Net Framework up to version 3.5 doesn’t have a Reverse Method. here I will try to add Reverse Extension Method  to String class.

The idea behind string reverse is converting the string to an array of chars and then apply Array.Reverse() method and again convert the array of chars to string. see code

public string ReverseString(string originalString)
{
 char[] strArray = originalString.ToCharArray();
 Array.Reverse(strArray);
 string strReversed = new string(strArray);
 return strReversed;
}

For simplicity, StringHelper class is created to provide string.Reverse method as Extension Method
public static class StringHelper
{
 public static string ReverseString(string originalString)
 {
  char[] strArray = originalString.ToCharArray();
  Array.Reverse(strArray);
  string strReversed = new string(strArray);
  return strReversed;
 }

 public static string Reverse(this string originalString)
 {
  char[] strArray = originalString.ToCharArray();
  Array.Reverse(strArray);
  string strReversed = new string(strArray);
  return strReversed;
 }
}

Easy to use
string str = "abcdef";
string ReversedStr = str.Reverse();

Happy Coding…

Shout it kick it on DotNetKicks.com Retweet

Categories: C# Tags: ,

My Trip to The Holy Places

April 5, 2010 3 comments

Hi Guys, I have been to Saudi Arabia last few days. it was very good trip to Islamic Holy Places.

Here are some photos I captured during my trip.

Kaaba

Kaaba

Kaaba

Kaaba

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Quba Mosque

Quba Mosque

Al-Baqi' cemetery

Al-Baqi' cemetery

Mount Uhud

Mount Uhud

Mount Uhud

Mount Uhud

Monkeys live in Mountains!

Monkeys live in Mountains!

“Sound Like” Strings

March 31, 2010 2 comments

Two days back, a colleague of mine asked How can he retrieve all rows which have similar employee names.

The situation, there are two tables/Excel sheets he has got from two different sources for the same set of employees. he needs to extract some information from both. the employee name column is the key to identity each one of these employees. the challenge here, employee name is not exactly the same in the two files.

The first solution jumped on the table is similar names. SQL Server provides us with some functions which will help us to achieve this task such as SOUNDEX() and DIFFERENCE().

Here is an example, assume there is a table like below

This table contains some of my friends’ names. as this table shows I have 5 friends share similar names with “Mhmd” letters but with different form for each one of them.

Now I want to write T-SQL query which should give me all friends whose name sounds similar “Mhmd”.

I wrote this query

SELECT     FriendFisrtName, FriendLastName
FROM       MyFriends
WHERE      SOUNDEX('Mhmd') = SOUNDEX(FriendFisrtName)

And I got this result set

Hope this helps…

Shout it kick it on DotNetKicks.com Retweet

My SQL Server Reporting Services Presentation

March 31, 2010 Leave a comment

First off, good night or it might be good morning in the other side of the world. however, I am here to share my presentation about SQL Server Reporting Services (SSRS) with you/DEVelopers.

It was a quick overview to clarify and simplify the concepts under the Reporting Generation Tools and did some practices using  MS SSRS.

Session Slides are shared through SlideSahre

Categories: SQL Server Tags: ,
Follow

Get every new post delivered to your Inbox.