instruction stringlengths 0 30k ⌀ |
|---|
|visual-studio|resharper| |
Does anyone know a keyboard shortcut to close all tabs except for the current one in Visual Studio? And while we're at it, the shortcut for closing all tabs? Is there a Resharper option for this? I've looked in the past and have never been able to find it. |
typeof(MyType).GetField("fieldName", BindingFlags.Private | BindingFlags.Instance) |
typeof(MyType).GetField("fieldName", BindingFlags.NonPublic | BindingFlags.Instance) |
MBelly is right on the money - But then the trigger will always try and update table B even if that's not required (Because you're also inserting from table C?).
Darren is also correct here, you can't get multiple identities back as a result set. Your options are using a cursor and taking the identity for each row y... |
The obvious include guards
#ifndef MYHEADER_H
#define MYHEADER_H
...
#endif |
Restarting ColdFusion mail queue |
|coldfusion|administration| |
We are currently experiencing intermittent mail queue stoppages. I'm seeking diagnostic help in another area.
In the meantime, is there a way to restart the CF mail queue without restarting the service as a whole?
CF8 standard
Win2k3 |
We are currently experiencing intermittent mail queue stoppages. I'm [seeking diagnostic help in another area][1].
In the meantime, is there a way to restart the CF mail queue without restarting the service as a whole?
CF8 standard
Win2k3
[1]: http://stackoverflow.com/questions/94932/coldfusion-mail-queu... |
We are currently experiencing intermittent mail queue stoppages. I'm [seeking diagnostic help in another area][1].
In the meantime, is there a way to restart the CF mail queue without restarting the service as a whole?
CF8 standard
Win2k3
[1]: http://stackoverflow.com/questions/94932/coldfusion-mail-queue-... |
MSYS+gcc toolchain uses the old MSVCRT runtime library (now built into Windows) and Visual C++ 2005/2008 bring their own. It is a known fact that code should not depend on multiple runtimes. Passing things s.a. file handles, memory pointers etc. will be affected, and will cause apparently random crashes in such scenari... |
MSYS+gcc toolchain uses the old MSVCRT runtime library (now built into Windows) and Visual C++ 2005/2008 bring their own. It is a [known fact][1] that code should not depend on multiple runtimes. Passing things s.a. file handles, memory pointers etc. will be affected, and will cause apparently random crashes in such sc... |
Wrapping lists into columns |
|html|ul|coldfusion|javascript|jquery| |
I'm using ClodFusion(sic) to populate a template that includes HTML lists (<ul>'s).
Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns.
Is there an HTML, ColdFusion or perhaps JavaScript (I have jQuery available) way to do this easily? It's ... |
|javascript|html|css|jquery|coldfusion|ul| |
So I dug up this article from A List Apart [CSS Swag: Multi-Column Lists](http://www.alistapart.com/articles/multicolumnlists). I ended up using the first solution, it's not the best but the others require either using complex HTML that can't be generated dynamically, or creating a lot of custom classes, which could b... |
There's a nice comparison between git, hg and bzr in [this InfoQ article][1]. They all have their strengths and weaknesses. You'll have to think about your project and your workflows and choose the best fit. The good news is that they're all fairly good.
[1]: http://www.infoq.com/articles/dvcs-guide |
I timed the 3 ways of using an index like this:
for ($ii = 0; $ii < 1000000; $ii++) {
TEST 1: $array[$idx] = $ii;
TEST 2: $array["$idx"] = $ii;
TEST 3: $array["{$idx}"] = $ii;
}
The first set of tests used $idx=0, the second set used $idx="0", and the third set used $idx... |
I timed the 3 ways of using an index like this:
for ($ii = 0; $ii < 1000000; $ii++) {
TEST 1: $array[$idx] = $ii;
TEST 2: $array["$idx"] = $ii;
TEST 3: $array["{$idx}"] = $ii;
}
The first set of tests used $idx=0, the second set used $idx="0", and the third set used $idx... |
An odd issue that I have been trying to address in a project - my calls to WebClient.DownloadFileAsync seem to be getting ignored and no exceptions are being raised. So far I have been able to determine this might be due to destination folder not existing, but from the looks of the MSDN documentation for [Webclient.Do... |
|.net|webclient| |
An odd issue that I have been trying to address in a project - my calls to WebClient.DownloadFileAsync seem to be getting ignored and no exceptions are being raised. So far I have been able to determine this might be due to destination folder not existing, but from the looks of the MSDN documentation for [Webclient.Do... |
The pseudo-typedef antipattern mentioned by Shog9 would work - though it's not recommended to use an ANTIPATTERN - but it does not address your intentions. The goal of pseudo-typedef is to reduce clutter in declaration and improve readability.
What you want is to be able to replace a group of generics declarations ... |
I recommend learning Rails and Ruby itself first, and then picking up something like InstantRails. Having too many layers when learning something new can make it hard to know what features are part of which language, and potentially confuse you when trying to determine where a bug is occurring. |
It's probably easier to start by saying what *isn't* business logic. Database or disk access isn't business logic. UI isn't business logic. Network communications aren't business logic.
To me, business logic is the rules that describe how a business operates, not how a software architecture operates. Business logic ... |
Do you have web form compatability checked in all the necessary places? Are you using the web compatible date controls? Are you sure you are using SharePoint 2003, I thought Form Services was a 2007 update. |
FYI, tasklist and taskkill already have filtering capabilities:
tasklist /FI "imagename eq chrome.exe"
taskkill /F /FI "imagename eq iexplore.exe"
If you want more general functionality, batch scripts (ugh) can help. For example:
for /f "tokens=1,2 delims= " %%i in ('tasklist /v') do (
if "... |
Don't. Unless you have a really good business justification for putting your code base through this exercise. What is the cost savings or revenue generated by your refactor? If I were your manager I would probably advise against it. Sorry. |
250,000 Lines is alot to refactor, plus you should take into account several of the follow:
1. Do you have a QA department that will be able to QA the refactored code?
2. Do you have unit tests for the old code?
3. Is there a timeframe that is around the project, i.e. are you maintaining the code as users ar... |
I've done some TDD with Javascript in the past, and what I had to do was make the distinction between Unit and Integration tests. Selenium will test your overall site, with the output from the server, its post backs, ajax calls, all of that. But for unit testing, none of that is important.
What you want is just the ... |
Experience with SQLExpress for a multi-user commercial application? |
|.net|sql-server|user-experience|installation| |
I have inherited a VB6/Access application that we have developed and sold for many years. We're considering going to SQL Server 2005 Express Edition and .Net.
The application can be multi-user. Currently the setup is simple for the customer -- Navigate to the folder to create the database on first launch; second... |
I have inherited a VB6/Access application that we have developed and sold for many years. We're considering going to SQL Server 2005 Express Edition and .Net.
The application can be multi-user. Currently the setup is simple for the customer -- Navigate to the folder to create the database on first launch; second... |
|.net|sql-server|installation|user-experience| |
I have inherited a VB6/Access application that we have developed and sold for many years. We're going to SQL Server 2005 Express Edition and .Net.
The application can be multi-user. Currently the setup is simple for the customer -- Navigate to the folder to create the database on first launch; second user browse... |
Eh, I disagree. It can provide total garbage within the EHLO/HELO if it wants to. As long as it says something, *and* as long as I can resolve the ip address it's coming from, I'm happy.
Inside the EHLO is often a short hostname, not a FQDN. |
How can I determine the name of the currently focused process in C# |
|c#| |
For example if the user is currently running VS2008 then I want the value VS2008. |
What generic techniques can be applied to optimize SQL queries? |
|sql|performance| |
What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply? |
To simplify things to a single line...
Business Logic would be code that doesn't depend on/won't change with a specific UI/implementation detail..
It is a code-representation of the rules, processes, etc. that are defined by/reflect the business being modelled. |
I think using SQL query analyzer would be a good start. |
In Oracle you can look at the [explain plan][1] to compare variations on your query
[1]: http://www.oracle-base.com/articles/8i/ExplainPlanUsage.php |
[OpenOffice][1] has a [Basic][2] interpreter which is largely compatible with VBA. This may help you with your Access applications. The OpenOffice versions should run on both Windows and Linux.
[1]: http://openoffice.org
[2]: http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide |
- Use primary keys
- Avoid select *
- Be as specific as you can when building your conditional statements
- De-normalisation can often be more efficient
- Table variables and temporary tables (where available) will often be better than using a large source table
- Partitioned views
- Employ indices and constr... |
Make sure that you have the right indexes on the table. if you frequently use a column as a way to order or limit your dataset an index can make a big difference. I saw in a recent article that select distinct can really slow down a query, especially if you have no index. |
Yes, Mendelt is right. We do exactly this in our products. Everything depends on the ILogger abstract interface, but it does not depend on anything else. Typically an executable or a high-level DLL will be the one to construct an actual implemented Logger interface and inject it. |
REQUEST_URI includes the Query String (?q=testing...) where DOCUMENT_URI does not. |
The obvious optimization for SELECT queries is ensuring you have indexes on columns used for joins or in WHERE clauses.
Since adding indexes can slow down data writes you do need to monitor performance to ensure you don't kill the DB's write performance, but that's where using a good query analysis tool can help you... |
Unless you have a really good reason to do this, then this generally is a bad idea. It makes it very difficult to optimize and scale the database.
If you absolutely must do it, then Travis's suggestion is fine for small tables, but its not really going to scale that well. |
The biggest thing you can do is to look for table scans in sql server query analyzer (make sure you turn on "show execution plan"). Otherwise there are a myriad of articles at MSDN and elsewhere that will give good advice.
As an aside, when I started learning to optimize queries I ran sql server query profiler again... |
How are ObjectA and AHelper related? Is AHelper.RetrieveByID() the same logic as BHelper.RetrieveByID()
If Yes, how about a Utility class based approach (class with public static methods only and no state)
static [return type] Helper.RetrieveByID(ObjectX x)
__edit: Looks like Rob beat me to the punch :) ___ |
You can use a ComboBox with the [DropDownStyle][1] property set to DropDownList and SelectedIndex to 0 (or whatever the default item is). This will force always having an item from the list selected. If you forget to do that, the user could just type something else into the edit box part - which would be bad :)
... |
How to add "Project Description" in FogBugz? |
|fogbugz| |
When i create a new project (or even editing the Sample Project) there is no way to add Description to the project.
Or am i blind to the obvious? |
Certainly, but the exact product may be dependent upon the VCS you are using.
What you might want to do, is have a a few different branches, and migrate up as you progress. E.g., Development -> Stable-Dev -> Beta -> Production. You can then simply auto-update to the latest version of Stable-Dev and Beta for your tes... |
Just to troubleshoot, can you use a domain account rather than the builtin NetworkService account to run your service?
I also found this post that describes the same error you reported:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&tid=ca2a5bdd-93a8-4... |
How do I post feedback on Stack Overflow? Edit my original post or post an "answer"? Anyway, I thought it might help to give an example of what is going on in AHelper.RetrieveByID() and BHelper.RetreiveByID()
Basically, both of these methods are going up against a third party webservice that returns various a gene... |
Are you looking for polymorphic behavior? Then you'll want the interface and normal constructor. What is unintuitive about calling a constructor? If you don't need polymorphism (sounds like you don't use it now), then you can stick with your static methods. If these are all wrappers around a vendor component, then ... |
> I agree this is not ideal, hence the comment. Any suggestions?
I think there is now way you can solve that, because you cannot access the one and only one thing that can distinguish two instances: their address in memory. So I have only one suggestion: reconsider your need of having a general total ordering proces... |
VB has the following `If` statement which the question referred to, I think:
' Usage 1
Dim result = If(a > 5, "World", "Hello")
' Usage 2
Dim foo = If(result Is Nothing, "Alternative")
The first is basically C#'s ternary conditional operator and the second is its coalesce operator. `If` has thu... |
System.getProperty("user.dir")
gets the directory the Java VM was started from. |
I would suggest you look into Silverlight and [DeepZoom][1]
[1]: http://www.vertigo.com/Deepzoom.aspx |
I believe Microsoft's [Seadragon](http://livelabs.com/seadragon/) is your answer. However, I am not sure if that is available to developers.
It looks like some of it has found its way into Silverlight |
When do you use dependency injection? |
|dependency-injection| |
I've been using StructureMap recently and have enjoyed the experience thoroughly. However, I can see how one can easily get carried away with interfacing everything out and end up with classes that take in a boatload of interfaces into their constructors. Even though that really isn't a huge problem when you're using... |
I develop on my Macbook (not pro) using VMWare Fusion and WinXP. For the most part, it is a very good experience. I assign 1GB of memory, out of my 4GB, to the VM and its pretty speedy.
The one major pitfall I've encountered is disk space. If you install a full VS2008 install and other tools, you can quickly eat ... |
I've used [Total Access Detective](http://www.fmsinc.com/MicrosoftAccess/DatabaseCompare.html) in the past and it did the trick. It's a while ago though so you might want to investigate first... |
What do you mean by "just adding a property to a class?"
My rule of thumb is to make the class unit testable. If your class relies on the implementation details of another class, that needs to be refactored/abstracted to the point that the classes can be tested in isolation.
EDIT: You mention a boatload of inter... |
Before the 6.0 version VxWorks only
supported kernel execution environment for tasks and did not support
processes, which is the traditional application execution environment
on OS like Unix or Windows. Tasks have an entry point which is the
address of the code to execute as a task. This address corresponds to
a C... |
Max value of int in ChucK |
|chuck| |
What is the maximum value of an int in ChucK? Is there a symbolic constant for it?
|
I just put the various properties in JNDI. This way each of the servers can be configured and I can have ONE war file.
If the list of properties is large, then I'll host the properties (or XML) files on another server. I'll use JNDI to specify the URL of the file to use.
If you are creating different app files (war... |
I just put the various properties in JNDI. This way each of the servers can be configured and I can have ONE war file.
If the list of properties is large, then I'll host the properties (or XML) files on another server. I'll use JNDI to specify the URL of the file to use.
If you are creating different app files (war... |
The second argument that is passed to your error function will either be the string "timeout" "parserror" "error" or "notmodified". The third will be the exception object. This object can be helpful for debugging. |
What is the best place to store a configuration file in a java web application (war) ? |
|java|web-applications|tomcat|jakarta-ee| |
I create a web application (war) and deploy it on Tomcat. In the webapp there is a page with a form where an administrator can enter some configuration data. I don't want to store this data in an DBMS, but just in an xml file on the file system. Where to put it?
I would like to put the file somewhere in the director... |
When you want to make a string out of an expression, the best example for this is `assert`.
#define ASSERT_THROW(condition) \
if (!condition) \
throw std::exception(#condition " is false");
|
How do I append to an alist in scheme? |
|lisp|scheme|list|associative| |
Adding an element to the head of an alist (Associative list) is simple enough:
> (cons '(ding . 53) '((foo . 42) (bar . 27)))
((ding . 53) (foo . 42) (bar . 27))
Appending to the tail of an alist is a bit trickier though. After some experimenting, I produced this:
> (define (alist-append alist pai... |
Can I create a Visual Studio macro to launch a specific project in the debugger? |
|visual-studio|visual-studio-2008|macros| |
My project has both client and server components in the same solution file. I usually have the debugger set to start them together when debugging, but it's often the case where I start the server up outside of the debugger so I can start and stop the client as needed when working on client-side only stuff. (this is mu... |
Is that a javascript error?
I suppose it has to do with back-button support in the toolkit.
And undefined errors mostly occurs because somehow the script that contains "AjaxControlToolkit" doesn't gets properly loaded.
Thing that come to mind:
* The order scripts get loaded, does the Toolkit gets priority?
... |
Cache the charcode on KeyPress and then respond to KeyUp. There are other key combinations that will generate the asterisk, especially if you're facing international users who may have different keyboard layouts, so you can't rely on the KeyUp to give you the information you need. |
Have you looked into ClickOnce deploying the Excel file? |
LINQ FormatException |
|exception|linq|linq-to-sql| |
I currently have an existing database and I am using the LINQtoSQL generator tool to create the classes for me. The tool is working fine for this database and there are no errors with that tool.
When I run a LINQ to SQL query against the data, there is a row that has some invalid data somehow within the table and it... |
I don't think there is one by default, but you can go to Options>Environment>Keyboard and bind a key to File.CloseAllButThis.
I use ctrl+alt+w |