instruction stringlengths 0 30k ⌀ |
|---|
Try the ReSharper StyleCop plugin at: http://www.codeplex.com/StyleCopForReSharper |
Simply re-run the setup.exe to check and install all the new prerequisites that you have added.
Applications deployed using ClickOnce only check for application updates (if enabled), not prerequisites as it's the bootstrapper's job to make sure all dependencies are installed before the application is installed.
I... |
Unfortunately, your users will have to re-run the setup.exe to check and install all the new prerequisites that you have added.
Applications deployed using ClickOnce only check for application updates (if enabled), not prerequisites as it's the bootstrapper's job to make sure all dependencies are installed before th... |
How about writing a script?
Filename: myscript
#!/bin/sh
/bin/ls -lah /root > /root/test.out
# end script
Then use sudo to run the script:
sudo myscript
|
To just empty it:
backup log <dbname> with truncate_only
To save it somewhere:
backup log <dbname> to disk='c:\somefile.bak'
If you dont really need transactional history, try setting the database recovery mode to simple. |
My hunch was that, as you suspected, unmanaged DLLs are loaded in the context of the process and not in the context of the AppDomain, so any static data in unmanaged code is shared among AppDomains.
[This link][1] shows someone with the same problem you have, still not 100% verification of this, but probably this is... |
If you want to get slightly more technical about what the volatile keyword does, consider the following program (I'm using DevStudio 2005):
#include <iostream>
void main()
{
int j = 0;
for (int i = 0 ; i < 100 ; ++i)
{
j += i;
}
for (volatile int i = 0 ; i < ... |
I had this issue last night with an application I was working on. I'm using FormAuthentication and set the web.config authentication section like so:
<authentication mode="Forms">
<forms name=".ASPXAUTH" requireSSL="true"
protection="All"
enableCrossAppRedirects="true" />
</a... |
How does one unit test sections of code that are procedural or event-based |
|unit-testing| |
I'm convinced from [this presentation][1] and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. I... |
sqlserver express database copy options |
|sql-server|sql-server-express| |
Why can i not see an option for copying database objects when i right click > tasks on my database?
|
No, obfuscation has been proven that it does not prevent someone from being able to decipher the compiled code. It makes it more difficult to do so but not impossible. |
Yes, post_commit hook is what you want.
What to hook *to*? I'd recommend rsync (if your site instance isn't a svn working copy) or ssh with key auth calling a script which does 'cd WEBDIR && svn up' (if it is). |
[Valgrind][1] can be used to intercept any function call. If you need to intercept a system call in your finished product then this will be no use. However, if you are try to intercept during development then it can be very useful. I have frequently used this technique to intercept hashing functions so that I can contr... |
For a secure alternative, try the [Perspectives Firefox add-on][1]
[1]: http://www.cs.cmu.edu/~perspectives/firefox.html
|
I would say Subclipse, as i couldnt even get Subversive working ;)
[Here's][1] another blog suggesting Subclipse over Subversive
[1]: http://www.barneyb.com/barneyblog/2006/10/26/subclipse-vs-subversive/ |
I would say Subclipse, as i couldnt even get Subversive working ;)
|
Actionscript 3 - Completely removing a child |
|flash|actionscript|3|cs3| |
I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an objec... |
|flash|actionscript-3|cs3| |
I consider [ActiveState's Python community][1] to be a great resource. Also
[DZone Snippets][2] can be useful.
[1]: http://code.activestate.com/recipes/langs/python/
[2]: http://snippets.dzone.com/tag/python/ |
It may be good enough to just call
SetStyle(ControlStyles::UserPaint | ControlStyles::AllDrawingInWmPaint, true);
The flickering you are seeing most likely because Windows draws the background of the control first (via WM_ERASEBKGND), then asks your control to do whatever drawing you need to do (via WM_PAINT... |
It's always a balance:
- too much TDD and you end up with code that works, but is a pain to work on.
- too much 'maintable code, clean design, and sound architecture' and you end up with <a href="http://www.joelonsoftware.com/articles/fog0000000018.html">Architecture Astronauts</a> that have talked themselves i... |
The simple answer is, whenever something is impossible. If a method is invoked and it impossible to do what the method is intended to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using the supplied parameters. |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
The simple answer is, whenever an operation is impossible (because of either application OR because it would violate business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance c... |
How about writing a script?
Filename: myscript
#!/bin/sh
/bin/ls -lah /root > /root/test.out
# end script
Then use sudo to run the script:
sudo ./myscript
|
That is not easy to do, if you want to also match "something.tld", because normal text will have many instances of that pattern, but if you want to match only URIs that begin with a scheme, you can try this regular expression (sorry, I don't know how to plug it in C#)
(http|https|ftp|mailto|tel):\S+[/a-zA-Z0-9]
... |
when you use the svn:// URI it uses port 3690 and probably won't use http proxy |
These kinds of cases, particularly in EJB, are generally best handled via thread local state. Usually the use case is something like you have a particular transaction which is encountering a problem and you need to elevate logging to debug for that operation so you can generate detailed logging on the problem operation... |
I think you might be slightly confused. CSS is a method of styling HTML documents, whether this is a table element or a 'div'.
It used to be that tables were used in HTML to design the whole page layout. It was common to see multiple nested tables (usually generated by WYSIWYG programs such as Dreamweaver), and this... |
I would use Perl. Write a small module (or more than one) for dealing with the different formats. You could then run perl oneliners using that library. Example for what it would
look like as follows:
perl -e 'use Parser;' -e 'parser("in.input").get("Name2");'
Don't quote me on the syntax, but that's the g... |
|c++|msbuild|build-automation|cruisecontrol.net| |
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... |
Sounds like you forgot to add a mapping assembly to the session factory configuration..
If you're using app.config...
.
.
<property name="show_sql">true</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<mapping assembly="Project.Domain... |
Andy, I believe Glenn Block answers many of folks (natural) questions like these in this thread up on the MSDN MEF Forum:
[*Comparison of CompositionContainer with traditional IoC Containers*][1] .
To a degree, Artem's answer above is correct relative to the the primary intent behind MEF, which is extensibility ... |
Building Flex projects in ant/nant |
|apache-flex|build-process|nant|flexbuilder| |
We have a recurring problem at my company with build breaks in our Flex projects. The problem primarily occurs because the build that the developers do on their local machines is fundamentally different from the build that occurs on the build machine. The devs are building the projects using FlexBuilder/eclipse and the... |
I'd caution that with multiple update panels you'll want to be careful. Make sure you set the UpdateMode to Conditional. Otherwise, when one update panel is "posted back" to the server, all of them are posted back.
I'd highly suggest using these tools
[Web Development Helper][1] (here's a brief tutorial [Web D... |
I ran into this exact problem at my last job. The best way I found was to fire off an asychronous process, and notify the user when it's done (email or something else). Making them wait that long is going to be problematic because of timeouts and wasted productivity for them. Having them wait for a progress bar can ... |
The "delegate(object o){..}" tells the compiler to package up whatever is inside the brackets as an object to be executed later, in this case when OnLogin is fired. Without the "delegate()" statement, the compiler would think you are tying to execute an action in the middle of an assignemnt statement and give you err... |
You might want to check [GNU Gettext][1] project out - at least something to start with.
[1]: http://www.gnu.org/software/gettext/ |
You might want to check [GNU Gettext][1] project out - at least something to start with.
*Edited to add info about projects:*
I've worked on several multilingual projects using Gettext technology in different technologies, including C++/MFC and J2EE/JSP, and it worked all fine. However, you need to write/find you... |
Why not just use INSTR (for Oracle) or CHARINDEX (for SQL Server) combined with SUBSTRING? Seems a bit more straightforward (and portable, since it's supported in older versions).
http://www.techonthenet.com/oracle/functions/instr.php and http://www.adp-gmbh.ch/ora/sql/substr.html
http://www.databasejournal.com/f... |
Despite what many people would like you believe, you can't be 100% pure.
Your value objects need some kind of Identity field. Sometimes it will be something unique for an object like a phone number, sometimes it will have to be something artificial, like TelephoneNumber.Id.
The sooner you accept this, the better ... |
three column web design with variable sides |
|html|css| |
I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't been able to get this working properly in all current browsers... |
You may also go with Application.ThreadException Event.
Once I was developing a .NET app running inside a COM based application; this event was the very useful, as AppDomain.CurrentDomain.UnhandledException didn't work in this case. |
Making sure a webpage is not cached, across all browsers. |
|security|http|caching| |
Our investigations have shown us that no all browsers respect the http cache directives in a uniform manner.
For security reasons we do not want certain pages in our application to cached, **ever,** by the web browser. This must work for at least the following browsers:
- Internet Explorer versions 6-8
- Fir... |
|security|http|caching|headers|http-headers| |
|security|https|caching|headers|http-headers| |
Making sure a web page is not cached, across all browsers. |
|security|caching|https|http-headers|headers| |
You can't. But why do you need to? Surely if the page just says that the file isn't available then it won't be a huge page (i.e. by definition, the file won't be there)? |
If you *really* want to go the transient approach you will need to reset the log when your object is deserialized. The way to do that is to implement the method:
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;
The javadocs for [Serializable](htt... |
Is it possible to write ActiveX Controls in C# that will run in Excel? |
|activex|.net|excel| |
I have been searching on the web for some example code on how we can write a custom ActiveX Control for use in Excel using .NET but so far I have found old articles suggesting that it is not supported. Can anybody give me an indication if it is possible using .NET 1.1 and if so to any pointers on best practices?
Tha... |
|c#|.net|excel|activex| |
I have been searching on the web for some example code on how we can write a custom ActiveX Control for use in Excel using .NET but so far I have found old articles suggesting that it is not supported.
The application we are building uses Excel as a report writer so we which to add some custom controls to the works... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
You may not have to buy a tool - Visual Studio.NET comes with a community version of Dotfuscator. Other free obfuscation tools [are listed here][1], and they may meet your needs.
It's possible that the obfuscated binaries aren't safe from reverse engineering, just like it's possible that your bike lock might be brea... |
ladder logic can be transformed to one of the modern HDL's like Verilog..
transform each ladder to an expression like
always @(*) R18 = R16 && ( R15 | R12);
or you could use an assign statement
assign R18 = R16 && (R15 | R12);
a latching relay
assign R18 = (set condition) || R18 && !(break ... |
ladder logic can be transformed to one of the modern HDL's like Verilog..
transform each ladder to an expression like
always @(*) R18 = R16 && ( R15 | R12);
or you could use an assign statement
assign R18 = R16 && (R15 | R12);
a latching relay
assign R18 = (set condition) || R18 && !(break ... |
ladder logic can be transformed to one of the modern HDL's like Verilog..
transform each ladder
|---|R15|---+---|/R16|---------(R18)--------|
| |
|---|R12|---+
to an expression like
always @(*) R18 = !R16 && ( R15 | R12);
or you could use an assign statement
assign R... |
[POCO Remoting][1] gives you a very simple way of creating web services in C++ by just annotating C++ class definitions with special comments and running a code generator over it. It's commercial, but delivered with full source code. A free eval version is available. Runs on Windows, Linux, Mac OS X, etc.
[1]: h... |
HTTP requests include an Accept-Language header which is set according to your locale preferences on most OS/browser combinations. Google uses a combination of that, the local domain you use (eg 'google.it', 'google.hu') and any preferences you set with the Preferences link in the home page to assign a language to your... |
j2me screen flicker when switching between canvases |
|java-me| |
I'm writing a mobile phone game using j2me. In this game, I am using multiple Canvas objects.
For example, the game menu is a Canvas object, and the actual game is a Canvas object too.
I've noticed that, on some devices, when I switch from one Canvas to another, e.g from the main menu to the game, the screen momentar... |
I'm writing a mobile phone game using j2me. In this game, I am using multiple Canvas objects.
For example, the game menu is a Canvas object, and the actual game is a Canvas object too.
I've noticed that, on some devices, when I switch from one Canvas to another, e.g from the main menu to the game, the screen momentar... |
A workflow in Sharepoint Designer should be easiest way to implement it with no need to code.
Here's an article that explains how to do this:
**Workflow example: Send a notification message** :
[http://office.microsoft.com/en-us/sharepointdesigner/HA101829081033.aspx][1]
[1]: http://office.microsoft.com... |
You could download Real Producer Basic, which is free here (http://forms.real.com/rnforms/products/tools/producerbasic/), and imbed it as an activeX object since it's on your intranet. Flash will embed the same way, it's on all the office workstations, but since this is your Intranet, you could install it on all the m... |
One advantage of jQuery is the large community which has developed a multitude of plugins. |
Sum = 100<br>
Bills = (40,30,20,10)
Number of 40's = 100 / 40 = 2
Remainder = 100 % 40 = 20
Number of 30's = 20 / 30 = 0
Remainder = 20 % 30 = 20
Number of 20's = 20 / 20 = 1
Remainder = 20 % 20 = 0
As soon as remainder = 0 you can stop.
If you run out of bills then you can't make it up and need to g... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
The simple answer is, whenever an operation is impossible (because of either application OR business logic). If a method is invoked and it impossible to do what the method was written to do, throw an Exception. A good example is that constructors always throw ArgumentExceptions if an instance cannot be created using th... |
I can't say much for other IoC toolkits but I use Spring.Net and have found that there is a one off initial performance penalty at startup. Once the container has been configured the application runs unaffected. |
I might be missing something here, but this this seems fairly straight forward using pthreads.
Set up a small threadpool with N threads in it and have one thread to control them all.
The master thread simply sits in a loop doing something like:
1. Get data chunk from DB
2. Find next free thread If no thread ... |
I don't see why having .NET 3.5 would comprimise the build box - 2.0 and 3.5 co-exist without a problem. The only concern I could see would be a developer upgrading a solution to VS2008 without your "permission" and the build not failing... |
How can I run a Windows GUI application on as a service? |
|windows|user-interface|legacy|windows-services| |
I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running.
Is this even possible? |
|windows|user-interface|windows-services|legacy| |
I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running.
Is this even possible?
EDIT: Further refinement here... I do not have the source, it's not my application. |
Yes - I think I / we are in the headache situation Rob descibes - we have something like 5 or 6 different web-sites and applications across three independent servers that need to access the same DB. As things stand, each one has its own Web or App.config with the settings described setting and / or overriding settings ... |
They major problem is that code becomes hard to understand. It might become *pure magical* if one overuse IoC. Another problem is performance. In most cases performance lost is not noticeable. But when you start creating most of your objects via IoC container, it can suddenly drop below ocean level. |
The verification of "logical" systems in the IC design arena is known as "Design Verification", which is the process of ensuring that the system you design in hardware (RTL) implements the desired functionality.
Ladder logic can be transformed to one of the modern HDL's like Verilog..
transform each ladder
... |
I have (about a year ago) played around with [Ch][1] and found it to be pretty good.
[1]: http://www.ddj.com/cpp/184402054 |