Follow me on Twitter RSS FEED

Last working day at Vertace Consultant

Posted in

It was a great day. To my surprise my Boss(Vasanth anna that’s how I call him) arranged for a small send off party. Ordered pizza and then had a photo session. Im really gonna miss my Boss and his prgming tips, appreciations and sense of humor. He always tells me MNC people don’t appreciate or care others and it’s only possible in SME!

And Prabha, Karthik anna and Prabhu anna. Chatting with all these people is sema fun. Gonna  miss them too L! And also T.nagar office location, All things in one spot!

Vertace , where people have fun at work!

Regular expression for html tags.

Posted in
Regular expression to select tags in a html document.
@"<[/]?(font|p|xml|del|ins|[ovwxp]:\w+)[^>]*?>"
By this way we can remove unwanted tags using Regex.Replace() method.

 issue in c#

Posted in
Code to remove Â in C#
Mostly occurs while working with html document file.
Best option is to replace all occurrences of this character.

  html = Regex.Replace(html, "[^\u0000-\u007F]", " ");//for space
  html = Regex.Replace(html, "[^\u0000-\u007F]", string.Empty);//for empty string

Replace string with only first match in C#

Posted in
Code to replace string with only first match in C#
string ReplaceFirstOccurence(string wordToReplace, string replaceWith, string Input)
        {
            Regex r = new Regex(wordToReplace, RegexOptions.IgnoreCase);
            return r.Replace(Input, replaceWith, 1);
        }

England Vs USA Vs Earth Quake Vs Facebook

Posted in

Fifa football world cup 2010. Previously I never watch football match like cricket. But now because of 4 things.


1.









2.







3.








4.All my Friends’ Facebook and twitter status updates about the fifa world cup about their favorite super stars and team. Thanks to Facebook mobile and twitter mobile now I can receive all their updates in my mobile as SMS.
made me to watch this season of world cup.

Its 13th June 2010, match started by 12AM, UK made their first goal at 6th minute of first half. To my surprise in the last tenth minute, a terrible mistake from England’s Robert Green gave USA one goal to equal the number. Really ridicules miss by the goalkeeper. Exactly 12:55, I change my posture to sit on sofa, within few seconds felt like traveling in a car. But since the game was with last 5 minutes of first half, I didn’t care about that. Again after some 2 seconds, same feel. OMG what’s happening.

Then Changed to local news channel, SUN NEWS which had banner about the earth quake in Chennai, was hit by many places in and around the city.

I switched on my computer and enter in Google just “Earth Quake in” thanks to AJAX Dropdown it displayed “Earth Quake in Andaman”, “Earth Quake in Chennai”. Now that's called the fast information update. And I clicked on first link which took me to myforecast  there its mentioned magnitude as 6.4 which is somewhat high but I didn’t felt that much. Then I switch off my sys’s monitor with standby mode and went back to match to see if there is any chance for England.

10 minutes later got a sms which says”Slippery Green….” That’s one of my friend updated about the match, and he is in Chennai. Thought none knows about earth quake. With 15 mins remaining in second half my hope towards England lost as I know it’s going to be a draw.

Then logged in to Facebook and Gmail saw many post about football match in FB. Many friends were online in Gmail. I asked Vivek and Sathish “Did you feel that?” Vivek didn’t reply but Sathish with “What?” I told him about earth quake and to see the sun news. Donno what happen he said “oh… ok” and went offline. May be he got afraid. And then came reply from Vivek with usual excitement “Hi thala, what feel”. And just drag and drop what I entered for Sathish to his chat window. He replied with “ahaa”. Guess he even didn’t know about that.

So I updated my FB Status with “When ppl updating their status about football match between England vs. USA... Why not the earth quake... Chennai had earthquake at 12:55 AM”. Soon got a comment”yeah I felt the shake” from a friend. And by seeing my FB status my uncle from US called me and asked about the situation here. I said all are fine. Except me none felt about the earth quake in home.

Vivek updated his status with “People who place their hands on head for longtime and watch FIFA match should change their posture coz u can't differentiate if its ur hand shaking or the Earth.....like me !!” and by seeing it I thought so that must be the reason why many didn’t feel LOL. Finally I went to sleep. And got up by 5:30 AM and check my mobile. Which had many status update about football match from twitter and Facebook. But not even one about the natural disaster.

My mobile rings again thought another update about the match. But to my surprise it Sai with “whatever the natural disaster it may be, either an earth quake or a tornado...people won’t stop updating their status in the Facebook in the very next minute EVEN IF IT IS 1AM.... ( RUN FOR THE LIFE IDIOTS!!-GOD MAY WONDER HOW TIS FACEBOOK IS ROCKING THE WORLD)”. At least one updated about the earth quake.

Sms tone again, status update by Vishnu “Robert Green u comedy....

Just wondered how people are interested in updating their status even while watching match. Donno if they are enjoying the match or want just to update their status. May be they want to share their ecstatic moment with all.

This shows that it’s a universal truth that people will watch match even if there is a tremor and update FB status even if there is tornado.

Have a Cheerful day.

Row not found or changed

Row not found or changed


Recently I worked with linq. Linq makes the record insertion, deletion and update much easier in to a database. So I really found very easy in coding it.

The enjoyment not last for a day. Suddenly faced an error “Row not found or changed” while updating a record. But there is no problem with insertion or deletion.

Searched in all forums. People responded with

  • Check if you have given the primary key for table
  • Delete and recreate the dbml 

Did all those but didn’t work for me. I told to my colleague about this issue. Even he asked me if I did above 2 things. Then I showed the code. Below is my code which raised error.


void update(int _ID,String _Name,String _Age)
{
StudentTable _StudentTable = new StudentTable();
_StudentTable.ID=_ID;
_StudentTable.Name=_Name;
_StudentTable.Age=_Age;
using (DataContext dc = new DataContext(ConnectionString))
{
dc.StudentTables.InsertOnSubmit(_StudentTable);
dc.SubmitChanges();
}
}


And he simply laughed at me and told the basic about linq. That every record will have a unique indentifier other than primary key.  In my case ,used a TimeStamp so that it will avoid concurrency issue. Well so for the update he told me I should have first retrieved the record and changed the respective fields in it.

Below is the working code.

void update(int _ID,String _Name,String _Age)
{
StudentTable _StudentTable ;
connString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
using (DataContext dc =new DataContext(connString)
{
_ StudentTable = (from u in dc.StudentTables
where u.ID == ID
select u).FirstOrDefault();
}
_StudentTable.ID=_ID;
_StudentTable.Name=_Name;
_StudentTable.Age=_Age;
using (DataContext dc = new DataContext(ConnectionString))
{
dc.StudentTables.InsertOnSubmit(_StudentTable);
dc.SubmitChanges();
}
}

Really nice experience with linq.

Have a cheerful day

Email tracking and Email marketing software

Posted in
Email tracking is used for monitoring email delivery to user (recipient). This method is widely used to find out the exact time and date when your message was received or opened. Such information as user IP address can also be collected through tracking technology. To use email tracker is quite easy and you don't have to install any spyware or anything else onto you subscribers' computers. Though data provided by email trackers cannot be considered an absolutely accurate one. The information sender typically wants to know is whether recipient actually received the email or clicked the links. You know the exact date (up to exact time) the user used to open your message


Advantages or Purpose
  • You know the amount of times use opened an email and how much time user had spent reading it
  • You can find out where the subscriber is from, because tool can show you an exact location on the map
  • You can easily find out the recipients IP address
  • You can see how many times the message was forwarded (if it was), and opened on different from user's computer
  • You can identify whether the link included in your email was clicked or not, etc.

Some email clients include email tracking option in their software (e.g. Microsoft Office Outlook).


Email marketing software sometimes includes tracking option as an advantage. The main tool it uses to track messages is cookies and web beacons (invisible tracking images that email marketing system insert into the message).

Due to data email tracking, can provide some companies use it to determine how effective their sales and mails are. Others try to better understand their customers' and subscribers' interests and needs. Legal use of email tracking provides useful information and both parts (the companies and the subscribers). If you are using e-mail tracking or e-mail marketing software, your company's privacy policy should state that you may utilize tracking devices such as cookies and web beacons.

One more area the email tracking software can be used is to discover the identity of spammers. Due to most of them use Yahoo or Hotmail it is quite easy to find out who are they. Such information can be very helpful if somebody tries to phishing in the name of legal company.

Thereby email tracking software considered to be useful one. It of course won't make people respond to you any quicker, but you always will know that subscriber has at least read your message. Moreover it is quite convenient way of collecting Data and knowledge about users’ or subscribers’ interest.


Have a Cheerful day.

Display images below

Posted in
Display images below
This is displayed in email client when one receives mail from new sender.


So why this normally asked?
Many might say that to avoid explicit or porno image. Yeap its true, but not in all cases. Cos these images will have tracker which fetches information about user system and cookies stored in temp folder as well.

Whenever you open a mail from spam folder or new sender never click display images below button but only after ensuring the content is from reliable sender.


Even you can track a mail
There is a website called spypig which renders image to the user as a tracker. Just fill some details like your email id, number of times you need to get notified and image details. It renders an image. All you need to do is copy the image and paste it in your mail or blog or social networking sites’. Each and every time when user views the image you will be notified with a mail to your email id. That’s a cool feature but it’s only for fun.

Think about the other mails which you receive. Like mails from corporate companies with contents like offer letter, Money Transaction, Bank Statement and User Account details. Even these mails might have trackers. Just to see if you opened the mail. They use Email marketing software, which provides them all the necessary features for tracking.


Don'ts
Never forward these sought of mails as your identity can be found. Especially kinds like Offer letter, User Account details!

And if you’re smart and do copy and paste content then mail it to others J.These trackers can be anywhere in the body of email and might not always being visible content. It can be even invisible content (web beacons) and not always an image but even some text.
-This is a web beacon :P

Have Wonderful day. Cheers.

A much awaited email

Posted in
AOLMAIL:"You Got Mail"

hearing above words, im excited and wanna know what mail is that? and it should be the mail which im waiting for 3 months.

So from the default screen i moved to inbox,and ... seeing the mail.

never felt so happy and my excitement gone very high.

And its the mail from infosys offering me the job for system engineer-trainee.

Finally going to mysore for the training and its on Dec 6th, well another 2 steps to become a successfull infoscian.

Fix to Windows 7 icon issue

Posted in
My friend had an issue with win7. He dont have any idea how it happen but all the icons changed to windows default icon.














When he told me, i googled and found some fix to this problem.

so here is the solution
  • Try to Restore as all people use to do.
  • Else try to clear the icon cache database.
1. Close all folder windows that are currently open.

2. Launch Task Manager using the CTRL+SHIFT+ESC key sequence, or by running taskmgr.exe.

3. In the Process tab, right-click on the Explorer.exe process and select End Process.

4. Click the End process button when asked for confirmation.

5. From the File menu of Task Manager, select New Task (Run…)

6. Type CMD.EXE, and click OK

7. In the Command Prompt window, type the commands one by one and press ENTER after each command:

CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
EXIT
8. In Task Manager, click File, select New Task (Run…)

9. Type EXPLORER.EXE, and click OK.

Thanks to winhelponline

Creating Transparant(Glassy) Layer For Web Page

Posted in
Lets start creating Glassy Layer.

Step1:
  • Fire Photoshop CS2 and above
  • Double click on the layer to unlock it
  • Erase the white using Eraser tool
  • You ll see black and white checks (transparent area)
  • now add any image or graphics
  • By selecting the item you added previously change the opacity to 45% range
  • after that File->Save for Web & Device...
  • Select the type as png-24 which is found below presets and save it
Now the image file is created.
Step 2:
  • Now in the HTML page use the image created above any other images.
Now this is called UI Experience.

Static background image for web page

Posted in
Many websites have there background image as static even when scroll, So how they do that?
Its just a one piece of CSS code..

background-attachment:fixed;

Even when you scroll this blog the background image is still. Well many times this is very cool but not all times.

Reverse String using XOR and without using Temporary Variable

Posted in
My friend faced this question for TCS technical interview. The code the much simple but the logic is bit complex

char* rev(char* str)
{
int end= strlen(str)-1;
int start = 0;

while( start<end )
{
str[start] ^= str[end];
str[end] ^= str[start];
str[start]^= str[end];

++start;
--end;
}

return str;
}
The the above version is with while loop even one can use for loop instead of it.

XOR (Exclusive OR) table
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
So how does it works.

First operation:x1 = x1 XOR x2
x1:100
x2:111
New x1:011
Second operationx2 = x2 XOR x1
x1:011
x2:111
New x2:100
Third operation:x1 = x1 XOR x2
x1:011
x2:100
New x1:111


So finally we have done X1 and X2 are swapped. This method is for both without using Temporary variable and also using Xor operator...

Pretty Cool huh...

Adding Parameter values to Database Query String

There were always problem with Adding Values to query string...

Consistent way:
const string query = "insert into TABLENAME (Id, Name) Values(?,?)";
object[] ParameterValues = {
IntId,
StrName
};
SqlConnection connection = new SqlConnection(connection_string);
SqlCommand command = new SqlCommand(query, connection);
foreach (object parameterValue in ParameterValues)
{
command.Parameters.AddWithValue("", parameterValue);
}
connection.Open();
command.ExecuteNonQuery();

So with this way we can add all the special characters like without using \(Back slash) to a sql Database.

Hope its usefull..