instruction
stringlengths
0
30k
Start with FxCop. If you can't do what you're trying there, try something like NStatic or NDepend.
how to write static code analyzer for .net
|vb.net|
I am intrested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.
I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.
How to write static code analyzer for .net
Indeed, just check ../enter_bug.cgi?format=guided , which forms an example of the template feature. Half the work is already done for you.
Your script gives the correct (true) output when `zsh` is used with the `emulate -L ksh` option. If all else fails you may wish to try using `zsh` on Linux.
It might be useful to think of HTML controls as an option when you want more control over the mark up that ends up getting emitted by your page. More control in the sense that you want EVERY browser to see exactly the same markup. If you create System.Web.UI.HtmlControls like: <input id='btnCancel' runat='ser...
I support Rob Grays answer, but wanted to add to it slightly. This may be overly obvious, but if you are using multiple clients, the app.config should store all settings that are installation specific and the database should store pretty much everything else. Single client (or server) apps are somewhat different. He...
VS.Net 2005 required on Build box with .Net 2.0 C++ Projects?
|msbuild|build-automation|cruisecontrol.net|c++|
We have a build box that uses CruiseControl.Net and has been building VB.Net and C# projects using msbuild. All I have installed on the box as far as .Net is concerned is .Net 2.0 SDK (I'm trying to keep the box as clean as possible). We are now trying to get a C++ app building on this box. The problem we are runnin...
|c++|cruisecontrol.net|msbuild|build-automation|
We have a build box that uses CruiseControl.Net and has been building VB.Net and C# projects using msbuild. All I have installed on the box as far as .Net is concerned is .Net 2.0 SDK (I'm trying to keep the box as clean as possible). We are now trying to get a C++ app building on this box. The problem we are runnin...
|architecture|tdd|agile|
I have mixed feelings about TDD. While I believe in testing I have a issues with the idea of the test driving my development effort. When you code to satisfy some tests written for an interface for requirements you have right now, you might shift your focus from building maintainable code, from clean design and from...
I personally use DotNetNuke quite extensively for both personal and business related ventures. However DNN does not meet one of your requirements as it is a .NET solution so it is windows dependent. I have found that using DotNetNuke has greatly reduced our time to delivery, and we can focus on our core needs rathe...
I don't know what this error message means, but it seems to be associated with third-party controls on the form. Anyway, the solution is almost as absurd as the problem: 1. Close the designer/error message. 2. Open the form code. 3. Right-click on the form code and select "View Designer". Presto! The desig...
Explicit... cursor foo is select * from blah; begin open fetch exit when close cursor yada yada yada don't use them, use implicit cursor foo is select * from blah; for n in foo loop x = n.some_column end loop I think you can even do this for n in (select * from blah) loop... Stick to impl...
Implementations of interface through Reflection
|c#|reflection|interface|
How to get all implementations of an interface through reflection in C#
Debugging design mode would help. From [here][1]: 1. List item 2. In visual studio, select the project you want to debug. 3. Right click -> Properties. 4. Select the debugging tab. 5. Change the debug mode to Program. 6. Set the “Start Application” to be your visual studio IDE (C:\Program Files\Microsoft ...
Doesn't the TFS workgroup edition somewhat fill this 'express' role? 5 users or less and the price is very 'express' when compared to the full 800 pound gorilla.
Well, I don't know how married you are to using a &lt;span&gt; tag, but why not do this? <p style="display: inline">Hello <p id="myIdValue" style="display: inline">new</p> World</p> That way the inserted html retains the same styling as the outer, and you can still have a handle to it, etc. Granted, you will ...
You have to have your monster data stored in files or a database and load them from a generic window. For example you have a picture of pikachu and one of bulbasaur stored in your hard disk. Then you make a window with a blank picture, when you show the window you tell the picture object to load the picture you need.
My Struts days are long over, but as far as I remember we used to place one view-specific bean (which would work as a holder for fine-graner beans or collections of beans) into the request scope within our Action.perform() implementation. This view-specific bean would then be rendered by the view.
As Struts 1.3 is considered old-school, I'd recommend to go with the flow and use the style that already is used throughout the application you inherited. If all different styles are already used, pick the most used one. After that, pick your personal favourite. Mine would be 1 or 3 - the form (2) is usually best su...
Reviews for programmable, tiling window manager ion3
|keyboard|window-managers|tiling|
I find the concept of the programmable, tiling, keyboard-focuessed window manager [ion3](http://www.modeemi.fi/~tuomov/ion/) very appealing, but I think it takes some time to customize it to your needs until you can really evaluate this totally different UI-concept. Therefore, I would like to read reviews of people ...
In some cases I can see this as being useful and even necessary. However, even if the processor has special instructions that make this process easier there is still a large overhead compared to a mutex or semaphore. Depending on how it's implemented it may also impact realtime performance (have to either stop inte...
I tend to agree with split suggestion. Ive created a "tester" for your problem in perl #!/usr/bin/perl -w @strings = ( "1.2.3", "1.2.*", "1.*","*" ); %regexp = ( svrist => qr/(?:(\d+)\.(\d+)\.(\d+)|(\d+)\.(\d+)|(\d+))?(?:\.\*)?/, onebyone => qr/^(\d+.)?(\d+.)?(\*|\...
I haven't tried it yet but you could make an extension method for what you want. I wouldn't do it, but I think it would work. Also I find `String.Format()` more in line with other patterned static methods like `Int32.Parse()`, `long.TryParse()`, etc. You cloud also just use a `StringBuilder` if you want a non st...
> When implementing a needle search of a > haystack in an object-oriented way, > you essentially have three > alternatives: > > 1. needle.find(haystack) > > 2. haystack.find(needle) > > 3. searcher.find(needle, haystack) > > Which do you prefer, and why? Correct me if I'm wrong, but in all three examp...
I agree that I am not sure of an ecosystem for C++. [OCaml][1] is pretty popular for doing functional programming outside of .NET. F# is also based off of it. [1]: http://caml.inria.fr/ocaml/
A HashTable is a really simple concept: it is an array in which key and value pairs are placed into, (like an associative array) by the following scheme: A hash function hashes the key to a (hopefully) unused index into the array. the value is then placed into the array at that particular index. Data retrieval is...
[AutomatedQA's TestComplete][1] is a good testing application to automate GUI testing. It supports more than just Windows Forms also, so you can reuse it for other applications. It is not open source and this is the best that I have found. I haven't seen an open source equivalent to WatiN. It does have a free trial...
Your getting into really far out AI type domain. I have done extensive work in text transformation into machine knowledge mainly using Attempto Controlled English (see: http://attempto.ifi.uzh.ch/site/), it is a natural language (english) that is completely computer processable into several different ontologies, such a...
I haven't tried this yet, but this should do it.. $objectlocation= 'CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca' $newlocation = 'OU=Temporarily Moved Groups, DC=Company,DC=ca' $from = new-object System.DirectoryServices.DirectoryEntry("LDAP://$objectLocation") ...
The jQuery [Form Plugin][1] is pretty much standard. It handles serializing form fields and AJAX submission. [1]: http://malsup.com/jquery/form/
Best Mocking Library
|mocking|
Which is the best mocking library? Why?
Which is the best mocking library for C# 3.0/ ASP.NET MVC? Why?
|mocking|
|c#|asp.net-mvc|mocking|
In order to embed a TrueType font in a Postscript document, you will first need to convert it to a Type 42 font. This conversion turns the font into postscript code. There are several small utilities for doing this conversion, or you can read the [Type 42 specification][1] and write your own code for it. Embeddin...
The only way to do this is to either modify the other spans to include a class name and only apply the styles to spans with that class, or override the styles set for all spans for your new span. So if you've done: span { display: block; margin: 10px; padding: 10px; } You could ov...
Postscript fonts come with widely varying encodings, so if you want to reliably print iso-8859-1 characters you need to reencode the font in your postscript program. [PostScript FAQ - How to print accented characters][1] [1]: http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_print_accented_characters.3F
> The Powers That Be want solid numbers on the cost of each type of crash being worked on I want to fly in my hot air balloon to Mars, but it doesn't mean that such a thing is possible. Seriously, I think you have a duty to tell them that there is no way to accurately measure this. Tell them you can rank the cras...
**UserControl**: A custom control, ending in .ascx, that is composed of other web controls. Its almost like a small version of an aspx webpage. It consists of a UI (the ascx) and codebehind. Cannot be reused in other projects by referencing a DLL. **WebConrol**: A control hosted on a webpage or in a UserControl...
Should you obfuscate a commercial .Net application?
|c#|.net|obfuscation|
I was thinking about obfuscating a commercial .Net application. But is it really worth the effort to select, buy and use such a tool? Are the obfuscated binaries really safe from reverse engineering?
I've been using Subversive since I upgraded to Ganymede. I use it with Eclipse in Linux (Ubuntu and Fedora Core), Windows XP and Mac OS X.5. Aside from some issues getting Subversion 1.5.1 to use the right security libraries under Mac OS, I haven't had any problems. Given that it has been adopted as an Eclipse technolo...
Function LastRow(rng As Range) As Long Dim iRowN As Long Dim iRowI As Long Dim iColN As Integer Dim iColI As Integer iRowN = 0 iColN = rng.Columns.count For iColI = 1 To iColN iRowI = rng.Columns(iColI).Offset(65536 - rng.Row, 0).End(xlUp)....
F# manual: [Statically linking the F# library using "--standalone"][1] Did you try to run peverify.exe utility? [1]: http://research.microsoft.com/fsharp/manual/compiler.aspx#Standalone
Hints for a high-traffic web service, c# asp.net sql2000
|c#|web-services|high-load|
I'm developing a web service whose methods will be called from a "dynamic banner" that will show a sort of queue of messages read from a sql server table. The banner will have a heavy pressure in the home pages of high traffic sites; every time the banner will be loaded, it will call my web service, in order to obta...
I tend to agree with split suggestion. Ive created a "tester" for your problem in perl #!/usr/bin/perl -w @strings = ( "1.2.3", "1.2.*", "1.*","*" ); %regexp = ( svrist => qr/(?:(\d+)\.(\d+)\.(\d+)|(\d+)\.(\d+)|(\d+))?(?:\.\*)?/, onebyone => qr/^(\d+.)?(\d+.)?(\*|\...
I tend to agree with split suggestion. Ive created a "tester" for your problem in perl #!/usr/bin/perl -w @strings = ( "1.2.3", "1.2.*", "1.*","*" ); %regexp = ( svrist => qr/(?:(\d+)\.(\d+)\.(\d+)|(\d+)\.(\d+)|(\d+))?(?:\.\*)?/, onebyone => qr/^(\d+.)?(\d+.)?(\*|\...
I tend to agree with split suggestion. Ive created a "tester" for your problem in perl #!/usr/bin/perl -w @strings = ( "1.2.3", "1.2.*", "1.*","*" ); %regexp = ( svrist => qr/(?:(\d+)\.(\d+)\.(\d+)|(\d+)\.(\d+)|(\d+))?(?:\.\*)?/, onebyone => qr/^(\d+\.)?(\d+\.)?(\*...
There should be some Compiler-specific Features. There is no standard way to do it for C/C++. Check out you compiler Compiler Reference Guide. For RealView Compiler see [this](http://www.keil.com/support/man/docs/armccref/armccref_cjagadac.htm) or [this](http://www.keil.com/support/man/docs/armccref/armccref_cjacagfi.h...
If the whole site is one big embedded flash file then yes it's possible. I don't think that you can acheive it any other way
svn over HTTP proxy
|linux|svn|ubuntu|proxy|
I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).<br> When I use svn up for url like 'http://.....' everything is cool (google chrome repository works perfect), but right now I need to svn up from server with 'svn://....' and I see connection refused.<br> I've set proxy config...
> The Powers That Be want solid numbers on the cost of each type of crash being worked on I want to fly in my hot air balloon to Mars, but it doesn't mean that such a thing is possible. Seriously, I think you have a duty to tell them that there is no way to accurately measure this. Tell them you can rank the cras...
the data objects don't track changes. the change tracking occurs on the DataContext and objects that you've retrieved through the DataContext. So in order to track changes you need to do the following: public class FooDataContext : DataContext { public Table<Order> Orders; } pub...
I'm assuming you have the basics for Maps in your code already with your API Key. <head> <script type="text/javascript" href="http://maps.google.com/maps? file=api&v=2&key=xxxxx"> function createMap() { var map = new GMap2(document.getElementById("map")); ...
I'm assuming you have the basics for Maps in your code already with your API Key. <head> <script type="text/javascript" href="http://maps.google.com/maps? file=api&v=2&key=xxxxx"> function createMap() { var map = new GMap2(document.getElementById("map")); ...
I am not sure what context the xml is coming from, but if it is stored in a string const variable that you created, then the easiest way to modify it would be: public class Example { private const string CAMLQUERY = "<Where><Eq><Field=\"FieldName\"><Value Type=\"Text\">{0}</Value></Field></Eq></Whe...
A Constant, of any type, can be declared by creating an immutable property that within a class (that is a member variable with the `final` modifier). Typically the `static` and `public` modifiers are also provided. public class OfficePrinter { public static final String STATE = "Ready"; }...
You could try pounding on your code with a load test tool that can make multiple requests at the same time. [Jmeter][1] comes to mind. [1]: http://jakarta.apache.org/jmeter/
Integration of JavaScript and JMS
|javascript|jms|activemq-classic|java|ejb|
Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)? I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web ...
|java|javascript|ejb|activemq-classic|jms|
Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)? I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web ...
Another way to do the same is to use an extra temp variable and explicit typing: var d = getDynamic(); var a: Array<Dynamic> = d.a; for (t in a) { ... }
assuming 32 bit if ( ((x^y) & 0x80000000) == 0) ... the answer if(x*y>0) is bad due to overflow
This seems closely related to the Subset Sum Problem, which is NP-Complete in general.
Convention question: When do you use a Getter/Setter function rather than using a Property
|c#|
It strikes me that Properties in C# should be use when trying to manipulate a field in the class. But when there's complex calculations or database involved, we should use a getter/setter. Is this correct? When do you use s/getter over properties?
You could attach both the MSSQL tables and the DB2 tables to a Jet database and bind your report to the Jet database. I don't know the implications of the single threaded nature of Jet, or how much work would be delegated to the backing stores.
By path, it might be referring to a path to a file or folder. There could be a malformed path that you are trying to reference, i.e. forward slash instead of backslash. Also, what changed since the error came up? Did you move any files around? Did you save any previously unsaved code? Update from a version control...
There's two ways to go at this. The first is to just go buy a SAN or a NAS from Dell or HP and throw money at the problem. Modern storage hardware just makes all of this easy to do, saving your expertise for more core problems. If you want to roll your own, take a look at using Linux with DRBD. <a href="http://...
Using SSIS to refresh a training database from a production database
|sql-server|ssis|
I have a particular system on out network where we need to maintain a training installation. The system uses SQL Server 2000 as its database engine and I need to set up a system for refreshing the data in the training database with the data from the production database on a regular basis. I want to use SSIS as we ha...
You can use the AppDomain.CurrentDomain.UnhandledException to get an event.
Apparently this should be fix in SQLServer 2005 SP2 [see here](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=473590&SiteID=1). Looks like you need to make sure to patch the client machine too if you are running the SSIS package from within Visual Studio.
The **Global.asax** class is your last line of defense. Look at: protected void Application_Error(Object sender, EventArgs e) method
Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt?
Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt? For the basics of using QPainter see [this excerpt](http://www.informit.com/articles/article.aspx?p=1174421) from the book "C++ GUI Programming with Qt4", and while it's C+...
Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt? For the basics of using QPainter see [this excerpt](http://www.informit.com/articles/article.aspx?p=1174421) from the book "C++ GUI Programming with Qt4", and while it's C+...