text stringlengths 8 267k | meta dict |
|---|---|
Q: How to find Commit Charge programmatically? I'm looking for the total commit charge.
A: public static long GetCommitCharge()
{
var p = new System.Diagnostics.PerformanceCounter("Memory", "Committed Bytes");
return p.RawValue;
}
A: Here's an example using WMI:
strComputer = "."
Set obj... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95850",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is best practice for large file transfer - SFTP or asymmetric file encryption? Which is generally considered "best practice" when wanting to securely transmit flat files over the wire? Asymmetric encryption seems to be a pain in that you have to manage keysets at endpoints and make sure that the same algorithm... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95852",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How to dynamically change the "src" or "data" for a PDF Object / Embed file using JavaScript? I have a web application that is dynamically loading PDF files for viewing in the browser.
Currently, it uses "innerHTML" to replace a div with the PDF Object. This works.
But, is there a better way to get the ID of the el... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95858",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Is there any place a developer can go besides Google to learn what it is they need to learn? I'm not really asking about how programmers learn how to program. More about specific technologies. If I wanted to learn Hibernate, how do I know what I should know prior to Hibernate? Should I learn JPA before, during or... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95862",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Best-performance query for "select max in group"? I have a simple table comments (id INT, revision INT, comment VARCHAR(140)) with some content like this:
1|1|hallo1|
1|2|hallo2|
1|3|hallo3|
2|1|hallo1|
2|2|hallo2|
I'm searching for an SQL statement which will return each comment with the highest revision:
1|3|hal... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95866",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: Best web front-end for SVN? I'm researching SVN repository browsers, and it's a tiresome task given how many are out there (I started here)
The "ideal" system would
*
*Run on Linux
*Be easy to use, even for non-developer types
*Look nice (have a decent skin)
*Either have built-in access control, or be written ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95868",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "26"
} |
Q: How to check if a variable is loaded in JavaScript? How do I see if a certain object has been loaded, and if not, how can it be loaded, like the following?
if (!isObjectLoaded(someVar)) {
someVar= loadObject();
}
A: myObject = myObject || loadObject();
A: If it is an object then you should just be able to ch... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95875",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "25"
} |
Q: What is the best way to present data from a very large resultset? I'm writing a report view of an audit trail, and I need to display this in a .jsp. What's the "best" way to get the data from the database to the screen?
We're using Spring for dependency injection, Data Access Objects, and Hibernate.
I can use hibern... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95886",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: What is a variable's linkage and storage specifier? When someone talks about a variables storage class specifier, what are they talking about?
They also often talk about variable linkage in the same context, what is that?
A: The storage class specifier controls the storage and the linkage of your variables. These a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95890",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
} |
Q: How to check if one DateTime is greater than the other in C# I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this done in C#?
A: StartDate < EndDate
A: This is probably too late, but to benefit other people who might stumble upon this, I used an extensio... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95895",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "137"
} |
Q: Client View of Everyone Looking at a Webpage First let me say that I really feel directionless on this question. I am using windows integrated security, and I can use vb.net to look up information about a user from AD. I also have other information about users I can look up from a MS SQL 2005 server by getting the l... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95909",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Find a private field with Reflection? Given this class
class Foo
{
// Want to find _bar with reflection
[SomeAttribute]
private string _bar;
public string BigBar
{
get { return this._bar; }
}
}
I want to find the private item _bar that I will mark with a attribute. Is that possible... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95910",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "273"
} |
Q: How can I detect if my process is running UAC-elevated or not? My Vista application needs to know whether the user has launched it "as administrator" (elevated) or as a standard user (non-elevated). How can I detect that at run time?
A: For those of us working in C#, in the Windows SDK there is a "UACDemo" applica... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95912",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "42"
} |
Q: Python reading Oracle path On my desktop I have written a small Pylons app that connects to Oracle. I'm now trying to deploy it to my server which is running Win2k3 x64. (My desktop is 32-bit XP) The Oracle installation on the server is also 64-bit.
I was getting errors about loading the OCI dll, so I installed th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95950",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Are delegates not just shorthand interfaces? Suppose we have:
interface Foo
{
bool Func(int x);
}
class Bar: Foo
{
bool Func(int x)
{
return (x>0);
}
}
class Baz: Foo
{
bool Func(int x)
{
return (x<0);
}
}
Now we can toss around Bar and Baz as a Foos and call their Func methods.
Delegates ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95954",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: FindNextFile fails on 64-bit Windows? using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn't seem to be able to find some files on 64-bit versions of Vista and XP. My test application is 32-bit.
If I use them to iterate through the folder C:\Windows\System32\Drivers they only find a handful of f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95956",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
} |
Q: How do you list the primary key of a SQL Server table? Simple question, how do you list the primary key of a table with T-SQL? I know how to get indexes on a table, but can't remember how to get the PK.
A: Here's another way from the question get table primary key using sql query:
SELECT COLUMN_NAME
FROM INFORMATIO... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95967",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "135"
} |
Q: Do access modifiers affect reflection also? I always believe they did, but seeing some answers here make me doubt...
Can I access private fields/properties/methods from outside a class through reflection?
A: Yes you can access private fields via reflection. This is how a lot of ORMs go about populating an object w... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95974",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: How to insert multiple records and get the identity value? I'm inserting multiple records into a table A from another table B. Is there a way to get the identity value of table A record and update table b record with out doing a cursor?
Create Table A
(id int identity,
Fname nvarchar(50),
Lname nvarchar(50))
Create... | {
"language": "en",
"url": "https://stackoverflow.com/questions/95988",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "65"
} |
Q: Multiple relations to the same model in Rails Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96003",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: What is the easier way to know if a type param implements an interface in c# 2.0? For example, given a type param method i'm looking for something like the part in bold
void MyMethod< T >() {
if ( typeof(T).Implements( IMyInterface ) )
{
//Do something
else
//Do something else
}
Anwers using C# 3.0 a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96027",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Get URL of ASP.Net Page in code-behind I have an ASP.Net page that will be hosted on a couple different servers, and I want to get the URL of the page (or even better: the site where the page is hosted) as a string for use in the code-behind. Any ideas?
A: Do you want the server name? Or the host name?
Request.Ur... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96029",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "202"
} |
Q: Flex best practices? I have the feeling that is easy to find samples, tutorials and simple examples on Flex.
It seems harder to find tips and good practices based on real-life projects.
Any tips on how to :
*
*How to write maintainable actionscript code
*How to ensure a clean separation of concern. Has anybody u... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96040",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: UI design alternatives with Groovy/JRuby/Jython or other JVM languages? For a developer in the Java eco-system, there is a handful of choices when it comes to UI design. The best known are:
*
*Swing (preferred when used with Netbeans and its GUI builder)
*Eclipse's SWT (mostly preferred for Eclipse plug-ins)
N... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96041",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: What's safecall? I'm working on the creation of an ActiveX EXE using VB6, and the only example I got is all written in Delphi.
Reading the example code, I noticed there are some functions whose signatures are followed by the safecall keyword. Here's an example:
function AddSymbol(ASymbol: OleVariant): WordBool; saf... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96042",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "16"
} |
Q: Is is possible to convert C# double[,,] array to double[] without making a copy I have huge 3D arrays of numbers in my .NET application. I need to convert them to a 1D array to pass it to a COM library. Is there a way to convert the array without making a copy of all the data?
I can do the conversion like this, but ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96054",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: What are the relative advantages of XMLEncoder and XStream? Suppose I want to store many small configuration objects in XML, and I don't care too much about the format. The XMLDecoder class built into the JDK would work, and from what I hear, XStream works in a similar way.
What are the advantages to each library?
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96059",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Automated unit testing with JavaScript I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently JSUnit works well with JUnit, but it seems to be abandonware and lacks good support for Ajax, debugging, and timeouts.
Has anyone had any luck automating (with Ant) a unit testing ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96066",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "62"
} |
Q: Developing UI in JavaScript using TDD Principles I've had a lot of trouble trying to come up with the best way to properly follow TDD principles while developing UI in JavaScript. What's the best way to go about this?
Is it best to separate the visual from the functional? Do you develop the visual elements first, ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96086",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "44"
} |
Q: Can the ffmpeg av libs return an accurate PTS? I'm working with an mpeg stream that uses a IBBP... GOP sequence. The (DTS,PTS) values returned for the first 4 AVPackets are as follows: I=(0,3) B=(1,1) B=(2,2) P=(3,6)
The PTS on the I frame looks like it is legit, but then the PTS on the B frames cannot be right, sin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96107",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: Unix commands like ping, ssh, work fine but socket-based programs are failing in connect I got a call from a tester about a machine that was failing our software. When I examined the problem machine, I quickly realized the problem was fairly low level: Inbound network traffic works fine. Basic outbound command like ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96113",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Rational Functional Tester wait for object existence I'm currently modifying a Java script in Rational Functional Tester and I'm trying to tell RFT to wait for an object with a specified set of properties to appear. Specifically, I want to wait until a table with X number of rows appear. The only way I have been abl... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96114",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: open IE without toolbar or address bar from Windows VB Application Shell ("explorer.exe www.google.com")
is how I'm currently opening my products ad page after successful install. However I think it would look much nicer if I could do it more like Avira does, or even a popup where there are no address bar links etc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96123",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: REDUX: How to overcome an incompatibility between the ksh on Linux vs. that installed on AIX/Solaris/HPUX? I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See here for the previous problem.
This code:
#!/bin/ksh
if [ -a k*... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96133",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: DIVs vs. TABLEs a rebuttal please There are lots of people out there asking "why shouldn't we use tables for structuring our HTML" and while a lot of answers come in, I rarely see anyone being converted to the world of semantics. That said, I've yet to see any convincing rebuttals to support the rationale for why we... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96137",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: OLEDBConnection.Open() generates 'Unspecified error' I have an application that uploads an Excel .xls file to the file system, opens the file with an oledbconnection object using the .open() method on the object instance and then stores the data in a database. The upload and writing of the file to the file system w... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96150",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How to click a button on an ASP.NET web page programmatically? I am trying to figure out how to click a button on a web page programmatically.
Specifically, I have a WinForm with a WebBrowser control. Once it navigates to the target ASP.NET login page I'm trying to work with, in the DocumentCompleted event handler ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96153",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: chapters in videos for the iPhone Is it possible to use chapters in videos for the iPhone in an application?
For example:
I have a 3 minutes video to play. I have chapter 1 starting at 0s, chapter 2 at 50s, chapter 3 at 95s.
Can I start plating the video at 50s (chapter 2) until the end? Can I make it play just the ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96156",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Web Dev - Where to store state of a shopping-cart-like object? You're building a web application. You need to store the state for a shopping cart like object during a user's session.
Some notes:
*
*This is not exactly a shopping cart, but more like an itinerary that the user is building... but we'll use the word ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96160",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "17"
} |
Q: Partial site SSL using asp.net login control I'm attempting to convert a home-grown login system to the standard asp.net login control included in .net. I want all communication on the website for a user not logged in to be in clear text, but lock everything in SSL once the user logs in - including the transmission... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96164",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Is there any WYSIWYG html editing tool or component that allows Format Copying from a paragraph to another? I believe the question says it all ... (I'll update if needed)
A: http://www.openwebware.com/
A: FCKEditor can do the job.
| {
"language": "en",
"url": "https://stackoverflow.com/questions/96185",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: When are C++ macros beneficial? The C preprocessor is justifiably feared and shunned by the C++ community. In-lined functions, consts and templates are usually a safer and superior alternative to a #define.
The following macro:
#define SUCCEEDED(hr) ((HRESULT)(hr) >= 0)
is in no way superior to the type safe:
in... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96196",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "183"
} |
Q: How to determine size in bytes of a result set from LINQ to SQL When writing manual SQL its pretty easy to estimate the size and shape of data returned by a query. I'm increasingly finding it hard to do this with LINQ to SQL queries. Sometimes I find WAY more data than I was expecting - which can really slow down a ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96211",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: .NET Compact Framework Printing libraries Can anyone point to libraries that can be used for Printing from Compact .Net Framework 1.0?
Criteria:
*
*I need to be able to print Text and Bar codes.
*The library should preferably be upgradable to .Net 2.0 or above with minimal disruption.
*Can be either Open Sourc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96218",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: Well developed web site architecture using linq to sql? Anybody found yet a good web site architecture using linq to sql? Any help will be very helpful!
A: We just finished up an internal IT project banking heavily on Linq2Sql and it paid off. I was a bit skeptical at first, but I think it worked out great in the... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96226",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Why would I use 2's complement to compare two doubles instead of comparing their differences against an epsilon value? Referenced here and here...Why would I use two's complement over an epsilon method? It seems like the epsilon method would be good enough for most cases.
Update: I'm purely looking for a theoreti... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96233",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: What is the best place to store a configuration file in a Java web application (WAR)? 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 th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96247",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "57"
} |
Q: How do I append to an alist in scheme? 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 (a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96249",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Can I create a Visual Studio macro to launch a specific project in the debugger? 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 sta... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96250",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Batch file to copy files from one directory to another I have two code bases of an application. I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn).
How can I write a batch files to do this?
A: XCOPY /D ?
xcopy c:\olddir\*.java c:\newdir... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96264",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is a better way to create a game loop on the iPhone other than using NSTimer? I am programming a game on the iPhone. I am currently using NSTimer to trigger my game update/render. The problem with this is that (after profiling) I appear to lose a lot of time between updates/renders and this seems to be mostly... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96265",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "23"
} |
Q: How do I intercept a paste event in an editbox? How do I intercept a paste event in an editbox, possibly before the value is transferred to the object?
A: Look up subclassing windows.
A: If you subclass then intercept the WM_PASTE message you can do what you want, throw the message away to prevent the paste, manip... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96271",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Temporarily load SSL Client Key for Client Authentication in C# I am using the WebBrowser control to add a WebInterface to C# app. My desire is to verify that only such app is able to connect to our Web server using SSL client certificates.
My idea was to embed the client certificate in the app and just use when con... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96276",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Visual Studio: Detecting unneeded Assemblies On larger and/or long running projects, I tend to reference many assemblies and namespaces, and often I end up removing some functionality later on or moving it into a different project.
I just wonder, is there a way to check every project (heck, every .cs file) in my who... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96279",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "13"
} |
Q: In C++ I Cannot Grasp Pointers and Classes I'm fresh out of college and have been working in C++ for some time now. I understand all the basics of C++ and use them, but I'm having a hard time grasping more advanced topics like pointers and classes. I've read some books and tutorials and I understand the examples i... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96285",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: What are some popular naming conventions for Unit Tests? General
*
*Follow the same standards for all tests.
*Be clear about what each test state is.
*Be specific about the expected behavior.
Examples
1) MethodName_StateUnderTest_ExpectedBehavior
Public void Sum_NegativeNumberAs1stParam_ExceptionThrown()
Pu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96297",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "208"
} |
Q: How can I restore svn control if the .svn folder has been damaged? I've got a couple large checkouts where the .svn folder has become damaged so I'm getting and error, "Cleanup failed to process the following path.." And I can no longer commit or update files in that directory.
I'd just delete and do the checkout ag... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96313",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "27"
} |
Q: How do you get the root namespace of an assembly? Given an instance of System.Reflection.Assembly.
A: I have come across this dilemma plenty of times when I want to load a resource from the current assembly by its manifest resource stream.
The fact is that if you embed a file as a resource in your assembly using Vi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96317",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "55"
} |
Q: KornShell (ksh) code to send attachments with mailx and uuencode? I need to attach a file with mailx but at the moment I am not having success.
Here's my code:
subject="Something happened"
to="somebody@somewhere.com"
body="Attachment Test"
attachment=/path/to/somefile.csv
uuencode $attachment | mailx -s "$subject" ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96326",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Best Approach For Configuring Multiple .Net Applications We have a suite of interlinked .Net 3.5 applications. Some are web sites, some are web services, and some are windows applications. Each app currently has its own configuration file (app.config or web.config), and currently there are some duplicate keys across... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96340",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Automatically verify my website's links are pointing to urls that exist? Is there a tool to automatically search through my site and test all the links? I hate running across bad urls.
A: Xenu link sleuth is excellent (and free)
A: w3.org checklink
A: If I were you, I'd check out the W3C Link Checker.
A: Somethi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96349",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Writing post data from one java servlet to another I am trying to write a servlet that will send a XML file (xml formatted string) to another servlet via a POST.
(Non essential xml generating code replaced with "Hello there")
StringBuilder sb= new StringBuilder();
sb.append("Hello there");
URL url = new... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96360",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: Using Validation in WPF With Dependency Property and Style Triggers I am trying to use Validation in WPF. I created a NotNullOrEmptyValidationRule as shown below:
public class NotNullOrEmptyValidationRule : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo cultureInfo)... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96377",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How To Tell What Files IE Thinks Are "nonsecure"? We have a CMS system whose web interface gets served over HTTPS. This works beautifully for Firefox, but when we load it in IE6 or IE7, it complains that "This page contains both secure and nonsecure items."
I've loaded the page in Firefox and checked with Firebug, a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96382",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: SQL server 2000 Like Statement Usage I have a SQL statement that looks like:
SELECT [Phone]
FROM [Table]
WHERE
(
[Phone] LIKE '[A-Z][a-z]'
OR [Phone] = 'N/A'
OR [Phone] LIKE '[0]'
)
The part I'm having trouble with is the where statement with the "LIKEs". I've seen SQL statements where authors used like... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96390",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Deploying to multiple servers I have to deploy my php/html/css/etc code to multiple servers and i am looking at my options for software that allows easy and secure deployment to multiple servers.
Also helps if it could be tied into my SVN.
Any suggestions?
A: Setting up password-less publickey authentication with s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96405",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: C++: Step 1: ExtractIconEx. Step 2: ??? Step 3: SetMenuItemBitmaps I'm experimenting with adding icons to a shell extension. I have this code (sanitized for easy reading), which works:
InsertMenu(hmenu, index, MF_POPUP|MF_BYPOSITION, (UINT)hParentMenu, namestring);
The next step is this code:
HICON hIconLarge, hIco... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96414",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do I split a string, breaking at a particular character? I have this string
'john smith~123 Street~Apt 4~New York~NY~12345'
Using JavaScript, what is the fastest way to parse this into
var name = "john smith";
var street= "123 Street";
//etc...
A: With JavaScript’s String.prototype.split function:
var input =... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96428",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "624"
} |
Q: How can I tell how many SQL Connections I have open in a windows service? I'm seeing some errors that would indicate a "connection leak". That is, connections that were not closed properly and the pool is running out. So, how do I go about instrumenting this to see exactly how many are open at a given time?
A: If y... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96431",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: How to read the value of a text input in a Flash SWF from a Flex App? I have a Flex application, which loads a SWF from CS3. The loaded SWF contains a text input called "myText". I can see this in the SWFLoader.content with no problems, but I don't know what type I should be treating it as in my Flex App. I thought ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96440",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: SQL Bulk import from CSV I need to import a large CSV file into an SQL server. I'm using this :
BULK
INSERT CSVTest
FROM 'c:\csvfile.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
problem is all my fields are surrounded by quotes (" ") so a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96448",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "23"
} |
Q: What's the most current, good practice, and easiest way to use sessions in PHP? Sessions in PHP seemed to have changed since the last time I used them, so I'm looking for a simple way of using sessions but at the same time for it to be relatively secure and a good common practice.
A: Session management changed some... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96460",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How do you get the response from the Request object in MooTools? How do you access the response from the Request
object in MooTools? I've been looking at the documentation and the MooTorial, but
I can't seem to make any headway. Other Ajax stuff I've done with
MooTools I haven't had to manipulate the response at all... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96463",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Javascript drawing library? Any suggestion for a JavaScript interactive drawing library? Just need to draw lines, polygons, texts of different colors. IE/Firefox/Opera/Safari compatible.
A: You can use the canvas object directly to draw in 2D. IE requires the excanvas library.
http://dev... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96486",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "45"
} |
Q: Is there anything wrong with returning default constructed values? Suppose I have the following code:
class some_class{};
some_class some_function()
{
return some_class();
}
This seems to work pretty well and saves me the trouble of having to declare a variable just to make a return value. But I don't think I... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96500",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: How to associated the cn in an ssl cert of pyOpenSSL verify_cb to a generated socket I am a little new to pyOpenSSL. I am trying to figure out how to associate the generated socket to an ssl cert. verify_cb gets called which give me access to the cert and a conn but how do I associate those things when this happen... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96508",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: Change ContextMenu Font Size in C# Is it possible to change the font size used in a ContextMenu using the .NET Framework 3.5 and C# for a desktop application? It seems it's a system-wide setting, but I would like to change it only within my application.
A: If you are defining your own context menu via a ContextMen... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96525",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: interacting with a CMutex without MFC We have multiple MFC apps, which use CMutex( false, "blah" ), where "blah" allows the mutex to work across process boundaries.
One of these apps was re-written without MFC (using Qt instead). How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-process.) ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96538",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Is there an elegant way to instantiate a variable type with parameters? This isn't legal:
public class MyBaseClass
{
public MyBaseClass() {}
public MyBaseClass(object arg) {}
}
public void ThisIsANoNo<T>() where T : MyBaseClass
{
T foo = new T("whoops!");
}
In order to do this, you have to do some reflectio... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96541",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
} |
Q: Practical limit to length of SQL query (specifically MySQL) Is it particularly bad to have a very, very large SQL query with lots of (potentially redundant) WHERE clauses?
For example, here's a query I've generated from my web application with everything turned off, which should be the largest possible query for thi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96553",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "18"
} |
Q: Arial Font doesn't display properly in Mac I have a flash movie with a dynamic text that supposedly is Arial, and in my windows machine it displays as Arial. But when I tried it in a Mac, it shows as something like Times New Roman.
I tried every property available and can't seem to get it to show as Arial on the Mac... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96562",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: STL vectors with uninitialized storage? I'm writing an inner loop that needs to place structs in contiguous storage. I don't know how many of these structs there will be ahead of time. My problem is that STL's vector initializes its values to 0, so no matter what I do, I incur the cost of the initialization plus t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96579",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "51"
} |
Q: How do I Upgrade to Subversion 1.5 On CentOS 5? My development server (CentOS 5) is running Subversion 1.4.2, and I wish to upgrade it to 1.5. I have read in various blogs and documents scattered around the web that this may be done by using RPMForge. I have followed the instructions found on CentOS Wiki, includin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96597",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "22"
} |
Q: Git - is it pull or rebase when working on branches with other people So if I'm using branches that are remote (tracked) branches, and I want to get the lastest, I'm still unclear if I should be doing git pull or git rebase. I thought I had read that doing git rebase when working on a branch with other users, it can... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96615",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "33"
} |
Q: How to scroll only the right side of a table, listview, or datagrid? Let's say I have data structures that're something like this:
Public Class AttendenceRecord
Public CourseDate As Date
Public StudentsInAttendence As Integer
End Class
Public Class Course
Public Name As String
Public CourseID As String
Pu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96618",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to prevent others from using my .Net assembly? I have an assembly which should not be used by any application other than the designated executable. Please give me some instructions to do so.
A: 100% completely impossible without jumping through some hoops.
One of the perks of using the .NET is the ability to us... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96624",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: Problems with Visual Studio Express installation I just installed 'Visual C# 2008 Express Edition' and 'Visual Web Developer 2008 Express Edition' on my Vista machine. Previously I have been running these in Win XP. When launching the software, starting a new project and trying to build it I get warnings like "The r... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96648",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Displaying the correct size in Windows' Add/Remove Programs I have a need to manually setup the registry settings for an entry in Window's Add/Remove Programs (for XP and Vista). Everything works except for the displayed size.
According to this 2004 post by Raymond Chen it should be possible by setting the Estimate... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96653",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How can I make MS Access Query Parameters Optional? I have a query that I would like to filter in different ways at different times. The way I have done this right now by placing parameters in the criteria field of the relevant query fields, however there are many cases in which I do not want to filter on a given f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96661",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: What's the difference between | and || in Java?
Possible Duplicate:
Why do we usually use || not |, what is the difference?
Title says it all. It's been discussed for other languages, but I haven't seen it for Java yet.
| {
"language": "en",
"url": "https://stackoverflow.com/questions/96667",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "15"
} |
Q: How do I get flash to reload the parent HTML page it is embedded in? I have a flash app (SWF) running Flash 8 embedded in an HTML page. How do I get flash to reload the parent HTML page it is embedded in? I've tried using ExternalInterface to call a JavaScript function to reload the page but that doesn't seem to wor... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96671",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Organizing Extension Methods How do you organize your Extension Methods? Say if I had extensions for the object class and string class I'm tempted to separate these extension methods into classes IE:
public class ObjectExtensions
{
...
}
public class StringExtensions
{
...
}
am I making this too complicate... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96718",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "19"
} |
Q: Any suggestions for effectively testing AJAX enabled web pages using MSVS Tester Edition Tools? It seems like MS really left a massive gaping hole in their automated testing tools in Visual Studio for web pages with AJAX components and I have been hard pressed to find any commentary or third party add-ons that remed... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96719",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Embedding one dll inside another as an embedded resource and then calling it from my code I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible.
This with ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96732",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "60"
} |
Q: Are iframes a terrible idea? I'm building a widget, and I've been using iframes to present content within it. At some point, I might start serving third party HTML and JS, so I thought iframes would be a good idea.
It does make the widget javascript a little more complicated, and I'm concerned that this might not b... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96748",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "30"
} |
Q: How do I remove the .NET Compact Framework from my Windows Mobile 5 device? I'm trying to get a number of third party applications to work on my Windows Mobile 5 smartphone.
I've installed the latest version (3.5) of the Microsoft.NET Compact Framework, but whenever I run the apps I get an error message which states... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96750",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How do I Sort a Multidimensional Array in PHP I have CSV data loaded into a multidimensional array. In this way each "row" is a record and each "column" contains the same type of data. I am using the function below to load my CSV file.
function f_parse_csv($file, $longest, $delimiter)
{
$mdarray = array();
$fil... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96759",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "203"
} |
Q: Why is Visual Studio constantly crashing? Visual Studio randomly crashes when adding/removing references and projects.
Any thoughts why? Will installing Sp1 help?
EDIT: I do not work with any addons except SourceSafe. I do most of my development in connected mode.
Developing using:
Visual Studio 2008
WinXp ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96780",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "32"
} |
Q: What are appropriate library naming conventions? There are two popular naming conventions:
*
*vc90/win64/debug/foo.dll
*foo-vc90-win64-debug.dll
Please discuss the problems/benefits associated with either approach.
I am also wondering if it is possible to expose meta-data (i.e. compiler, platform, build-type) ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96811",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Vim: How do I search for a word which is not followed by another word? Pretty basic question, I'm trying to write a regex in Vim to match any phrase starting with "abc " directly followed by anything other than "defg".
I've used "[^defg]" to match any single character other than d, e, f or g.
My first instinct was ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/96826",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "53"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.