ILT - Click-Once Deployment Error - Cannot Publish Because a Project Failed to Build
28-08-2012 Deploying using click-once setup is very easy. If you need a step by step guide to deploy a click-once, I'd recommend this article. Even though it is easy to create a click-once deployment package, the visual studio can face problems if you have third party ad-ons like DevExpress. If you get an error called "Cannot publish because a project failed to build" then don't use the "Publish Now" button in the project properties wind...
5 Ways to Get Rid of Financial Stress and Optimal Utilization of Money
2008-12-14 With the rise of Global Financial Crisis, Financial stress has become a hot topic in the Internet. Since I am also a victim, I thought to make a small research on this. In this post I am trying my best to explain what I gained during my research. I hope you would find this interesting! We go to school, high school, university, technical colleges, ... etc. then we find a job, then focus on collecting additional qualifications ...
How to get Table Information in SQL Server (Equivalent of Oracle's desc)
01-06-2012 You can use following stored procedures to get table information similar to what you get by calling "Desc" in Oracle. Sp_columns '<TableName>' This will show the list of columns along with other useful information such as: data type, length, Is-Nullable, etc... You can also use sp_help '<TableName>' For even more descriptive information This will show column information such as: data type, len...
Use of "as" keyword as for casting in C#
2009-01-06 The keyword as doesn't throw an exception if it fails to complete the casting operation. Instead it will return null. Other casting operations will throw an exception when the provided value cannot be casted. Since the "as" keyword sets or returns "null" value when it fails, the variable you use must be of a reference type or nullable in order to be used with the as keyword. For example, following operation will not be suit...
ILT - How to Programmatically Get Version Information of a Visual Studio Solution
03-10-2012 How to get major, minor, build and revision version figures for a visual studio solution (using c#)? // Step 1: Create a <a href="http://msdn.microsoft.com/en-us/library/system.version.aspx">Version</a> object Version v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; // Step 2: Use Major, Minor, Build and Revision components in the Version object a...
ILT - How to find if two time frames overlap or collide?
14/06/2013 Let's assume that time frame 1 starts from Start1 and ends on End1 (Time Frame 1 = Start1 - End1) Similarly Time frame 2 = Start2 - End 2 Time Frame 1 and Frame 2 Over Lap IF: Start1 <= End2 AND End1 >= Start2 Time Frames do not overlap IF: End2 < Start1 OR Start2 > End1 Following is the code of an SQL stored procedure in which I used this concept: </pre> USE [XXXX] GO ...
How To Temporarily Undo Or Turn Off Auto-Correct In Excel
22-05-2012 The auto correct feature can run you mad sometimes. For example, today I had to type EHR in Excel and it kept auto correcting it to HER :( I did a quick search and following are our options around this: Try Undo-ing (ctrl+z) - this works for earlier versions of excel but not for later versions like 2007 Type a space after typing what you want and then undo (ctrl+z) before you leave the cell. You must do this before you ...
/// 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.)