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.