qid int64 4 8.14M | question stringlengths 20 48.3k | answers list | date stringlengths 10 10 | metadata list | input stringlengths 12 45k | output stringlengths 2 31.8k |
|---|---|---|---|---|---|---|
352,703 | <p>Is it possible to integrate <a href="http://hudson.dev.java.net/" rel="noreferrer" title="hudson: an extensible continuous integration engine">Hudson</a> with MS Test?</p>
<p>I am setting up a smaller CI server on my development machine with Hudson right now, just so that I can have some statistics (ie. <a href="ht... | [
{
"answer_id": 352717,
"author": "Rob Hruska",
"author_id": 29995,
"author_profile": "https://Stackoverflow.com/users/29995",
"pm_score": 0,
"selected": false,
"text": "<p>Hudson has a <a href=\"http://hudson.gotdns.com/wiki/display/HUDSON/Plot+Plugin\" rel=\"nofollow noreferrer\">Plot P... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11963/"
] | Is it possible to integrate [Hudson](http://hudson.dev.java.net/ "hudson: an extensible continuous integration engine") with MS Test?
I am setting up a smaller CI server on my development machine with Hudson right now, just so that I can have some statistics (ie. [FxCop](http://blogs.msdn.com/fxcop/ "Code Analysis Tea... | Hudson has a new plugin for MSTest. Just specify the location of the .trx file and the work is done for you. It wouldn't surprise me if the plugin used Allen's solution. |
352,752 | <p>My application is developped in C++ using Qt and is using signals and slots.</p>
<p>Let's say I have the following classes (pseudo-C++ code) :</p>
<pre><code>class Ball
{
Color m_Color;
int m_Size;
};
class Player
{
public:
setBall(Ball* pBall)
{
if (pBall != m_pBall)
{
... | [
{
"answer_id": 370771,
"author": "user11323",
"author_id": 11323,
"author_profile": "https://Stackoverflow.com/users/11323",
"pm_score": 1,
"selected": false,
"text": "<blockquote>\n <p>Ball will be deleted if not used\n anymore by other players</p>\n</blockquote>\n\n<p>As i can see - ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2796/"
] | My application is developped in C++ using Qt and is using signals and slots.
Let's say I have the following classes (pseudo-C++ code) :
```
class Ball
{
Color m_Color;
int m_Size;
};
class Player
{
public:
setBall(Ball* pBall)
{
if (pBall != m_pBall)
{
Ball* pPreviousBall ... | How about using a reference counting trick for the ball? When a ball is stored in the command, the command can increment the reference count for the ball, hence preventing from being deleted by the handler (or by itself, depending on how you would change the implementation). |
352,758 | <p>I have an inherited QTreeWidget (called PackList) class and its parent is a KXmlGuiWindow.
How can I access to the parent's slots? </p>
<p>I've tried getParent()->mySlot() from the QTreeWidget class but I've got</p>
<pre><code>error: no matching function for call to 'PackList::mySlot()'
</code></pre>
<p>Does any... | [
{
"answer_id": 352850,
"author": "Jérôme",
"author_id": 2796,
"author_profile": "https://Stackoverflow.com/users/2796",
"pm_score": 1,
"selected": false,
"text": "<p>I'm not sure I fully understand your question.</p>\n\n<p>However, you can access the parent widget of a widget with <a hre... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39339/"
] | I have an inherited QTreeWidget (called PackList) class and its parent is a KXmlGuiWindow.
How can I access to the parent's slots?
I've tried getParent()->mySlot() from the QTreeWidget class but I've got
```
error: no matching function for call to 'PackList::mySlot()'
```
Does anybody know the correct way? Thanks | If you know the parent's class, you will have to cast parentWidget() to that class and then call your slot. Keep in mind whether or not it's a slot makes no difference in this case. You are just calling a method.
```
((KXmlGuiWindow*)parentWidget())->mySlot();
```
You can make the call without casting by wiring up y... |
352,777 | <p>Using JDBC (with jt400 driver / connection, naming=system) I'm running these SQL statements:</p>
<pre><code>"CREATE ALIAS QTEMP/SOURCETEMP FOR " + library + "/" + file + " (" + member + ")"
"SELECT SRCDTA FROM QTEMP/SOURCETEMP"
"DROP ALIAS QTEMP/SOURCETEMP"
</code></pre>
<p>This works. However, when the member St... | [
{
"answer_id": 352854,
"author": "nearly_lunchtime",
"author_id": 23447,
"author_profile": "https://Stackoverflow.com/users/23447",
"pm_score": 2,
"selected": false,
"text": "<p>You can escape any .'s by changing eg:</p>\n\n<pre><code>member = \"foo.bar\"\n</code></pre>\n\n<p>to</p>\n\n<... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29574/"
] | Using JDBC (with jt400 driver / connection, naming=system) I'm running these SQL statements:
```
"CREATE ALIAS QTEMP/SOURCETEMP FOR " + library + "/" + file + " (" + member + ")"
"SELECT SRCDTA FROM QTEMP/SOURCETEMP"
"DROP ALIAS QTEMP/SOURCETEMP"
```
This works. However, when the member String has a . in it this con... | You can escape any .'s by changing eg:
```
member = "foo.bar"
```
to
```
member = "\"FOO.BAR\""
```
ie capital letters enclosed within double quotes. |
352,790 | <pre><code><xsl:template match="foo">
</code></pre>
<p>matches the foo element in the null namespace.</p>
<pre><code><xsl:template match="*">
</code></pre>
<p>matches any element in <em>any</em> namespace.</p>
<p>I tried:</p>
<pre><code>xmlns:null=""
...
<xsl:template match="null:*">
</code></pre... | [
{
"answer_id": 352826,
"author": "Jeff Yates",
"author_id": 23234,
"author_profile": "https://Stackoverflow.com/users/23234",
"pm_score": 4,
"selected": true,
"text": "<p>You could try:</p>\n\n<pre><code><xsl:template match='*[namespace-uri() = \"\"]'>\n</code></pre>\n\n<p>If the n... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31662/"
] | ```
<xsl:template match="foo">
```
matches the foo element in the null namespace.
```
<xsl:template match="*">
```
matches any element in *any* namespace.
I tried:
```
xmlns:null=""
...
<xsl:template match="null:*">
```
but it's illegal to declare a prefix for the null namespace.
So how can I match an element... | You could try:
```
<xsl:template match='*[namespace-uri() = ""]'>
```
If the node-set is empty or has no namespace URI, an empty string is returned by the `namespace-uri` function, which should achieve what you want. |
352,837 | <p>This is a question regarding Unix shell scripting (any shell), but any other "standard" scripting language solution would also be appreciated:</p>
<p>I have a directory full of files where the filenames are hash values like this:</p>
<pre><code>fd73d0cf8ee68073dce270cf7e770b97
fec8047a9186fdcc98fdbfc0ea607... | [
{
"answer_id": 352846,
"author": "csl",
"author_id": 21028,
"author_profile": "https://Stackoverflow.com/users/21028",
"pm_score": 4,
"selected": false,
"text": "<p>You can use</p>\n\n<pre><code>file -i filename\n</code></pre>\n\n<p>to get a MIME-type. You could potentially lookup the t... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5949/"
] | This is a question regarding Unix shell scripting (any shell), but any other "standard" scripting language solution would also be appreciated:
I have a directory full of files where the filenames are hash values like this:
```
fd73d0cf8ee68073dce270cf7e770b97
fec8047a9186fdcc98fdbfc0ea6075ee
```
These files have di... | Here's mimetypes' version:
```
#!/usr/bin/env python
"""It is a `filename -> filename.ext` filter.
`ext` is mime-based.
"""
import fileinput
import mimetypes
import os
import sys
from subprocess import Popen, PIPE
if len(sys.argv) > 1 and sys.argv[1] == '--rename':
do_rename = True
del sys.argv[1]
else:... |
352,839 | <p>I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:</p>
<p>All items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Something like this:</p>
<pre><cod... | [
{
"answer_id": 352859,
"author": "Chris Van Opstal",
"author_id": 7264,
"author_profile": "https://Stackoverflow.com/users/7264",
"pm_score": 2,
"selected": false,
"text": "<p>Try the CSS below:</p>\n\n<pre><code>#menu {\n display: table; \n} \n#menu a {\n display:table-cell; \n ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41360/"
] | I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:
All items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Something like this:
```
+--------+--------+... | OK, I talked with my superiors and they decided that it might be OK that you cannot right-click a menu item and select "Open in New Window". If this requirement is dropped, then I'm not bound to `<a>` elements for links. With JavaScript I can turn anything into a link. Thus, I choose you, ~~pikachoo~~ `<table>`!
Yap, ... |
352,885 | <p>This is also a question that I asked in a comment in one of Miško Hevery's <a href="http://misko.hevery.com/2008/11/11/clean-code-talks-dependency-injection/" rel="noreferrer">google talks</a> that was dealing with dependency injection but it got buried in the comments.</p>
<p>I wonder how can the factory / builder... | [
{
"answer_id": 352913,
"author": "Joris Timmermans",
"author_id": 33987,
"author_profile": "https://Stackoverflow.com/users/33987",
"pm_score": 2,
"selected": false,
"text": "<p>Things get complicated if you don't settle on the question of ownership once and for all. You will simply hav... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6403/"
] | This is also a question that I asked in a comment in one of Miško Hevery's [google talks](http://misko.hevery.com/2008/11/11/clean-code-talks-dependency-injection/) that was dealing with dependency injection but it got buried in the comments.
I wonder how can the factory / builder step of wiring the dependencies toget... | This talk is about Java and dependency injection.
In C++ we try **NOT** to pass RAW pointers around. This is because a RAW pointer have no ownership semantics associated with it. If you have no ownership then we don't know who is responsible for cleaning up the object.
I find that most of the time dependency inject... |
352,899 | <p>Is Structured Exception Handling bad? What is the right way to handle exceptions?</p>
<p><strong>EDIT: Exception Handling in .NET using C#.</strong></p>
<p>I usually have a set of specific exception classes (DivideByZeroException, ArrayTypeMismatchException) and don't have a generic "catch (Exception ex)".</p>
<p... | [
{
"answer_id": 352916,
"author": "Zombies",
"author_id": 17675,
"author_profile": "https://Stackoverflow.com/users/17675",
"pm_score": 2,
"selected": false,
"text": "<p>Catch statements + Stack traces. Don't ever catch an exception without printing a stack trace, you or someone else will... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443363/"
] | Is Structured Exception Handling bad? What is the right way to handle exceptions?
**EDIT: Exception Handling in .NET using C#.**
I usually have a set of specific exception classes (DivideByZeroException, ArrayTypeMismatchException) and don't have a generic "catch (Exception ex)".
The thinking behind this is that I e... | I'm not sure what you mean by 'structured exception handling'.
The worst thing that can be done in exception handling is to 'swallow' the exception or handle it silently.
Do NOT do this:
```
try {
...
}
catch (Exception e) {
//TODO: handle this later
}
```
This is very often done out of laziness to get code... |
352,949 | <p>I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get them into a single LINQ statement? Is the... | [
{
"answer_id": 353031,
"author": "user32415",
"author_id": 32415,
"author_profile": "https://Stackoverflow.com/users/32415",
"pm_score": 3,
"selected": false,
"text": "<p>Create a proc/view in your database.</p>\n"
},
{
"answer_id": 353062,
"author": "TGnat",
"author_id":... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23935/"
] | I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get them into a single LINQ statement? Is there ... | You *can* do this, even across servers, as long as you can access one database from the other. That is, if it's possible to write a SQL statement against *ServerA*.*DatabaseA* that accesses *ServerB*.*DatabaseB*.*schema*.*TableWhatever*, then you can do the same thing in LINQ.
To do it, you'll need to edit the .dbml f... |
352,952 | <p>I have a web service which returns tab delimited data (see sample below).</p>
<p>I need to parse this into an array or similar so I can create a navigation view of it.</p>
<p>I've managed to perform the web request and could parse an XML file, but my knowledge of Objective-C is small.</p>
<pre><code>433 Eat
5... | [
{
"answer_id": 353483,
"author": "Brett",
"author_id": 37848,
"author_profile": "https://Stackoverflow.com/users/37848",
"pm_score": 3,
"selected": false,
"text": "<p>I'm not sure I understand your format exactly (it displays a little strange to me) but the easiest way to do this is <cod... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258/"
] | I have a web service which returns tab delimited data (see sample below).
I need to parse this into an array or similar so I can create a navigation view of it.
I've managed to perform the web request and could parse an XML file, but my knowledge of Objective-C is small.
```
433 Eat
502 Not Fussed
442 Britis... | You're on the right track with NSScanner. You'll need at least two scanners: One to scan lines from the whole input string, and one scanner for each line. Set the whole-input scanner to skip only whitespace (not newlines), then:
1. Scan one line (source string up to end-of-line).
2. Create a scanner and have it scan t... |
352,954 | <p>Im using asynchronous threading in my application WITH httpClient. I make a call using the Future Api like so </p>
<pre><code>mStrResults = (String) rssFuture.get();
</code></pre>
<p>this call attempts to retrieve an html string returned from my Callable httpClient call() method.</p>
<p>What i want to do however... | [
{
"answer_id": 353483,
"author": "Brett",
"author_id": 37848,
"author_profile": "https://Stackoverflow.com/users/37848",
"pm_score": 3,
"selected": false,
"text": "<p>I'm not sure I understand your format exactly (it displays a little strange to me) but the easiest way to do this is <cod... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24481/"
] | Im using asynchronous threading in my application WITH httpClient. I make a call using the Future Api like so
```
mStrResults = (String) rssFuture.get();
```
this call attempts to retrieve an html string returned from my Callable httpClient call() method.
What i want to do however is ensure that the get method doe... | You're on the right track with NSScanner. You'll need at least two scanners: One to scan lines from the whole input string, and one scanner for each line. Set the whole-input scanner to skip only whitespace (not newlines), then:
1. Scan one line (source string up to end-of-line).
2. Create a scanner and have it scan t... |
352,958 | <p>I'd like to do something like the following in C#:</p>
<pre><code> class Container {
//...
public void ForEach(Action method) {
foreach (MyClass myObj in sequence) myObj.method();
}
}
//...
containerObj.ForEach(MyClass.Method);
</code></pre>
<p>In C++ I would use... | [
{
"answer_id": 352981,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 0,
"selected": false,
"text": "<p>Assuming that:</p>\n\n<pre><code> public void ForEach(Action method) {\n foreach (MyClass myObj in seque... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44615/"
] | I'd like to do something like the following in C#:
```
class Container {
//...
public void ForEach(Action method) {
foreach (MyClass myObj in sequence) myObj.method();
}
}
//...
containerObj.ForEach(MyClass.Method);
```
In C++ I would use something like std::mem\_... | This ought to work, in C# 3.0:
```
class Container
{
//...
public void ForEach(Action<MyObj> method)
{
foreach (MyClass myObj in sequence) method(myObj);
}
}
//... containerObj.ForEach( myobj => myObj.Method() );
``` |
352,980 | <p>I have been developing an event handler to clean up the RolesAssignments of the new item of a document library in MOSS. I’ve searched for a method that could clean all the RolesAssignments efficiently, although the best way I found seams to be loop through the RolesAssignments and delete one by one? Is there anoth... | [
{
"answer_id": 353272,
"author": "jwmiller5",
"author_id": 7824,
"author_profile": "https://Stackoverflow.com/users/7824",
"pm_score": -1,
"selected": false,
"text": "<p>How about ResetRoleInheritance? This should clear out all of the RoleAssignments.</p>\n"
},
{
"answer_id": 353... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28333/"
] | I have been developing an event handler to clean up the RolesAssignments of the new item of a document library in MOSS. I’ve searched for a method that could clean all the RolesAssignments efficiently, although the best way I found seams to be loop through the RolesAssignments and delete one by one? Is there another wa... | I have the answer, put the propertie SPListItem.BreakRoleInheritance(false) to break the role inheritance and remove the role assignments. |
352,991 | <p>How can I do for inserting a Default Value into a column of a table in Access?
I use this instruction:</p>
<pre><code>ALTER TABLE Tabella ADD Campo Double DEFAULT 0
ALTER TABLE Tabella ADD Campo Double DEFAULT (0)
ALTER TABLE Tabella ADD Campo DEFAULT 0
ALTER TABLE Tabella ADD Campo DEFAULT (0)
ALTER TABLE Tabella ... | [
{
"answer_id": 353003,
"author": "Dan Vinton",
"author_id": 21849,
"author_profile": "https://Stackoverflow.com/users/21849",
"pm_score": 1,
"selected": false,
"text": "<p>See this answer?</p>\n\n<p><a href=\"https://stackoverflow.com/questions/47535/sql-to-add-column-with-default-value-... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How can I do for inserting a Default Value into a column of a table in Access?
I use this instruction:
```
ALTER TABLE Tabella ADD Campo Double DEFAULT 0
ALTER TABLE Tabella ADD Campo Double DEFAULT (0)
ALTER TABLE Tabella ADD Campo DEFAULT 0
ALTER TABLE Tabella ADD Campo DEFAULT (0)
ALTER TABLE Tabella ADD Campo SET ... | From [MSDN](http://msdn.microsoft.com/en-us/library/bb243857.aspx):
>
> The DEFAULT statement can be executed
> only through the Access OLE DB
> provider and ADO. It will return an
> error message if used through the
> Access SQL View user interface.
>
>
>
Sooo... tell us more about what you're doing and how ... |
352,997 | <p>I would appreciate your opinion/advice on the following</p>
<p><strong>Scenario</strong> </p>
<p>HTML has PDF file nick name, back end has URL for each nick. </p>
<p>The link URL is always <code>download.php?what=%PDF_Nick%</code> to ensure download for JS disabled clients. </p>
<p>For JS enabled clients I do JQ... | [
{
"answer_id": 353027,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 2,
"selected": false,
"text": "<p>Is there a reason you disable the asynchronous nature of the AJAX request? it will lock the browser until the req... | 2008/12/09 | [
"https://Stackoverflow.com/questions/352997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I would appreciate your opinion/advice on the following
**Scenario**
HTML has PDF file nick name, back end has URL for each nick.
The link URL is always `download.php?what=%PDF_Nick%` to ensure download for JS disabled clients.
For JS enabled clients I do JQuery AJAX call and rewrite link URL from `download.php?... | Is there a reason you disable the asynchronous nature of the AJAX request? it will lock the browser until the request is completed.
You are better off using a callback instead:
```
$.ajax({
type: "GET",
url: "download.php?ajax=true",
data: "what=" + what,
dataType: "script",
success: function(msg) {
lo... |
353,013 | <p>I'm trying to abstract out all database code into a separate library and then use that library in all my code. All database connections are done using typed TableAdapters that I create by dragging and dropping in datasets in VS2005, using a connection string from the appSettings.</p>
<p>The problem that I haven't b... | [
{
"answer_id": 353027,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 2,
"selected": false,
"text": "<p>Is there a reason you disable the asynchronous nature of the AJAX request? it will lock the browser until the req... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2973/"
] | I'm trying to abstract out all database code into a separate library and then use that library in all my code. All database connections are done using typed TableAdapters that I create by dragging and dropping in datasets in VS2005, using a connection string from the appSettings.
The problem that I haven't been able t... | Is there a reason you disable the asynchronous nature of the AJAX request? it will lock the browser until the request is completed.
You are better off using a callback instead:
```
$.ajax({
type: "GET",
url: "download.php?ajax=true",
data: "what=" + what,
dataType: "script",
success: function(msg) {
lo... |
353,014 | <p>I've been doing a <code>convert(varchar,datefield,112)</code> on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields.</p>
<p>Now, I'm hearing that the converts aren't indexable and that there are... | [
{
"answer_id": 353045,
"author": "Kieveli",
"author_id": 15852,
"author_profile": "https://Stackoverflow.com/users/15852",
"pm_score": 2,
"selected": false,
"text": "<p>It's correct - doing the conversion will execute the conversion for every row queried. It's better to leave the date co... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/335036/"
] | I've been doing a `convert(varchar,datefield,112)` on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields.
Now, I'm hearing that the converts aren't indexable and that there are better methods, in S... | Converting numeric types to string values (a type of Boxing) is not the best performing method of doing what you are looking for. Its not really about index-able, because the actual column type is date time.
If you are looking for the best way query for dates, then your example is right, but you may want to take into... |
353,020 | <p>I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it.</p>
<p>I am wondering which of the following is a better approach:</p>
<p>1) Select all the columns of my Primary Table into the Temp Table and then being able to sele... | [
{
"answer_id": 353036,
"author": "Tony Andrews",
"author_id": 18747,
"author_profile": "https://Stackoverflow.com/users/18747",
"pm_score": 1,
"selected": false,
"text": "<p>With approach 1, the data in the temp table may be out of step with the real data, i.e. if other sessions make cha... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32372/"
] | I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it.
I am wondering which of the following is a better approach:
1) Select all the columns of my Primary Table into the Temp Table and then being able to select the rows I wou... | If you have a non-trivial amount of rows (more than 100) than a table variable's performance is generally going to be worse than a temp table equivalent. But test it to make sure.
Option 2 would use less resources, because there is less data duplication.
Tony's points about this being a dirty read are really somethin... |
353,039 | <p>I'm writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they're slow and most importantly the quality of the sized image is not acceptable. </p>
<p>I compared the same image scaled by OpenGL (i.e. my video card) and my routine and it's miles... | [
{
"answer_id": 353083,
"author": "Dan",
"author_id": 11606,
"author_profile": "https://Stackoverflow.com/users/11606",
"pm_score": 2,
"selected": false,
"text": "<p>I've found the wxWidgets implementation fairly straightforward to modify as required. It is all C++ so no problems with por... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4065/"
] | I'm writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they're slow and most importantly the quality of the sized image is not acceptable.
I compared the same image scaled by OpenGL (i.e. my video card) and my routine and it's miles apart in ... | I've found the wxWidgets implementation fairly straightforward to modify as required. It is all C++ so no problems with portability there. The only difference is that their implementation works with unsigned char arrays (which I find to be the easiest way to deal with images anyhow) with a byte order of RGB and the alp... |
353,040 | <p>I want to list (a sorted list) all my entries from an attribute called streetNames in my table/relation Customers.
eg. I want to achieve the following order: </p>
<p>Street_1A<br>
Street_1B<br>
Street_2A<br>
Street_2B<br>
Street_12A<br>
Street_12B </p>
<p>A simple order by streetNames will do a lexical comparisio... | [
{
"answer_id": 353054,
"author": "mson",
"author_id": 36902,
"author_profile": "https://Stackoverflow.com/users/36902",
"pm_score": 2,
"selected": false,
"text": "<p>Select street_name from tablex\norder by udf_getStreetNumber(street_name)</p>\n\n<p>in your udf_getStreetNumber - write yo... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I want to list (a sorted list) all my entries from an attribute called streetNames in my table/relation Customers.
eg. I want to achieve the following order:
Street\_1A
Street\_1B
Street\_2A
Street\_2B
Street\_12A
Street\_12B
A simple order by streetNames will do a lexical comparision and then Street... | The reliable way to do it (reliable in terms of "to sort your data correctly", not "to solve your general problem") is to split the data into street name and house number and sort both of them on their own. But this requires knowing where the house number starts. And this is the tricky part - making the assumption best... |
353,078 | <p>I'm running into a problem when modifying a WCF service.</p>
<p>The original service method looks like this:</p>
<pre><code>[OperationContract(IsOneWay = true, IsInitiating = true, IsTerminating = false)]
void Login(string userName, string password);
</code></pre>
<p>This method works.</p>
<p>The problem is that... | [
{
"answer_id": 353054,
"author": "mson",
"author_id": 36902,
"author_profile": "https://Stackoverflow.com/users/36902",
"pm_score": 2,
"selected": false,
"text": "<p>Select street_name from tablex\norder by udf_getStreetNumber(street_name)</p>\n\n<p>in your udf_getStreetNumber - write yo... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373/"
] | I'm running into a problem when modifying a WCF service.
The original service method looks like this:
```
[OperationContract(IsOneWay = true, IsInitiating = true, IsTerminating = false)]
void Login(string userName, string password);
```
This method works.
The problem is that when I change it to this:
```
[Operati... | The reliable way to do it (reliable in terms of "to sort your data correctly", not "to solve your general problem") is to split the data into street name and house number and sort both of them on their own. But this requires knowing where the house number starts. And this is the tricky part - making the assumption best... |
353,093 | <p>I know that I can use $('#myId').load('aPage.html'); to load a page into an element, how do I do use that to alter an image?</p>
| [
{
"answer_id": 353098,
"author": "matdumsa",
"author_id": 1775,
"author_profile": "https://Stackoverflow.com/users/1775",
"pm_score": 4,
"selected": true,
"text": "<pre><code>$(\"selectorforyourimage\").attr(\"src\",\"newimagelocation\");\n</code></pre>\n"
},
{
"answer_id": 35367... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384652/"
] | I know that I can use $('#myId').load('aPage.html'); to load a page into an element, how do I do use that to alter an image? | ```
$("selectorforyourimage").attr("src","newimagelocation");
``` |
353,100 | <p>The below <a href="http://docs.jquery.com/Effects/fadeIn" rel="nofollow noreferrer">fadeIn</a>, <a href="http://docs.jquery.com/Effects/fadeOut" rel="nofollow noreferrer">fadeOut</a> effect works fine in Firefox 3.0 but it doesn't work in IE 7 ... Whay is that and what's the trick? The idea is of course to get a "bl... | [
{
"answer_id": 353487,
"author": "lucas",
"author_id": 31172,
"author_profile": "https://Stackoverflow.com/users/31172",
"pm_score": 3,
"selected": false,
"text": "<p>Weird.. couldn't tell you why you're getting that problem, but maybe try the pulsate effect plugin? <a href=\"http://doc... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/298/"
] | The below [fadeIn](http://docs.jquery.com/Effects/fadeIn), [fadeOut](http://docs.jquery.com/Effects/fadeOut) effect works fine in Firefox 3.0 but it doesn't work in IE 7 ... Whay is that and what's the trick? The idea is of course to get a "blink" effect and attract the attention of the user to a specific row in a tabl... | Weird.. couldn't tell you why you're getting that problem, but maybe try the pulsate effect plugin? <http://docs.jquery.com/UI/Effects/Pulsate> |
353,110 | <p>Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the <code>SuppressMessageAttribute</code>?</p>
<p>In my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot of FxCop issues, and obviously, I will not modify all... | [
{
"answer_id": 353145,
"author": "Chane",
"author_id": 43808,
"author_profile": "https://Stackoverflow.com/users/43808",
"pm_score": 1,
"selected": false,
"text": "<p>Use the Generated Code Attribute, heres the <a href=\"http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11963/"
] | Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the `SuppressMessageAttribute`?
In my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot of FxCop issues, and obviously, I will not modify all of those to match Fx... | If you tag your classes with the `[GeneratedCode]` attribute, you can use the /ignoregeneratedcode flag with FxCop as described in this MSDN post:
[FAQ: How do I prevent FxCop from firing warnings against generated code](http://blogs.msdn.com/b/codeanalysis/archive/2008/02/28/faq-how-do-i-prevent-fxcop-1-36-from-firin... |
353,126 | <p>This is probably not possible, but I have this class:</p>
<pre><code>public class Metadata<DataType> where DataType : struct
{
private DataType mDataType;
}
</code></pre>
<p>There's more to it, but let's keep it simple. The generic type (DataType) is limited to value types by the where statement. What ... | [
{
"answer_id": 353134,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 9,
"selected": true,
"text": "<pre><code>public abstract class Metadata\n{\n}\n\n// extend abstract Metadata class\npublic class Metadata<DataType> ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44626/"
] | This is probably not possible, but I have this class:
```
public class Metadata<DataType> where DataType : struct
{
private DataType mDataType;
}
```
There's more to it, but let's keep it simple. The generic type (DataType) is limited to value types by the where statement. What I want to do is have a list of the... | ```
public abstract class Metadata
{
}
// extend abstract Metadata class
public class Metadata<DataType> : Metadata where DataType : struct
{
private DataType mDataType;
}
``` |
353,131 | <p>I'm trying to store the names of some variables inside strings. For example:</p>
<pre><code>Dim Foo1 as Integer
Dim Foo1Name as String
' -- Do something to set Foo1Name to the name of the other variable --
MessageBox.Show(Foo1Name & " is the variable you are looking for.")
' Outputs:
' Foo1 is the variable yo... | [
{
"answer_id": 353154,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 4,
"selected": true,
"text": "<p>Well, you can clearly just set Foo1Name = \"Foo1\" - but I strongly suspect that's not what you're after.</p>\n\n<p>Ho... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38258/"
] | I'm trying to store the names of some variables inside strings. For example:
```
Dim Foo1 as Integer
Dim Foo1Name as String
' -- Do something to set Foo1Name to the name of the other variable --
MessageBox.Show(Foo1Name & " is the variable you are looking for.")
' Outputs:
' Foo1 is the variable you are looking for.... | Well, you can clearly just set Foo1Name = "Foo1" - but I strongly suspect that's not what you're after.
How would you know which variable you're trying to find the name of? What's the bigger picture? What you want *may* be possible with reflection, if we're talking about non-local variables, but I suspect it's either ... |
353,132 | <p>I am modifying a SQL table through C# code and I need to drop a NOT NULL constraint if it exists. How do I check to see if it exists first?</p>
| [
{
"answer_id": 353146,
"author": "mson",
"author_id": 36902,
"author_profile": "https://Stackoverflow.com/users/36902",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not sure about your business rules, so I could be wrong, but what you are proposing sounds like a bad idea.</p>\n\n<p>... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3047/"
] | I am modifying a SQL table through C# code and I need to drop a NOT NULL constraint if it exists. How do I check to see if it exists first? | ```
select is_nullable
from sys.columns
where object_id = OBJECT_ID('tablename')
and name = 'columnname';
``` |
353,148 | <p>I am on a shared host and can not change the symbolic link to Python2.4, it defaults to 2.3. I tried creating a sym link in the director I would be working on to 2.4, but it seems the the 'global' python interpreter under /usr/bin/python take presedence unless I run it as ./python. What alternative ways are there to... | [
{
"answer_id": 353159,
"author": "Bombe",
"author_id": 43582,
"author_profile": "https://Stackoverflow.com/users/43582",
"pm_score": 3,
"selected": true,
"text": "<p>Create a symlink and prepend the path to your PATH variable:</p>\n\n<pre><code>ln -s /usr/bin/python2.4 $HOME/bin/python\n... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/370899/"
] | I am on a shared host and can not change the symbolic link to Python2.4, it defaults to 2.3. I tried creating a sym link in the director I would be working on to 2.4, but it seems the the 'global' python interpreter under /usr/bin/python take presedence unless I run it as ./python. What alternative ways are there to ov... | Create a symlink and prepend the path to your PATH variable:
```
ln -s /usr/bin/python2.4 $HOME/bin/python
export PATH="$HOME/bin:$PATH"
``` |
353,152 | <p>I'm tackling project euler's <a href="http://projecteuler.net/index.php?section=problems&id=220" rel="nofollow noreferrer">problem 220</a> (looked easy, in comparison to some of the
others - thought I'd try a higher numbered one for a change!)</p>
<p>So far I have:</p>
<pre><code>D = "Fa"
def iterate(D,num):... | [
{
"answer_id": 353220,
"author": "Steve Jessop",
"author_id": 13005,
"author_profile": "https://Stackoverflow.com/users/13005",
"pm_score": 2,
"selected": false,
"text": "<p>If you think about how many \"a\" and \"b\" characters there are in D(0), D(1), etc, you'll see that the string ge... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16511/"
] | I'm tackling project euler's [problem 220](http://projecteuler.net/index.php?section=problems&id=220) (looked easy, in comparison to some of the
others - thought I'd try a higher numbered one for a change!)
So far I have:
```
D = "Fa"
def iterate(D,num):
for i in range (0,num):
D = D.replace("a","A")
... | Python strings are not going to be the answer to this one. Strings are stored as immutable arrays, so each one of those replacements creates an entirely new string in memory. Not to mention, the set of instructions after 10^12 steps will be at least 1TB in size if you store them as characters (and that's with some mino... |
353,161 | <p>I would like to be able to query whether or not a service is running from a windows batch file. I know I can use: </p>
<blockquote>
<p>sc query "ServiceName" </p>
</blockquote>
<p>but, this dumps out some text. What I really want is for it to set the <code>errorlevel</code> environment variable so that I can t... | [
{
"answer_id": 353196,
"author": "Igal Serban",
"author_id": 25737,
"author_profile": "https://Stackoverflow.com/users/25737",
"pm_score": 8,
"selected": true,
"text": "<pre><code>sc query \"ServiceName\" | find \"RUNNING\"\n</code></pre>\n"
},
{
"answer_id": 353201,
"author"... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11898/"
] | I would like to be able to query whether or not a service is running from a windows batch file. I know I can use:
>
> sc query "ServiceName"
>
>
>
but, this dumps out some text. What I really want is for it to set the `errorlevel` environment variable so that I can take action on that.
Do you know a simple way... | ```
sc query "ServiceName" | find "RUNNING"
``` |
353,165 | <p>I have a virtual path (example: "~/Images/Banner.jpg") and I want to make that an absolute web path (example: "/ApplicationRoot/Images/Banner.jpg"). There is a method that will do this, I believe in a class called something like HTTPUtility or similar name. Though ever time I need this method, it takes me hours ... | [
{
"answer_id": 353184,
"author": "Boris Callens",
"author_id": 11333,
"author_profile": "https://Stackoverflow.com/users/11333",
"pm_score": 7,
"selected": true,
"text": "<pre><code>System.Web.VirtualPathUtility.ToAbsolute(\"yourRelativePath\");\n</code></pre>\n\n<p>There you go :)</p>\n... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18893/"
] | I have a virtual path (example: "~/Images/Banner.jpg") and I want to make that an absolute web path (example: "/ApplicationRoot/Images/Banner.jpg"). There is a method that will do this, I believe in a class called something like HTTPUtility or similar name. Though ever time I need this method, it takes me hours searchi... | ```
System.Web.VirtualPathUtility.ToAbsolute("yourRelativePath");
```
There you go :) |
353,187 | <p>From reading here and around the net, I'm close to assuming the answer is "no", but...</p>
<p>Let's say I have an ASP.Net page that sometimes has a query string parameter. If the page has the query string parameter, I want to strip it off before, during, or after postback. The page already has a lot of client-side ... | [
{
"answer_id": 353202,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 1,
"selected": false,
"text": "<p>It is probably bad practice, but in those cases (and ones I just need to 'reset' the page), I simply do a Response.Redir... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14894/"
] | From reading here and around the net, I'm close to assuming the answer is "no", but...
Let's say I have an ASP.Net page that sometimes has a query string parameter. If the page has the query string parameter, I want to strip it off before, during, or after postback. The page already has a lot of client-side script (pu... | iam not sure this is what you are looking for, but if understand correctly you could do this:
-on page load check for the QS value, if its not there use a hidden input field.
-first time page loads with QS, do your normal processing and store QS value in a hidden input field.
-if no QS then use the hidden input val... |
353,224 | <p>I'm brand new to Erlang. How do you do modulo (get the remainder of a division)? It's % in most C-like languages, but that designates a comment in Erlang.</p>
<p>Several people answered with rem, which in most cases is fine. But I'm revisiting this because now I need to use negative numbers and rem gives you the re... | [
{
"answer_id": 353241,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": false,
"text": "<p>According to <a href=\"http://jjinux.blogspot.com/2007/05/erlang-amazingly-funky-and-amazingly.html\" rel=\"nofollow ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17693/"
] | I'm brand new to Erlang. How do you do modulo (get the remainder of a division)? It's % in most C-like languages, but that designates a comment in Erlang.
Several people answered with rem, which in most cases is fine. But I'm revisiting this because now I need to use negative numbers and rem gives you the remainder of... | In Erlang, `5 rem 3.` gives `2`, and `-5 rem 3.` gives `-2`. If I understand your question, you would want `-5 rem 3.` to give 1 instead, since `-5 = -2 * 3 + 1.`
Does this do what you want?
```
mod(X,Y) when X > 0 -> X rem Y;
mod(X,Y) when X < 0 -> Y + X rem Y;
mod(0,Y) -> 0.
``` |
353,233 | <p>I have the following code in a SQL Server 2005 trigger: </p>
<pre>
CREATE TRIGGER [myTrigger] ON [myTable]
FOR UPDATE,DELETE
AS
BEGIN
DECLARE @OperationType VARCHAR(6)
IF EXISTS(SELECT 1 FROM INSERTED)
BEGIN
SET @OperationType='Update'
END
ELSE
BEGIN
SET @OperationType='Delete'
END
</pre>
<p>My question: ... | [
{
"answer_id": 353260,
"author": "Gordon Bell",
"author_id": 16473,
"author_profile": "https://Stackoverflow.com/users/16473",
"pm_score": 3,
"selected": false,
"text": "<p>Why don't you just create two separate triggers?</p>\n\n<pre><code>CREATE TRIGGER [myUpdateTrigger] ON [myTable]\nF... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39735/"
] | I have the following code in a SQL Server 2005 trigger:
```
CREATE TRIGGER [myTrigger] ON [myTable]
FOR UPDATE,DELETE
AS
BEGIN
DECLARE @OperationType VARCHAR(6)
IF EXISTS(SELECT 1 FROM INSERTED)
BEGIN
SET @OperationType='Update'
END
ELSE
BEGIN
SET @OperationType='Delete'
END
```
My question: is there a si... | Why don't you just create two separate triggers?
```
CREATE TRIGGER [myUpdateTrigger] ON [myTable]
FOR UPDATE
AS
BEGIN
END
CREATE TRIGGER [myDeleteTrigger] ON [myTable]
FOR DELETE
AS
BEGIN
END
``` |
353,246 | <p>I want my emacs buffer to have a different name than the file name. Rather than setting this manually every time, I want to have this happen automatically based on the file contents, something like:</p>
<p>// Local Variables:<br>
// buffer-name: MyName<br>
// End:</p>
<p>But this doesn't work because buffer-name ... | [
{
"answer_id": 353369,
"author": "Pierre",
"author_id": 24449,
"author_profile": "https://Stackoverflow.com/users/24449",
"pm_score": 5,
"selected": true,
"text": "<p>You could say:</p>\n\n<pre><code>// Local Variables:\n// eval: (rename-buffer \"my-buffer-name-here\")\n// end:\n</code><... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44634/"
] | I want my emacs buffer to have a different name than the file name. Rather than setting this manually every time, I want to have this happen automatically based on the file contents, something like:
// Local Variables:
// buffer-name: MyName
// End:
But this doesn't work because buffer-name is a function, not a... | You could say:
```
// Local Variables:
// eval: (rename-buffer "my-buffer-name-here")
// end:
```
It is a trick though.
You could otherwise program a `find-file-hook` hook in your `.emacs` which rename the buffer to a specific local variable contents. Something like:
```
(defvar pdp-buffer-name nil)
(defun pdp-r... |
353,252 | <p>How to implement a great search within a mysqldb - within a table
if i search with '...LIke %bla%....' not all entrys would be found - if bla within a word for example.
a search with soundex would be great to - but if i read the manual i must create an soundex-index to search for soundex-values? </p>
<p>So the ques... | [
{
"answer_id": 353369,
"author": "Pierre",
"author_id": 24449,
"author_profile": "https://Stackoverflow.com/users/24449",
"pm_score": 5,
"selected": true,
"text": "<p>You could say:</p>\n\n<pre><code>// Local Variables:\n// eval: (rename-buffer \"my-buffer-name-here\")\n// end:\n</code><... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How to implement a great search within a mysqldb - within a table
if i search with '...LIke %bla%....' not all entrys would be found - if bla within a word for example.
a search with soundex would be great to - but if i read the manual i must create an soundex-index to search for soundex-values?
So the question whats... | You could say:
```
// Local Variables:
// eval: (rename-buffer "my-buffer-name-here")
// end:
```
It is a trick though.
You could otherwise program a `find-file-hook` hook in your `.emacs` which rename the buffer to a specific local variable contents. Something like:
```
(defvar pdp-buffer-name nil)
(defun pdp-r... |
353,270 | <p>I have some critical logic in a finally block (with an empty try block), because I want to guarantee that the code gets executed even if the thread is aborted. However, I'd also like to detect the ThreadAbortException. I've found that wrapping my critical try/finally block in a try/catch does not catch the ThreadAbo... | [
{
"answer_id": 353279,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 2,
"selected": false,
"text": "<p>Read about <a href=\"http://msdn.microsoft.com/en-us/library/ms228973.aspx\" rel=\"nofollow noreferrer\">Constrained Execut... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7529/"
] | I have some critical logic in a finally block (with an empty try block), because I want to guarantee that the code gets executed even if the thread is aborted. However, I'd also like to detect the ThreadAbortException. I've found that wrapping my critical try/finally block in a try/catch does not catch the ThreadAbortE... | This is a curious problem.
The code you posted *should* work. It seems there's some kind of optimization going on that decides not to call your catch handler.
So, I wanted to detect the exception with this:
```
bool threadAborted = true;
try {
try { }
finally { /* critical code */ }
threadAborted = false;
}
fi... |
353,288 | <p>I just started diving into ADO.NET Data Services for a project, and I quickly ran into a problem. At first I was amazed by the performance, but then I realized that the data was cached. My project relies on real-time data, and I'd love to use the ADO.NET Data Services REST query syntax (without needing to use WCF or... | [
{
"answer_id": 392303,
"author": "Phani Raj",
"author_id": 46455,
"author_profile": "https://Stackoverflow.com/users/46455",
"pm_score": 2,
"selected": false,
"text": "<p>We made a post recently about how to use ETags to control the caching policy of data returned from a Data Service , <... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44636/"
] | I just started diving into ADO.NET Data Services for a project, and I quickly ran into a problem. At first I was amazed by the performance, but then I realized that the data was cached. My project relies on real-time data, and I'd love to use the ADO.NET Data Services REST query syntax (without needing to use WCF or SO... | By default the data context has MergeOption set to AppendOnly. This means that re-requests will only add new entities and will not update existing ones. Try setting MergeOption to OverwriteChanges:
```
this.context.MergeOption = MergeOption.OverwriteChanges;
```
This worked for me when I noticed this! If you're usin... |
353,296 | <p>I have a set of objects which I iterate through, however I may decide during the iteration that one (or more) of those objects now need to be deleted. </p>
<p>My code goes as follows:</p>
<pre><code>if( ! m_Container.empty() )
{
for( typedefedcontainer::iterator it = m_Container.begin();
... | [
{
"answer_id": 353334,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 4,
"selected": true,
"text": "<p>It depends on the container. The list container supports deletion during enumeration by returning a new iterator from ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] | I have a set of objects which I iterate through, however I may decide during the iteration that one (or more) of those objects now need to be deleted.
My code goes as follows:
```
if( ! m_Container.empty() )
{
for( typedefedcontainer::iterator it = m_Container.begin();
it != m_Container.en... | It depends on the container. The list container supports deletion during enumeration by returning a new iterator from the erase method that represents the next item in the list. map doesn't support this.
A simple method for map is to accumulate the items you want to erase in a separate list, and then iterate over that... |
353,297 | <p>I am trying to create an application like the one here:</p>
<p><a href="http://www.eigenfaces.com/" rel="nofollow noreferrer">http://www.eigenfaces.com/</a></p>
<p>Basically lots of overlapping circles drawn with pygame. I cannot figure out how the blend the circles to make them translucent. That is to have overla... | [
{
"answer_id": 353719,
"author": "Zoomulator",
"author_id": 44563,
"author_profile": "https://Stackoverflow.com/users/44563",
"pm_score": 3,
"selected": false,
"text": "<p>I got it to work by drawing to a surface that is not the display and combining the set colorkey and set alpha functi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am trying to create an application like the one here:
<http://www.eigenfaces.com/>
Basically lots of overlapping circles drawn with pygame. I cannot figure out how the blend the circles to make them translucent. That is to have overlapping colors show through. My code so far is this:
```
import sys, random, time
i... | I got it to work by drawing to a surface that is not the display and combining the set colorkey and set alpha functions.
```
import pygame
from pygame.locals import *
TRANSPARENT = (255,0,255)
pygame.init()
screen = pygame.display.set_mode((500,500))
surf1 = pygame.Surface((200,200))
surf1.fill(TRANSPARENT)
surf1.se... |
353,309 | <p>I need a <a href="http://www.codeproject.com/KB/dotnet/regextutorial.aspx" rel="nofollow noreferrer">Regular Expressions</a> to get the text within 2 tags.</p>
<p>Lets say I want an array returned containing <strong>any text within <code><data</code>> and <code></data</code>> tags.</strong>
Or any text <stro... | [
{
"answer_id": 353319,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "<p>Perl regexp would be</p>\n\n<pre><code>$string =~ /color=rgb\\((\\d+),(\\d+),(\\d+)\\)/;\n@array = ($1,$2,$3);\n</code></pr... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41021/"
] | I need a [Regular Expressions](http://www.codeproject.com/KB/dotnet/regextutorial.aspx) to get the text within 2 tags.
Lets say I want an array returned containing **any text within `<data`> and `</data`> tags.**
Or any text **within "(" and ")" tags.**
How can I do that with RegEx's in C#?
---
An advanced question... | Since you specifically mentioned C#, here's how I'm doing that exact parsing:
```
private static readonly Regex RgbValuePattern = new Regex(@"(?<r>\d{1,3}) ?, ?(?<g>\d{1,3}) ?, ?(?<b>\d{1,3})",
RegexOptions.Compiled | RegexOptions.ExplicitCapture);
```
Then l... |
353,326 | <p>I have a Rake task (in lib/tasks directory) that I run with cron on my shared web hosting. The problem is that I want to compare a UTF-8 string using case statment but my source code is not UTF-8 encoded. If I save source code as UTF-8 there is error when I try to start it :(</p>
<p>What I have to do? </p>
<p>May ... | [
{
"answer_id": 354272,
"author": "John Topley",
"author_id": 1450,
"author_profile": "https://Stackoverflow.com/users/1450",
"pm_score": 0,
"selected": false,
"text": "<p>Try using the <code>mb_chars</code> method from Rails' <a href=\"http://api.rubyonrails.org/classes/ActiveSupport/Mul... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44537/"
] | I have a Rake task (in lib/tasks directory) that I run with cron on my shared web hosting. The problem is that I want to compare a UTF-8 string using case statment but my source code is not UTF-8 encoded. If I save source code as UTF-8 there is error when I try to start it :(
What I have to do?
May be read this stri... | I'd say you need to change your text editor as BOM is *not* needed for UTF-8. UTF-8 is not byte-order dependent. See [link text](http://en.wikipedia.org/wiki/UTF-8#Byte-order_mark) for details. |
353,336 | <p>I'm completely at loss how the ant task ivy:publish is supposed to work.</p>
<p>I would expect that I do my normal build, which creates a bunch of jar files, then I would push those jars to the (local) repository.</p>
<p>How can I specify from where to retrieve the built jars, and how would those end up in the rep... | [
{
"answer_id": 353368,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 3,
"selected": false,
"text": "<p>You need to specify the \"resolver\". Something like:</p>\n\n<pre><code><ivy:publish resolver=\"local\" pubrevision=\"... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/917/"
] | I'm completely at loss how the ant task ivy:publish is supposed to work.
I would expect that I do my normal build, which creates a bunch of jar files, then I would push those jars to the (local) repository.
How can I specify from where to retrieve the built jars, and how would those end up in the repository?
**Updat... | You need to specify the "resolver". Something like:
```
<ivy:publish resolver="local" pubrevision="1.0"/>
```
It's controlled by the pattern. This [page](http://ant.apache.org/ivy/history/latest-milestone/concept.html#patterns) covers it pretty well. It looks like you want yours to be:
```
<artifacts pattern="${dis... |
353,342 | <p>We have lots of logging calls in our app. Our logger takes a System.Type parameter so it can show which component created the call. Sometimes, when we can be bothered, we do something like:</p>
<pre><code>class Foo
{
private static readonly Type myType = typeof(Foo);
void SomeMethod()
{
Logger.Log(myT... | [
{
"answer_id": 353435,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 8,
"selected": true,
"text": "<p>I strongly suspect that GetType() will take significantly less time than any actual logging. Of course, there's the po... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3856/"
] | We have lots of logging calls in our app. Our logger takes a System.Type parameter so it can show which component created the call. Sometimes, when we can be bothered, we do something like:
```
class Foo
{
private static readonly Type myType = typeof(Foo);
void SomeMethod()
{
Logger.Log(myType, "SomeMethod... | I strongly suspect that GetType() will take significantly less time than any actual logging. Of course, there's the possibility that your call to Logger.Log won't do any actual IO... I still suspect the difference will be irrelevant though.
EDIT: Benchmark code is at the bottom. Results:
```
typeof(Test): 2756ms
Test... |
353,353 | <p>I am trying to use onkeypress on an input type="text" control to fire off some javascript if the enter button is pressed. It works on most pages, but I also have some pages with custom .NET controls.</p>
<p>The problem is that the .NET submit fires before the onkeypress. Does anybody have an insight on how to mak... | [
{
"answer_id": 353435,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 8,
"selected": true,
"text": "<p>I strongly suspect that GetType() will take significantly less time than any actual logging. Of course, there's the po... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42574/"
] | I am trying to use onkeypress on an input type="text" control to fire off some javascript if the enter button is pressed. It works on most pages, but I also have some pages with custom .NET controls.
The problem is that the .NET submit fires before the onkeypress. Does anybody have an insight on how to make onkeypress... | I strongly suspect that GetType() will take significantly less time than any actual logging. Of course, there's the possibility that your call to Logger.Log won't do any actual IO... I still suspect the difference will be irrelevant though.
EDIT: Benchmark code is at the bottom. Results:
```
typeof(Test): 2756ms
Test... |
353,354 | <p><code>DBCC SHRINKFILE</code> always works when I run it manually on a log file, even when I get the following message:</p>
<pre><code>'Cannot shrink log file 2 (Claim_Log) because all logical log files are in use.'
</code></pre>
<p>When I run it from a job, however, it only shrinks the log about one third of the t... | [
{
"answer_id": 353495,
"author": "rip747",
"author_id": 31278,
"author_profile": "https://Stackoverflow.com/users/31278",
"pm_score": 2,
"selected": false,
"text": "<p>try issuing the <strong>CHECKPOINT</strong> command first, then shrinking the logs</p>\n\n<p>taken from BOL (<a href=\"h... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22448/"
] | `DBCC SHRINKFILE` always works when I run it manually on a log file, even when I get the following message:
```
'Cannot shrink log file 2 (Claim_Log) because all logical log files are in use.'
```
When I run it from a job, however, it only shrinks the log about one third of the time. The other times, it just remains... | I recently solved a similar issue, I found that in sys.databases, log\_reuse\_wait\_desc was equal to 'replication'. Apparently this means something to the effect of SQL Server waiting for a replication task to finish before it can reuse the log space.
However replication had never been used on our DB nor on our serve... |
353,379 | <p>I have a PHP application that will on occasion have to handle URLs where more than one parameter in the URL will have the same name. Is there an easy way to retrieve all the values for a given key? PHP $_GET returns only the last value. </p>
<p>To make this concrete, my application is an OpenURL resolver, and may g... | [
{
"answer_id": 353400,
"author": "Stefan Gehrig",
"author_id": 11354,
"author_profile": "https://Stackoverflow.com/users/11354",
"pm_score": 3,
"selected": false,
"text": "<p>I think you'd have to parse <code>$_SERVER['QUERY_STRING']</code> manually.</p>\n\n<p>Something like (untested):<... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9684/"
] | I have a PHP application that will on occasion have to handle URLs where more than one parameter in the URL will have the same name. Is there an easy way to retrieve all the values for a given key? PHP $\_GET returns only the last value.
To make this concrete, my application is an OpenURL resolver, and may get URL pa... | Something like:
```
$query = explode('&', $_SERVER['QUERY_STRING']);
$params = array();
foreach( $query as $param )
{
// prevent notice on explode() if $param has no '='
if (strpos($param, '=') === false) $param += '=';
list($name, $value) = explode('=', $param, 2);
$params[urldecode($name)][] = urldecode($... |
353,414 | <p>I have inherited an ASP.NET 2.0 project and one of the things I have noticed is that the user has to click a <code>dropdownlist</code> twice in order to expand it - why is this?</p>
<p><strong>Sequence of Events</strong></p>
<ol>
<li>The first click with give the control focus and the second will expand it.</li>
<... | [
{
"answer_id": 353496,
"author": "Scott Evernden",
"author_id": 11397,
"author_profile": "https://Stackoverflow.com/users/11397",
"pm_score": 0,
"selected": false,
"text": "<p>dunno if this is the best solution and haven't tried it .. but how about setfocus at onload() to the control in ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31580/"
] | I have inherited an ASP.NET 2.0 project and one of the things I have noticed is that the user has to click a `dropdownlist` twice in order to expand it - why is this?
**Sequence of Events**
1. The first click with give the control focus and the second will expand it.
2. The application uses Master/Content pages and i... | Found it and sorted it (for now).
The problem was being caused by a Javascript function that was inserted by a usercontrol and was adding styling to the DropDownLists. Why this was not done in CSS I have no idea (but it will be shortly) but commenting out the following function resolved my problem:
```
function i... |
353,424 | <p>Is it possible to generate a list of all source members within an iSeries source file using SQL?</p>
<p>Might be similar to getting table definitions from SYSTABLES and SYSCOLUMNS, but I'm unable to find anything so far.</p>
| [
{
"answer_id": 355445,
"author": "Kwebble",
"author_id": 4167,
"author_profile": "https://Stackoverflow.com/users/4167",
"pm_score": 2,
"selected": false,
"text": "<p>You can write a CL program that retrieves the list of members using the DSPFD command. Perhaps you can call that program ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23447/"
] | Is it possible to generate a list of all source members within an iSeries source file using SQL?
Might be similar to getting table definitions from SYSTABLES and SYSCOLUMNS, but I'm unable to find anything so far. | Sadly SQL doesn't know anything about members, so all the sourcefile-info you could get from qsys2.syscolumns is, that they consist of three columns.
you want the member info and i suggest using the qshell( STRQSH ) together with a query to qsys2.systables as source files are specially marked there.
```
select table_... |
353,425 | <p>I have a Stored Procedure called spGetOrders which accepts a few parameters: @startdate and @enddate. This queries an "Orders" table. One of the columns in the table is called "ClosedDate". This column will hold NULL if an order hasn't been closed or a date value if it has. I'd like to add a @Closed parameter w... | [
{
"answer_id": 353441,
"author": "dkretz",
"author_id": 31641,
"author_profile": "https://Stackoverflow.com/users/31641",
"pm_score": 2,
"selected": false,
"text": "<p>SQL Statement:</p>\n\n<pre><code>SELECT * \nFROM orders \nWHERE orderdate BETWEEN @startdate AND @enddate \nAND (@Clo... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | I have a Stored Procedure called spGetOrders which accepts a few parameters: @startdate and @enddate. This queries an "Orders" table. One of the columns in the table is called "ClosedDate". This column will hold NULL if an order hasn't been closed or a date value if it has. I'd like to add a @Closed parameter which wil... | Try this:
```
select * from orders o
where o.orderdate between @startdate AND @enddate
and ((@Closed = 1 And o.ClosedDate IS NULL) Or (@Closed = 0 And o.ClosedDate IS NOT NULL))
```
Be vary careful about mixing AND's and OR's in the where clause. When doing this, the parenthesis to control the order of evaluation is... |
353,430 | <p>I'm building a custom property grid that displays the properties of items in a collection. What I want to do is show only the properties in the grid that are common amongst each item. I am assuming the best way to do this would be to find the the common base class of each type in the collection and display it's prop... | [
{
"answer_id": 353492,
"author": "matt_dev",
"author_id": 39086,
"author_profile": "https://Stackoverflow.com/users/39086",
"pm_score": 0,
"selected": false,
"text": "<p>Well,</p>\n\n<p>You could create in interface similar to IComparable but instead call it something like IPropertyCompa... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17744/"
] | I'm building a custom property grid that displays the properties of items in a collection. What I want to do is show only the properties in the grid that are common amongst each item. I am assuming the best way to do this would be to find the the common base class of each type in the collection and display it's propert... | You can do this with a method that keeps checking for common base classes. I wrote up this, quickly, using the BaseClass feature of the Type class. You don't have to use an array, a list or other IEnumerable can work with small modifications to this.
I tested it with:
```
static void Main(string[] args)
{
Consol... |
353,464 | <p>Is there a way to use verbatim String literals in managed C++? Similar to C#'s</p>
<pre><code>String Docs = @"c:\documents and settings\"
</code></pre>
| [
{
"answer_id": 353529,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": 3,
"selected": false,
"text": "<p>This is not currently possible. Managed C++ string literals have almost the exact same rules as normal C++ strings. ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2831/"
] | Is there a way to use verbatim String literals in managed C++? Similar to C#'s
```
String Docs = @"c:\documents and settings\"
``` | in C++11, there is raw string literal:
```
cout<<R"((\"ddd\aa)\n)"<<endl;
cout<<R"delimiter((\"ddd\aa)\n)delimiter"<<endl;
```
output is:
```
(\"ddd\aa)\n
(\"ddd\aa)\n
``` |
353,481 | <p>I know this is particularly difficult with CSS and the current set of browsers, but nonetheless I have the requirement.</p>
<p>I need to be able to have 3 divs in a column. Each div should be able to take up a certain percentage of the vertical space (for example, 33%). The contents of each div <em>could</em> end u... | [
{
"answer_id": 353522,
"author": "JSBձոգչ",
"author_id": 8078,
"author_profile": "https://Stackoverflow.com/users/8078",
"pm_score": 1,
"selected": false,
"text": "<p>The following renders properly on IE7, Firefox 3, and Google Chrome, now that I've fixed the boneheaded error in the CSS:... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5416/"
] | I know this is particularly difficult with CSS and the current set of browsers, but nonetheless I have the requirement.
I need to be able to have 3 divs in a column. Each div should be able to take up a certain percentage of the vertical space (for example, 33%). The contents of each div *could* end up being larger th... | Maybe I'm missing something, but given:
```
<div id="column">
<div id="a" class="cell">A</div>
<div id="b" class="cell">B</div>
<div id="c" class="cell">C</div>
</div>
```
What's wrong with:
```
#column
{
height: 100%;
width: 20%;
}
#column .cell
{
height... |
353,485 | <p>I am trying to create a Data Source in SharePoint Designer that connects to a SharePoint List via XML Web Services. I have created the Data Source and connected to the list in question. I can view all the data using GetListItems, and I want to filter it using the query parameter.</p>
<p>The query parameter takes ... | [
{
"answer_id": 354027,
"author": "Peter Lillevold",
"author_id": 35245,
"author_profile": "https://Stackoverflow.com/users/35245",
"pm_score": 1,
"selected": false,
"text": "<p>Did you XML encode the query? I believe you need to encode characters like <, > and \" such that it is valid... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1753/"
] | I am trying to create a Data Source in SharePoint Designer that connects to a SharePoint List via XML Web Services. I have created the Data Source and connected to the list in question. I can view all the data using GetListItems, and I want to filter it using the query parameter.
The query parameter takes an XmlNode, ... | There is a bug in SharePoint Designer. You cannot pass a Query object to a SOAPDataSource like this - the XML gets overencoded. Nothing you can do to fix it, except use Visual Studio.
I'll let you know if there's ever a hotfix available.
If anyone wants to quote this answer in a new answer, I'll accept that answer. |
353,486 | <p>I'm looking at using ASP.NET for a new SaaS service, but for the love of me I can't seem to figure out how to do account lookups based on subdomains like most SaaS applications (e.g. 37Signals) do.</p>
<p>For example, if I offer yourname.mysite.com, then how would I use ASP.NET (MVC specifically) to extract the sub... | [
{
"answer_id": 353564,
"author": "Brian Lyttle",
"author_id": 636,
"author_profile": "https://Stackoverflow.com/users/636",
"pm_score": 2,
"selected": false,
"text": "<p>You should be able to pick this up from the <a href=\"http://msdn.microsoft.com/en-us/library/ms524602.aspx\" rel=\"no... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40667/"
] | I'm looking at using ASP.NET for a new SaaS service, but for the love of me I can't seem to figure out how to do account lookups based on subdomains like most SaaS applications (e.g. 37Signals) do.
For example, if I offer yourname.mysite.com, then how would I use ASP.NET (MVC specifically) to extract the subdomain so ... | This works for me:
```
//--------------------------------------------------------------------------------------------------------------------------
public string GetSubDomain()
{
string SubDomain = "";
if (Request.Url.HostNameType == UriHostNameType.Dns)
SubDomain = Regex.Repla... |
353,489 | <p>In my case, I have a number of column names coming from a form. I want to filter to make sure they're all true. Here's how I currently do it:</p>
<pre><code>for op in self.cleaned_data['options']:
cars = cars.filter((op, True))
</code></pre>
<p>Now it <em>works</em> but there are are a possible ~40 columns to ... | [
{
"answer_id": 353602,
"author": "prairiedogg",
"author_id": 27462,
"author_profile": "https://Stackoverflow.com/users/27462",
"pm_score": 3,
"selected": false,
"text": "<p>Build the query as a dictionary and use the ** operator to unpack the options as keyword arguments to the filter me... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12870/"
] | In my case, I have a number of column names coming from a form. I want to filter to make sure they're all true. Here's how I currently do it:
```
for op in self.cleaned_data['options']:
cars = cars.filter((op, True))
```
Now it *works* but there are are a possible ~40 columns to be tested and it therefore doesn'... | Django's query sets are lazy, so what you're currently doing is actually pretty efficient. The database won't be hit until you try to access one of the fields in the QuerySet... assuming, that is, that you didn't edit out some code, and it is effectively like this:
```
cars = CarModel.objects.all()
for op in self.clea... |
353,491 | <p>Say I have a hierarchy of classes, let's use the classic <code>Shape</code> examples: </p>
<p><code>abstract class Shape</code><br>
<code>Circle : Shape</code><br>
<code>Square : Shape</code> </p>
<p>I have a second hierarchy of renderer classes that handle the rendering of shapes in different ways:</p>
<p><code>... | [
{
"answer_id": 353549,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": false,
"text": "<p>I think it <em>should</em> be a breaking change. If you add a shape, the existing renderers clearly aren't going to b... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Say I have a hierarchy of classes, let's use the classic `Shape` examples:
`abstract class Shape`
`Circle : Shape`
`Square : Shape`
I have a second hierarchy of renderer classes that handle the rendering of shapes in different ways:
`abstract class ShapeRenderer`
`HtmlShapeRenderer : ShapeRenderer`
`Wi... | I think it *should* be a breaking change. If you add a shape, the existing renderers clearly aren't going to be able to cope - they'll need to be changed.
You could change ShapeRenderer to add RenderTriangle() as a virtual (non-abstract) method which just logs the fact that it can't render appropriately, and then fix ... |
353,505 | <p>I'm trying to get a JEditorPane to highlight the full width of a displayed line. All the examples I've tried only highlight the textual content. For example if I have content such as this:</p>
<pre><code> ---------------------------------
|Here is some text |
|some more text |
----... | [
{
"answer_id": 354283,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 3,
"selected": true,
"text": "<p>This seems not too complicated. I would make that a little <a href=\"https://stackoverflow.com/questions/172184\"><strong>cod... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4023/"
] | I'm trying to get a JEditorPane to highlight the full width of a displayed line. All the examples I've tried only highlight the textual content. For example if I have content such as this:
```
---------------------------------
|Here is some text |
|some more text |
------------------... | This seems not too complicated. I would make that a little [**code-challenge**](https://stackoverflow.com/questions/172184).
Just create your own custom Highlighter, extending DefaultHighlighter.
Override the `paint()` method, and simply leave unchanged the width of the rectangle paint: it will be the width of the pa... |
353,520 | <p>Is it possible to post a description/comment variable to the facebook sharer url? It's only possible for url and title as far as I can figure out.</p>
| [
{
"answer_id": 529285,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>Facebook sharer use the description <code>meta</code> tag to add a description in your post for the pictures. I don't reall... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18671/"
] | Is it possible to post a description/comment variable to the facebook sharer url? It's only possible for url and title as far as I can figure out. | The parameters that you can pass to the actual `sharer.php` are "u" and "t" which are `url` and `title`. You can add `meta` tags to your page to get more info to appear in the sharer. To quote the [docs](http://www.facebook.com/share_partners.php) (make sure you click the advance partners link):
>
> In order to make ... |
353,545 | <p>I have a C# program which uses a SQL Server database.I am already using it in a country that uses . as decimal separator.
Now I want to use it in another country that uses , as decimal separator.</p>
<p>in C# is there some application level setting that I can change or write some code so that I can use the same da... | [
{
"answer_id": 353613,
"author": "Victor",
"author_id": 42518,
"author_profile": "https://Stackoverflow.com/users/42518",
"pm_score": 0,
"selected": false,
"text": "<p>you can do a couple of things to fix this.</p>\n\n<p>first, if you are taking values in from the interface, then you are... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a C# program which uses a SQL Server database.I am already using it in a country that uses . as decimal separator.
Now I want to use it in another country that uses , as decimal separator.
in C# is there some application level setting that I can change or write some code so that I can use the same database and ... | If you built the query using string concatenation, use parameters instead.
So instead of writing:
```
var query = "insert into tblproducts(productId,Price) values('" + article + "','"
+ price + ')';
```
use [OleDbParameters](http://msdn.microsoft.com/library/yy6y35y8.aspx):
```
var query = "insert into tblpr... |
353,550 | <p>All the member variables and member functions in my class ClassA are static. </p>
<p>If a user is trying (by mistake) to create an object of this class, he receives a warning: "ClassA, local variable never referenced", because all the functions are static, so this object is never referenced. So, I want to prevent t... | [
{
"answer_id": 353555,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": 4,
"selected": false,
"text": "<p>Creating a private default constructor should be sufficient. Both of the other default constructs (copy constructor a... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44673/"
] | All the member variables and member functions in my class ClassA are static.
If a user is trying (by mistake) to create an object of this class, he receives a warning: "ClassA, local variable never referenced", because all the functions are static, so this object is never referenced. So, I want to prevent the user fr... | Like others said, a namespace is what you should use. If you want to stay with your class, create a class that has a private constructor, and derive from it, to make your intention obvious:
```
class NonConstructible {
NonConstructible();
};
class SuperUtils: NonConstructible {
static void foo();
// ...
... |
353,558 | <p>I have a classes like:</p>
<pre><code>[Serializable]
public class child {
public Parent parent;
}
[Serializable]
public class Parent {
public List<child> children;
}
</code></pre>
<p>When I deserialize Parent, I want each of each children to have a reference to it's parent. Question is, where in the... | [
{
"answer_id": 353581,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 2,
"selected": false,
"text": "<p>If you leave it alone and let Parent be a public read/write property of the Child class, .NET automatic serialization proce... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a classes like:
```
[Serializable]
public class child {
public Parent parent;
}
[Serializable]
public class Parent {
public List<child> children;
}
```
When I deserialize Parent, I want each of each children to have a reference to it's parent. Question is, where in the deserialization process can I se... | Circular references are handled differently for the `BinaryFormatter`, `XmlSerializer` and `DataContractSerializer`.
The [`BinaryFormatter`](http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter.aspx) supports circular references by default, no work required:
```
using... |
353,561 | <p>How can you create a C# Winforms control which goes out of the bounds of its region? Such as a drop down box. Kind of like if you had a DropDownBox in a Small Sized Panel.</p>
| [
{
"answer_id": 353859,
"author": "BFree",
"author_id": 15861,
"author_profile": "https://Stackoverflow.com/users/15861",
"pm_score": 2,
"selected": false,
"text": "<p>I did something similiar to that recently, and I used a ListBox. The cool think about a listbox, is that you can display ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28717/"
] | How can you create a C# Winforms control which goes out of the bounds of its region? Such as a drop down box. Kind of like if you had a DropDownBox in a Small Sized Panel. | Windows Forms doesn't support windows like that well, it is pretty fundamentally incompatible with the designer. Here's some code to get you started. You can't use this control in the designer, it must be created at run-time. You also must call its Dispose() method yourself.
```
using System;
using System.Drawing;
usi... |
353,569 | <p>Can any one explain why the output of this code is only 'hello' and what this code means?</p>
<pre><code>( 0, characterArray, 0, characterArray.Length );
</code></pre>
<p>The output is showing:</p>
<p><PRE>The character array is: hello</PRE></p>
<p>The code follows:</p>
<pre><code>string string1 = "hello there"... | [
{
"answer_id": 353583,
"author": "AaronS",
"author_id": 26932,
"author_profile": "https://Stackoverflow.com/users/26932",
"pm_score": 4,
"selected": true,
"text": "<p>It's because your array is only set for 5 characters. Expand it to 11 and it will work.</p>\n\n<p>Here is what the Copyto... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Can any one explain why the output of this code is only 'hello' and what this code means?
```
( 0, characterArray, 0, characterArray.Length );
```
The output is showing:
```
The character array is: hello
```
The code follows:
```
string string1 = "hello there";
char[] characterArray = new char[ 5 ];
string1.Copy... | It's because your array is only set for 5 characters. Expand it to 11 and it will work.
Here is what the Copyto is:
```
public void CopyTo(
int sourceIndex,
char[] destination,
int destinationIndex,
int count
)
```
```
Parameters
sourceIndex
Type: System..::.Int32
A character position in this insta... |
353,571 | <p>I just got done working through the Django tutorials for the second time, and am understanding things much more clearly now. However, I'm still unclear how apps inside a site interact with one another.</p>
<p>For example, lets say I'm writing a blog application (a rather popular activity, apparently). Blog posts an... | [
{
"answer_id": 353615,
"author": "muhuk",
"author_id": 42188,
"author_profile": "https://Stackoverflow.com/users/42188",
"pm_score": 2,
"selected": false,
"text": "<p>Your code seems correct. I would keep the post and the comment in a <strong>blog</strong> app though. I am not saying thi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33383/"
] | I just got done working through the Django tutorials for the second time, and am understanding things much more clearly now. However, I'm still unclear how apps inside a site interact with one another.
For example, lets say I'm writing a blog application (a rather popular activity, apparently). Blog posts and comments... | Take a look at django's built-in [contenttypes framework](http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#ref-contrib-contenttypes):
`django.contrib.contenttypes`
It allows you develop your applications as stand-alone units. This is what the django developers used to allow django's built-in [comment fr... |
353,601 | <p>I have a command-line process I would like to automate and capture in C#.</p>
<p>At the command line, I type:</p>
<pre><code>nslookup
</code></pre>
<p>This launches a shell which gives me a > prompt. At the prompt, I then type:</p>
<pre><code>ls -a mydomain.local
</code></pre>
<p>This returns a list of local CN... | [
{
"answer_id": 353624,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 4,
"selected": true,
"text": "<pre><code>ProcessStartInfo si = new ProcessStartInfo(\"nslookup\");\nsi.RedirectStandardInput = true;\nsi.RedirectStandardOutp... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5287/"
] | I have a command-line process I would like to automate and capture in C#.
At the command line, I type:
```
nslookup
```
This launches a shell which gives me a > prompt. At the prompt, I then type:
```
ls -a mydomain.local
```
This returns a list of local CNAMEs from my primary DNS server and the physical machine... | ```
ProcessStartInfo si = new ProcessStartInfo("nslookup");
si.RedirectStandardInput = true;
si.RedirectStandardOutput = true;
Process nslookup = new Process(si);
nslookup.Start();
nslookup.StandardInput.WriteLine("ls -a mydomain.local");
nslookup.StandardInput.Flush();
// use nslookup.StandardOutput stream to read the... |
353,610 | <p>I have an html table </p>
<pre><code> <table border="0" width="100%">
<tr class="headerbg">
<th width="5%">
No
</th>
<th width="30%">
Name
</th>
<th width="20%">
... | [
{
"answer_id": 353636,
"author": "jwmiller5",
"author_id": 7824,
"author_profile": "https://Stackoverflow.com/users/7824",
"pm_score": 3,
"selected": true,
"text": "<p>Remove BUILTIN/Administrators from the SA group.</p>\n"
},
{
"answer_id": 369832,
"author": "Nathan Griffith... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5552/"
] | I have an html table
```
<table border="0" width="100%">
<tr class="headerbg">
<th width="5%">
No
</th>
<th width="30%">
Name
</th>
<th width="20%">
Department or Division
</th>
... | Remove BUILTIN/Administrators from the SA group. |
353,614 | <pre><code>int x;
printf("hello %n World\n", &x);
printf("%d\n", x);
</code></pre>
| [
{
"answer_id": 353637,
"author": "Darron",
"author_id": 22704,
"author_profile": "https://Stackoverflow.com/users/22704",
"pm_score": 2,
"selected": false,
"text": "<p>It's fairly esoteric. If you need to replace a placeholder in the generated string later you might want to remember an ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7734/"
] | ```
int x;
printf("hello %n World\n", &x);
printf("%d\n", x);
``` | It's not so useful for `printf()`, but it can be very useful for `sscanf()`, especially if you're parsing a string in multiple iterations. `fscanf()` and `scanf()` automatically advance their internal pointers by the amount of input read, but `sscanf()` does not. For example:
```
char stringToParse[256];
...
char *cur... |
353,632 | <p>Where I work, people mostly think that objects are best initialised using C++-style construction (with parentheses), whereas primitive types should be initialised with the = operator:</p>
<pre><code>std::string strFoo( "Foo" );
int nBar = 5;
</code></pre>
<p>Nobody seems to be able to explain why they prefer thing... | [
{
"answer_id": 353645,
"author": "Andrew Stein",
"author_id": 13029,
"author_profile": "https://Stackoverflow.com/users/13029",
"pm_score": 0,
"selected": false,
"text": "<p>It's an issue of style. Even the statement that \"std::string = \"Foo\"; would be inefficient because it would inv... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11575/"
] | Where I work, people mostly think that objects are best initialised using C++-style construction (with parentheses), whereas primitive types should be initialised with the = operator:
```
std::string strFoo( "Foo" );
int nBar = 5;
```
Nobody seems to be able to explain why they prefer things this way, though. I can ... | Unless you've proven that it matters with respect to performance, I wouldn't worry about an extra copy using the assignment operator in your example (`std::string foo = "Foo";`). I'd be pretty surprised if that copy even exists once you look at the optimized code, I believe that will actually call the appropriate param... |
353,678 | <p>I have some data that has a detail table. I want the data to be presented in a ListView. I want the detail data to appear as a nested ListView when you select an item in the original list. I can't seem to figure out how to get the data binding to work.</p>
<p>Here's what I have so far, (the problem is the <code>{Bi... | [
{
"answer_id": 353925,
"author": "Bryan Anderson",
"author_id": 21186,
"author_profile": "https://Stackoverflow.com/users/21186",
"pm_score": 1,
"selected": false,
"text": "<p>If I understand your question correctly you need to bind to the SelectedItem of the original list:</p>\n\n<pre><... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42911/"
] | I have some data that has a detail table. I want the data to be presented in a ListView. I want the detail data to appear as a nested ListView when you select an item in the original list. I can't seem to figure out how to get the data binding to work.
Here's what I have so far, (the problem is the `{Binding Path=FK_H... | If I understand your question correctly you need to bind to the SelectedItem of the original list:
```
<ListView ItemsSource="{Binding ElementName=lstHistory, Path=SelectedItem}">
```
And then set the datatemplate/view as needed. If you don't want to use ElementName for the binding you could also use RelativeSource ... |
353,684 | <p>I'm writing a mapping application that I am writing in python and I need to get the lat/lon centroid of N points.
Say I have two locations</p>
<pre><code>a.lat = 101
a.lon = 230
b.lat = 146
b.lon = 200
</code></pre>
<p>Getting the center of two points is fairly easy using a euclidean formula. I would like
to be ... | [
{
"answer_id": 353718,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 1,
"selected": false,
"text": "<p>The math is pretty simple if the points form a <a href=\"http://en.wikipedia.org/wiki/Centroid\" rel=\"nofollow n... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33966/"
] | I'm writing a mapping application that I am writing in python and I need to get the lat/lon centroid of N points.
Say I have two locations
```
a.lat = 101
a.lon = 230
b.lat = 146
b.lon = 200
```
Getting the center of two points is fairly easy using a euclidean formula. I would like
to be able to do it for more the... | Have a look at the pdf document linked below. It explains how to apply [the plane figure algorithm that Bill the Lizard](https://stackoverflow.com/questions/353684/determine-the-centroid-of-multiple-points#353718) mentions, but on the surface of a sphere.
[poster thumbnail and some details http://img51.imageshack.us/i... |
353,706 | <p>Beyond the official documentation, are there any recommended resources for learning to build jQuery plugins. I'm particularly interested in building plugins for the UI libary. </p>
<p>I've been looking at the source for some of the official ones, but I've found they all look quite different from each other. Many ar... | [
{
"answer_id": 353975,
"author": "hughdbrown",
"author_id": 10293,
"author_profile": "https://Stackoverflow.com/users/10293",
"pm_score": 1,
"selected": false,
"text": "<p>Have you tried the Manning Publications book on jQuery, <a href=\"http://www.manning.com/bibeault/\" rel=\"nofollow ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5291/"
] | Beyond the official documentation, are there any recommended resources for learning to build jQuery plugins. I'm particularly interested in building plugins for the UI libary.
I've been looking at the source for some of the official ones, but I've found they all look quite different from each other. Many are not well... | Tutorial at "Learning jQuery"
-----------------------------
[Learning jQuery](http://www.learningjquery.com) is a very helpful site, and has a [great tutorial on plugin authoring](http://www.learningjquery.com/2007/10/a-plugin-development-pattern).
One principle I really liked was: **create default settings that user... |
353,715 | <p>i have a frame that instantiates another frame but i don't want to use the close(x) button on the instantiated frame., so i created a button. how do i code that this button can be used to close the instantiated frame without quitting the JVM.</p>
| [
{
"answer_id": 430762,
"author": "Tom",
"author_id": 8969,
"author_profile": "https://Stackoverflow.com/users/8969",
"pm_score": 3,
"selected": false,
"text": "<p>Having your own close button is weird UI and should be avoided.</p>\n\n<p>To get rid of a frame when your own button is click... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | i have a frame that instantiates another frame but i don't want to use the close(x) button on the instantiated frame., so i created a button. how do i code that this button can be used to close the instantiated frame without quitting the JVM. | Having your own close button is weird UI and should be avoided.
To get rid of a frame when your own button is clicked you can just do:
```
jFrame.setVisible(false);
```
or
```
jFrame.dispose();
```
if you want to get rid of it completely.
On frames you don't want to exit the JVM on the close button being click... |
353,746 | <p>This question deals with concurrency issues, for suggestions on how to display a busy icon see this question: <a href="https://stackoverflow.com/questions/205631/javascript-loadingbusy-indicator-or-transparent-div-over-page-on-event-click">Javascript - loading/busy indicator or transparent div over page on event cli... | [
{
"answer_id": 353774,
"author": "mmattax",
"author_id": 1638,
"author_profile": "https://Stackoverflow.com/users/1638",
"pm_score": 0,
"selected": false,
"text": "<p>Please see my answer here: </p>\n\n<p><a href=\"https://stackoverflow.com/questions/244183/how-to-display-a-loading-scree... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3238/"
] | This question deals with concurrency issues, for suggestions on how to display a busy icon see this question: [Javascript - loading/busy indicator or transparent div over page on event click](https://stackoverflow.com/questions/205631/javascript-loadingbusy-indicator-or-transparent-div-over-page-on-event-click)
When a... | If you want the same busy indicator for all actions, then use a counter.
Instead of "show\_busy\_icon()", do a "increment\_busy\_count()", which calls "show\_busy\_icon()" if busy count goes from 0 to 1. Instead of "hide\_busy\_icon()", do a "decrement\_busy\_count()", which calls "hide\_busy\_icon()" if busy count go... |
353,772 | <p>i have the following jquery code. </p>
<p>basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.</p>
<p>I have the following code and it works (it uses the default windows' sample pictures), but i... | [
{
"answer_id": 353809,
"author": "TM.",
"author_id": 12983,
"author_profile": "https://Stackoverflow.com/users/12983",
"pm_score": 4,
"selected": true,
"text": "<p>The first thing you can do, to make it cleaner is replace all those similar calls with something more generic. </p>\n\n<p>(... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34683/"
] | i have the following jquery code.
basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.
I have the following code and it works (it uses the default windows' sample pictures), but if someone can thi... | The first thing you can do, to make it cleaner is replace all those similar calls with something more generic.
(note: assume all of this is inside of `document.ready()`)
```
$('#trigger1').data('target', '#divsunset');
$('#trigger2').data('target', '#divwinter');
$('#trigger3').data('target', '#divbh');
$('#trigger4... |
353,773 | <p>How can I determine when the control key is held down during button click in a C# Windows program? I want one action to take place for Ctrl/Click and a different one for Click.</p>
| [
{
"answer_id": 353816,
"author": "lesscode",
"author_id": 18482,
"author_profile": "https://Stackoverflow.com/users/18482",
"pm_score": 3,
"selected": false,
"text": "<p>Assuming WinForms, use Control.ModifierKeys, eg:</p>\n\n<pre><code>private void button1_Click(object sender, EventArgs... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2536/"
] | How can I determine when the control key is held down during button click in a C# Windows program? I want one action to take place for Ctrl/Click and a different one for Click. | And a little bit more:
```
private void button1_Click ( object sender, EventArgs e )
{
if( (ModifierKeys & Keys.Control) == Keys.Control )
{
ControlClickMethod();
}
else
{
ClickMethod();
}
}
private void ControlClickMethod()
{
MessageBox.Show( "Control is pr... |
353,786 | <p>I have this function in my head:</p>
<pre><code><head>
window.onload = function(){
var x = new Array(0,2,3,4,5,6,7,8);
var y = new Array(20,10,40,30,60,50,70,10);
drawGraph(y,x);
}
</head>
</code></pre>
<p>Can I declare the function drawGraph() somewhere in the ... | [
{
"answer_id": 353802,
"author": "Kevin Tighe",
"author_id": 39461,
"author_profile": "https://Stackoverflow.com/users/39461",
"pm_score": 4,
"selected": true,
"text": "<p>The order does matter. You'll need to have the drawGraph() function declared before it's called.</p>\n"
},
{
... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26004/"
] | I have this function in my head:
```
<head>
window.onload = function(){
var x = new Array(0,2,3,4,5,6,7,8);
var y = new Array(20,10,40,30,60,50,70,10);
drawGraph(y,x);
}
</head>
```
Can I declare the function drawGraph() somewhere in the body? Do I need to declare it before i... | The order does matter. You'll need to have the drawGraph() function declared before it's called. |
353,800 | <p>I'm wondering if storing the data in viewstate is a good idea for this given problem.
He's a simplified example of what I am trying to achieve, firstly we have a Repeater control:</p>
<pre><code><asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:TextBox id="Name" runat="server" />
&l... | [
{
"answer_id": 353806,
"author": "gbn",
"author_id": 27535,
"author_profile": "https://Stackoverflow.com/users/27535",
"pm_score": 5,
"selected": true,
"text": "<p>SELECT * FROM <a href=\"http://msdn.microsoft.com/en-us/library/ms174397(SQL.90).aspx\" rel=\"noreferrer\">sys.database_file... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44702/"
] | I'm wondering if storing the data in viewstate is a good idea for this given problem.
He's a simplified example of what I am trying to achieve, firstly we have a Repeater control:
```
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:TextBox id="Name" runat="server" />
<asp:TextBox id="Age" runat="serve... | SELECT \* FROM [sys.database\_files](http://msdn.microsoft.com/en-us/library/ms174397(SQL.90).aspx) (SQL 2005+)
SELECT \* FROM dbo.sysfiles (SQL 2000) |
353,803 | <p>How can I get a PHP function go to a specific website when it is done running?</p>
<p>For example:</p>
<pre><code><?php
//SOMETHING DONE
GOTO(http://example.com/thankyou.php);
?>
</code></pre>
<p>I would really like the following...</p>
<pre><code><?php
//SOMETHING DONE
GOTO($url);
?>
</code>... | [
{
"answer_id": 353839,
"author": "Bullines",
"author_id": 27870,
"author_profile": "https://Stackoverflow.com/users/27870",
"pm_score": 4,
"selected": false,
"text": "<p>If \"SOMETHING DONE\" doesn't invovle any output via echo/print/etc, then:</p>\n\n<pre><code><?php\n // SOMETHING... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33194/"
] | How can I get a PHP function go to a specific website when it is done running?
For example:
```
<?php
//SOMETHING DONE
GOTO(http://example.com/thankyou.php);
?>
```
I would really like the following...
```
<?php
//SOMETHING DONE
GOTO($url);
?>
```
I want to do something like this:
```
<?php
//SOMETHIN... | ```
<?
ob_start(); // ensures anything dumped out will be caught
// do stuff here
$url = 'http://example.com/thankyou.php'; // this can be set based on whatever
// clear out the output buffer
while (ob_get_status())
{
ob_end_clean();
}
// no redirect
header( "Location: $url" );
?>
``` |
353,804 | <p>I'm working on a database that tracks files and dependencies in projects. Briefly, I have two main tables; the PROJECTS table lists project names and other properties, the FILES table lists files. Every file entry points to a project as a foreign key set to CASCADE, so if I delete a project record from the database,... | [
{
"answer_id": 353869,
"author": "David Aldridge",
"author_id": 6742,
"author_profile": "https://Stackoverflow.com/users/6742",
"pm_score": 0,
"selected": false,
"text": "<p>Does the system support deferred constraints, in which the constraint check can be deferred until a commit point?<... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8415/"
] | I'm working on a database that tracks files and dependencies in projects. Briefly, I have two main tables; the PROJECTS table lists project names and other properties, the FILES table lists files. Every file entry points to a project as a foreign key set to CASCADE, so if I delete a project record from the database, al... | You can't control the order of deletion through a cascading foreign key, but you may be able to design a trigger on `PROJECTS` to delete rows in `FILES` that belong to this project and are also listed in `DEPENDENCIES` as dependent on other `FILES`. Make it a `BEFORE DELETE` trigger, so it should execute before the cas... |
353,808 | <p>How do I implement this method (see below)? I'm new to Objective-C and I'm just not getting it right.</p>
<p>From: <a href="http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00027.html" rel="nofollow noreferrer">http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00027.html</a></p>
<blockquote>
<p>... | [
{
"answer_id": 354258,
"author": "Jeff",
"author_id": 8597,
"author_profile": "https://Stackoverflow.com/users/8597",
"pm_score": 1,
"selected": false,
"text": "<p>Got some help from a discussion board: </p>\n\n<p>There seems to be an implementation of this method included in WebKit's\nW... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597/"
] | How do I implement this method (see below)? I'm new to Objective-C and I'm just not getting it right.
From: <http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00027.html>
>
> By default databases have a quota of 0; this quota must be increased before any database will be stored on disk.
>
>
> **WebKit clie... | In whatever class you've defined as the delegate for your WebView you need to implement that method, something like this:
```
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier {
unsigned long long new... |
353,841 | <p>I'm new to the forum and very new to silverlight. Myself and my coworker are working on a custom application. We are building a menu system that will only display buttons if that useris in an assigned role. A new property was created to allow roles to be defined, and for testing purposes we are simply trying to a... | [
{
"answer_id": 353824,
"author": "Evan Teran",
"author_id": 13430,
"author_profile": "https://Stackoverflow.com/users/13430",
"pm_score": 2,
"selected": false,
"text": "<p>I would \"no\" to the general question. Not <em>every</em> class needs one. If you can know that the class should ne... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44713/"
] | I'm new to the forum and very new to silverlight. Myself and my coworker are working on a custom application. We are building a menu system that will only display buttons if that useris in an assigned role. A new property was created to allow roles to be defined, and for testing purposes we are simply trying to assign ... | The question is really, do you want to *enforce* rules about how your classes should be used? Why?
If a class doesn't have a virtual destructor, anyone using the class knows that it is not intended to be derived from, and what limitations apply if you try it anyway. Isn't that good enough?
Or do you need the compiler ... |
353,842 | <p>In C#, I'm trying to build an extension method for StringBuilder called AppendCollection() that would let me do this:</p>
<pre><code>var sb1 = new StringBuilder();
var sb2 = new StringBuilder();
var people = new List<Person>() { ...init people here... };
var orders = new List<Orders>() { ...init orders ... | [
{
"answer_id": 353858,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 2,
"selected": false,
"text": "<p>What is this method suppose to return? I can see a string, but why, if you are appending to a StringBuilder?</p>\n\n<p>W... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571/"
] | In C#, I'm trying to build an extension method for StringBuilder called AppendCollection() that would let me do this:
```
var sb1 = new StringBuilder();
var sb2 = new StringBuilder();
var people = new List<Person>() { ...init people here... };
var orders = new List<Orders>() { ...init orders here... };
sb1.AppendColl... | Use the `Func<T,string>` delegate.
```
public static void AppendCollection<T>(this StringBuilder sb,
IEnumerable<T> collection, Func<T, string> method) {
foreach(T x in collection)
sb.AppendLine(method(x));
}
``` |
353,843 | <p>I'm trying to search multiple attributes in XML :</p>
<pre><code><APIS>
<API Key="00001">
<field Username="username1" UserPassword="password1" FileName="Filename1.xml"/>
<field Username="username2" UserPassword="password2" FileName="Filename2.xml"/>
<field Username="username... | [
{
"answer_id": 353881,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 2,
"selected": false,
"text": "<p>Searching XML is what <a href=\"http://www.w3.org/TR/xpath\" rel=\"nofollow noreferrer\">XPath</a> was made for. ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24958/"
] | I'm trying to search multiple attributes in XML :
```
<APIS>
<API Key="00001">
<field Username="username1" UserPassword="password1" FileName="Filename1.xml"/>
<field Username="username2" UserPassword="password2" FileName="Filename2.xml"/>
<field Username="username3" UserPassword="password3" FileName="Fil... | To search for what you want in the snippet of XML you provided, you would need the following XPath expression:
```
/APIS/API/field[@Username='username1' and @UserPassword='password1']
```
This would either return something, if user name and password match - or not if they don't.
Of couse the XPath expression is jus... |
353,882 | <pre><code><asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoAddProperty" Text="Add Property to TIV" />
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoRemoveProperty" Text="Remove Property from TIV" />
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rd... | [
{
"answer_id": 353902,
"author": "Mitchel Sellers",
"author_id": 13279,
"author_profile": "https://Stackoverflow.com/users/13279",
"pm_score": 0,
"selected": false,
"text": "<p>You will have to put your client id out to the form, as with INamingContainer your ID can change in relation to... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44595/"
] | ```
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoAddProperty" Text="Add Property to TIV" />
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoRemoveProperty" Text="Remove Property from TIV" />
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoChangeProperty" Text=... | If your radios are contained within something like a DIV, and because your asp:RadioButtons will render as HTML inputs, you could do something like:
```
<script type="text/javascript" language="javascript">
function Validate()
{
var l_elemsRadios = document.getElementById("MyRadios").getElementsByTagNa... |
353,926 | <p>Anyone know what the C# "M" syntax means?</p>
<pre><code>var1 = Math.Ceiling(hours / (40.00M * 4.3M));
</code></pre>
| [
{
"answer_id": 353939,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 3,
"selected": false,
"text": "<p>it means that the number is a <code>decimal</code> type.</p>\n"
},
{
"answer_id": 353943,
"author": "A... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/300930/"
] | Anyone know what the C# "M" syntax means?
```
var1 = Math.Ceiling(hours / (40.00M * 4.3M));
``` | M is the suffix for Decimal. Stands for "money" I assume.
<http://msdn.microsoft.com/en-us/library/364x0z75(VS.71).aspx> |
353,928 | <p>Subreports overlap in this example -- what am I doing wrong? The second one is supposed to "float" below the first one, with its 'y' attribute being ignored, but it isn't.</p>
<p>Thanks !!</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http... | [
{
"answer_id": 359092,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "<p>I got the answer! (I'm the one who asked, different IP I guess)\nAccording to the documentation, the floating element would... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Subreports overlap in this example -- what am I doing wrong? The second one is supposed to "float" below the first one, with its 'y' attribute being ignored, but it isn't.
Thanks !!
```xml
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http:/... | I got the answer! (I'm the one who asked, different IP I guess)
According to the documentation, the floating element would have its y attribute ignored. I had taken that literally, tried arbitrary values for y and saw that everytime the element was placed at the specified position.
But no, you need to set y to positio... |
353,948 | <p>Data table structure is:<br>
id1,id2,id3,id4,... (some other fields).<br>
I want to create summary query to find out how many times some ID value is used in every column.</p>
<p>Data<br>
1,2,3,4,2008<br>
2,3,5,1,2008<br>
1,3,2,5,2007<br>
1,2,3,6,2007<br>
3,1,2,5,2007<br></p>
<p>For value 1, the result should be<br... | [
{
"answer_id": 353971,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 1,
"selected": false,
"text": "<p>Use a characteristic or delta function:</p>\n\n<pre><code>DECLARE @look_for AS int\nSET @look_for = 1\n\nSELECT SUM(C... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44715/"
] | Data table structure is:
id1,id2,id3,id4,... (some other fields).
I want to create summary query to find out how many times some ID value is used in every column.
Data
1,2,3,4,2008
2,3,5,1,2008
1,3,2,5,2007
1,2,3,6,2007
3,1,2,5,2007
For value 1, the result should be
1,0,0,1,2008
2,1,0,0,2... | This seems like the best solution (from [Wiki](http://en.wikibooks.org/wiki/Programming:MySQL/Pivot_table)):
```
select years,
sum(1*(1-abs(sign(id1-56)))) as id1,
sum(1*(1-abs(sign(id2-56)))) as id2,
sum(1*(1-abs(sign(id3-56)))) as id3,
sum(1*(1-abs(sign(id4-56)))) as id4,
from mytable
group by years
``` |
354,002 | <p>I have 2 tables (A and B) with the same primary keys. I want to select all row that are in A and not in B. The following works:</p>
<pre><code>select * from A where not exists (select * from B where A.pk=B.pk);
</code></pre>
<p>however it seems quite bad (~2 sec on only 100k rows in A and 3-10k less in B)</p>
<p>... | [
{
"answer_id": 354059,
"author": "Nick Berardi",
"author_id": 17,
"author_profile": "https://Stackoverflow.com/users/17",
"pm_score": 6,
"selected": false,
"text": "<p>I think your last statement is the best way. You can also try</p>\n\n<pre><code>SELECT A.* \nfrom A left join B on \... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343/"
] | I have 2 tables (A and B) with the same primary keys. I want to select all row that are in A and not in B. The following works:
```
select * from A where not exists (select * from B where A.pk=B.pk);
```
however it seems quite bad (~2 sec on only 100k rows in A and 3-10k less in B)
Is there a better way to run this... | I use queries in the format of your second example. A join is usually more scalable than a correlated subquery. |
354,004 | <p>I am calling an executable in C#. When the executable runs, it writes out to the console so the C# code is getting the console output and writing it to a text file. When the crash happens a couple of things occur.</p>
<p>1) The output of the text file is not completely written out.
2) The executable process seems t... | [
{
"answer_id": 354042,
"author": "Dirk Vollmar",
"author_id": 40347,
"author_profile": "https://Stackoverflow.com/users/40347",
"pm_score": 1,
"selected": false,
"text": "<p>What is the crash that you are getting? A .Net exception?</p>\n\n<p>That the file is not written completely could ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44707/"
] | I am calling an executable in C#. When the executable runs, it writes out to the console so the C# code is getting the console output and writing it to a text file. When the crash happens a couple of things occur.
1) The output of the text file is not completely written out.
2) The executable process seems to run comp... | Try adding a flush after the tw.Write. That should cause the complete output up to the point of failure to be produced, which may include error messages from the executable (if that's what is crashing?) |
354,008 | <pre><code>SELECT pe.prodtree_element_id prodID, pe.prodtree_element_name_s, li.line_name, av2.value
FROM prodtree_element pe
LEFT JOIN prodtree_link pl
ON pe.prodtree_element_id = pl.to_prodtree_node_id
LEFT JOIN line li
ON pe.line_code = li.line_code
INNER JOIN attribute_values av
... | [
{
"answer_id": 354028,
"author": "StingyJack",
"author_id": 16391,
"author_profile": "https://Stackoverflow.com/users/16391",
"pm_score": 0,
"selected": false,
"text": "<p>Without knowing the DDL its very hard to test. 30-50K rows should still take only a few seconds. </p>\n\n<p>Try swit... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | ```
SELECT pe.prodtree_element_id prodID, pe.prodtree_element_name_s, li.line_name, av2.value
FROM prodtree_element pe
LEFT JOIN prodtree_link pl
ON pe.prodtree_element_id = pl.to_prodtree_node_id
LEFT JOIN line li
ON pe.line_code = li.line_code
INNER JOIN attribute_values av
ON ... | ```
INNER JOIN attribute_values av
ON av.attribute_definition_id = #statusCode#
LEFT JOIN attribute_values av2
ON pe.prodtree_element_id = av.prodtree_element_id
```
This is the problem.
There is a cross join between pe and av, followed by an outer join onto the cross join.
You're lucky it only takes 30 mins... |
354,010 | <p>Ok, so we have a bunch of tables that are named like this:</p>
<pre><code>training_data_001
training_data_002
training_data_003
training_data_004
training_data_005
</code></pre>
<p>And then to find those we look at a field in another table, let's just call it master.training_type.</p>
<p>Anyway, I was wondering i... | [
{
"answer_id": 354013,
"author": "gbn",
"author_id": 27535,
"author_profile": "https://Stackoverflow.com/users/27535",
"pm_score": 2,
"selected": false,
"text": "<p>You can only use dynamic SQL to read master.training_type to build a string that you then execute using <code>EXEC (@string... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12448/"
] | Ok, so we have a bunch of tables that are named like this:
```
training_data_001
training_data_002
training_data_003
training_data_004
training_data_005
```
And then to find those we look at a field in another table, let's just call it master.training\_type.
Anyway, I was wondering if anyone knew of a way to do a w... | You can only use dynamic SQL to read master.training\_type to build a string that you then execute using `EXEC (@stringvar)` |
354,037 | <p>I am looking for a way to determine what the Name/IP Address of the domain controller is for a given domain that a client computer is connected to.</p>
<p>At our company we have a lot of small little networks that we use for testing and most of them have their own little domains. As an example, one of the domains ... | [
{
"answer_id": 354128,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 4,
"selected": false,
"text": "<p>In C#/.NET 3.5 you could write a little program to do:</p>\n\n<pre><code>using (PrincipalContext context = new Princ... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34508/"
] | I am looking for a way to determine what the Name/IP Address of the domain controller is for a given domain that a client computer is connected to.
At our company we have a lot of small little networks that we use for testing and most of them have their own little domains. As an example, one of the domains is named "T... | With the most simple programming language: DOS batch
```
echo %LOGONSERVER%
``` |
354,038 | <p>How do I check if a string represents a numeric value in Python?</p>
<pre><code>def is_number(s):
try:
float(s)
return True
except ValueError:
return False
</code></pre>
<p>The above works, but it seems clunky.</p>
<hr />
<p><sub>If what you are testing comes from user input, it is <e... | [
{
"answer_id": 354073,
"author": "Zoomulator",
"author_id": 44563,
"author_profile": "https://Stackoverflow.com/users/44563",
"pm_score": 11,
"selected": false,
"text": "<p>For non-negative (unsigned) integers only, use <a href=\"https://docs.python.org/3/library/stdtypes.html#str.isdigi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40115/"
] | How do I check if a string represents a numeric value in Python?
```
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
```
The above works, but it seems clunky.
---
If what you are testing comes from user input, it is *still* a string *even if it represents... | >
> Which, not only is ugly and slow
>
>
>
I'd dispute both.
A regex or other string parsing method would be uglier and slower.
I'm not sure that anything much could be faster than the above. It calls the function and returns. Try/Catch doesn't introduce much overhead because the most common exception is caught... |
354,044 | <p>A quick search for currency regex brings up <a href="https://regexlib.com/Search.aspx?k=currency&c=-1&m=-1&ps=20" rel="noreferrer">a lot of results</a>.</p>
<p>The problem I have in choosing one is that regex is difficult to verify without testing all the edge cases. Does anyone have a regex for U.S. cur... | [
{
"answer_id": 354216,
"author": "Keng",
"author_id": 730,
"author_profile": "https://Stackoverflow.com/users/730",
"pm_score": 8,
"selected": true,
"text": "<p>here's some stuff from the makers of Regex Buddy. These came from the library so i'm confident they have been thoroughly teste... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23566/"
] | A quick search for currency regex brings up [a lot of results](https://regexlib.com/Search.aspx?k=currency&c=-1&m=-1&ps=20).
The problem I have in choosing one is that regex is difficult to verify without testing all the edge cases. Does anyone have a regex for U.S. currency that has been *thoroughly tested*?
My only... | here's some stuff from the makers of Regex Buddy. These came from the library so i'm confident they have been thoroughly tested.
Number: Currency amount (cents mandatory)
Optional thousands separators; mandatory two-digit fraction
```
Match; JGsoft:
^[+-]?[0-9]{1,3}(?:,?[0-9]{3})*\.[0-9]{2}$
```
Number: Currency am... |
354,050 | <p>I am trying to passing in 3 pointers to a DLL function. I have:</p>
<pre>
{
$code=1;
$len=100;
$str=" " x $len;
$function = new Win32::API(DLLNAME,'dllfunction','PPP','V');
$function->Call($code,$str,$len);
}
</pre>
<p>The DLL is defined as <code>void dllfunction(int* a, char* str, int* len);</code> The DLL wi... | [
{
"answer_id": 354135,
"author": "Harper Shelby",
"author_id": 21196,
"author_profile": "https://Stackoverflow.com/users/21196",
"pm_score": 0,
"selected": false,
"text": "<p>IANAPH, but I think you need to do use a <a href=\"http://www.troubleshooters.com/codecorn/littperl/perlsub.htm#R... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354050",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44730/"
] | I am trying to passing in 3 pointers to a DLL function. I have:
```
{
$code=1;
$len=100;
$str=" " x $len;
$function = new Win32::API(DLLNAME,'dllfunction','PPP','V');
$function->Call($code,$str,$len);
}
```
The DLL is defined as `void dllfunction(int* a, char* str, int* len);` The DLL will modify all the variab... | AH!! I figured it out.
The problem was this
>
> 5. And optionally you can specify the calling convention, this defaults to '\_\_stdcall', alternatively you can specify '\_cdecl'.
>
>
>
The dll function was exported with extern "C" \_\_declspec(dllexport) so I figured maybe I should be using '\_cdecl' flag.
Win... |
354,057 | <p>I am begging to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change the <code>null</code> to <code>{}</code> it works fine. Is null not valid for this case and I just got lucky that it worked in IE or is this an error with jquery.</p>
<pre><code>$.post("complexitybar.ashx?a=... | [
{
"answer_id": 354079,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 1,
"selected": false,
"text": "<p>Since the parameter you are attempting to pass <code>null</code> to <a href=\"http://docs.jquery.com/Ajax/jQuery.post\" re... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24500/"
] | I am begging to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change the `null` to `{}` it works fine. Is null not valid for this case and I just got lucky that it worked in IE or is this an error with jquery.
```
$.post("complexitybar.ashx?a=init&vc=" + validationCode, null, loadI... | Try [`$.get()`](http://docs.jquery.com/Ajax/jQuery.get) for query-string requests:
```
$.get('complexitybar.ashx?a=init&vc=...')
```
POST requests expect the URL and key-value pairs to be seperate:
```
$.post('complexitybar.ashx', 'a=init&vc=...')
```
With POST requests, the key-value pairs are sent as content da... |
354,068 | <p>I have an application that is using Windows Authentication and a SqlRoleProvider for user authentication and role management respectively. It is working fine with my test users that I have added to the database as defaults. The application requires users to login (using Windows credentials) and then be able to use... | [
{
"answer_id": 354105,
"author": "CheGueVerra",
"author_id": 17787,
"author_profile": "https://Stackoverflow.com/users/17787",
"pm_score": 0,
"selected": false,
"text": "<p>I would add the default role to the user directly after the user was fetched.</p>\n\n<p>Something like such:</p>\n\... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28540/"
] | I have an application that is using Windows Authentication and a SqlRoleProvider for user authentication and role management respectively. It is working fine with my test users that I have added to the database as defaults. The application requires users to login (using Windows credentials) and then be able to use this... | I was able to locate the solution after digging and playing around a bit more. I added the following code to my Global.asax file and it is accomplishing what I am hoping for.
```
protected void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs e)
{
if (!Roles.IsUserInRole(e.Identit... |
354,070 | <p>After reading it, this is <em>not</em> a duplicate of <a href="https://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins">Explicit vs Implicit SQL Joins</a>.
The answer may be related (or even the same) but the <strong>question</strong> is different.</p>
<hr>
<p>What is the difference and what shoul... | [
{
"answer_id": 354089,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 5,
"selected": false,
"text": "<p>On an inner join, they mean the same thing. However you will get different results in an outer join depending on if you pu... | 2008/12/09 | [
"https://Stackoverflow.com/questions/354070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343/"
] | After reading it, this is *not* a duplicate of [Explicit vs Implicit SQL Joins](https://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins).
The answer may be related (or even the same) but the **question** is different.
---
What is the difference and what should go in each?
If I understand the theory ... | They are not the same thing.
Consider these queries:
```
SELECT *
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
WHERE Orders.ID = 12345
```
and
```
SELECT *
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
AND Orders.ID = 12345
```
The first will return an order and its li... |