15,881,173 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Pankaj Chamria (Top 17 by date)
Pankaj Chamria
7-Jun-12 3:21am
View
Thanks. But am hoping for a log4net solution to this problem without having to use two logging frameworks. Of course if there is none then I may resort to the Logging Application Block in Microsoft's Enterprise Library.
Pankaj Chamria
30-Jan-12 23:35pm
View
Deleted
I think it simply should be -
#if DEBUG
PerformDebugLogging(message);
//continue with your code..
Now if you are working in Debug configuration you should have the DEBUG compilation symbol defined. And in the Release mode you wont have the DEBUG symbol defined. So automatically the PerformDebugLogging() function would not even be part of the IL generated in RELEASE mode.
I am not sure what extra you achieve using the ModeDetector() class.
Another observation - Its not just the if statement, but every time you are instantiating a new instance of the ModeDetector class within the if statement, which is completely unnecessary.
Pankaj Chamria
30-Jan-12 9:13am
View
Deleted
Reason for my vote of 2
The reason it is bad design is because it has a performance hit even in Release mode. Since you have wrapped the preprocessor directives within your own custom class, your custom lines of code will always be executed thus wasting cpu cycles on un-necessary code that should not have been executed in release mode.
I guess sometimes effort to simplify makes us tread into the wrong direction. Been there. Done that :)
Pankaj Chamria
30-Jan-12 9:08am
View
Deleted
Reason for my vote of 1
This is not an alternative. Removing a temporary variable and returning the boolean directly doesn't mean that you have come up with an alternative tip
Pankaj Chamria
30-Jan-12 8:55am
View
Deleted
Never thought about this.. Thankyou. Have 5
Pankaj Chamria
29-Jan-12 10:16am
View
Deleted
Reason for my vote of 1
A tip should intend to do at-least one of the following -
1. Solve a complex problem using a brilliant idea.
2. Give a simpler solution to a common problem, where your solution is either better performing/ saves development time/ is more maintainable
3. A decent workaround to a problem to which there is no permamnent solution. Ex: Workarounds to overcome limitations of a framework.
Your tip I am afraid is none of these.. Its simply a small text book tutorial for beginners. I maintain that it is neither an article nor a tip.
Pankaj Chamria
27-Jan-12 10:13am
View
Deleted
Reason for my vote of 5
Very handy while working in the query analyzer. thanks
Pankaj Chamria
18-Jan-12 3:10am
View
Deleted
The comments I have received about this tip I posted has made me realize that the my code has a lot of pitfalls and it is best that such I remove the tip to avoid mis-guiding young developers. I agree that following the standard Dispose Pattern variations posted by Scott Dorman is the way to go. Hence I will be removing this tip. Thank you all for your valuable inputs.
Pankaj Chamria
18-Jan-12 2:59am
View
Deleted
Thanks for your reply and I agree with your observations. Accordingly I am making some changes in the code.
Pankaj Chamria
17-Jan-12 5:41am
View
Deleted
Thanks for explaining your vote. And I agree that this is not a pattern which can be recommended universally. The only purpose of wrapping it up in a base class was avoiding to have it implemented in all classes individually. This has worked beautifully for me in all my projects, but I admit that I haven't tested this in the most complex of scenarios. Again I know this is not a perfect or ideal solution, and hence I have mentioned in my tip that this might not work for all cases.
Pankaj Chamria
17-Jan-12 5:34am
View
Deleted
I have already mentioned the link you gave at the beginning of my tip. My intention is not to create a new pattern. Not at all. My tip is simply about wrapping up any pattern you want to use in a base class so that you don't need to implement it everywhere you want to. The simple base class code I have used will not work for all scenarios and I have already mentioned that in my tip. So you are free to choose how you want to implement the base class. There may be issues with this implementation which I am not aware of and would like to know. But it has worked for me in multiple projects without any problems, hence I felt like sharing it.
Pankaj Chamria
15-Jan-12 2:22am
View
Deleted
Thank you Deeskha Shenoy for making those changes to improve the article.
Pankaj Chamria
3-Jan-12 10:03am
View
Questions -
1. Is word installed on your machine?
2. Is this output showing up in browser window itself or notepad? It surely is not showing up in word which means either you do not have MS word installed or your Response.Write code to output this file is not correct.
Pankaj Chamria
3-Jan-12 8:53am
View
Due to browser security considerations, you will get the login prompt at least once, upon which you can choose to tick the Remember credentials checkbox. Even then in some environments, you may have to input the username/ password each time you open a new instance of browser to access your service.
Pankaj Chamria
3-Jan-12 8:27am
View
You will need to use Microsoft Office Automation API to read the file.. There are plenty of links available on the web.. Here are a few -
http://www.programmerfish.com/quick-tutorial-how-to-read-microsoft-word-file-in-c/
http://www.codeproject.com/KB/office/ExtractTextFromDOCXs.aspx
Pankaj Chamria
12-Sep-11 5:42am
View
Not yet :(
Pankaj Chamria
11-Aug-11 8:10am
View
Perfect! You pointed me in the right direction. The article link helped me find the answer. As I wanted the impersonation for my entire WCF service functions, I just used the attribute on top of every OperationContract and it worked like a charm..
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
Thanks Simon!
Show More