How to (Full and Transaction Log) backup and restore a database in Microsoft SQL Server 2005
2008-12-04 In this article I will discus how to backup a database as a FULL backup or with Transaction Log (Tail Log) backup and how to restore the database, how to recover transactions made after you taking the backup, etc. Since it is not easy to use and organize images in the post itself I have uploaded a compiled pdf file of this article. Please download the complete manual from following link: How to backup and restore a database in Mic...
The Structure-Conduct-Performance Model
2010-04-01 In 1930s, a group of economists developed an approach to understand relationship among a firm’s environment, behaviour and performance. This theoretical framework, since then, is known as the Structure-Conduct-Performance (S-C-P) Model. Structure, in this model refers to the structure of the industry in which the...
ASP.NET - AutoPostBack : What is AutoPostBack and How AutoPostBack Works
2008-12-26 Today I was experimenting on a grid view where I was trying to select multiple rows of the grid view using a check box column. I wrote some code in the CheckedChanged of checkbox but then I found that the code was not executed when the state of the checkbox is changed. So I did a little googling and found out about this AutoPostBack property. This property defines whether the control should post back to the server each time when the ...
How to Suggest Values or Autocomplete Values When A User Types Into a Combo Box
08-06-2012 .Net has a 5 seconds super easy way to achieve this. Use ComboBox.AutoCompleteSource and ComboBox.AutoCompleteMode properties: (Available from .Net 2.0 onwards) Steps: Load all possible values to ComboBox.Items collection - this is the easiest source available. Select Properties of the ComboBox and select ComboBox1.AutoCompleteSource to "List Items" Select ComboBox.AutoCompleteMode to anything other than "none" &nb...
How To Check For Full SubStrings In A Comma Separated String
22/07/2013 How to avoid detecting substrings, how to check for perfect substrings, avoid detecting substrings, avoid detecting substrings when checked for substrings. Today I needed to find if a string is contained within a string. So I used the most straight forward method (I used SQL but this works for any language) declare @msgsToSkip varchar(max) = 'geoLocation,statusUpdateCheck,forceClose'; ...
How to Search for UnRead Emails On Gmail?
26-09-2012 How to find un-read emails that are hidden under stacks and stacks of read emails? Simple, just add is:unread to your search then Gmail will bring all unread emails relevant to your search. For example, if you want to see all unread emails from your Friends circle: Usually you would use circle:friends in the search box. To get the unread ones, add is:unread to it. circle:friends is:unread This will bring unread emails...
How To Choose Between ItemsSource and DataContext
2012-02-24 // LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15; // ]]> // I usually use ItemsSource property when I need to databind a control in WPF because it's straightforward and the framework does everything for me. However, I came accross a situation where I had to do all data formatting and stuff for a DataGrid. In such a case the best method is to use the DataContext property. The DataCont...
/// Stops asp.net from encoding the source HTML string.
public static IHtmlString HTMLRaw(string source)
return new HtmlString(source);
call this function whenever you want asp.net NOT to encode the string.
Note: You can use <%= and %> tags to avoid encoding as well.
StackOverFlow has become a popular site over the years. This unfortunately has given wings to their owners and senior members who beleive they have an almighty power to control anything a junior/new member says.
StackOverFlow is utilizing an interesting strategy to maintain their site at ZERO cost. They have introduced a points system according to which people with more points get the almighty power.
And the most stupid thing is that they give “MORE” points when someone “EDIT” or “CRITICIZE” someone else s comment/opinion.
This has made a massive circle of so-called “senior” guys who will find something in a relatively “junior” persons post.
Basically, if you are new to the site, your post will be “EDITED” so many times since you publish it.
Don’t get me wrong this DOES NOT mean that those senior guys give you a solution. Oh No!
All they do is “EDIT” your post!
They will find something, a spelling mistake most of the time.
They are also good at finding a similar post and then criticize your post saying it’s a “DUPLICATE”
The most funny thing is that you cannot even complaint!
Because guess who edit complaint forum? Yeah the SAME SENIOR GUYS
read more about my experience below…
It is very unprofessional to go and edit someones’s post unless they have misused the site.
Every time I submit a question, the first thing that happen is some “superior” guy delete a word or two TO GET HIS/HER NAME IN THE POST.
IT’S VERY CLEAR THAT PEOPLE DO THIS TO GET THEIR NAME EVERYWHERE.
What’s wrong with saying thanks to other professionals for spending their time to consider my matter?
The usual answer for this is that deleting “Hi” and “Thanks” makes the question “Clear”
Seriously? How can deleting most human friendly one or two words from a post and adding a comment to justify that act can make the post “clearer”???
It only makes IT pros look like “geeks” I’m sorry but not all professionals are “geeks” there are people who knows how to have a balanced life.
Perhaps if you guys stop editing others “Thanks” out may be you can have one too.
Many thanks for your time.
p.s. Now, if you can, tell me how my first “Hello” and last “thanks” lines made this post “unclear”?
I CHALLENGE SUCH “SUPERIOR” EDITORS TO RESPECT MY OPINION AND ANSWER THIS RATHER THAN DELETING (OR TOUCHING) THIS POST
Thanks again. (“You can chose to be a geek but you were born human” – a quote)
How to avoid detecting substrings, how to check for perfect substrings, avoid detecting substrings, avoid detecting substrings when checked for substrings.
Today I needed to find if a string is contained within a string.
So I used the most straight forward method (I used SQL but this works for any language)
declare @msgsToSkip varchar(max) = ‘geoLocation,statusUpdateCheck,forceClose’;
declare @msg varchar(max)= ‘statusUpdate’
if(charindex(@msg, @msgsToSkip) > 0)
print ‘not found’
Problem – as you can see, this code is written to messages with caption as either “geoLocation”, “statusUpdateCheck”, or “forcedClose”
But I also receive a message with caption “statusUpdate” this is different to “statusUpdateCheck” and must be allowed but obviously the code returns true for statusUpdate as it is a substring of statusUpdateCheck.
Simply make each word dirty by adding a character to it. It could be any character as long as you keep the code consistent. In more simple words, simply add a character to the string you are
Looking For and the string you are Searching In.
This is the fixed code
declare @msgsToSkip varchar(max) = ‘geoLocation-,statusUpdateCheck-,forceClose-’; — <– Notice that a ‘-’ is added to make each word dirty
declare @msg varchar(max)= ‘statusUpdate’
if(charindex(@msg + ‘-’, @msgsToSkip) > 0) — <- Notice the + ‘-’
print ‘not found’
This will not detect statusUpdate as statusUpdateCheck because at the checking time, the code sees statusUpdate as statusUpdate- and it is not a substring of statusUpdateCheck (note that statusUpdateCheck is now statusUpdateCheck- but it’s the ‘-’ in the statusUpdate that does the trick.)