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 |
|---|---|---|---|---|---|---|
80,857 | <p>In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".</p>
<p>I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.</p>
<p>I don't th... | [
{
"answer_id": 80869,
"author": "RWendi",
"author_id": 15152,
"author_profile": "https://Stackoverflow.com/users/15152",
"pm_score": -1,
"selected": false,
"text": "<p>Put the mouse cursor on the method name or any identifier, and press <kbd>F12</kbd></p>\n"
},
{
"answer_id": 808... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369/"
] | In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".
I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.
I don't think there's a way... | You could create an Autohotkey script that does that. When you ctrl-click a word, send a doubleclick then a F12.
I don't have AHK handy so I can't try and sketch some code but it should be pretty easy; the AHK recorder should have enough features to let you create it in a point 'n' click fashion and IIRC it is smart e... |
80,859 | <p>I'm writing a Rails application which will monitor data quality over some specific databases. In order to do that, I need to be able to execute direct SQL queries over these databases - which of course are not the same as the one used to drive the Rails application models. In short, this means I can't use the trick ... | [
{
"answer_id": 80946,
"author": "Codebeef",
"author_id": 12037,
"author_profile": "https://Stackoverflow.com/users/12037",
"pm_score": 0,
"selected": false,
"text": "<p>You may be able to do this through <a href=\"http://blog.whitet.net/articles/2008/01/30/rails-has_many-with-models-over... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11477/"
] | I'm writing a Rails application which will monitor data quality over some specific databases. In order to do that, I need to be able to execute direct SQL queries over these databases - which of course are not the same as the one used to drive the Rails application models. In short, this means I can't use the trick of ... | I had a situation like this where I had to connect to hundreds of different instances of an external application, and I did code similar to the following:
```
def get_custom_connection(identifier, host, port, dbname, dbuser, password)
eval("Custom_#{identifier} = Class::new(ActiveRecord::Base)")
eval("Cu... |
80,863 | <p>I am seeing strange behaviour with the flash.media.Sound class in Flex 3.</p>
<pre><code>var sound:Sound = new Sound();
try{
sound.load(new URLRequest("directory/file.mp3"))
} catch(e:IOError){
...
}
</code></pre>
<p>However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound c... | [
{
"answer_id": 81447,
"author": "grapefrukt",
"author_id": 914,
"author_profile": "https://Stackoverflow.com/users/914",
"pm_score": 1,
"selected": false,
"text": "<p>You will need to add a listener since the URLRequest is not instantaneous. It will be <strong>very</strong> fast if you'r... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13220/"
] | I am seeing strange behaviour with the flash.media.Sound class in Flex 3.
```
var sound:Sound = new Sound();
try{
sound.load(new URLRequest("directory/file.mp3"))
} catch(e:IOError){
...
}
```
However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound constructor.
>
> Error #2... | [IOError](http://livedocs.adobe.com/flex/3/langref/flash/errors/IOError.html) = target file cannot be found (or for some other reason cannot be read). Check your file's path.
Edit: I just realized this may not be your problem, you're just trying to catch the IO error? If so, you can do this:
```
var sound:Sound = new... |
80,875 | <p>How do you create a hardlink (as opposed to a symlink or a Mac OS alias) in OS X that points to a directory? I already know the command "ln target destination" but that only works when the target is a file. I know that Mac OS, unlike other Unix environments, does allow hardlinking to folders (this is used for Time M... | [
{
"answer_id": 81000,
"author": "Penfold",
"author_id": 11952,
"author_profile": "https://Stackoverflow.com/users/11952",
"pm_score": -1,
"selected": false,
"text": "<p>The short answer is you can't. :) (except possibly as root, when it would be more accurate to say you shouldn't.)</p>\n... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4939/"
] | How do you create a hardlink (as opposed to a symlink or a Mac OS alias) in OS X that points to a directory? I already know the command "ln target destination" but that only works when the target is a file. I know that Mac OS, unlike other Unix environments, does allow hardlinking to folders (this is used for Time Mach... | You can't do it directly in BASH then. However... I found an article here that discusses how to do it indirectly: <http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html> by compiling a simple little C program:
```
#include <unistd.h>
#include <stdio.h>
int main(int argc, char *arg... |
80,903 | <p>My problem is that I want to have a server application (on a remote computer) to publish certain events to several client computers. The server and client communicate using .Net-Remoting so currently I am using remoted .Net-Events to get the functionality. But there is one drawback: when the server (the event publis... | [
{
"answer_id": 81843,
"author": "Hallgrim",
"author_id": 15454,
"author_profile": "https://Stackoverflow.com/users/15454",
"pm_score": 0,
"selected": false,
"text": "<p>If your server comes offline every once and a while I cannot see how you can avoid to poll it to check that it is alive... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9602/"
] | My problem is that I want to have a server application (on a remote computer) to publish certain events to several client computers. The server and client communicate using .Net-Remoting so currently I am using remoted .Net-Events to get the functionality. But there is one drawback: when the server (the event publisher... | What about MSMQ? It seems perfect for what you are trying to achieve? You can use a traditional publish/subscribe model or multicast the messages. |
80,963 | <p>I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so <code>[b]</code> will become <code><b></code> and so forth. the RegEx I am using looks like so</p>
<pre><code>var exptags = /\[(b|u|i|s|center|code){1}]((.){1,}?)\[\/(\1){1}]/ig;
</code></pre>
<p>with the followin... | [
{
"answer_id": 81074,
"author": "Eugen Anghel",
"author_id": 4017,
"author_profile": "https://Stackoverflow.com/users/4017",
"pm_score": 1,
"selected": false,
"text": "<p>AFAIK you can't express recursion with regular expressions. </p>\n\n<p>You can however do that with .NET's System.Tex... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2098/"
] | I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so `[b]` will become `<b>` and so forth. the RegEx I am using looks like so
```
var exptags = /\[(b|u|i|s|center|code){1}]((.){1,}?)\[\/(\1){1}]/ig;
```
with the following JavaScript
```
s.replace(exptags,"<$1>$2</$1>");
`... | The easiest solution would be to to replace all the tags, whether they are closed or not and let `.innerHTML` work out if they are matched or not it will much more resilient that way..
```
var tagreg = /\[(\/?)(b|u|i|s|center|code)]/ig
div.innerHTML="[b][i]helloworld[/b]".replace(tagreg, "<$1$2>") //no closing i
//div... |
80,993 | <p>As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions?</p>
<pre><code>import atexit
def helloworld():
print("Hello World!")
atexit.register(helloworld)
raise Exception("Good bye cruel world!")
</code></pre>
<p>... | [
{
"answer_id": 81051,
"author": "Joe Skora",
"author_id": 14057,
"author_profile": "https://Stackoverflow.com/users/14057",
"pm_score": -1,
"selected": false,
"text": "<p>If you call</p>\n\n<pre><code>import os\nos._exit(0)\n</code></pre>\n\n<p>the exit handlers will not be called, yours... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15274/"
] | As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions?
```
import atexit
def helloworld():
print("Hello World!")
atexit.register(helloworld)
raise Exception("Good bye cruel world!")
```
outputs
```
Traceback (mo... | I don't really know why you want to do that, but you can install an excepthook that will be called by Python whenever an uncatched exception is raised, and in it clear the array of registered function in the `atexit` module.
Something like that :
```
import sys
import atexit
def clear_atexit_excepthook(exctype, valu... |
81,022 | <p>In the KornShell (ksh) on <b>AIX UNIX Version 5.3</b> with the editor mode set to vi using:</p>
<pre><code>set -o vi
</code></pre>
<p>What are the key-strokes at the shell command line to autocomplete a file or directory name?</p>
| [
{
"answer_id": 81135,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 5,
"selected": true,
"text": "<p>ESC\\ works fine on AIX4.2 at least. One thing I noticed is that it only autocompletes to the unique part of the file ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/381/"
] | In the KornShell (ksh) on **AIX UNIX Version 5.3** with the editor mode set to vi using:
```
set -o vi
```
What are the key-strokes at the shell command line to autocomplete a file or directory name? | ESC\ works fine on AIX4.2 at least. One thing I noticed is that it only autocompletes to the unique part of the file name.
So if you have the files x.txt, x171go and x171stop, the following will happen:
```
Press keys: Command line is:
x x
<ESC>\ x
1 x1... |
81,052 | <p>Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual?</p>
| [
{
"answer_id": 81059,
"author": "Maximilian",
"author_id": 1733,
"author_profile": "https://Stackoverflow.com/users/1733",
"pm_score": 0,
"selected": false,
"text": "<p>If you want to give it an implementation in your base class you make it virtual, if you don't you make it abstract.</p>... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6651/"
] | Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual? | An abstract method or property (both can be virtual or abstract) can only be declared in an abstract class and cannot have a body, i.e. you can't implement it in your abstract class.
A virtual method or property must have a body, i.e. you must provide an implementation (even if the body is empty).
If someone want to ... |
81,099 | <p>As the title states, I'd be interested to find a safe feature-based (that is, without using navigator.appName or navigator.appVersion) way to detect Google Chrome.</p>
<p>By feature-based I mean, for example:</p>
<pre><code>if(window.ActiveXObject) {
// internet explorer!
}
</code></pre>
<p><strong>Edit:</str... | [
{
"answer_id": 81121,
"author": "Marijn",
"author_id": 12038,
"author_profile": "https://Stackoverflow.com/users/12038",
"pm_score": 2,
"selected": false,
"text": "<p>Not exactly an answer to the question... but if you are trying to detect a specific browser brand, the point of feature-c... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14981/"
] | As the title states, I'd be interested to find a safe feature-based (that is, without using navigator.appName or navigator.appVersion) way to detect Google Chrome.
By feature-based I mean, for example:
```
if(window.ActiveXObject) {
// internet explorer!
}
```
**Edit:** As it's been pointed out, the question do... | ```
isChrome = function() {
return Boolean(window.chrome);
}
``` |
81,150 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/48935/how-can-i-register-a-global-hot-key-to-say-ctrlshiftletter-using-wpf-and-ne">How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?</a> </p>
</blockquote>
<p>I'd like to ha... | [
{
"answer_id": 81335,
"author": "arul",
"author_id": 15409,
"author_profile": "https://Stackoverflow.com/users/15409",
"pm_score": 3,
"selected": false,
"text": "<p><a href=\"http://www.codeproject.com/KB/cs/CSLLKeyboardHook.aspx\" rel=\"noreferrer\">http://www.codeproject.com/KB/cs/CSLL... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | >
> **Possible Duplicate:**
>
> [How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?](https://stackoverflow.com/questions/48935/how-can-i-register-a-global-hot-key-to-say-ctrlshiftletter-using-wpf-and-ne)
>
>
>
I'd like to have multiple global hotkeys in my new app (to contro... | The nicest solution I've found is <http://bloggablea.wordpress.com/2007/05/01/global-hotkeys-with-net/>
```
Hotkey hk = new Hotkey();
hk.KeyCode = Keys.1;
hk.Windows = true;
hk.Pressed += delegate { Console.WriteLine("Windows+1 pressed!"); };
hk.Register(myForm);
```
Note how you can set different lambdas to diff... |
81,174 | <p>I want to have a text box that the user can type in that shows an Ajax-populated list of my model's names, and then when the user selects one I want the HTML to save the model's ID, and use that when the form is submitted.</p>
<p>I've been poking at the auto_complete plugin that got excised in Rails 2, but it seems... | [
{
"answer_id": 81265,
"author": "Dan Harper",
"author_id": 14530,
"author_profile": "https://Stackoverflow.com/users/14530",
"pm_score": 1,
"selected": false,
"text": "<p>I rolled my own. The process is a little convoluted, but...</p>\n\n<p>I just made a text_field on the form with an o... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5657/"
] | I want to have a text box that the user can type in that shows an Ajax-populated list of my model's names, and then when the user selects one I want the HTML to save the model's ID, and use that when the form is submitted.
I've been poking at the auto\_complete plugin that got excised in Rails 2, but it seems to have ... | I've got a hackneyed fix for the junk spaces from the image. I added a `:after_update_element => "trimSelectedItem"` to the options hash of the `model_auto_completer` (that's the first hash of the three given). My `trimSelectedItem` then finds the appropriate sub-element and uses the contents of that for the element va... |
81,180 | <p>We have simple HTML form with <code><input type="file"></code>, like shown below:</p>
<pre><code><form>
<label for="attachment">Attachment:</label>
<input type="file" name="attachment" id="attachment">
<input type="submit">
</form>
</code></pre>
<p>In IE7 (and probab... | [
{
"answer_id": 81227,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>Simply you cannot do it with FF3.</p>\n\n<p>The other option could be using applet or other controls to select and upload fi... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446104/"
] | We have simple HTML form with `<input type="file">`, like shown below:
```
<form>
<label for="attachment">Attachment:</label>
<input type="file" name="attachment" id="attachment">
<input type="submit">
</form>
```
In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like '//s... | For preview in Firefox works this - attachment is object of attachment element in first example:
```
if (attachment.files)
previewImage.src = attachment.files.item(0).getAsDataURL();
else
previewImage.src = attachment.value;
``` |
81,191 | <p>While answering <a href="https://stackoverflow.com/questions/68645/python-static-variable#81002">Static class variables in Python</a> </p>
<p>I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?</p>
<pre><code>PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)]... | [
{
"answer_id": 81274,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https://Stackoverflow.com/users/3171",
"pm_score": 3,
"selected": true,
"text": "<p>My guess is as follows. The PythonWin editor offers autocomplete for an object, i.e. when you type <code>myobject.</cod... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14351/"
] | While answering [Static class variables in Python](https://stackoverflow.com/questions/68645/python-static-variable#81002)
I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?
```
PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32.
Portions Copyright 19... | My guess is as follows. The PythonWin editor offers autocomplete for an object, i.e. when you type `myobject.` it offers a little popup of all the availble method names. So I think when you type `X().` it's creating an instance of `X` in the background and doing a `dir` or similar to find out the attributes of the obje... |
81,194 | <p>We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. </p>
<p>Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. </p>
<p>Is anyone familiar with a way to debug remotely using Eclipse CDT without gd... | [
{
"answer_id": 90518,
"author": "Nick Bastin",
"author_id": 1502059,
"author_profile": "https://Stackoverflow.com/users/1502059",
"pm_score": 1,
"selected": false,
"text": "<p>I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15367/"
] | We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.
Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.
Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps ... | finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.
In Main C/C++ Applications I set the full path on the Samba share of the executable (`X:\abin\vlmi9506`). I also set a linked folder on `X:\abin` in the project. Then I modified my batch-scr... |
81,214 | <p>I just want an ASP.NET DropDownList with no selected item. Setting SelectedIndex to -1 is of no avail, so far. I am using Framework 3.5 with AJAX, i.e. this DropDownList is within an UpdatePanel.
Here is what I am doing:</p>
<pre><code> protected void Page_Load (object sender, EventArgs e)
{
this.myD... | [
{
"answer_id": 81246,
"author": "bryansh",
"author_id": 211367,
"author_profile": "https://Stackoverflow.com/users/211367",
"pm_score": 2,
"selected": false,
"text": "<p>I'm pretty sure that dropdown has to have some item selected; I usually add an empty list item</p>\n\n<p>this.myDropDo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I just want an ASP.NET DropDownList with no selected item. Setting SelectedIndex to -1 is of no avail, so far. I am using Framework 3.5 with AJAX, i.e. this DropDownList is within an UpdatePanel.
Here is what I am doing:
```
protected void Page_Load (object sender, EventArgs e)
{
this.myDropDownList.Se... | Bare in mind myDropDownList.Items.Add will add a new Listitem element at the bottom if you call it after performing a DataSource/DataBind call so use myDropDownList.Items.Insert method instead eg...
```
myDropDownList.DataSource = DataAccess.GetDropDownItems(); // Psuedo Code
myDropDownList.DataTextField = "Value";
my... |
81,236 | <p>Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ?</p>
| [
{
"answer_id": 81257,
"author": "William",
"author_id": 14829,
"author_profile": "https://Stackoverflow.com/users/14829",
"pm_score": 8,
"selected": true,
"text": "<p>Open an administrator command prompt, and do this command:</p>\n\n<pre><code>fsutil fsinfo ntfsinfo [your drive]\n</code>... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ? | Open an administrator command prompt, and do this command:
```
fsutil fsinfo ntfsinfo [your drive]
```
The Bytes Per Cluster is the equivalent of the allocation unit. |
81,238 | <p>Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from <a href="http://www.dizzler.com" rel="nofollow noreferrer">http://www.dizzler.com</a> which is a flash based site that allows you to browse a library of crawled publicly availab... | [
{
"answer_id": 81247,
"author": "perimosocordiae",
"author_id": 10601,
"author_profile": "https://Stackoverflow.com/users/10601",
"pm_score": 0,
"selected": false,
"text": "<p>It's not a very elegant solution, but you could block the site's crawler bot, then rename your mp3 files to brea... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/327/"
] | Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from <http://www.dizzler.com> which is a flash based site that allows you to browse a library of crawled publicly available mp3s.
**Edit:** Dizzler was still getting in (probably wasn'... | That's like saying you want to stop spam-bots from harvesting emails on your publicly visible page - it's very tough to tell the difference between users and bots without forcing your viewers to log in to confirm their identity.
You could use robots.txt to disallow the spiders that actually follow those rules, but tha... |
81,243 | <p>In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed.</p>
<p>In addition to TApplication.HelpFile, ea... | [
{
"answer_id": 81318,
"author": "Graza",
"author_id": 11820,
"author_profile": "https://Stackoverflow.com/users/11820",
"pm_score": 0,
"selected": false,
"text": "<p>Inexperienced with help files here, and even moreso with Vista, but I can offer you a possible workaround...</p>\n\n<p>Bui... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5888/"
] | In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed.
In addition to TApplication.HelpFile, each form al... | Assuming you have two help files called "Help File 1.chm" and "Help File 2.chm" and you are opening these help files from your Delphi code.
To open Help File 1, the following code will work:
```
procedure TForm1.Button1Click(Sender: TObject);
begin
Application.HelpFile := 'Help File 1.chm';
Application.HelpContex... |
81,260 | <p>Is there a tool or script which easily merges a bunch of <a href="http://en.wikipedia.org/wiki/JAR_%28file_format%29" rel="noreferrer">JAR</a> files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.</p>
<p>The concrete case is a <a href="http://jrst.labs.libre-entrepri... | [
{
"answer_id": 81273,
"author": "larsivi",
"author_id": 14047,
"author_profile": "https://Stackoverflow.com/users/14047",
"pm_score": 4,
"selected": false,
"text": "<p>If you are a <a href=\"http://en.wikipedia.org/wiki/Apache_Maven\" rel=\"nofollow noreferrer\">Maven</a> user, typically... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12677/"
] | Is there a tool or script which easily merges a bunch of [JAR](http://en.wikipedia.org/wiki/JAR_%28file_format%29) files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.
The concrete case is a [Java restructured text tool](http://jrst.labs.libre-entreprise.org/en/user/fu... | Eclipse 3.4 JDT's Runnable JAR export wizard.
In Eclipse 3.5, this has been extended. Now you can chose how you want to treat your referenced JAR files. |
81,268 | <p>I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance probl... | [
{
"answer_id": 81327,
"author": "Peter",
"author_id": 5189,
"author_profile": "https://Stackoverflow.com/users/5189",
"pm_score": 1,
"selected": false,
"text": "<p>If you cannot change the sort-order on the database(best option), then the indexes on unknown case fields will not help. Th... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15395/"
] | I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance problems... | Try creating a `functional index`, like
```
Create Index INDX_MY_SEARCH on TABLE_NAME(LOWER(@MySearch)
``` |
81,280 | <p>The question says it all basically. </p>
<p>I want in a </p>
<pre><code>class MyClass
</code></pre>
<p>to listen to a routed event. Can it be done ?</p>
| [
{
"answer_id": 81578,
"author": "tucuxi",
"author_id": 15472,
"author_profile": "https://Stackoverflow.com/users/15472",
"pm_score": 0,
"selected": false,
"text": "<p>If you can create an <em>inner</em> class of MyClass (call it MyInnerClass) that derives from FrameworkElement while reta... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5246/"
] | The question says it all basically.
I want in a
```
class MyClass
```
to listen to a routed event. Can it be done ? | Actually I wiredup the event the wrong way :|
I had
```
EventManager.RegisterClassHandler ( typeof ( MyClass )......
```
Instead of
```
EventManager.RegisterClassHandler ( typeof ( TheClassThatOwnedTheEvent )
```
So .. my bad. |
81,283 | <p>How do people usually detect the MIME type of an uploaded file using ASP.NET?</p>
| [
{
"answer_id": 81312,
"author": "Kinjal Dixit",
"author_id": 6629,
"author_profile": "https://Stackoverflow.com/users/6629",
"pm_score": 6,
"selected": true,
"text": "<p>in the aspx page:</p>\n\n<pre><code><asp:FileUpload ID=\"FileUpload1\" runat=\"server\" />\n</code></pre>\n\n<p>... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15396/"
] | How do people usually detect the MIME type of an uploaded file using ASP.NET? | in the aspx page:
```
<asp:FileUpload ID="FileUpload1" runat="server" />
```
in the codebehind (c#):
```
string contentType = FileUpload1.PostedFile.ContentType
``` |
81,285 | <p>I re-image one of my machines regularly; and have a script that I run after the OS install completes to configure my machine; such that it works how I like.</p>
<p>I happen to have my data on another drive...and I'd like to add code to my script to change the location of the Documents directory from "C:\Users\bryan... | [
{
"answer_id": 81312,
"author": "Kinjal Dixit",
"author_id": 6629,
"author_profile": "https://Stackoverflow.com/users/6629",
"pm_score": 6,
"selected": true,
"text": "<p>in the aspx page:</p>\n\n<pre><code><asp:FileUpload ID=\"FileUpload1\" runat=\"server\" />\n</code></pre>\n\n<p>... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/211367/"
] | I re-image one of my machines regularly; and have a script that I run after the OS install completes to configure my machine; such that it works how I like.
I happen to have my data on another drive...and I'd like to add code to my script to change the location of the Documents directory from "C:\Users\bryansh\Documen... | in the aspx page:
```
<asp:FileUpload ID="FileUpload1" runat="server" />
```
in the codebehind (c#):
```
string contentType = FileUpload1.PostedFile.ContentType
``` |
81,294 | <pre><code>struct foo { unsigned x:1; } f;
printf("%d\n", (int)sizeof(f.x = 1));
</code></pre>
<p>What is the expected output and why? Taking the size of a bitfield lvalue directly isn't allowed. But by using the assignment operator, it seems we can still take the size of a bitfield type.</p>
<p>What is the "size of... | [
{
"answer_id": 81348,
"author": "Jason Dagit",
"author_id": 5113,
"author_profile": "https://Stackoverflow.com/users/5113",
"pm_score": 0,
"selected": false,
"text": "<p>Wouldn't</p>\n\n<pre><code>(f.x = 1)\n</code></pre>\n\n<p>be an expression evaluating to true (technically in evaluate... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
struct foo { unsigned x:1; } f;
printf("%d\n", (int)sizeof(f.x = 1));
```
What is the expected output and why? Taking the size of a bitfield lvalue directly isn't allowed. But by using the assignment operator, it seems we can still take the size of a bitfield type.
What is the "size of a bitfield in bytes"? Is i... | You are right, integer promotions aren't applied to the operand of `sizeof`:
>
> The integer promotions are applied only: as part of the usual arithmetic conversions, to certain argument expressions, to the operands of the unary +, -, and ~ operators, and to both operands of the shift operators, as specified by their... |
81,295 | <p>I have a webservice that that uses message layer security with X.509 certificates in WSE 3.0. The service uses a X509v3 policy to sign various elements in the soapheader.</p>
<p>I need to do some custom checks on the certificates so I've tried to implement a custom X509SecurityTokenManager and added a section in we... | [
{
"answer_id": 81630,
"author": "Kieran Benton",
"author_id": 5777,
"author_profile": "https://Stackoverflow.com/users/5777",
"pm_score": 0,
"selected": false,
"text": "<p>Not particular constructive advice I know, but if I was you I'd get off WSE3.0 as soon as possible. We did some work... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15406/"
] | I have a webservice that that uses message layer security with X.509 certificates in WSE 3.0. The service uses a X509v3 policy to sign various elements in the soapheader.
I need to do some custom checks on the certificates so I've tried to implement a custom X509SecurityTokenManager and added a section in web.config.
... | The problem was located elsewhere. My serverproject was an web-app and some options wasn't available for web-apps just for web-sites. So I made a small web-site project and compared web.configs and noticed that some lines diffed.
These lines was in the website web.config but not in my other projekt
```
<soapServerP... |
81,306 | <p>We're currently having a debate whether it's better to throw faults over a WCF channel, versus passing a message indicating the status or the response from a service.</p>
<p>Faults come with built-in support from WCF where by you can use the built-in error handlers and react accordingly. This, however, carries over... | [
{
"answer_id": 81339,
"author": "Paul van Brenk",
"author_id": 1837197,
"author_profile": "https://Stackoverflow.com/users/1837197",
"pm_score": 6,
"selected": true,
"text": "<blockquote>\n <p>This however carries overhead as throwing exceptions in .NET can be quite costly.</p>\n</block... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15360/"
] | We're currently having a debate whether it's better to throw faults over a WCF channel, versus passing a message indicating the status or the response from a service.
Faults come with built-in support from WCF where by you can use the built-in error handlers and react accordingly. This, however, carries overhead as th... | >
> This however carries overhead as throwing exceptions in .NET can be quite costly.
>
>
>
You're serializing and de-serializing objects to XML and sending them over a slow network.. the overhead from throwing an exception is negligable compared to that.
I usually stick to throwing exceptions, since they clearly... |
81,317 | <p>I have been making a little toy web application in C# along the lines of Rob Connery's Asp.net MVC storefront.</p>
<p>I find that I have a repository interface, call it IFooRepository, with methods, say</p>
<pre><code>IQueryable<Foo> GetFoo();
void PersistFoo(Foo foo);
</code></pre>
<p>And I have three impl... | [
{
"answer_id": 81326,
"author": "Jon Limjap",
"author_id": 372,
"author_profile": "https://Stackoverflow.com/users/372",
"pm_score": 2,
"selected": false,
"text": "<p>In MbUnit, you might be able to use the RowTest attribute to specify parameters on your test.</p>\n\n<pre><code>[RowTest]... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5599/"
] | I have been making a little toy web application in C# along the lines of Rob Connery's Asp.net MVC storefront.
I find that I have a repository interface, call it IFooRepository, with methods, say
```
IQueryable<Foo> GetFoo();
void PersistFoo(Foo foo);
```
And I have three implementations of this: ISqlFooRepository,... | Create an abstract class that contains concrete versions of the tests and an abstract GetRepository method which returns IFooRepository.
Create three classes that derive from the abstract class, each of which implements GetRepository in a way that returns the appropriate IFooRepository implementation.
Add all three cla... |
81,323 | <p>Is there a way to change the encoding used by the String(byte[]) constructor ?</p>
<p>In my own code I use String(byte[],String) to specify the encoding but I am using an external library that I cannot change.</p>
<pre><code>String src = "with accents: é à";
byte[] bytes = src.getBytes("UTF-8");
System.out.println... | [
{
"answer_id": 81363,
"author": "jrudolph",
"author_id": 7647,
"author_profile": "https://Stackoverflow.com/users/7647",
"pm_score": 1,
"selected": false,
"text": "<p>Quoted from <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html\" rel=\"nofollow noreferrer\"... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7198/"
] | Is there a way to change the encoding used by the String(byte[]) constructor ?
In my own code I use String(byte[],String) to specify the encoding but I am using an external library that I cannot change.
```
String src = "with accents: é à";
byte[] bytes = src.getBytes("UTF-8");
System.out.println("UTF-8 decoded: "+ne... | You need to change the locale before launching the JVM; see:
[Java, bug ID 4163515](http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=6f932817e77b249681417c21bfaf?bug_id=4163515)
Some places seem to imply you can do this by setting the file.encoding variable when launching the JVM, such as
```
java -Dfile.enco... |
81,346 | <p>I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times.</p>
<p>Say I'm creating a word frequency list, using a Map (probably a HashMap), where each key is a String with the word that's being ... | [
{
"answer_id": 81401,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 1,
"selected": false,
"text": "<p>The various primitive wrappers, e.g., <code>Integer</code> are immutable so there's really not a more concise way to do w... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10204/"
] | I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times.
Say I'm creating a word frequency list, using a Map (probably a HashMap), where each key is a String with the word that's being counted an... | Some test results
-----------------
I've gotten a lot of good answers to this question--thanks folks--so I decided to run some tests and figure out which method is actually fastest. The five methods I tested are these:
* the "ContainsKey" method that I presented in [the question](https://stackoverflow.com/questions/8... |
81,350 | <p>What are the private IP address ranges?</p>
| [
{
"answer_id": 81365,
"author": "Sargun Dhillon",
"author_id": 10432,
"author_profile": "https://Stackoverflow.com/users/10432",
"pm_score": 6,
"selected": true,
"text": "<p>You will find the answers to this in <a href=\"http://www.faqs.org/rfcs/rfc1918.html\" rel=\"noreferrer\">RFC 1918... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11034/"
] | What are the private IP address ranges? | You will find the answers to this in [RFC 1918](http://www.faqs.org/rfcs/rfc1918.html). Though, I have listed them below for you.
```
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
```
It is a common ... |
81,361 | <p>I have set up a repository using SVN and uploaded projects. There are multiple users working on these projects. But, not everyone requires access to all projects. I want to set up user permissions for each project.</p>
<p>How can I achieve this?</p>
| [
{
"answer_id": 81396,
"author": "Mladen Mihajlovic",
"author_id": 11421,
"author_profile": "https://Stackoverflow.com/users/11421",
"pm_score": 2,
"selected": false,
"text": "<p>The best way is to set up Apache and to set the access through it. Check the <a href=\"http://svnbook.red-bean... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15425/"
] | I have set up a repository using SVN and uploaded projects. There are multiple users working on these projects. But, not everyone requires access to all projects. I want to set up user permissions for each project.
How can I achieve this? | In your **svn\repos\YourRepo\conf** folder you will find two files, **authz** and **passwd**. These are the two you need to adjust.
In the **passwd** file you need to add some usernames and passwords. I assume you have already done this since you have people using it:
```
[users]
User1=password1
User2=password2
```
... |
81,392 | <p>If you declare variables of type byte or short and attempt to perform arithmetic operations on these, you receive the error "Type mismatch: cannot convert int to short" (or correspondingly "Type mismatch: cannot convert int to byte"). </p>
<pre><code>byte a = 23;
byte b = 34;
byte c = a + b;
</code></pre>
<p>In th... | [
{
"answer_id": 81394,
"author": "Brad Richards",
"author_id": 7732,
"author_profile": "https://Stackoverflow.com/users/7732",
"pm_score": 5,
"selected": true,
"text": "<p>Although the arithmetic operators are defined to operate on any numeric type, according the Java language specificati... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7732/"
] | If you declare variables of type byte or short and attempt to perform arithmetic operations on these, you receive the error "Type mismatch: cannot convert int to short" (or correspondingly "Type mismatch: cannot convert int to byte").
```
byte a = 23;
byte b = 34;
byte c = a + b;
```
In this example, the compile er... | Although the arithmetic operators are defined to operate on any numeric type, according the Java language specification (5.6.2 Binary Numeric Promotion), operands of type byte and short are automatically promoted to int before being handed to the operators.
To perform arithmetic operations on variables of type byte or... |
81,410 | <p>I've got a <a href="http://notebooks.readerville.com/" rel="noreferrer">site</a> that provides blog-friendly widgets via JavaScript. These work fine in most circumstances, including self-hosted Wordpress blogs. With blogs hosted at Wordpress.com, however, JavaScript isn't allowed in sidebar text modules. Has anyone ... | [
{
"answer_id": 81505,
"author": "matt lohkamp",
"author_id": 14026,
"author_profile": "https://Stackoverflow.com/users/14026",
"pm_score": 4,
"selected": true,
"text": "<p>you could always petition wp to add your widget to their 'approved' list, but who knows how long that would take. yo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6478/"
] | I've got a [site](http://notebooks.readerville.com/) that provides blog-friendly widgets via JavaScript. These work fine in most circumstances, including self-hosted Wordpress blogs. With blogs hosted at Wordpress.com, however, JavaScript isn't allowed in sidebar text modules. Has anyone seen a workaround for this limi... | you could always petition wp to add your widget to their 'approved' list, but who knows how long that would take. you're talking about a way to circumvent the rules they have in place about posting arbitrary script. myspace javascript exploits in particular have increased awareness of the possibility of such workaround... |
81,448 | <p>In Oracle, what is the difference between :</p>
<pre><code>CREATE TABLE CLIENT
(
NAME VARCHAR2(11 BYTE),
ID_CLIENT NUMBER
)
</code></pre>
<p>and</p>
<pre><code>CREATE TABLE CLIENT
(
NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11)
ID_CLIENT NUMBER
)
</code></pre>
| [
{
"answer_id": 81465,
"author": "Matthias Kestenholz",
"author_id": 317346,
"author_profile": "https://Stackoverflow.com/users/317346",
"pm_score": 5,
"selected": false,
"text": "<p>One has exactly space for 11 bytes, the other for exactly 11 characters. Some charsets such as Unicode var... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12388/"
] | In Oracle, what is the difference between :
```
CREATE TABLE CLIENT
(
NAME VARCHAR2(11 BYTE),
ID_CLIENT NUMBER
)
```
and
```
CREATE TABLE CLIENT
(
NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11)
ID_CLIENT NUMBER
)
``` | Let us assume the database character set is UTF-8, which is the recommended setting in recent versions of Oracle. In this case, some characters take more than 1 byte to store in the database.
If you define the field as `VARCHAR2(11 BYTE)`, Oracle can use up to 11 bytes for storage, but you may not actually be able to ... |
81,451 | <p>I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through <code>db.TextProperty</code> and <code>db.BlobProperty</code>.</p>
<p>I'll be glad anyone can provide cod... | [
{
"answer_id": 81479,
"author": "Guido",
"author_id": 12388,
"author_profile": "https://Stackoverflow.com/users/12388",
"pm_score": 1,
"selected": false,
"text": "<p>You can not store files as there is not a traditional file system. You can only store them in their own DataStore (in a f... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] | I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`.
I'll be glad anyone can provide code sample (both the client and th... | Here is a complete, working file. I pulled the original from the Google site and modified it to make it slightly more real world.
A few things to notice:
1. This code uses the [BlobStore API](http://code.google.com/appengine/docs/python/blobstore/)
2. The purpose of this line in the
ServeHandler class is to "fix" the... |
81,512 | <p>I have three unordered lists that have been created as Scriptaculous Sortables so that the user can drag items within the lists and also between them:</p>
<pre><code>var lists = ["pageitems","rowitems","columnitems"];
Sortable.create("pageitems", { dropOnEmpty: true, containment: lists, constraint: false });
... | [
{
"answer_id": 82201,
"author": "mercutio",
"author_id": 1951,
"author_profile": "https://Stackoverflow.com/users/1951",
"pm_score": 3,
"selected": true,
"text": "<p>Maybe the empty list has no height, and therefore no droppable area available. If that's the case, perhaps you just need t... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have three unordered lists that have been created as Scriptaculous Sortables so that the user can drag items within the lists and also between them:
```
var lists = ["pageitems","rowitems","columnitems"];
Sortable.create("pageitems", { dropOnEmpty: true, containment: lists, constraint: false });
Sortable.cre... | Maybe the empty list has no height, and therefore no droppable area available. If that's the case, perhaps you just need to set a minimum height, or some padding on the block. |
81,520 | <p>How can you suppress the <code>Terminated</code> message that comes up after you kill a
process in a bash script?</p>
<p>I tried <code>set +bm</code>, but that doesn't work.</p>
<p>I know another solution involves calling <code>exec 2> /dev/null</code>, but is that
reliable? How do I reset it back so that I can... | [
{
"answer_id": 81539,
"author": "Matthias Kestenholz",
"author_id": 317346,
"author_profile": "https://Stackoverflow.com/users/317346",
"pm_score": 3,
"selected": false,
"text": "<p>Maybe detach the process from the current shell process by calling <code>disown</code>?</p>\n"
},
{
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14437/"
] | How can you suppress the `Terminated` message that comes up after you kill a
process in a bash script?
I tried `set +bm`, but that doesn't work.
I know another solution involves calling `exec 2> /dev/null`, but is that
reliable? How do I reset it back so that I can continue to see stderr? | The short answer is that you can't. Bash always prints the status of foreground jobs. The monitoring flag only applies for background jobs, and only for interactive shells, not scripts.
see notify\_of\_job\_status() in jobs.c.
As you say, you can redirect so standard error is pointing to /dev/null but then you miss a... |
81,521 | <p>I have settled a web synchronization between SQLSERVER 2005 as publisher and SQLEXPRESS as suscriber. Web synchro has to be launched manually through IE interface (menu tools/synchronize) and to be selected among available synchronizations.</p>
<p>Everything is working fine except that I did not find a way to autom... | [
{
"answer_id": 81539,
"author": "Matthias Kestenholz",
"author_id": 317346,
"author_profile": "https://Stackoverflow.com/users/317346",
"pm_score": 3,
"selected": false,
"text": "<p>Maybe detach the process from the current shell process by calling <code>disown</code>?</p>\n"
},
{
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11436/"
] | I have settled a web synchronization between SQLSERVER 2005 as publisher and SQLEXPRESS as suscriber. Web synchro has to be launched manually through IE interface (menu tools/synchronize) and to be selected among available synchronizations.
Everything is working fine except that I did not find a way to automate the sy... | The short answer is that you can't. Bash always prints the status of foreground jobs. The monitoring flag only applies for background jobs, and only for interactive shells, not scripts.
see notify\_of\_job\_status() in jobs.c.
As you say, you can redirect so standard error is pointing to /dev/null but then you miss a... |
81,533 | <p>I'm currently trying to improve the design of a legacy db and I have the following situation</p>
<p>Currently I have a table SalesLead in which we store the the LeadSource.</p>
<pre><code>Create Table SalesLead(
....
LeadSource varchar(20)
....
)
</code></pre>
<p>The Lead Sources are helpfully stored ... | [
{
"answer_id": 81553,
"author": "LohanJ",
"author_id": 11286,
"author_profile": "https://Stackoverflow.com/users/11286",
"pm_score": 1,
"selected": false,
"text": "<p>Did you consider an updatable view? Depending on your database server and the integrity of your database design you will ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm currently trying to improve the design of a legacy db and I have the following situation
Currently I have a table SalesLead in which we store the the LeadSource.
```
Create Table SalesLead(
....
LeadSource varchar(20)
....
)
```
The Lead Sources are helpfully stored in a table.
```
Create Table Lea... | If you want to de-normalize the table, simply add the LeadSource (Varchar) column to your SalesLead table, instead of using a FK or an ID.
On the other hand, if your language has support for ENUM structures, the "magic numbers" should be safely stored in an enum, so you could:
```
SELECT * FROM SALESLEAD WHERE LeadS... |
81,556 | <p>Opening an Infopath form with parameter can be done like this:</p>
<pre><code>System.Diagnostics.Process.Start(PathToInfopath + "infopath.exe", "Template.xsn /InputParameters Id=123");
</code></pre>
<p>But that requires I know the path to Infopath.exe which changes with each version of Office. Is there a way to s... | [
{
"answer_id": 82291,
"author": "Steve",
"author_id": 15526,
"author_profile": "https://Stackoverflow.com/users/15526",
"pm_score": 1,
"selected": false,
"text": "<p>Play around with System.Diagnostics.ProcessStartInfo which allows you to specify a file you wish to open and also allows y... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Opening an Infopath form with parameter can be done like this:
```
System.Diagnostics.Process.Start(PathToInfopath + "infopath.exe", "Template.xsn /InputParameters Id=123");
```
But that requires I know the path to Infopath.exe which changes with each version of Office. Is there a way to simply launch the template a... | Play around with System.Diagnostics.ProcessStartInfo which allows you to specify a file you wish to open and also allows you to specify arguments.
You can then use Process.Start(ProcessStartInfo) to kick off the process. The framework will determine which application to run based on the file specified in the ProcessSt... |
81,589 | <p>My workplace has sales people using a 3rd party desktop application that connects directly the a Sql Server and the software is leaving hundreds of sleeping connections for each user. Is there anyway to clear these connection programmatically?</p>
| [
{
"answer_id": 83416,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "<p>Which version of SQL Server do you run? You can write a stored procedure to do this, looking at the data from sp_who and the... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5802/"
] | My workplace has sales people using a 3rd party desktop application that connects directly the a Sql Server and the software is leaving hundreds of sleeping connections for each user. Is there anyway to clear these connection programmatically? | Which version of SQL Server do you run? You can write a stored procedure to do this, looking at the data from sp\_who and then making some guess about the last activity. There's a "LastBatch" column that does the last time something was submitted by this user. I'd say if that is over an hour old (or whatever interval),... |
81,627 | <p>I am using Qt Dialogs in one of my application.
I need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window.</p>
| [
{
"answer_id": 81927,
"author": "amos",
"author_id": 15429,
"author_profile": "https://Stackoverflow.com/users/15429",
"pm_score": 7,
"selected": true,
"text": "<p>By default the <em>Qt::WindowContextHelpButtonHint</em> flag is added to dialogs.\nYou can control this with the <em>WindowF... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11212/"
] | I am using Qt Dialogs in one of my application.
I need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window. | By default the *Qt::WindowContextHelpButtonHint* flag is added to dialogs.
You can control this with the *WindowFlags* parameter to the dialog constructor.
For instance you can specify only the *TitleHint* and *SystemMenu* flags by doing:
```
QDialog *d = new QDialog(0, Qt::WindowSystemMenuHint | Qt::WindowTitleHint... |
81,628 | <p>I'd like to build a query string based on values taken from 5 groups of radio buttons.</p>
<p>Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1</p>
<p>The asp:Radiobuttonlist control does not like null values so I'm r... | [
{
"answer_id": 81678,
"author": "Jon",
"author_id": 12261,
"author_profile": "https://Stackoverflow.com/users/12261",
"pm_score": 0,
"selected": false,
"text": "<p>You could use StringBuilder instead of creating those three different strings. You can help it out by preallocating about ho... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12232/"
] | I'd like to build a query string based on values taken from 5 groups of radio buttons.
Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1
The asp:Radiobuttonlist control does not like null values so I'm resorting to norma... | The easiest way would be to use a non-server-side <form> tag with the method="get" then when the form was submitted you would automatically get the querystring you are after (and don't forget to add <label> tags and associate them with your radio buttons):
```
<form action="..." method="get">
<input type="radio" n... |
81,631 | <p>I want:
all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: <a href="http://mysite.com/article" rel="nofollow noreferrer">http://mysite.com/article</a> -> <a href="http://mysite.com/article/" rel="nofollow noreferrer">http://mysite.com/article/</a>
... | [
{
"answer_id": 81648,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>Clarification needed:</p>\n\n<p>Given the url:\n<a href=\"http://server/path/file\" rel=\"nofollow noreferrer\">http://serve... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13427/"
] | I want:
all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: <http://mysite.com/article> -> <http://mysite.com/article/>
But <http://mysite.com/article/article-15.html> not redirects.
What regulat expression I must write to .htaccess for adding slash to... | I think the following might work:
```
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
```
When it comes to mod\_rewrite I can never be sure without testing though... |
81,644 | <p>I am using mysql++ in order to connect to a MySQL database to perform a bunch of data queries. Due to the fact that the tables I am reading from are constantly being written to, and that I need a consistent view of the data, I lock the tables first. However, MySQL has no concept of 'NOWAIT' in its lock query, thus i... | [
{
"answer_id": 81663,
"author": "INS",
"author_id": 13136,
"author_profile": "https://Stackoverflow.com/users/13136",
"pm_score": 0,
"selected": false,
"text": "<p>You could execute the blocking query in a different thread and never being bothered with the timeout. When some data arrives... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am using mysql++ in order to connect to a MySQL database to perform a bunch of data queries. Due to the fact that the tables I am reading from are constantly being written to, and that I need a consistent view of the data, I lock the tables first. However, MySQL has no concept of 'NOWAIT' in its lock query, thus if t... | You can implement a "cancel-like" behavior this way:
You execute the query on a separate thread, that keeps running whether or not the timeout occurs. The timeout occurs on the main thread, and sets a variable to "1" marking that it occurred. Then you do whatever you want to do on your main thread.
The query thread,... |
81,674 | <p>I am looking for an easy way to check if an object in C# is serializable.</p>
<p>As we know you make an object serializable by either implementing the <em>ISerializable</em> interface or by placing the <em>[Serializable]</em> at the top of the class.</p>
<p>What I am looking for is a quick way to check this withou... | [
{
"answer_id": 81705,
"author": "Grad van Horck",
"author_id": 12569,
"author_profile": "https://Stackoverflow.com/users/12569",
"pm_score": 3,
"selected": false,
"text": "<pre><code>Attribute.IsDefined(typeof (YourClass), typeof (SerializableAttribute));\n</code></pre>\n\n<p>Probably in... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231/"
] | I am looking for an easy way to check if an object in C# is serializable.
As we know you make an object serializable by either implementing the *ISerializable* interface or by placing the *[Serializable]* at the top of the class.
What I am looking for is a quick way to check this without having to reflect the class t... | You have a lovely property on the `Type` class called `IsSerializable`. |
81,686 | <p>We have a NET app that gets installed to the Program Files folder.
The app itself writes some files and creates some directories to its app folder.
But when a normal windows user tries to use our application it crashes because that user does not have permission to write to app folder.
Is there any folder in both Wi... | [
{
"answer_id": 81738,
"author": "RickL",
"author_id": 7261,
"author_profile": "https://Stackoverflow.com/users/7261",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not sure that there is a single path to which all non-administrator users have permission to write to.</p>\n\n<p>I think... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15528/"
] | We have a NET app that gets installed to the Program Files folder.
The app itself writes some files and creates some directories to its app folder.
But when a normal windows user tries to use our application it crashes because that user does not have permission to write to app folder.
Is there any folder in both WinXP... | There is no such folder.
But you can create one.
There is CSIDL\_COMMON\_APPDATA which in Vista maps to %ProgramData% (c:\ProgramData) and in XP maps to c:\Documents and Settings\AllUsers\Application Data
Feel free to create a folder there in your installer and set the ACL so that everyone can write to that folder.
... |
81,698 | <p>Are the any task tracking systems with command-line interface? </p>
<p>Here is a list of features I'm interested in:</p>
<ul>
<li>Simple task template<br>
Something like plain-text file with property:type pairs, for example:</li>
</ul>
<blockquote>
<pre><code>description:string
some-property:integer required
</... | [
{
"answer_id": 81758,
"author": "Peter Hilton",
"author_id": 2670,
"author_profile": "https://Stackoverflow.com/users/2670",
"pm_score": 3,
"selected": false,
"text": "<p>Interesting idea; the closest thing I have heard of is <a href=\"http://todotxt.com/\" rel=\"noreferrer\">todo.txt</a... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1196/"
] | Are the any task tracking systems with command-line interface?
Here is a list of features I'm interested in:
* Simple task template
Something like plain-text file with property:type pairs, for example:
>
>
> ```
> description:string
> some-property:integer required
>
> ```
>
>
* command line interface
... | >
> Ditz is a simple, light-weight distributed issue tracker designed to work
> with distributed version control systems like darcs and git.
>
>
>
Ditz: <http://web.archive.org/web/20121212202849/http://gitorious.org/ditz>
Also cloned here: <https://github.com/jashmenn/ditz> |
81,716 | <p>I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error:</p>
<p><strong>stdio.h : No such file or directory</strong></p>
<p>The code (hello.c) looks like this:</p>
<pre><code>#include < stdio.h >
void main()
{
printf("\nHello World\n");
}
</code></pre>
<... | [
{
"answer_id": 81731,
"author": "Leigh Caldwell",
"author_id": 3267,
"author_profile": "https://Stackoverflow.com/users/3267",
"pm_score": 4,
"selected": true,
"text": "<p>Try changing the first line to:</p>\n\n<pre><code>#include <stdio.h>\n</code></pre>\n\n<p>without the spaces. ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3565/"
] | I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error:
**stdio.h : No such file or directory**
The code (hello.c) looks like this:
```
#include < stdio.h >
void main()
{
printf("\nHello World\n");
}
```
I use a batch file to call gcc. The batch file looks like... | Try changing the first line to:
```
#include <stdio.h>
```
without the spaces. It is trying to look for a file called " stdio.h " with a space at the beginning and end. |
81,723 | <p>I have the concept of <code>NodeType</code>s and <code>Node</code>s. A <code>NodeType</code> is a bunch of meta-data which you can create <code>Node</code> instances from (a lot like the whole Class / Object relationship).</p>
<p>I have various <code>NodeType</code> implementations and various Node implementations.... | [
{
"answer_id": 81742,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 3,
"selected": true,
"text": "<p>You can just replace <code><T extends AbstractNode> T</code> with <code>AbstractNode</code> thanks to the magic of <... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666/"
] | I have the concept of `NodeType`s and `Node`s. A `NodeType` is a bunch of meta-data which you can create `Node` instances from (a lot like the whole Class / Object relationship).
I have various `NodeType` implementations and various Node implementations.
In my AbstractNodeType (top level for NodeTypes) I have ab abs... | You can just replace `<T extends AbstractNode> T` with `AbstractNode` thanks to the magic of [covariant returns](http://en.wikipedia.org/wiki/Covariant_return_type). `Java 5` added support, but it didn't receive the pub it deserved. |
81,730 | <p>In .NET, after this code, what mechanism stops the <code>Thread</code> object from being garbage collected?</p>
<pre><code>new Thread(Foo).Start();
GC.Collect();
</code></pre>
<p>Yes, it's safe to assume <strong>something</strong> has a reference to the thread, I was just wandering what exactly. For some reason Re... | [
{
"answer_id": 81739,
"author": "Jon",
"author_id": 12261,
"author_profile": "https://Stackoverflow.com/users/12261",
"pm_score": 0,
"selected": false,
"text": "<p>Well, it's safe to assume that if a thread is running somewhere that something has a reference to it so wouldn't that be eno... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | In .NET, after this code, what mechanism stops the `Thread` object from being garbage collected?
```
new Thread(Foo).Start();
GC.Collect();
```
Yes, it's safe to assume **something** has a reference to the thread, I was just wandering what exactly. For some reason Reflector doesn't show me `System.Threading`, so I c... | The runtime keeps a reference to the thread as long as it is running. The GC wont collect it as long as anyone still keeps that reference. |
81,768 | <p>I have a Yahoo map with lots of markers (~500). The map performs well enough until I close the page, at which point it pauses (in Firefox) and brings up a "Stop running this script?" dialog (in IE7). If given long enough the script does complete its work.</p>
<p>Is there anything I can do to reduce this delay?</p>
... | [
{
"answer_id": 83328,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 0,
"selected": false,
"text": "<p>You could try removing all the markers, or even removing the map from the DOM using the \"onbeforeunl... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4914/"
] | I have a Yahoo map with lots of markers (~500). The map performs well enough until I close the page, at which point it pauses (in Firefox) and brings up a "Stop running this script?" dialog (in IE7). If given long enough the script does complete its work.
Is there anything I can do to reduce this delay?
This stripped... | Use Javascript profiler and see which function is slow. Then you'll have better idea how to make a workaround or at least how to remove expensive cleanup (and let it leak in IE6). |
81,788 | <p>I couldn't find a decent ThreadPool implementation for Ruby, so I wrote mine (based partly on code from here: <a href="http://web.archive.org/web/20081204101031/http://snippets.dzone.com:80/posts/show/3276" rel="nofollow noreferrer">http://web.archive.org/web/20081204101031/http://snippets.dzone.com:80/posts/show/32... | [
{
"answer_id": 82034,
"author": "mweerden",
"author_id": 4285,
"author_profile": "https://Stackoverflow.com/users/4285",
"pm_score": 1,
"selected": false,
"text": "<p>I'm slightly biased here, but I would suggest modelling this in some process language and model check it. Freely availabl... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12695/"
] | I couldn't find a decent ThreadPool implementation for Ruby, so I wrote mine (based partly on code from here: <http://web.archive.org/web/20081204101031/http://snippets.dzone.com:80/posts/show/3276> , but changed to wait/signal and other implementation for ThreadPool shutdown. However after some time of running (having... | Ok, so the main problem with the implementation is: how to make sure no signal is lost and avoid dead locks ?
In my experience, this is REALLY hard to achieve with condition variables and mutex, but easy with semaphores. It so happens that ruby implement an object called Queue (or SizedQueue) that should solve the pro... |
81,870 | <p>For example:</p>
<pre><code>int a = 12;
cout << typeof(a) << endl;
</code></pre>
<p>Expected output:</p>
<pre><code>int
</code></pre>
| [
{
"answer_id": 81886,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 8,
"selected": false,
"text": "<p>Try:</p>\n\n<pre class=\"lang-cpp prettyprint-override\"><code>#include <typeinfo>\n\n// …\nstd::cout <<... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6508/"
] | For example:
```
int a = 12;
cout << typeof(a) << endl;
```
Expected output:
```
int
``` | C++11 update to a very old question: Print variable type in C++.
The accepted (and good) answer is to use `typeid(a).name()`, where `a` is a variable name.
Now in C++11 we have `decltype(x)`, which can turn an expression into a type. And `decltype()` comes with its own set of very interesting rules. For example `decl... |
81,896 | <p>I have a script that works fine on my test server (using IIS6). The script processes an ajax request and sends a response with the following line:</p>
<pre><code>header( 'application/javascript' );
</code></pre>
<p>But on my live server, this line crashes the page and causes a 500 error.</p>
<p>Do I need to allow... | [
{
"answer_id": 81940,
"author": "Sietse",
"author_id": 6400,
"author_profile": "https://Stackoverflow.com/users/6400",
"pm_score": 8,
"selected": true,
"text": "<p>The header is incorrect, try this instead:</p>\n\n<pre><code>header('Content-Type: application/javascript');\n</code></pre>\... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15567/"
] | I have a script that works fine on my test server (using IIS6). The script processes an ajax request and sends a response with the following line:
```
header( 'application/javascript' );
```
But on my live server, this line crashes the page and causes a 500 error.
Do I need to allow PHP to send different MIME types... | The header is incorrect, try this instead:
```
header('Content-Type: application/javascript');
``` |
81,905 | <p>I have a table in my database the records start and stop times for a specific task. Here is a sample of the data:</p>
<pre><code>Start Stop
9/15/2008 5:59:46 PM 9/15/2008 6:26:28 PM
9/15/2008 6:30:45 PM 9/15/2008 6:40:49 PM
9/16/2008 8:30:45 PM 9/15/2008 9:20:29 PM
9/16/2... | [
{
"answer_id": 81928,
"author": "Paul van Brenk",
"author_id": 1837197,
"author_profile": "https://Stackoverflow.com/users/1837197",
"pm_score": 0,
"selected": false,
"text": "<p>The <a href=\"http://msdn.microsoft.com/en-us/library/ms189794.aspx\" rel=\"nofollow noreferrer\">datediff fu... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768/"
] | I have a table in my database the records start and stop times for a specific task. Here is a sample of the data:
```
Start Stop
9/15/2008 5:59:46 PM 9/15/2008 6:26:28 PM
9/15/2008 6:30:45 PM 9/15/2008 6:40:49 PM
9/16/2008 8:30:45 PM 9/15/2008 9:20:29 PM
9/16/2008 12:30:45 PM... | ```
SELECT SUM( CASE WHEN Stop = '31 dec 9999'
THEN DateDiff(mi, Start, Stop)
ELSE DateDiff(mi, Start, GetDate())
END ) AS TotalMinutes
FROM task
```
However, a better solution would be to make the `Stop field nullable, and make it null when the task is still ... |
81,934 | <p>I need a way to easily export and then import data in a MySQL table from a remote server to my home server. I don't have direct access to the server, and no utilities such as phpMyAdmin are installed. I do, however, have the ability to put PHP scripts on the server.</p>
<p>How do I get at the data?</p>
<p><em>I as... | [
{
"answer_id": 81951,
"author": "Jrgns",
"author_id": 6681,
"author_profile": "https://Stackoverflow.com/users/6681",
"pm_score": 4,
"selected": false,
"text": "<p>I did it by exporting to CSV, and then importing with whatever utility is available. I quite like the use of the php://outpu... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6681/"
] | I need a way to easily export and then import data in a MySQL table from a remote server to my home server. I don't have direct access to the server, and no utilities such as phpMyAdmin are installed. I do, however, have the ability to put PHP scripts on the server.
How do I get at the data?
*I ask this question pure... | You could use SQL for this:
```
$file = 'backups/mytable.sql';
$result = mysql_query("SELECT * INTO OUTFILE '$file' FROM `##table##`");
```
Then just point a browser or FTP client at the directory/file (backups/mytable.sql). This is also a nice way to do incremental backups, given the filename a timestamp for exampl... |
81,972 | <p>The question I want to ask is thus:</p>
<p>Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available?</p>
<p>Now, the example of why I think it can be used for good.</p>
<p... | [
{
"answer_id": 81990,
"author": "petr k.",
"author_id": 15497,
"author_profile": "https://Stackoverflow.com/users/15497",
"pm_score": 2,
"selected": false,
"text": "<p>You really should not access any derived classes from the base class as it pretty much breaks the idea of OOP. Readibili... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15537/"
] | The question I want to ask is thus:
Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available?
Now, the example of why I think it can be used for good.
I recently implemented ... | I think I would make the this[int] and this[string] accessors virtual and override them in BList/BDictionary. Classes where the accessors does not make sense should cast a NotSupportedException() (perhaps by having a default implementation in BItem).
That makes your code work in the same way and gives you a more reada... |
82,003 | <p>I have a remote DB2 database that I'm accessing through ODBC. When I have a query like</p>
<pre><code>SELECT t.foo, t.bar, t.problemcolumn
FROM problemtable t
WHERE t.bar < 60;
</code></pre>
<p>it works like a charm, so the table and columns obviously exist.</p>
<p>But if I specify the problem column in the WH... | [
{
"answer_id": 82070,
"author": "Per Hornshøj-Schierbeck",
"author_id": 11619,
"author_profile": "https://Stackoverflow.com/users/11619",
"pm_score": 2,
"selected": false,
"text": "<p>Sorry for the obvious answer, but does the problemtable exist? Your code looks like pseudo code because ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2087/"
] | I have a remote DB2 database that I'm accessing through ODBC. When I have a query like
```
SELECT t.foo, t.bar, t.problemcolumn
FROM problemtable t
WHERE t.bar < 60;
```
it works like a charm, so the table and columns obviously exist.
But if I specify the problem column in the WHERE clause
```
SELECT t.foo, t.bar,... | Sorry for the obvious answer, but does the problemtable exist? Your code looks like pseudo code because of the table/column names, but be sure to double check your spelling. It's not a view which might even consist of joined tables across different databases/servers? |
82,008 | <p>I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?</p>
<p>E.g.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<xml>
<value>受</value>
</xml>
</code></pre>
<p>to</p>
<pre><code><?xml version="1.0" encodin... | [
{
"answer_id": 82021,
"author": "Blair Conrad",
"author_id": 1199,
"author_profile": "https://Stackoverflow.com/users/1199",
"pm_score": 2,
"selected": false,
"text": "<p>If I understand the question, then yes. You just need a <code>;</code> after the <code>27544</code>:</p>\n\n<pre><cod... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9539/"
] | I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?
E.g.
```
<?xml version="1.0" encoding="utf-8"?>
<xml>
<value>受</value>
</xml>
```
to
```
<?xml version="1.0" encoding="Windows-1252"?>
<xml>
<value>殘</value>
</xml>
```
I deserialize t... | Okay I tested it with the following code:
```
string xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml><value>受</value></xml>";
XmlWriterSettings settings = new XmlWriterSettings { Encoding = Encoding.Default };
MemoryStream ms = new MemoryStream();
using (XmlWriter writer = XmlTextWriter.Create(ms, settings)... |
82,047 | <p>I have a requirement to validate an incoming file against an XSD. Both will be on the server file system.<br /></p>
<p>I've looked at <code>dbms_xmlschema</code>, but have had issues getting it to work.</p>
<p>Could it be easier to do it with some Java?<br />What's the simplest class I could put in the database?</... | [
{
"answer_id": 83488,
"author": "Adam Hawkes",
"author_id": 6703,
"author_profile": "https://Stackoverflow.com/users/6703",
"pm_score": -1,
"selected": false,
"text": "<p>If I remember correctly, that error message is given when XDB (Oracle's XML DataBase package) is not properly install... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1895/"
] | I have a requirement to validate an incoming file against an XSD. Both will be on the server file system.
I've looked at `dbms_xmlschema`, but have had issues getting it to work.
Could it be easier to do it with some Java?
What's the simplest class I could put in the database?
Here's a simple example:
```
DECLA... | **Update**
XML Schema registration requires following privileges:
```
grant alter session to <USER>;
grant create type to <USER>; /* required when gentypes => true */
grant create table to <USER>; /* required when gentables => true */
```
For some reason it's not enough if those privileges are granted indirectly vi... |
82,058 | <p>Given the following JSON Date representation:</p>
<pre><code>"\/Date(1221644506800-0700)\/"
</code></pre>
<p>How do you deserialize this into it's JavaScript Date-type form?</p>
<p>I've tried using MS AJAX JavaScrioptSerializer as shown below:</p>
<pre><code>Sys.Serialization.JavaScriptSerializer.deserialize("\/... | [
{
"answer_id": 82244,
"author": "Daniel",
"author_id": 6852,
"author_profile": "https://Stackoverflow.com/users/6852",
"pm_score": 1,
"selected": false,
"text": "<p>The big number is the standard JS time</p>\n\n<pre><code>new Date(1221644506800)\n</code></pre>\n\n<p>Wed Sep 17 2008 19:41... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9275/"
] | Given the following JSON Date representation:
```
"\/Date(1221644506800-0700)\/"
```
How do you deserialize this into it's JavaScript Date-type form?
I've tried using MS AJAX JavaScrioptSerializer as shown below:
```
Sys.Serialization.JavaScriptSerializer.deserialize("\/Date(1221644506800-0700)\/")
```
However, ... | Provided you know the string is definitely a date I prefer to do this :
```
new Date(parseInt(value.replace("/Date(", "").replace(")/",""), 10))
``` |
82,064 | <p>I have a version number of the following form:</p>
<p>version.release.modification</p>
<p>where version, release and modification are either a set of digits or the '*' wildcard character. Additionally, any of these numbers (and any preceding .) may be missing.</p>
<p>So the following are valid and parse as:</p>
... | [
{
"answer_id": 82104,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 4,
"selected": false,
"text": "<p>This might work:</p>\n\n<pre><code>^(\\*|\\d+(\\.\\d+){0,2}(\\.\\*)?)$\n</code></pre>\n\n<p>At the top level, \"*\" is ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7271/"
] | I have a version number of the following form:
version.release.modification
where version, release and modification are either a set of digits or the '\*' wildcard character. Additionally, any of these numbers (and any preceding .) may be missing.
So the following are valid and parse as:
```
1.23.456 = version 1, r... | I'd express the format as:
>
> "1-3 dot-separated components, each numeric except that the last one may be \*"
>
>
>
As a regexp, that's:
```
^(\d+\.)?(\d+\.)?(\*|\d+)$
```
[Edit to add: this solution is a concise way to validate, but it has been pointed out that extracting the values requires extra work. It's... |
82,074 | <p>In a digital signal acquisition system, often data is pushed into an observer in the system by one thread. </p>
<p>example from <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow noreferrer">Wikipedia/Observer_pattern</a>:</p>
<pre><code>foreach (IObserver observer in observers)
observer.Up... | [
{
"answer_id": 82116,
"author": "Skizz",
"author_id": 1898,
"author_profile": "https://Stackoverflow.com/users/1898",
"pm_score": 0,
"selected": false,
"text": "<p>You could send a message to all observers informing them the data source is terminating and let the observers remove themsel... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6610/"
] | In a digital signal acquisition system, often data is pushed into an observer in the system by one thread.
example from [Wikipedia/Observer\_pattern](http://en.wikipedia.org/wiki/Observer_pattern):
```
foreach (IObserver observer in observers)
observer.Update(message);
```
When e.g. a user action from e.g. a G... | If you want to have the data source to always be on the safe side of concurrency, you should have at least one pointer that is always safe for him to use.
So the Observer object should have a lifetime that isn't ended before that of the data source.
This can be done by only adding Observers, but never removing them. ... |
82,109 | <p>I am using Java 1.4 with Log4J. </p>
<p>Some of my code involves serializing and deserializing value objects (POJOs). </p>
<p>Each of my POJOs declares a logger with</p>
<pre><code>private final Logger log = Logger.getLogger(getClass());
</code></pre>
<p>The serializer complains of org.apache.log4j.Logger not be... | [
{
"answer_id": 82130,
"author": "mindas",
"author_id": 7345,
"author_profile": "https://Stackoverflow.com/users/7345",
"pm_score": 4,
"selected": false,
"text": "<p>The logger must be static; this would make it non-serializable.</p>\n\n<p>There's no reason to make logger non-static, unle... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15452/"
] | I am using Java 1.4 with Log4J.
Some of my code involves serializing and deserializing value objects (POJOs).
Each of my POJOs declares a logger with
```
private final Logger log = Logger.getLogger(getClass());
```
The serializer complains of org.apache.log4j.Logger not being Serializable.
Should I use
```
pri... | How about using a static logger? Or do you need a different logger reference for each instance of the class? Static fields are not serialized by default; you can explicitly declare fields to serialize with a private, static, final array of `ObjectStreamField` named `serialPersistentFields`. [See Oracle documentation](h... |
82,123 | <p>I'm new to BIRT and I'm trying to make the Report Engine running. I'm using the code snippets provided in <a href="http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php" rel="nofollow noreferrer">http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php</a></p>
<p>But I have a strange exception:</p>
... | [
{
"answer_id": 82229,
"author": "cH1cK3n",
"author_id": 15615,
"author_profile": "https://Stackoverflow.com/users/15615",
"pm_score": 2,
"selected": false,
"text": "<p>I had the same mistake a couple of month ago. I'm not quite sure what actually fixed it but my code looks like the follo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446104/"
] | I'm new to BIRT and I'm trying to make the Report Engine running. I'm using the code snippets provided in <http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php>
But I have a strange exception:
>
> java.lang.AssertionError
> at org.eclipse.birt.core.framework.Platform.startup(Platform.java:86)
>
>
>
an... | Just a thought, but I wonder if your use of a forward slash when setting the logger is causing a problem? instead of
```
config.setLogConfig("d:/temp", Level.FINEST);
```
you should use
```
config.setLogConfig("/temp", Level.FINEST);
```
or
```
config.setLogConfig("d:\\temp", Level.FINEST);
```
Finally, I ... |
82,191 | <p>I'm creating a plugin, and am looking to use RSpec so I can build it using BDD. </p>
<p>Is there a recommended method of doing this?</p>
| [
{
"answer_id": 82680,
"author": "Dan Harper",
"author_id": 14530,
"author_profile": "https://Stackoverflow.com/users/14530",
"pm_score": 0,
"selected": false,
"text": "<p>For an example of an existing plugin that uses rspec, check out the <a href=\"http://github.com/technoweenie/restful... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12037/"
] | I'm creating a plugin, and am looking to use RSpec so I can build it using BDD.
Is there a recommended method of doing this? | OK, I think I have a solution:
* Generate the plugin via script/generate plugin
* change the Rakefile, and add
`require 'spec/rake/spectask'`
```
desc 'Test the PLUGIN_NAME plugin.'
Spec::Rake::SpecTask.new(:spec) do |t|
t.libs << 'lib'
t.verbose = true
end
```
* Create a spec directory, and begin adding specs... |
82,214 | <p>In the early days of SharePoint 2007 beta, I've come across the ability to customize the template used to emit the RSS feeds from lists. I can't find it again. Anybody know where it is?</p>
| [
{
"answer_id": 82680,
"author": "Dan Harper",
"author_id": 14530,
"author_profile": "https://Stackoverflow.com/users/14530",
"pm_score": 0,
"selected": false,
"text": "<p>For an example of an existing plugin that uses rspec, check out the <a href=\"http://github.com/technoweenie/restful... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1533/"
] | In the early days of SharePoint 2007 beta, I've come across the ability to customize the template used to emit the RSS feeds from lists. I can't find it again. Anybody know where it is? | OK, I think I have a solution:
* Generate the plugin via script/generate plugin
* change the Rakefile, and add
`require 'spec/rake/spectask'`
```
desc 'Test the PLUGIN_NAME plugin.'
Spec::Rake::SpecTask.new(:spec) do |t|
t.libs << 'lib'
t.verbose = true
end
```
* Create a spec directory, and begin adding specs... |
82,235 | <p>I'm experiencing the following very annoying behaviour when using JPA entitys in conjunction with Oracle 10g. </p>
<p>Suppose you have the following entity.</p>
<pre><code>@Entity
@Table(name = "T_Order")
public class TOrder implements Serializable {
private static final long serialVersionUID = 223574230237717... | [
{
"answer_id": 82416,
"author": "Jeroen Wyseur",
"author_id": 15490,
"author_profile": "https://Stackoverflow.com/users/15490",
"pm_score": 0,
"selected": false,
"text": "<p>I already had my share of problems with JPA and timestamps. I've been reading in the <a href=\"http://forums.oracl... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15657/"
] | I'm experiencing the following very annoying behaviour when using JPA entitys in conjunction with Oracle 10g.
Suppose you have the following entity.
```
@Entity
@Table(name = "T_Order")
public class TOrder implements Serializable {
private static final long serialVersionUID = 2235742302377173533L;
@Id
@... | You should not use a Calendar for accessing dates from the database, for this exact reason. You should use `java.util.Date` as so:
```
@Temporal(TemporalType.TIMESTAMP)
@Column(name="activationDate")
public Date getActivationDate() {
return this.activationDate;
}
```
`java.util.Date` points to a moment in time, ... |
82,256 | <p>I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.</p>
<p>The trouble is, this contrived example doesn't work:</p>
<pre><code>sudo ls -hal /root/ > /root/test.out
</code><... | [
{
"answer_id": 82274,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>How about writing a script?</p>\n\n<p>Filename: myscript</p>\n\n<pre><code>#!/bin/sh\n\n/bin/ls -lah /root > /root/test.o... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6910/"
] | I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.
The trouble is, this contrived example doesn't work:
```
sudo ls -hal /root/ > /root/test.out
```
I just receive the respons... | Your command does not work because the redirection is performed by your shell which does not have the permission to write to `/root/test.out`. The redirection of the output **is not** performed by sudo.
There are multiple solutions:
* Run a shell with sudo and give the command to it by using the `-c` option:
```
sud... |
82,268 | <p>I have to deal with text files in a motley selection of formats. Here's an example (Columns <strong>A</strong> and <strong>B</strong> are tab delimited):</p>
<pre><code>A B
a Name1=Val1, Name2=Val2, Name3=Val3
b Name1=Val4, Name3=Val5
c Name1=Val6, Name2=Val7, Name3=Val8
</code></pre>
<p>The files could ha... | [
{
"answer_id": 82282,
"author": "auramo",
"author_id": 4110,
"author_profile": "https://Stackoverflow.com/users/4110",
"pm_score": 1,
"selected": false,
"text": "<p>You have all the basic bash shell commands, for example grep, cut, sed and awk at your disposal. You can also use Perl or R... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6387/"
] | I have to deal with text files in a motley selection of formats. Here's an example (Columns **A** and **B** are tab delimited):
```
A B
a Name1=Val1, Name2=Val2, Name3=Val3
b Name1=Val4, Name3=Val5
c Name1=Val6, Name2=Val7, Name3=Val8
```
The files could have headers or not, have mixed delimiting schemes, ha... | I don't like sed too much, but it works for such things:
```
var="Name2";sed -n "1p;s/\([^ ]*\) .*$var=\([^ ,]*\).*/\1 \2/p" < filename
```
Gives you:
```
A B
a Val2
c Val7
``` |
82,319 | <p>In the uncompressed situation I know I need to read the wav header, pull out the number of channels, bits, and sample rate and work it out from there:
(channels) * (bits) * (samples/s) * (seconds) = (filesize)</p>
<p>Is there a simpler way - a free library, or something in the .net framework perhaps?</p>
<p>How wo... | [
{
"answer_id": 82344,
"author": "xan",
"author_id": 15667,
"author_profile": "https://Stackoverflow.com/users/15667",
"pm_score": 1,
"selected": false,
"text": "<p>You might find that the <a href=\"http://msdn.microsoft.com/en-us/xna/default.aspx\" rel=\"nofollow noreferrer\">XNA library... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | In the uncompressed situation I know I need to read the wav header, pull out the number of channels, bits, and sample rate and work it out from there:
(channels) \* (bits) \* (samples/s) \* (seconds) = (filesize)
Is there a simpler way - a free library, or something in the .net framework perhaps?
How would I do this ... | You may consider using the mciSendString(...) function (error checking is omitted for clarity):
```
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace Sound
{
public static class SoundInfo
{
[DllImport("winmm.dll")]
private static extern uint mciSendString(
... |
82,323 | <p>I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page <code>Width</code> (or <code>ActualWidth</code>) and I would prefer to do this in XAML if possible.</p>
<p>This is some sample XAML to play with in XamlP... | [
{
"answer_id": 85173,
"author": "Thomas",
"author_id": 9970,
"author_profile": "https://Stackoverflow.com/users/9970",
"pm_score": 0,
"selected": false,
"text": "<p>Too lazy to actually write it up myself, but you should be able to use a mathematical converter and bind to your parent win... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6415/"
] | I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page `Width` (or `ActualWidth`) and I would prefer to do this in XAML if possible.
This is some sample XAML to play with in XamlPad (or similar) which shows what... | I think the XAML-only approach is somewhat circuitous, but here is a way to do it.
```
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<!-- This contains our real grid, ... |
82,332 | <p>I am using C# to process a message in my Outlook inbox that contains attachments. One of the attachments is of type olEmbeddeditem. I need to be able to process the contents of that attachment. From what I can tell I need to save the attachment to disk and use CreateItemFromTemplate which would return an object. ... | [
{
"answer_id": 96403,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>I found the following code on Google Groups for determining the type of an Outlook object:</p>\n\n<pre><code>Type t = SomeOu... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8391/"
] | I am using C# to process a message in my Outlook inbox that contains attachments. One of the attachments is of type olEmbeddeditem. I need to be able to process the contents of that attachment. From what I can tell I need to save the attachment to disk and use CreateItemFromTemplate which would return an object.
The ... | I found the following code on Google Groups for determining the type of an Outlook object:
```
Type t = SomeOutlookObject.GetType();
string messageClass = t.InvokeMember("MessageClass",
BindingFlags.Public |
BindingFlags.GetField |
BindingFlags.GetProperty,
null,
SomeOutlookObject,
new object[]{}).ToStri... |
82,359 | <p>I've just inherited some old Struts code.</p>
<p>If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ?</p>
<p>So far, I've seen the Action classes push variables in <code>(1)</code> the HTTP request with</p>
<pre><code>request.setAttribute("name", user... | [
{
"answer_id": 82512,
"author": "Arno",
"author_id": 13685,
"author_profile": "https://Stackoverflow.com/users/13685",
"pm_score": 1,
"selected": false,
"text": "<p>My Struts days are long over, but as far as I remember we used to place one view-specific bean (which would work as a holde... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15649/"
] | I've just inherited some old Struts code.
If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ?
So far, I've seen the Action classes push variables in `(1)` the HTTP request with
```
request.setAttribute("name", user.getName())
```
`(2)` in ActionForm c... | As `Struts 1.3` is considered old-school, I'd recommend to go with the flow and use the style that already is used throughout the application you inherited.
If all different styles are already used, pick the most used one. After that, pick your personal favourite. Mine would be 1 or 3 - the form (2) is usually best su... |
82,380 | <p>I need to do a multilingual website, with urls like</p>
<pre><code>www.domain.com/en/home.aspx for english
www.domain.com/es/home.aspx for spanish
</code></pre>
<p>In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL</p>
<p... | [
{
"answer_id": 82590,
"author": "thomasb",
"author_id": 6776,
"author_profile": "https://Stackoverflow.com/users/6776",
"pm_score": 0,
"selected": false,
"text": "<p>I personnaly use <a href=\"http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx\" rel=\"nofollow noreferrer\">the resourc... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2385/"
] | I need to do a multilingual website, with urls like
```
www.domain.com/en/home.aspx for english
www.domain.com/es/home.aspx for spanish
```
In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL
```
Sub Application_BeginRequest... | I decided to go with the new ASP.net Routing.
Why not urlRewriting? Because I don't want to change the clean URL that routing gives to you.
Here is the code:
```
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
RegisterRoutes(RouteTable.Routes)
End... |
82,404 | <p>Given the problem that a stored procedure on SQL Server 2005, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time:</p>
<p>edit: I'd remove the cursor if I could, unfortunatly, I have to be doing a bunch of processing and ru... | [
{
"answer_id": 82780,
"author": "baldy",
"author_id": 2012,
"author_profile": "https://Stackoverflow.com/users/2012",
"pm_score": 1,
"selected": false,
"text": "<p>I'm not sure if that would solve the problem. IMHO the performance problem with cursors is around the amount of memory you ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9610/"
] | Given the problem that a stored procedure on SQL Server 2005, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time:
edit: I'd remove the cursor if I could, unfortunatly, I have to be doing a bunch of processing and running othe... | Putting the WAITFOR inside the loop would indeed slow it down and allow other things to go faster. You might also consider a WHILE loop instead of a cursor - in my experience it runs faster. You might also consider moving your cursor to a fast-forward, read-only cursor - that can limit how much memory it takes up.
```... |
82,409 | <p>If I have a table in my database called 'Users', there will be a class generated by LINQtoSQL called 'User' with an already declared empty constructor.</p>
<p>What is the best practice if I want to override this constructor and add my own logic to it?</p>
| [
{
"answer_id": 82470,
"author": "Yaakov Ellis",
"author_id": 51,
"author_profile": "https://Stackoverflow.com/users/51",
"pm_score": 2,
"selected": false,
"text": "<p>It doesn't look like you can override the empty constructor. Instead, I would create a method that performs the functiona... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15717/"
] | If I have a table in my database called 'Users', there will be a class generated by LINQtoSQL called 'User' with an already declared empty constructor.
What is the best practice if I want to override this constructor and add my own logic to it? | The default constructor which is generated by the O/R-Designer, calls a partial function called `OnCreated` - so the best practice is not to override the default constructor, but instead implement the partial function `OnCreated` in `MyDataClasses.cs` to initialize items:
```
partial void OnCreated()
{
Name = "";
}
... |
82,417 | <p>Is it possible to hide or exclude certain data from a report if it's being rendered in a particular format (csv, xml, excel, pdf, html).
The problem is that I want hyperlinks to other reports to not be rendered when the report is generated in Excel format - but they should be there when the report is rendered in HTM... | [
{
"answer_id": 82835,
"author": "Bob Dizzle",
"author_id": 9581,
"author_profile": "https://Stackoverflow.com/users/9581",
"pm_score": 0,
"selected": false,
"text": "<p>I don't think this is possible in the 2000 version, but might be in later versions.</p>\n\n<p>If I remember right, we e... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15428/"
] | Is it possible to hide or exclude certain data from a report if it's being rendered in a particular format (csv, xml, excel, pdf, html).
The problem is that I want hyperlinks to other reports to not be rendered when the report is generated in Excel format - but they should be there when the report is rendered in HTML f... | The way I did this w/SSRS 2005 for a web app using the ReportViewer control is I had a hidden boolean report parameter which was used in the report decide if to render text as hyperlinks or not.
Then the trick was how to send that parameter value depending on the rendering format. The way I did that was by disabling t... |
82,437 | <p>Why is the following C# code not allowed:</p>
<pre><code>public abstract class BaseClass
{
public abstract int Bar { get;}
}
public class ConcreteClass : BaseClass
{
public override int Bar
{
get { return 0; }
set {}
}
}
</code></pre>
<blockquote>
<p>CS0546 'ConcreteClass.Bar.set... | [
{
"answer_id": 82464,
"author": "Ishmaeel",
"author_id": 227,
"author_profile": "https://Stackoverflow.com/users/227",
"pm_score": -1,
"selected": false,
"text": "<p>Because at the IL level, a read/write property translates into two (getter and setter) methods.</p>\n\n<p>When overriding,... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Why is the following C# code not allowed:
```
public abstract class BaseClass
{
public abstract int Bar { get;}
}
public class ConcreteClass : BaseClass
{
public override int Bar
{
get { return 0; }
set {}
}
}
```
>
> CS0546 'ConcreteClass.Bar.set': cannot override because 'BaseClas... | Because the writer of Baseclass has explicitly declared that Bar has to be a read-only property. It doesn't make sense for derivations to break this contract and make it read-write.
I'm with Microsoft on this one.
Let's say I'm a new programmer who has been told to code against the Baseclass derivation. i write som... |
82,442 | <p>Inspired by the MVC storefront the latest project I'm working on is using extension methods on IQueryable to filter results.</p>
<p>I have this interface;</p>
<pre><code>IPrimaryKey
{
int ID { get; }
}
</code></pre>
<p>and I have this extension method</p>
<pre><code>public static IPrimaryKey GetByID(this IQuer... | [
{
"answer_id": 82463,
"author": "Garry Shutler",
"author_id": 6369,
"author_profile": "https://Stackoverflow.com/users/6369",
"pm_score": 2,
"selected": false,
"text": "<p>This cannot work due to the fact that generics don't have the ability to follow inheritance patterns. ie. IQueryable... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15691/"
] | Inspired by the MVC storefront the latest project I'm working on is using extension methods on IQueryable to filter results.
I have this interface;
```
IPrimaryKey
{
int ID { get; }
}
```
and I have this extension method
```
public static IPrimaryKey GetByID(this IQueryable<IPrimaryKey> source, int id)
{
ret... | It works, when done right. cfeduke's solution works. However, you don't have to make the `IPrimaryKey` interface generic, in fact, you don't have to change your original definition at all:
```
public static IPrimaryKey GetByID<T>(this IQueryable<T> source, int id) where T : IPrimaryKey
{
return source(obj => obj.I... |
82,483 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/219594/net-whats-the-best-way-to-implement-a-catch-all-exceptions-handler">.NET - What’s the best way to implement a “catch all exceptions handler”</a> </p>
</blockquote>
<p>I have a .NET console app app that i... | [
{
"answer_id": 82508,
"author": "Juanma",
"author_id": 3730,
"author_profile": "https://Stackoverflow.com/users/3730",
"pm_score": 5,
"selected": false,
"text": "<p>You can add an event handler to AppDomain.UnhandledException event, and it'll be called when a exception is thrown and not ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7442/"
] | >
> **Possible Duplicate:**
>
> [.NET - What’s the best way to implement a “catch all exceptions handler”](https://stackoverflow.com/questions/219594/net-whats-the-best-way-to-implement-a-catch-all-exceptions-handler)
>
>
>
I have a .NET console app app that is crashing and displaying a message to the user.
A... | Contrary to what some others have posted, there's nothing wrong catching all exceptions. The important thing is to handle them all appropriately. If you have a stack overflow or out of memory condition, the app should shut down for them. Also, keep in mind that OOM conditions can prevent your exception handler from run... |
82,530 | <p>I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).<br>
When I use svn up for url like 'http://.....' everything is cool (google chrome repository works perfect), but right now I need to svn up from server with 'svn://....' and I see connection refused.<br>
I've set proxy confi... | [
{
"answer_id": 82547,
"author": "Cetra",
"author_id": 15087,
"author_profile": "https://Stackoverflow.com/users/15087",
"pm_score": 0,
"selected": false,
"text": "<p>when you use the svn:// URI it uses port 3690 and probably won't use http proxy</p>\n"
},
{
"answer_id": 82576,
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15752/"
] | I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).
When I use svn up for url like 'http://.....' everything is cool (google chrome repository works perfect), but right now I need to svn up from server with 'svn://....' and I see connection refused.
I've set proxy configurat... | In `/etc/subversion/servers` you are setting `http-proxy-host`, which has nothing to do with `svn://` which connects to a different server usually running on port 3690 started by `svnserve` command.
If you have access to the server, you can setup `svn+ssh://` as [explained here.](http://svnbook.red-bean.com/en/1.0/ch0... |
82,550 | <p>I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this:</p>
<pre><code>namespace boost {
namespace serialization {
template< typename T, typename U >
struct version<... | [
{
"answer_id": 83616,
"author": "James Hopkin",
"author_id": 11828,
"author_profile": "https://Stackoverflow.com/users/11828",
"pm_score": 5,
"selected": true,
"text": "<pre><code>#include <boost/serialization/version.hpp>\n</code></pre>\n\n<p>:-)</p>\n"
},
{
"answer_id": 3... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14443/"
] | I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST\_CLASS\_VERSION does not work for template classes. I tried this:
```
namespace boost {
namespace serialization {
template< typename T, typename U >
struct version< C<T,U> >
{
... | ```
#include <boost/serialization/version.hpp>
```
:-) |
82,607 | <p>I get DNS records from a Python program, using <a href="http://www.dnspython.org/" rel="nofollow noreferrer">DNS
Python</a></p>
<p>I can get various DNSSEC-related records:</p>
<pre><code>>>> import dns.resolver
>>> myresolver = dns.resolver.Resolver()
>>> myresolver.use_edns(1, 0, 1400)... | [
{
"answer_id": 82868,
"author": "Cetra",
"author_id": 15087,
"author_profile": "https://Stackoverflow.com/users/15087",
"pm_score": 0,
"selected": false,
"text": "<p>If you try this, what happens?</p>\n\n<pre><code>print myresolver.query('sources.org', 'ANY', 'RRSIG')\n</code></pre>\n"
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15625/"
] | I get DNS records from a Python program, using [DNS
Python](http://www.dnspython.org/)
I can get various DNSSEC-related records:
```
>>> import dns.resolver
>>> myresolver = dns.resolver.Resolver()
>>> myresolver.use_edns(1, 0, 1400)
>>> print myresolver.query('sources.org', 'DNSKEY')
<dns.resolver.Answer object at 0... | You probably mean RRSIG ANY (otherwise, the order is wrong, the class needs to be after the type)
```
>>> print myresolver.query('sources.org', 'RRSIG', 'ANY')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/dns/resolver.py", line 664, in query
answ... |
82,612 | <p>How can I figure out, how many files needs to be recompiled <em>before</em> I start the build process.</p>
<p>Sometimes I don't remember how many basic header files I changed so a Rebuild All would be better than a simple build. There seams to be no option for this, but IMHO it must be possible (f.e. XCode give me ... | [
{
"answer_id": 82868,
"author": "Cetra",
"author_id": 15087,
"author_profile": "https://Stackoverflow.com/users/15087",
"pm_score": 0,
"selected": false,
"text": "<p>If you try this, what happens?</p>\n\n<pre><code>print myresolver.query('sources.org', 'ANY', 'RRSIG')\n</code></pre>\n"
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15757/"
] | How can I figure out, how many files needs to be recompiled *before* I start the build process.
Sometimes I don't remember how many basic header files I changed so a Rebuild All would be better than a simple build. There seams to be no option for this, but IMHO it must be possible (f.e. XCode give me this information)... | You probably mean RRSIG ANY (otherwise, the order is wrong, the class needs to be after the type)
```
>>> print myresolver.query('sources.org', 'RRSIG', 'ANY')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/dns/resolver.py", line 664, in query
answ... |
82,661 | <p>I want to clear the list of projects on the start page...how do I do this? I know I can track it down in the registry, but is there an approved route to go?</p>
| [
{
"answer_id": 82705,
"author": "Charles Anderson",
"author_id": 11677,
"author_profile": "https://Stackoverflow.com/users/11677",
"pm_score": 3,
"selected": false,
"text": "<p>If you try opening up a project that can no longer be found, Visual Studio will prompt you for permission to re... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15778/"
] | I want to clear the list of projects on the start page...how do I do this? I know I can track it down in the registry, but is there an approved route to go? | There is an MSDN article [here](http://msdn.microsoft.com/en-us/library/aa991991.aspx) which suggests that you just move the projects to a new directory.
However, as you mentioned, the list of projects is kept in the registry under this key:
```
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\ProjectMRULi... |
82,721 | <p>In a SQL server database, I have a table which contains a TEXT field which is set to allow NULLs. I need to change this to not allow NULLs. I can do this no problem via Enterprise Manager, but when I try to run the following script, <strong>alter table dbo.[EventLog] Alter column [Message] text Not null</strong>, I ... | [
{
"answer_id": 82748,
"author": "Seb Rose",
"author_id": 12405,
"author_profile": "https://Stackoverflow.com/users/12405",
"pm_score": 2,
"selected": false,
"text": "<p>Create a new field. Copy the data across. Drop the old field. Rename the new field.</p>\n"
},
{
"answer_id": 82... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585/"
] | In a SQL server database, I have a table which contains a TEXT field which is set to allow NULLs. I need to change this to not allow NULLs. I can do this no problem via Enterprise Manager, but when I try to run the following script, **alter table dbo.[EventLog] Alter column [Message] text Not null**, I get an error:
*... | You can use Enterprise Manager to create your script. Right click on the table in EM and select Design. Uncheck the Allow Nulls column for the Text field. Instead of hitting the regular save icon (the floppy), click an icon that looks like a golden scroll with a tiny floppy or just do Table Designer > Generate Change S... |
82,788 | <p>I have an issue that is driving me a bit nuts: Using a UserProfileManager as an non-authorized user.</p>
<p>The problem: The user does not have "Manage User Profiles" rights, but I still want to use the UserProfileManager. The idea of using SPSecurity.RunWithElevatedPrivileges does not seem to work, as the UserProf... | [
{
"answer_id": 83102,
"author": "senfo",
"author_id": 10792,
"author_profile": "https://Stackoverflow.com/users/10792",
"pm_score": 3,
"selected": true,
"text": "<p>The permission that needs set is actually found in the Shared Service Provider.</p>\n\n<ol>\n<li>Navigate to Central Admin<... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91/"
] | I have an issue that is driving me a bit nuts: Using a UserProfileManager as an non-authorized user.
The problem: The user does not have "Manage User Profiles" rights, but I still want to use the UserProfileManager. The idea of using SPSecurity.RunWithElevatedPrivileges does not seem to work, as the UserProfileManager... | The permission that needs set is actually found in the Shared Service Provider.
1. Navigate to Central Admin
2. Navigate to the Shared Service Provider
3. Under **User Profiles and My Sites** navigate to Personalization services permissions .
4. If the account doesn't already exist, add the account for which your site... |
82,814 | <p>The following code is causing an intermittent crash on a Vista machine.</p>
<pre><code>using (SoundPlayer myPlayer = new SoundPlayer(Properties.Resources.BEEPPURE))
myPlayer.Play();
</code></pre>
<p>I highly suspect it is this code because the program crashes mid-beep or just before the beep is played every t... | [
{
"answer_id": 82901,
"author": "Frank Krueger",
"author_id": 338,
"author_profile": "https://Stackoverflow.com/users/338",
"pm_score": 1,
"selected": false,
"text": "<p>You can use WinDBG and trap all first-chance exceptions. I'm sure you'll see something interesting. If so, you can use... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490/"
] | The following code is causing an intermittent crash on a Vista machine.
```
using (SoundPlayer myPlayer = new SoundPlayer(Properties.Resources.BEEPPURE))
myPlayer.Play();
```
I highly suspect it is this code because the program crashes mid-beep or just before the beep is played every time. I have top-level trap... | Actually, the above code (that is, new SoundPlayer(BEEPPURE)).Play(); was crashing for me.
This article explains why, and provides an alternative to SoundPlayer that works flawlessly:
<http://www.codeproject.com/KB/audio-video/soundplayerbug.aspx?msg=2862832#xx2862832xx> |
82,831 | <p>How do I check whether a file exists or not, without using the <a href="https://docs.python.org/3.6/reference/compound_stmts.html#try" rel="noreferrer"><code>try</code></a> statement?</p>
| [
{
"answer_id": 82836,
"author": "Paul",
"author_id": 215086,
"author_profile": "https://Stackoverflow.com/users/215086",
"pm_score": 10,
"selected": false,
"text": "<pre><code>import os\n\nif os.path.isfile(filepath):\n print("File exists")\n</code></pre>\n"
},
{
"ans... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15616/"
] | How do I check whether a file exists or not, without using the [`try`](https://docs.python.org/3.6/reference/compound_stmts.html#try) statement? | If the reason you're checking is so you can do something like `if file_exists: open_it()`, it's safer to use a `try` around the attempt to open it. Checking and then opening risks the file being deleted or moved or something between when you check and when you try to open it.
If you're not planning to open the file im... |
82,838 | <p>Below are two ways of reading in the commandline parameters. The first is the way that I'm accustom to seeing using the parameter in the main. The second I stumbled on when reviewing code. I noticed that the second assigns the first item in the array to the path and application but the first skips this. </p>
<p... | [
{
"answer_id": 82857,
"author": "David Thibault",
"author_id": 5903,
"author_profile": "https://Stackoverflow.com/users/5903",
"pm_score": 6,
"selected": true,
"text": "<p>Second way is better because it can be used outside the main(), so when you refactor it's one less thing to think ab... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2357/"
] | Below are two ways of reading in the commandline parameters. The first is the way that I'm accustom to seeing using the parameter in the main. The second I stumbled on when reviewing code. I noticed that the second assigns the first item in the array to the path and application but the first skips this.
Is it just pr... | Second way is better because it can be used outside the main(), so when you refactor it's one less thing to think about.
Also I don't like the "magic" that puts the args in the method parameter for the first way. |
82,847 | <p>If I am in a function in the code behind, and I want to implement displaying a "Loading..." in the status bar the following makes sense, but as we know from WinForms is a NoNo:</p>
<pre><code>StatusBarMessageText.Text = "Loading Configuration Settings...";
LoadSettingsGridData();
StatusBarMessageText.Te... | [
{
"answer_id": 83216,
"author": "Abe Heidebrecht",
"author_id": 9268,
"author_profile": "https://Stackoverflow.com/users/9268",
"pm_score": -1,
"selected": false,
"text": "<p>The easiest way to get this to work is to add the LoadSettingsGridData to the dispatcher queue. If you set the o... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2744/"
] | If I am in a function in the code behind, and I want to implement displaying a "Loading..." in the status bar the following makes sense, but as we know from WinForms is a NoNo:
```
StatusBarMessageText.Text = "Loading Configuration Settings...";
LoadSettingsGridData();
StatusBarMessageText.Text = "Done";
... | Best and simplest:
```
using(var d = Dispatcher.DisableProcessing())
{
/* your work... Use dispacher.begininvoke... */
}
```
Or
```
IDisposable d;
try
{
d = Dispatcher.DisableProcessing();
/* your work... Use dispacher.begininvoke... */
} finally {
d.Dispose();
}
``` |
82,867 | <p>I want to create a number of masked edit extenders from codebehind. Something like:</p>
<pre><code>private MaskedEditExtender m_maskedEditExtender;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
m_maskedEditExtender = new MaskedEditExtender()
{
BehaviorID = "clientName"
};
... | [
{
"answer_id": 83085,
"author": "Aaron Powell",
"author_id": 11388,
"author_profile": "https://Stackoverflow.com/users/11388",
"pm_score": 1,
"selected": false,
"text": "<p>Your example is not providing a TargetControlID.</p>\n\n<p>Do you have an updatePanel on the page? I had problems d... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31505/"
] | I want to create a number of masked edit extenders from codebehind. Something like:
```
private MaskedEditExtender m_maskedEditExtender;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
m_maskedEditExtender = new MaskedEditExtender()
{
BehaviorID = "clientName"
};
m_maskedEditE... | See [ASP.NET Page Life Cycle Overview](http://msdn.microsoft.com/en-us/library/ms178472.aspx) if this is in a Page subclass. If you scroll down to the event list, that page advises you to use the PreInit event to create any dynamic controls. It's necessary to do that early to ensure that ASP.NET cleanly loads ViewState... |
82,872 | <p>I have a old website that generate its own RSS everytime a new post is created. Everything worked when I was on a server with PHP 4 but now that the host change to PHP 5, I always have a "bad formed XML". I was using xml_parser_create() and xml_parse(...) and fwrite(..) to save everything.</p>
<p>Here is the exampl... | [
{
"answer_id": 82894,
"author": "Marc Gear",
"author_id": 6563,
"author_profile": "https://Stackoverflow.com/users/6563",
"pm_score": 2,
"selected": false,
"text": "<p>I would use <a href=\"http://www.php.net/simplexml\" rel=\"nofollow noreferrer\">simpleXML</a> to create the required st... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13913/"
] | I have a old website that generate its own RSS everytime a new post is created. Everything worked when I was on a server with PHP 4 but now that the host change to PHP 5, I always have a "bad formed XML". I was using xml\_parser\_create() and xml\_parse(...) and fwrite(..) to save everything.
Here is the example when ... | At swcombine.com we use [Feedcreator](http://feedcreator.org/). Use that one and your problem will be gone. :)
Here is the PHP code to use it once installed:
```
function feed_simnews() {
$objRSS = new UniversalFeedCreator();
$objRSS->title = 'My News';
$objRSS->link = 'http://link.to/news.php';
$objR... |
82,875 | <p>What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the <code>ATTACH</code> command on the SQLite 3 command line tool?</p>
| [
{
"answer_id": 82889,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 9,
"selected": false,
"text": "<p>It appears you need to go through the <strong>sqlite_master</strong> table, like this:</p>\n\n<pre><code>SELECT * F... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/974/"
] | What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the `ATTACH` command on the SQLite 3 command line tool? | The `.tables`, and `.schema` "helper" functions don't look into ATTACHed databases: they just query the `SQLITE_MASTER` table for the "main" database. Consequently, if you used
```
ATTACH some_file.db AS my_db;
```
then you need to do
```
SELECT name FROM my_db.sqlite_master WHERE type='table';
```
Note that temp... |
82,881 | <p>Lets say I have a Dictionary object:</p>
<pre><code>Dictionary myDictionary<int, SomeObject> = new Dictionary<string, SomeObject>();
</code></pre>
<p>Now I want to iterate through the dictionary in reverse order. I can't use a simple for loop because I don't know the keys of the dictionary. A <em>forea... | [
{
"answer_id": 82897,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 5,
"selected": false,
"text": "<p>A dictionary or any other form of hashtable has no ordering. So what you are trying to do is pointless :)</p>\n"
},
{... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2273/"
] | Lets say I have a Dictionary object:
```
Dictionary myDictionary<int, SomeObject> = new Dictionary<string, SomeObject>();
```
Now I want to iterate through the dictionary in reverse order. I can't use a simple for loop because I don't know the keys of the dictionary. A *foreach* is easy:
```
foreach (SomeObject obj... | I'd use a SortedList instead of a dictionary. You can still access it by Key, but you can access it by index as well.
```
SortedList sCol = new SortedList();
sCol.Add("bee", "Some extended string matching bee");
sCol.Add("ay", "value matching ay");
sCol.Add("cee", "Just a standard cee");
// Go through it backwards.
... |
82,908 | <p>I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on the client side when I press the Cancel button, which has the CausesValidation attribute set to "False". How can I get this to stop? </p>
<p>I do not believe that Validation Groups are supported in 1.1.</p>
<p>Here's a co... | [
{
"answer_id": 82923,
"author": "Aaron Powell",
"author_id": 11388,
"author_profile": "https://Stackoverflow.com/users/11388",
"pm_score": 0,
"selected": false,
"text": "<p>Are they in separate validation groups (the button and validator controls)?</p>\n\n<p>You're not manually calling t... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15815/"
] | I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on the client side when I press the Cancel button, which has the CausesValidation attribute set to "False". How can I get this to stop?
I do not believe that Validation Groups are supported in 1.1.
Here's a code sample:
```
<a... | Validation Groups were not added to ASP.NET until version 2.0. This is a 1.1 question.
Double check your setting and make sure you are not overwriting it in the code behind. |
82,914 | <p>I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel.</p>
<p>The answer Joel Martinez gave looks right, but how do I incorporate that when I draw the sprite w... | [
{
"answer_id": 83004,
"author": "Neoaikon",
"author_id": 15837,
"author_profile": "https://Stackoverflow.com/users/15837",
"pm_score": 0,
"selected": false,
"text": "<p>I haven't wrote my own pixel shaders, mostly modified samples from the net, what you would do is you would increase the... | 2008/09/17 | [
"https://Stackoverflow.com/questions/82914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11911/"
] | I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel.
The answer Joel Martinez gave looks right, but how do I incorporate that when I draw the sprite with Sprite... | I think this is what you're looking for
```
sampler2D baseMap;
struct PS_INPUT
{
float2 Texcoord : TEXCOORD0;
};
float4 ps_main( PS_INPUT Input ) : COLOR0
{
float4 color = tex2D( baseMap, Input.Texcoord );
return float4(1.0f, 1.0f, 1.0f, color.w);
}
```
It's very simple, it just takes the sampled color... |