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 |
|---|---|---|---|---|---|---|
61,366 | <p>This question is slightly related to <a href="https://stackoverflow.com/questions/61354/how-to-get-entire-chain-of-exceptions-in-applicationthreadexception-event-handl">this question about exception handling</a>. The workaround I found there consists of rolling my own message loop.</p>
<p>So my Main method now look... | [
{
"answer_id": 61393,
"author": "ima",
"author_id": 5733,
"author_profile": "https://Stackoverflow.com/users/5733",
"pm_score": 2,
"selected": false,
"text": "<p>Pitfall 1: </p>\n\n<pre><code>Thread.Sleep(100);\n</code></pre>\n\n<p>Never. Use WaitMessage().</p>\n\n<p>Otherwise, it is pos... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5422/"
] | This question is slightly related to [this question about exception handling](https://stackoverflow.com/questions/61354/how-to-get-entire-chain-of-exceptions-in-applicationthreadexception-event-handl). The workaround I found there consists of rolling my own message loop.
So my Main method now looks basically like this... | Pitfall 1:
```
Thread.Sleep(100);
```
Never. Use WaitMessage().
Otherwise, it is possible roll out your own message loop, but in your scenario it seems somewhat pointless.
You may also want to examine Application.Run() code (with .Net Reflector, for instance). |
61,405 | <p>I'm about to start on a large Qt application, which is made up of smaller components (groups of classes that work together). For example, there might be a dialog that is used in the project, but should be developed on its own before being integrated into the project. Instead of working on it in another folder somewh... | [
{
"answer_id": 61423,
"author": "kokos",
"author_id": 1065,
"author_profile": "https://Stackoverflow.com/users/1065",
"pm_score": 0,
"selected": false,
"text": "<p>For Qt on Windows you can create DLLs for every subproject you want. No problem with using them from the main project (exe) ... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1585/"
] | I'm about to start on a large Qt application, which is made up of smaller components (groups of classes that work together). For example, there might be a dialog that is used in the project, but should be developed on its own before being integrated into the project. Instead of working on it in another folder somewhere... | Here is what I would do. Let's say I want the following folder hierarchy :
```
/MyWholeApp
```
will contain the files for the whole application.
```
/MyWholeApp/DummyDlg/
```
will contain the files for the standalone dialogbox which will be eventually part of the whole application.
I would develop the standalone... |
61,418 | <p>I have a function that gives me the following warning:</p>
<blockquote>
<p>[DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined</p>
</blockquote>
<p>The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function... | [
{
"answer_id": 61424,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 1,
"selected": false,
"text": "<p>There seems to be some sort of bug in Delphi. Read this post, the last comment links to other bug-reports that may be the one... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267/"
] | I have a function that gives me the following warning:
>
> [DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined
>
>
>
The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function is:
```
Result := '';
```
an... | Are you sure you have done everything to solve the warning? Maybe you could post the code for us to look at?
You can turn off the warning locally this way:
```
{$WARN NO_RETVAL OFF}
function func(...): string;
begin
...
end;
{$WARN NO_RETVAL ON}
``` |
61,421 | <p>I'm making an example for someone who hasn't yet realized that controls like <code>ListBox</code> don't have to contain strings; he had been storing formatted strings and jumping through complicated parsing hoops to get the data back out of the <code>ListBox</code> and I'd like to show him there's a better way.</p>
... | [
{
"answer_id": 61425,
"author": "Quibblesome",
"author_id": 1143,
"author_profile": "https://Stackoverflow.com/users/1143",
"pm_score": 3,
"selected": false,
"text": "<p>Use the datasource property and a BindingSource object in between the datasource and the datasource property of the li... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547/"
] | I'm making an example for someone who hasn't yet realized that controls like `ListBox` don't have to contain strings; he had been storing formatted strings and jumping through complicated parsing hoops to get the data back out of the `ListBox` and I'd like to show him there's a better way.
I noticed that if I have an ... | BindingList handles updating the bindings by itself.
```
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace TestBindingList
{
public class Employee
{
public string Name { get; set; }
public int Id { get; set; }
}
public partial class Form1 : Form
{
... |
61,443 | <p>I have a counter in hardware that I can observe for timing considerations. It counts miliseconds and is stored in a 16 bit unsigned value. How do I safely check if a timer value has passed a certain time and safely handle the inevitable rollover:</p>
<pre><code>//this is a bit contrived, but it illustrates what I'm... | [
{
"answer_id": 61444,
"author": "Jason Punyon",
"author_id": 6212,
"author_profile": "https://Stackoverflow.com/users/6212",
"pm_score": 1,
"selected": false,
"text": "<p>Just check if ms_timer < last_print_time and if so add 2^16 no?</p>\n\n<p>Edit: You also need to up to an uint32 ... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/445087/"
] | I have a counter in hardware that I can observe for timing considerations. It counts miliseconds and is stored in a 16 bit unsigned value. How do I safely check if a timer value has passed a certain time and safely handle the inevitable rollover:
```
//this is a bit contrived, but it illustrates what I'm trying to do
... | You don't actually need to do anything here. The original code listed in your question will work fine, assuming `ms_timer()` returns a value of type uint16\_t.
(Also assuming that the timer doesn't overflow twice between checks...)
To convince yourself this is the case, try the following test:
```
uint16_t t1 = 0xF... |
61,446 | <p>Particularly, what is the best snippets package out there?</p>
<p>Features:</p>
<ul>
<li>easy to define new snippets (plain text, custom input with defaults)</li>
<li>simple navigation between predefined positions in the snippet</li>
<li>multiple insertion of the same custom input</li>
<li>accepts currently select... | [
{
"answer_id": 61447,
"author": "jfs",
"author_id": 4279,
"author_profile": "https://Stackoverflow.com/users/4279",
"pm_score": 6,
"selected": true,
"text": "<p><a href=\"http://manual.macromates.com/en/snippets\" rel=\"nofollow noreferrer\">TextMate's snippets</a> is the most closest ma... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4279/"
] | Particularly, what is the best snippets package out there?
Features:
* easy to define new snippets (plain text, custom input with defaults)
* simple navigation between predefined positions in the snippet
* multiple insertion of the same custom input
* accepts currently selected text as a custom input
* *cross-platfor... | [TextMate's snippets](http://manual.macromates.com/en/snippets) is the most closest match but it is not a cross-platform solution and not for Emacs.
The second closest thing is [YASnippet](http://github.com/joaotavora/yasnippet/ "Yet Another Snippet Package for Emacs") ([screencast](http://www.youtube.com/watch?v=vOj7... |
61,451 | <p>Does Django have any template tags to generate common HTML markup? For example, I know that I can get a url using</p>
<pre><code>{% url mapper.views.foo %}
</code></pre>
<p>But that only gives me the URL and not the HTML code to create the link. Does Django have anything similar to Rails' link_to helper? I found <... | [
{
"answer_id": 61457,
"author": "John Boker",
"author_id": 2847,
"author_profile": "https://Stackoverflow.com/users/2847",
"pm_score": 2,
"selected": false,
"text": "<p>it doesnt look like they're built in but here's a couple snippets. it looks like it'd be pretty easy to create these h... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/796/"
] | Does Django have any template tags to generate common HTML markup? For example, I know that I can get a url using
```
{% url mapper.views.foo %}
```
But that only gives me the URL and not the HTML code to create the link. Does Django have anything similar to Rails' link\_to helper? I found [django-helpers](http://co... | No it doesn't.
[James Bennett](http://www.b-list.org/) answered a [similar question](http://www.b-list.org/weblog/2006/jul/02/django-and-ajax/) a while back, regarding Rails' built-in JavaScript helpers.
It's *really* unlikely that Django will ever have 'helper' functionality built-in. The reason, if I understand cor... |
61,456 | <p>After trying to avoid JavaScript for years, Iv started using Query for <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow noreferrer">validation</a> in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is. </p>
<p>Fir... | [
{
"answer_id": 61460,
"author": "Gulzar Nazim",
"author_id": 4337,
"author_profile": "https://Stackoverflow.com/users/4337",
"pm_score": 2,
"selected": false,
"text": "<p>There is a Visual Studio 2008 hotfix for <a href=\"http://weblogs.asp.net/bradvincent/archive/2008/04/28/better-jquer... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230/"
] | After trying to avoid JavaScript for years, Iv started using Query for [validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is.
Firstly is there a way to get intellisense working... | Try specifying both a wrapper and a label container in your options. I also added `display:none;` to the style of error-container to let jQuery decide when to show it.
```js
$().ready(function() {
$("#CreateLog").validate({
errorLabelContainer: $("ul", $('div.error-container')),
wrapper: 'li',
rules:... |
61,480 | <p>In the past we declared properties like this:</p>
<pre><code>public class MyClass
{
private int _age;
public int Age
{
get{ return _age; }
set{ _age = value; }
}
}
</code></pre>
<p>Now we can do:</p>
<pre><code>public class MyClass
{
public int Age {get; set;}
}
</code><... | [
{
"answer_id": 61484,
"author": "Quibblesome",
"author_id": 1143,
"author_profile": "https://Stackoverflow.com/users/1143",
"pm_score": 2,
"selected": false,
"text": "<p>You can't, it's a language feature as opposed to a IDE feature. To be honest i'd prefer then IDE to add the private va... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1368/"
] | In the past we declared properties like this:
```
public class MyClass
{
private int _age;
public int Age
{
get{ return _age; }
set{ _age = value; }
}
}
```
Now we can do:
```
public class MyClass
{
public int Age {get; set;}
}
```
My question is, how can I access the pr... | The aim of the new automatic properties is to reduce the amount of boilerplate code you need to write when you just have a simple property that doesn't need any special logic in the get or the set.
If you want to access the private member that these properties use, that's usually for a few reasons:
* You need to mor... |
61,486 | <p>I need to figure out what div is visible out of four possible divs using jQuery. Only one of those div's will be visible at any given time.</p>
<p>This is what I have that works so far:</p>
<pre><code>$("#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible").attr("id");
<... | [
{
"answer_id": 61500,
"author": "Gilean",
"author_id": 6305,
"author_profile": "https://Stackoverflow.com/users/6305",
"pm_score": 5,
"selected": true,
"text": "<p>Assign the same class to each div then:</p>\n\n<pre><code>$(\"div.myClass:visible\").attr(\"id\");\n</code></pre>\n"
},
... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/648/"
] | I need to figure out what div is visible out of four possible divs using jQuery. Only one of those div's will be visible at any given time.
This is what I have that works so far:
```
$("#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible").attr("id");
```
Is there a way to... | Assign the same class to each div then:
```
$("div.myClass:visible").attr("id");
``` |
61,517 | <p>Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:</p>
<pre><code>>>> class Foo:
... bar = 'hello'
... baz = 'world'
...
>>> f = Foo()
>>> props(f)
{ 'bar' : 'hello', 'baz' : 'world' }
</code></pre>
<p><... | [
{
"answer_id": 61522,
"author": "dF.",
"author_id": 3002,
"author_profile": "https://Stackoverflow.com/users/3002",
"pm_score": 6,
"selected": false,
"text": "<p>The <code>dir</code> builtin will give you all the object's attributes, including special methods like <code>__str__</code>, <... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61517",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2148/"
] | Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:
```
>>> class Foo:
... bar = 'hello'
... baz = 'world'
...
>>> f = Foo()
>>> props(f)
{ 'bar' : 'hello', 'baz' : 'world' }
```
**NOTE:** It should not include methods. Only fields. | Note that best practice in Python 2.7 is to use *[new-style](https://www.python.org/doc/newstyle/)* classes (not needed with Python 3), i.e.
```
class Foo(object):
...
```
Also, there's a difference between an 'object' and a 'class'. To build a dictionary from an arbitrary *object*, it's sufficient to use `__dict... |
61,552 | <p><a href="http://www.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118">Alan Storm's comments</a> in response to my answer regarding the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with" rel="noreferrer"><code>with</code> statement</a> got me thinking. I'v... | [
{
"answer_id": 61566,
"author": "Sören Kuklau",
"author_id": 1600,
"author_profile": "https://Stackoverflow.com/users/1600",
"pm_score": 4,
"selected": false,
"text": "<p>Visual Basic.NET has a similar <code>With</code> statement. One of the more common ways I use it is to quickly set a ... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/811/"
] | [Alan Storm's comments](http://www.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118) in response to my answer regarding the [`with` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with) got me thinking. I've seldom found a reason to use this particular langua... | Another use occurred to me today, so I searched the web excitedly and found an existing mention of it: [Defining Variables inside Block Scope](http://web.archive.org/web/20090111183416/http://www.hedgerwow.com/360/dhtml/js_block_scope.html).
### Background
JavaScript, in spite of its superficial resemblance to C and ... |
61,604 | <p>Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?</p>
<p><strong>Note:</strong> I am not talking about <a href="https://stackoverflow.com/questions/20922/do-you-comment-your-code">comments within the code<... | [
{
"answer_id": 61608,
"author": "Fire Lancer",
"author_id": 6266,
"author_profile": "https://Stackoverflow.com/users/6266",
"pm_score": 1,
"selected": false,
"text": "<p>I think they do, and have always placed comments in the header files (c++) arcordingly.</p>\n\n<p>In addition to valid... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6309/"
] | Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?
**Note:** I am not talking about [comments within the code](https://stackoverflow.com/questions/20922/do-you-comment-your-code)
By "value limits", I mean:
*... | I think they **can** belong together but don't necessarily **have** to belong together. In your scenario, it seems like it makes sense that the limits are documented in such a way that they appear in the generated API documentation and intellisense (if the language/IDE support it).
I think it does depend on the langua... |
61,605 | <p>In python, you can have a function return multiple values. Here's a contrived example:</p>
<pre><code>def divide(x, y):
quotient = x/y
remainder = x % y
return quotient, remainder
(q, r) = divide(22, 7)
</code></pre>
<p>This seems very useful, but it looks like it can also be abused ("Well..functio... | [
{
"answer_id": 61629,
"author": "Jason Etheridge",
"author_id": 2193,
"author_profile": "https://Stackoverflow.com/users/2193",
"pm_score": 5,
"selected": false,
"text": "<p>Firstly, note that Python allows for the following (no need for the parenthesis):</p>\n\n<pre><code>q, r = divide(... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4883/"
] | In python, you can have a function return multiple values. Here's a contrived example:
```
def divide(x, y):
quotient = x/y
remainder = x % y
return quotient, remainder
(q, r) = divide(22, 7)
```
This seems very useful, but it looks like it can also be abused ("Well..function X already computes what w... | Absolutely (for the example you provided).
### Tuples are first class citizens in Python
There is a builtin function [`divmod()`](https://docs.python.org/3/library/functions.html#divmod) that does exactly that.
```
q, r = divmod(x, y) # ((x - x%y)/y, x%y) Invariant: div*y + mod == x
```
There are other examples: `... |
61,638 | <p>I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?</p>
<p>Subsonic Sugar has some really nice functions:</p>
<p><a href="http://subsonichelp.com/html/1413bafa-b5aa-99a... | [
{
"answer_id": 61645,
"author": "Mike Stone",
"author_id": 122,
"author_profile": "https://Stackoverflow.com/users/122",
"pm_score": 2,
"selected": false,
"text": "<p>Is there a specific problem you are trying to handle with dates? If the existing date API in .NET can handle your proble... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230/"
] | I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?
Subsonic Sugar has some really nice functions:
<http://subsonichelp.com/html/1413bafa-b5aa-99aa-0478-10875abe82ec.htm>
... | Is there a specific problem you are trying to handle with dates? If the existing date API in .NET can handle your problem cleanly, I see no reason to consider a 3rd party library to do it. When I was in .NET, we had to deal with dates quite a bit, and the standard libraries provided a fair amount of functionality to us... |
61,675 | <p>I'm reading lines of input on a TCP socket, similar to this:</p>
<pre><code>class Bla
def getcmd
@sock.gets unless @sock.closed?
end
def start
srv = TCPServer.new(5000)
@sock = srv.accept
while ! @sock.closed?
ans = getcmd
end
end
end
</code></pre>
<p>If the endpoint termi... | [
{
"answer_id": 61732,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": -1,
"selected": false,
"text": "<p>If you believe the <a href=\"http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/index.html\" rel=\"nofollow noreferrer... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3796/"
] | I'm reading lines of input on a TCP socket, similar to this:
```
class Bla
def getcmd
@sock.gets unless @sock.closed?
end
def start
srv = TCPServer.new(5000)
@sock = srv.accept
while ! @sock.closed?
ans = getcmd
end
end
end
```
If the endpoint terminates the connection while... | You can use select to see whether you can safely gets from the socket, see following implementation of a TCPServer using this technique.
```
require 'socket'
host, port = 'localhost', 7000
TCPServer.open(host, port) do |server|
while client = server.accept
readfds = true
got = nil
begin
readfds, ... |
61,677 | <p>Suppose I have a COM object which users can access via a call such as:</p>
<pre><code>Set s = CreateObject("Server")
</code></pre>
<p>What I'd like to be able to do is allow the user to specify an event handler for the object, like so:</p>
<pre><code>Function ServerEvent
MsgBox "Event handled"
End Function
... | [
{
"answer_id": 61723,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 2,
"selected": false,
"text": "<p>I'm a little hazy on the details, but maybe the link below might help:</p>\n\n<p><a href=\"http://msdn.microsoft.... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5449/"
] | Suppose I have a COM object which users can access via a call such as:
```
Set s = CreateObject("Server")
```
What I'd like to be able to do is allow the user to specify an event handler for the object, like so:
```
Function ServerEvent
MsgBox "Event handled"
End Function
s.OnDoSomething = ServerEvent
```
I... | This is how I did it just recently. Add an interface that implements IDispatch and a coclass for that interface to your IDL:
```
[
object,
uuid(6EDA5438-0915-4183-841D-D3F0AEDFA466),
nonextensible,
oleautomation,
pointer_default(unique)
]
interface IServerEvents : IDispatch
{
[id(1)]
HRESUL... |
61,680 | <p>I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha).</p>
<p>I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class?</p>
<p>Specifically, this array is my zbuffer in a graphics program. I need to store a z value... | [
{
"answer_id": 61684,
"author": "Adam Mitz",
"author_id": 2574,
"author_profile": "https://Stackoverflow.com/users/2574",
"pm_score": 5,
"selected": true,
"text": "<p>You need about 2.5 megs, so just using the heap should be fine. You don't need a vector unless you need to resize it. S... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396/"
] | I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha).
I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class?
Specifically, this array is my zbuffer in a graphics program. I need to store a z value for every pixel on ... | You need about 2.5 megs, so just using the heap should be fine. You don't need a vector unless you need to resize it. See [C++ FAQ Lite](https://isocpp.org/wiki/faq/freestore-mgmt#multidim-arrays) for an example of using a "2D" heap array.
```
int *array = new int[800*800];
```
(Don't forget to `delete[]` it when yo... |
61,691 | <p>The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option. </p>
<p>I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this?</p>
<p>Also, I am aware o... | [
{
"answer_id": 61697,
"author": "Mladen Janković",
"author_id": 6300,
"author_profile": "https://Stackoverflow.com/users/6300",
"pm_score": 4,
"selected": true,
"text": "<p>You can make shortcut to:</p>\n\n<pre><code>msiexec /uninstall [path to msi or product code]\n</code></pre>\n"
},... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4050/"
] | The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option.
I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this?
Also, I am aware of non Microsoft in... | You can make shortcut to:
```
msiexec /uninstall [path to msi or product code]
``` |
61,692 | <p>I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it.</p>
<p>I've also tried using the exit handler on my main application UI window but... | [
{
"answer_id": 61697,
"author": "Mladen Janković",
"author_id": 6300,
"author_profile": "https://Stackoverflow.com/users/6300",
"pm_score": 4,
"selected": true,
"text": "<p>You can make shortcut to:</p>\n\n<pre><code>msiexec /uninstall [path to msi or product code]\n</code></pre>\n"
},... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849/"
] | I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it.
I've also tried using the exit handler on my main application UI window but it has no... | You can make shortcut to:
```
msiexec /uninstall [path to msi or product code]
``` |
61,699 | <p>Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an <a href="https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project">uninstall option in the start menu</a> (thanks Giovanni Galbo), however we now need to GAC... | [
{
"answer_id": 61701,
"author": "aku",
"author_id": 1196,
"author_profile": "https://Stackoverflow.com/users/1196",
"pm_score": 1,
"selected": false,
"text": "<p>Not sure about library, but you can call <a href=\"http://msdn.microsoft.com/en-us/library/ex0ss12c%28VS.80%29.aspx\" rel=\"no... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an [uninstall option in the start menu](https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project) (thanks Giovanni Galbo), however we now need to GAC some external... | According to <http://jrsoftware.org/files/is5-whatsnew.htm> you should be able to do it with v5.3 and above
>
> Added .NET support (these cause an
> internal error if used on a system
> with no .NET Framework present):
>
>
>
> ```
> * Added new [Files] section flag: gacinstall.
> * Added new [Files] section para... |
61,718 | <p>When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?</p>
| [
{
"answer_id": 61720,
"author": "Free Wildebeest",
"author_id": 1849,
"author_profile": "https://Stackoverflow.com/users/1849",
"pm_score": 3,
"selected": false,
"text": "<p>For simple database applications I find using <a href=\"http://www.sqlite.org/\" rel=\"noreferrer\">SQLite</a> inv... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6369/"
] | When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database? | Transactions.
What the ruby on rails unit test framework does is this:
```
Load all fixture data.
For each test:
BEGIN TRANSACTION
# Yield control to user code
ROLLBACK TRANSACTION
End for each
```
This means that
1. Any changes your test makes to the database won't affect other threads while it's in-... |
61,733 | <p>Which of the following is better code in c# and why?</p>
<pre><code>((DateTime)g[0]["MyUntypedDateField"]).ToShortDateString()
</code></pre>
<p>or</p>
<pre><code>DateTime.Parse(g[0]["MyUntypedDateField"].ToString()).ToShortDateString()
</code></pre>
<p>Ultimately, is it better to cast or to parse?</p>
| [
{
"answer_id": 61740,
"author": "Wilka",
"author_id": 1367,
"author_profile": "https://Stackoverflow.com/users/1367",
"pm_score": 5,
"selected": true,
"text": "<p>If g[0][\"MyUntypedDateField\"] is really a DateTime object, then the cast is the better choice. If it's not really a DateTim... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4246/"
] | Which of the following is better code in c# and why?
```
((DateTime)g[0]["MyUntypedDateField"]).ToShortDateString()
```
or
```
DateTime.Parse(g[0]["MyUntypedDateField"].ToString()).ToShortDateString()
```
Ultimately, is it better to cast or to parse? | If g[0]["MyUntypedDateField"] is really a DateTime object, then the cast is the better choice. If it's not really a DateTime, then you have no choice but to use the Parse (you would get an InvalidCastException if you tried to use the cast) |
61,739 | <p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p>
<pre><code>DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);
</code></pre>
<p>I've never been able to figure out a sure fire... | [
{
"answer_id": 124737,
"author": "David L Morris",
"author_id": 3137,
"author_profile": "https://Stackoverflow.com/users/3137",
"pm_score": 2,
"selected": false,
"text": "<p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct an... | 2008/09/14 | [
"https://Stackoverflow.com/questions/61739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3655/"
] | I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:
```
DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);
```
I've never been able to figure out a sure fire way to figure out what to pas... | It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.
I happen to use bit maps 13 x 13 rather than 12 x 12. The bitmap part of the check box seems to be passed in the WM\_DRAWITEM. However, I had also set up WM\_MEASUREITEM and fed it th... |
61,747 | <p>How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.</p>
| [
{
"answer_id": 61799,
"author": "Alan",
"author_id": 5878,
"author_profile": "https://Stackoverflow.com/users/5878",
"pm_score": 1,
"selected": false,
"text": "<p>I'm not sure this will help with the PDO drivers specifically, but you might look into <a href=\"http://bitnami.org/stack/map... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6371/"
] | How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all. | I had to install the PDO\_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I've found can help others (like myself) who will undoub... |
61,805 | <p>I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so:</p>
<pre><code>public partial class Home : ViewMasterPage
</code></pre>
<p>On Home.Master there is a display statement like this:</p>
<pre><code><%= ((GenericViewData)ViewD... | [
{
"answer_id": 61808,
"author": "Matt Mitchell",
"author_id": 364,
"author_profile": "https://Stackoverflow.com/users/364",
"pm_score": 0,
"selected": false,
"text": "<p>I've decided to replace all instances of ViewData[\"blah\"] with ViewData.Eval(\"blah\").\nHowever, I'd like to know t... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/364/"
] | I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so:
```
public partial class Home : ViewMasterPage
```
On Home.Master there is a display statement like this:
```
<%= ((GenericViewData)ViewData["Generic"]).Skin %>
```
However, a... | We made that change because we wanted a bit of symmetry with the [] indexer. The Eval() method uses reflection and looks into the model to retrieve values. The indexer only looks at items directly added to the dictionary. |
61,817 | <p>I am wondering what the best way to obtain the current domain is in ASP.NET?</p>
<p>For instance:</p>
<p><a href="http://www.domainname.com/subdir/" rel="noreferrer">http://www.domainname.com/subdir/</a> should yield <a href="http://www.domainname.com" rel="noreferrer">http://www.domainname.com</a>
<a href="http:/... | [
{
"answer_id": 61819,
"author": "Matt Mitchell",
"author_id": 364,
"author_profile": "https://Stackoverflow.com/users/364",
"pm_score": 5,
"selected": false,
"text": "<p>As per <a href=\"http://www.velocityreviews.com/forums/t89365-get-hostdomain-name.html\" rel=\"noreferrer\">this link<... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/364/"
] | I am wondering what the best way to obtain the current domain is in ASP.NET?
For instance:
<http://www.domainname.com/subdir/> should yield <http://www.domainname.com>
<http://www.sub.domainname.com/subdir/> should yield <http://sub.domainname.com>
As a guide, I should be able to add a url like "/Folder/Content/file... | Same answer as MattMitchell's but with some modification.
This checks for the default port instead.
>
> Edit: Updated syntax and using `Request.Url.Authority` as suggested
>
>
>
```
$"{Request.Url.Scheme}{System.Uri.SchemeDelimiter}{Request.Url.Authority}"
``` |
61,838 | <p>If I have something like a UILabel linked to a xib file, do I need to release it on dealloc of my view? The reason I ask is because I don't alloc it, which makes me think I don't need to release it either?
eg (in the header):</p>
<pre><code>IBOutlet UILabel *lblExample;
</code></pre>
<p>in the implementation:</p>
... | [
{
"answer_id": 61841,
"author": "Sören Kuklau",
"author_id": 1600,
"author_profile": "https://Stackoverflow.com/users/1600",
"pm_score": 0,
"selected": false,
"text": "<p>Related: <a href=\"https://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-objective-c\"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6044/"
] | If I have something like a UILabel linked to a xib file, do I need to release it on dealloc of my view? The reason I ask is because I don't alloc it, which makes me think I don't need to release it either?
eg (in the header):
```
IBOutlet UILabel *lblExample;
```
in the implementation:
```
....
[lblExample setText:... | If you follow what is now considered to be best practice, you *should* release outlet properties, because you should have retained them in the set accessor:
```
@interface MyController : MySuperclass {
Control *uiElement;
}
@property (nonatomic, retain) IBOutlet Control *uiElement;
@end
@implementation MyControll... |
61,861 | <p>I would like to make my web control more readable in design mode, basically I want the tag declaration to look like:</p>
<pre><code><cc1:Ctrl ID="Value1" runat="server">
<Values>string value 1</Value>
<Values>string value 2</Value>
</cc1:Ctrl>
</code></pre>
<p>... | [
{
"answer_id": 61925,
"author": "Matt",
"author_id": 4154,
"author_profile": "https://Stackoverflow.com/users/4154",
"pm_score": 0,
"selected": false,
"text": "<p>I see two options, but both depend on your web control implementing some sort of collection for your values. The first optio... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2758/"
] | I would like to make my web control more readable in design mode, basically I want the tag declaration to look like:
```
<cc1:Ctrl ID="Value1" runat="server">
<Values>string value 1</Value>
<Values>string value 2</Value>
</cc1:Ctrl>
```
Lets say I have a private variable in the code behind:
```
Li... | I think what you are searching for is the attribute:
```
[PersistenceMode(PersistenceMode.InnerProperty)]
```
[Persistence Mode](http://msdn.microsoft.com/en-us/library/system.web.ui.persistencemode.aspx)
Remember that you have to register your namespace and prefix with:
```
<%@ Register Namespace="MyNamespace" Ta... |
61,872 | <p>We are rewriting our legacy <a href="https://en.wikipedia.org/wiki/Accounting_information_system" rel="nofollow noreferrer">accounting system</a> in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the dollar amounts using floats... | [
{
"answer_id": 61875,
"author": "Niall",
"author_id": 6049,
"author_profile": "https://Stackoverflow.com/users/6049",
"pm_score": 2,
"selected": false,
"text": "<p>Floats are not exact representations, precision issues are possible, for example when adding very large and very small value... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4964/"
] | We are rewriting our legacy [accounting system](https://en.wikipedia.org/wiki/Accounting_information_system) in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the dollar amounts using floats. The legacy system language, I programm... | >
> Should Float or Decimal data type be used for dollar amounts?
>
>
>
The answer is easy. Never floats. *NEVER*!
Floats were according to [IEEE 754](http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=4610933) always binary, only the new standard [IEEE 754R](http://www.intel.com/technology/itj/2007/v11i... |
61,893 | <p>I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'. What is the usual cause of a bad address error?</p>
<pre><code>if(copy_to_user(info, &kernel_info, sizeof(struct prinfo)))
</code></pre>
| [
{
"answer_id": 61948,
"author": "roo",
"author_id": 716,
"author_profile": "https://Stackoverflow.com/users/716",
"pm_score": 3,
"selected": false,
"text": "<p>Bad Address error means that the address location that you have given is invalid. With the case you have above I would guess it ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'. What is the usual cause of a bad address error?
```
if(copy_to_user(info, &kernel_info, sizeof(struct prinfo)))
``` | Bad Address error means that the address location that you have given is invalid. With the case you have above I would guess it is because you are passing a copy of `info` instead of a pointer to `info`'s memory location.
Looking at the docs, `copy_to_user` is defined as
```
copy_to_user(void __user * to, const void ... |
61,894 | <p>So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of:</p>
<pre><code>siteroot/
models/
controllers/
controller1/
controller2/
...
templates/
template1/
template2/
... | [
{
"answer_id": 62121,
"author": "Toni Ruža",
"author_id": 6267,
"author_profile": "https://Stackoverflow.com/users/6267",
"pm_score": 1,
"selected": false,
"text": "<p>The <code>dirname</code> function returns an absolute path, use relative paths. See what is the current directory when y... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4904/"
] | So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of:
```
siteroot/
models/
controllers/
controller1/
controller2/
...
templates/
template1/
template2/
...
```
... | You can't use relative paths, as Toni suggests, because you have no guarantee that the path from your working directory to your app's directory will remain the same.
The correct solution is to either use os.path.split, as you are, or to use something like:
```
path = os.path.join(os.path.dirname(__file__), '..', 'tem... |
61,902 | <p>I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: <a href="http://www.dayah.com/periodic/" rel="nofollow noreferrer">http://www.dayah.com/periodic/</a>. Click on an element and the iframe is displayed and links to ... | [
{
"answer_id": 61907,
"author": "Till",
"author_id": 2859,
"author_profile": "https://Stackoverflow.com/users/2859",
"pm_score": -1,
"selected": false,
"text": "<p>You could always download the site and scrap it. I think everything inside <code><div id=\"bodyContent\"></code> is th... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61902",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5234/"
] | I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: <http://www.dayah.com/periodic/>. Click on an element and the iframe is displayed and links to the article only (no wrapper). So how'd they do that? Seems like JavaScrip... | The periodic table example loads the printer-friendly version of the wiki artice into an iframe. <http://en.wikipedia.org/wiki/Potasium>?**printable=yes**
it's done in *function click\_wiki(e)* (line 534, interactivity.js)
>
> ```
>
> var article = el.childNodes[0].childNodes[n_name].innerHTML;
> ...
> window.frame... |
61,906 | <p>In Hibernate we have two classes with the following classes with JPA mapping:</p>
<pre><code>package com.example.hibernate
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax... | [
{
"answer_id": 61935,
"author": "Chris Kimpton",
"author_id": 48310,
"author_profile": "https://Stackoverflow.com/users/48310",
"pm_score": 0,
"selected": false,
"text": "<p>Not really seen this problem, although we do get intermittent Lazy Load errors - so perhaps we have the same probl... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3332/"
] | In Hibernate we have two classes with the following classes with JPA mapping:
```
package com.example.hibernate
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.M... | I had a similar problem:
* I did Session.save(nastyItem) to save an object into the Session.
However, I did not fill in the property buyer which is mapped as update="false" insert="false" (this happens a lot when you have a composed primary key, then you map the many-to-one's as insert="false" update="false")
* I a qu... |
61,953 | <p>Let's say I have the following simple enum:</p>
<pre><code>enum Response
{
Yes = 1,
No = 2,
Maybe = 3
}
</code></pre>
<p>How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been... | [
{
"answer_id": 61961,
"author": "Mark Glorie",
"author_id": 952,
"author_profile": "https://Stackoverflow.com/users/952",
"pm_score": 8,
"selected": true,
"text": "<p>I probably wouldn't <strong>bind</strong> the data as it's an enum, and it won't change after compile time (unless I'm ha... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] | Let's say I have the following simple enum:
```
enum Response
{
Yes = 1,
No = 2,
Maybe = 3
}
```
How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been selected? | I probably wouldn't **bind** the data as it's an enum, and it won't change after compile time (unless I'm having one of those *stoopid* moments).
Better just to iterate through the enum:
```
Dim itemValues As Array = System.Enum.GetValues(GetType(Response))
Dim itemNames As Array = System.Enum.GetNames(GetType(Resp... |
61,967 | <p>Let's say I have the following simple table variable:</p>
<pre><code>declare @databases table
(
DatabaseID int,
Name varchar(15),
Server varchar(15)
)
-- insert a bunch rows into @databases
</code></pre>
<p>Is declaring and using a cursor my only option if I wanted to iterate through ... | [
{
"answer_id": 61981,
"author": "GateKiller",
"author_id": 383,
"author_profile": "https://Stackoverflow.com/users/383",
"pm_score": 2,
"selected": false,
"text": "<p>You can use a while loop:</p>\n\n<pre><code>While (Select Count(*) From #TempTable) > 0\nBegin\n Insert Into @Datab... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] | Let's say I have the following simple table variable:
```
declare @databases table
(
DatabaseID int,
Name varchar(15),
Server varchar(15)
)
-- insert a bunch rows into @databases
```
Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another... | First of all you should be absolutely sure you need to iterate through each row — set based operations will perform faster in every case I can think of and will normally use simpler code.
Depending on your data it may be possible to loop using just `SELECT` statements as shown below:
```
Declare @Id int
While (Selec... |
61,995 | <p>Given the following XML:</p>
<pre><code><current>
<login_name>jd</login_name>
</current>
<people>
<person>
<first>John</first>
<last>Doe</last>
<login_name>jd</login_name>
</preson>
<person>
<first>Pier... | [
{
"answer_id": 62010,
"author": "Kendall Helmstetter Gelner",
"author_id": 6330,
"author_profile": "https://Stackoverflow.com/users/6330",
"pm_score": 0,
"selected": false,
"text": "<p>I think what he actually wanted was the replacement in the match for the \"current\" node, not a match ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/61995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1532/"
] | Given the following XML:
```
<current>
<login_name>jd</login_name>
</current>
<people>
<person>
<first>John</first>
<last>Doe</last>
<login_name>jd</login_name>
</preson>
<person>
<first>Pierre</first>
<last>Spring</last>
<login_name>ps</login_name>
</preson>
</people>
```
How can I... | I'd define a key to index the people:
```
<xsl:key name="people" match="person" use="login_name" />
```
Using a key here simply keeps the code clean, but you might also find it helpful for efficiency if you're often having to retrieve the `<person>` elements based on their `<login_name>` child.
I'd have a template ... |
62,013 | <p>I set up a website to use SqlMembershipProvider as written on <a href="http://msdn.microsoft.com/en-us/library/ms998347.aspx" rel="nofollow noreferrer">this page</a>.</p>
<p>I followed every step. I have the database, I modified the Web.config to use this provider, with the correct connection string, and the authen... | [
{
"answer_id": 62036,
"author": "Jon Limjap",
"author_id": 372,
"author_profile": "https://Stackoverflow.com/users/372",
"pm_score": 1,
"selected": false,
"text": "<p>What is the role of the username you are logging in with? Have you permitted this role to access Default.aspx?</p>\n\n<p>... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968/"
] | I set up a website to use SqlMembershipProvider as written on [this page](http://msdn.microsoft.com/en-us/library/ms998347.aspx).
I followed every step. I have the database, I modified the Web.config to use this provider, with the correct connection string, and the authentication mode is set to Forms. Created some use... | I have checked the code over in the files you have sent me (thanks again for sending them through).
**Note: I have not tested this since I have not installed the database etc..**
However, I am pretty sure this is the issue.
You need to set the *MembershipProvider* Property for your ASP.NET controls. Making the defin... |
62,044 | <p>I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, <code>-exec</code> on find doesn't allow to use pipe or even <code>\|</code> because the shell interprets that character first. </p>
<p>Here is specifically what I'm trying to do (whic... | [
{
"answer_id": 62054,
"author": "Xetius",
"author_id": 274,
"author_profile": "https://Stackoverflow.com/users/274",
"pm_score": 1,
"selected": false,
"text": "<p>As this outputs a list would you not :</p>\n\n<pre><code>find /path/to/jpgs -type f -exec jhead -v {} \\; | grep 123\n</code>... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3499/"
] | I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, `-exec` on find doesn't allow to use pipe or even `\|` because the shell interprets that character first.
Here is specifically what I'm trying to do (which doesn't work because pipe ends t... | Try this
```
find /path/to/jpgs -type f -exec sh -c 'jhead -v {} | grep 123' \; -print
```
Alternatively you could try to embed your exec statement inside a sh script and then do:
```
find -exec some_script {} \;
``` |
62,079 | <p>I am trying to get some accurate runtime comparisons of PHP vs Python (and potentially any other language that I have to include). Timing within a script is not my problem but timing within a script does not account for everything from the moment the request is made to run the script to output.</p>
<blockquote>
<... | [
{
"answer_id": 62094,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 3,
"selected": true,
"text": "<p>If your idea is to compare the languages, I'd say anything outside them is not relevant for comparison purposes. </... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384652/"
] | I am trying to get some accurate runtime comparisons of PHP vs Python (and potentially any other language that I have to include). Timing within a script is not my problem but timing within a script does not account for everything from the moment the request is made to run the script to output.
>
> 1) Is it actually ... | If your idea is to compare the languages, I'd say anything outside them is not relevant for comparison purposes.
Nonetheless you can use the time command to measure everything and can compare it with the timing within a script.
Like this:
```
$ time script.php
HI!
real 0m3.218s
user 0m0.080s
sys 0m0.064s... |
62,086 | <p>I am using Adobe Flex/Air here, but as far as I know this applies to all of JavaScript. I have come across this problem a few times, and there must be an easy solution out there!</p>
<p>Suppose I have the following XML (using e4x):</p>
<pre><code>var xml:XML = <root><example>foo</example></roo... | [
{
"answer_id": 62165,
"author": "Loren Segal",
"author_id": 6436,
"author_profile": "https://Stackoverflow.com/users/6436",
"pm_score": 0,
"selected": false,
"text": "<p>If you're trying to change the root element of a document, you don't really need to-- just throw out the existing docu... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6448/"
] | I am using Adobe Flex/Air here, but as far as I know this applies to all of JavaScript. I have come across this problem a few times, and there must be an easy solution out there!
Suppose I have the following XML (using e4x):
```
var xml:XML = <root><example>foo</example></root>
```
I can change the contents of the ... | It seems you confuse variables for the values they contain. The assignment
```
node = textInput.text;
```
changes the value the *variable* `node` points to, it doesn't change anything with the object that `node` currently points to. To do what you want to do you can use the `setChildren` method of the `XML` class:
... |
62,137 | <p>I've just heard the term covered index in some database discussion - what does it mean?</p>
| [
{
"answer_id": 62140,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 7,
"selected": true,
"text": "<p>A <em>covering index</em> is an index that contains all of, and possibly more, the columns you need for your query.<... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5466/"
] | I've just heard the term covered index in some database discussion - what does it mean? | A *covering index* is an index that contains all of, and possibly more, the columns you need for your query.
For instance, this:
```
SELECT *
FROM tablename
WHERE criteria
```
will typically use indexes to speed up the resolution of which rows to retrieve using *criteria*, but then it will go to the full table to r... |
62,153 | <p>Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool.</p>
<p>The arguments I've heard in favous are usually along the lines of :</p>
<ul>
<li>Wanting to 'eat our own dog food' in terms of some internally built web fra... | [
{
"answer_id": 62162,
"author": "Slavo",
"author_id": 1801,
"author_profile": "https://Stackoverflow.com/users/1801",
"pm_score": 3,
"selected": false,
"text": "<p>The most basic argument for me would be the time loss. I doubt it could be completed in less than a month or two. Why spend ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/797/"
] | Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool.
The arguments I've heard in favous are usually along the lines of :
* Wanting to 'eat our own dog food' in terms of some internally built web framework
* Needing some... | First, look at these [Ohloh](http://ohloh.net) metrics:
```
Trac: 44 KLoC, 10 Person Years, $577,003
Bugzilla: 54 KLoC, 13 Person Years, $714,437
Redmine: 171 KLoC, 44 Person Years, $2,400,723
Mantis: 182 KLoC, 47 Person Years, $2,562,978
```
What do we learn from these numbers? We learn that building Y... |
62,188 | <p>To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome.</p>
<p>ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call "recursion" is really iteration, and any solution which can be converted to an iterative sol... | [
{
"answer_id": 62189,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 7,
"selected": false,
"text": "<p>My current best (in x86 assembly) is:</p>\n\n<pre><code>push eax\njmp short $-1\n</code></pre>\n\n<p>which results in 3 by... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13/"
] | To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome.
ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call "recursion" is really iteration, and any solution which can be converted to an iterative solution rela... | All these answers and no Befunge? I'd wager a fair amount it's shortest solution of them all:
```
1
```
Not kidding. Try it yourself: <http://www.quirkster.com/iano/js/befunge.html>
EDIT: I guess I need to explain this one. The 1 operand pushes a 1 onto Befunge's internal stack and the lack of anything else puts it... |
62,226 | <p>An instance of class A instantiates a couple of other objects, say for example from class B:</p>
<pre><code>$foo = new B();
</code></pre>
<p>I would like to access A's public class variables from methods within B.</p>
<p>Unless I'm missing something, the only way to do this is to pass the current object to the i... | [
{
"answer_id": 62242,
"author": "Hanno Fietz",
"author_id": 2077,
"author_profile": "https://Stackoverflow.com/users/2077",
"pm_score": 1,
"selected": false,
"text": "<p>I would first check if you are not using the wrong pattern: From your application logic, should B really know about A?... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6260/"
] | An instance of class A instantiates a couple of other objects, say for example from class B:
```
$foo = new B();
```
I would like to access A's public class variables from methods within B.
Unless I'm missing something, the only way to do this is to pass the current object to the instances of B:
```
$foo = new B($... | That looks fine to me, I tend to use a rule of thumb of "would someone maintaining this understand it?" and that's an easily understood solution.
If there's only one "A", you could consider using the registry pattern, see for example <http://www.phppatterns.com/docs/design/the_registry> |
62,230 | <p>How do I save a jpg image to database and then load it in Delphi using FIBplus and TImage?</p>
| [
{
"answer_id": 62271,
"author": "Roger Ween",
"author_id": 6143,
"author_profile": "https://Stackoverflow.com/users/6143",
"pm_score": -1,
"selected": false,
"text": "<p><a href=\"http://delphi.about.com/od/database/l/aa030601a.htm\" rel=\"nofollow noreferrer\">Take a look here.</a>\nI t... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6155/"
] | How do I save a jpg image to database and then load it in Delphi using FIBplus and TImage? | ```
var
S : TMemoryStream;
begin
S := TMemoryStream.Create;
try
TBlobField(AdoQuery1.FieldByName('ImageField')).SaveToStream(S);
S.Position := 0;
Image1.Picture.Graphic.LoadFromStream(S);
finally
S.Free;
end;
end;
```
if you are using JPEG images, add JPG unit to **uses** clause of your unit... |
62,245 | <p>I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. ... | [
{
"answer_id": 62556,
"author": "uwiger",
"author_id": 6834,
"author_profile": "https://Stackoverflow.com/users/6834",
"pm_score": 2,
"selected": false,
"text": "<p>It is difficult to write generic access functions for records.\nOne workaround for this is the <a href=\"http://forum.trape... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5601/"
] | I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. Cur... | I wrote some code a while ago that merges two records. Is not entirely dynamic, but whith macros you could easily use it for several records.
It works like this: The merge/2 function takes two records and converts them to lists together with the empty record for reference (the record type is defined at compile time, a... |
62,264 | <p>I recently asked about <a href="https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </p>
<p>For better or worse, the project I'm working on at... | [
{
"answer_id": 62288,
"author": "Lily Ballard",
"author_id": 582,
"author_profile": "https://Stackoverflow.com/users/582",
"pm_score": 1,
"selected": false,
"text": "<p>You could set the ident attribute on your files, but that would produce strings like</p>\n\n<pre><code>$Id: deadbeefdea... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62264",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4161/"
] | I recently asked about [keyword expansion in Git](https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks) and I'm willing to accept the design not to really support this idea in Git.
For better or worse, the project I'm working on at the moment requires ... | What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, `git checkout` is designed to not touch any files that are identical in both branches.
Unfortunately, RCS keyword substitution breaks this. For example, using `$Date$` would require `git checkout` to touch every fi... |
62,289 | <p>How is it possible to read/write to the Windows registry using Java?</p>
| [
{
"answer_id": 62291,
"author": "Epaga",
"author_id": 6583,
"author_profile": "https://Stackoverflow.com/users/6583",
"pm_score": 4,
"selected": false,
"text": "<p>Yes, using the java.util.Preferences API, since the Windows implementation of it uses the Registry as a backend.</p>\n<p>In ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How is it possible to read/write to the Windows registry using Java? | I know this question is old, but it is the first search result on google to "java read/write to registry". Recently I found this amazing piece of code which:
* Can read/write to ANY part of the registry.
* DOES NOT USE JNI.
* DOES NOT USE ANY 3rd PARTY/EXTERNAL APPLICATIONS TO WORK.
* DOES NOT USE THE WINDOWS API (dir... |
62,317 | <p>In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?</p>
| [
{
"answer_id": 62367,
"author": "Paul Dixon",
"author_id": 6521,
"author_profile": "https://Stackoverflow.com/users/6521",
"pm_score": 4,
"selected": true,
"text": "<p>If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com? | If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send it an HTTP request like this
```
GET /dmsfm HTTP/1.0
Host: tinyurl.com
```
The response you get back will look like
```
HTTP/1.0 301 Moved Permanently
Connection: close
X-Powered-By: PHP/5.2.6
Loc... |
62,340 | <pre><code>std::vector<int> ints;
// ... fill ints with random values
for(std::vector<int>::iterator it = ints.begin(); it != ints.end(); )
{
if(*it < 10)
{
*it = ints.back();
ints.pop_back();
continue;
}
it++;
}
</code></pre>
<p>This code is not working because... | [
{
"answer_id": 62368,
"author": "David Joyner",
"author_id": 1146,
"author_profile": "https://Stackoverflow.com/users/1146",
"pm_score": 1,
"selected": false,
"text": "<p>Iterators are only invalidated on reallocation of storage. Google is your friend: <a href=\"http://www.sgi.com/tech/... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6605/"
] | ```
std::vector<int> ints;
// ... fill ints with random values
for(std::vector<int>::iterator it = ints.begin(); it != ints.end(); )
{
if(*it < 10)
{
*it = ints.back();
ints.pop_back();
continue;
}
it++;
}
```
This code is not working because when `pop_back()` is called, `it`... | The call to [`pop_back()`](http://en.cppreference.com/w/cpp/container/vector/pop_back) removes the last element in the vector and so the iterator to that element is invalidated. The `pop_back()` call does *not* invalidate iterators to items before the last element, only reallocation will do that. From Josuttis' "C++ St... |
62,353 | <p>I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?</p>
<hr>
<p><em>Edit: If you are interested t... | [
{
"answer_id": 62631,
"author": "SaguiItay",
"author_id": 6980,
"author_profile": "https://Stackoverflow.com/users/6980",
"pm_score": 0,
"selected": false,
"text": "<p>Using a single AseemblyInfo.cs file for multiple projects is not recommended.\nThe AssemblyInfo file includes informatio... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2361/"
] | I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?
---
*Edit: If you are interested there is a foll... | We're using a global file called GlobalAssemblyInfo.cs and a local one called AssemblyInfo.cs. The global file contains the following attributes:
```
[assembly: AssemblyProduct("Your Product Name")]
[assembly: AssemblyCompany("Your Company")]
[assembly: AssemblyCopyright("Copyright © 2008 ...")]
[assembly: Assemb... |
62,365 | <p>Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows:</p>
<pre><code>MyService service = new MyService();
service.MyMethod();
</code></pre>
<p>I need to do similar, with service and method not known until runtime. </p>
<p>I'm assu... | [
{
"answer_id": 62381,
"author": "Kibbee",
"author_id": 1862,
"author_profile": "https://Stackoverflow.com/users/1862",
"pm_score": 3,
"selected": true,
"text": "<p>I'm not sure if this would be the best way to go about it. The most obvious way to me, would be to make an HTTP Request, an... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60/"
] | Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows:
```
MyService service = new MyService();
service.MyMethod();
```
I need to do similar, with service and method not known until runtime.
I'm assuming that reflection is the way to g... | I'm not sure if this would be the best way to go about it. The most obvious way to me, would be to make an HTTP Request, and call the webservice using an actual HTTP GET or POST. Using your method, I'm not entirely sure how you'd set up the data you are sending to the web service. I've added some sample code in VB.Net
... |
62,382 | <p>I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they <em>have</em> to be DPs because I want to be able to animate them.)</p>
<p>However, when I try to run a storyboard to animate both of thes... | [
{
"answer_id": 72058,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>I would try commenting out the InvalidateArrange in the OnPropertyChanged and see what happens.</p>\n"
},
{
"answer_... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6483/"
] | I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they *have* to be DPs because I want to be able to animate them.)
However, when I try to run a storyboard to animate both of these properties, Sil... | It's a documented bug with Silverlight 2 Beta 2. You can't animate two custom dependancy properties on the same object. |
62,430 | <p>Is is possible to construct a regular expression that rejects all input strings?</p>
| [
{
"answer_id": 62438,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": -1,
"selected": false,
"text": "<p>EDIT:\n [^\\n\\r\\w\\s]</p>\n"
},
{
"answer_id": 62473,
"author": "Jan Hančič",
"author_id": 185527,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4984/"
] | Is is possible to construct a regular expression that rejects all input strings? | Probably this:
```
[^\w\W]
```
\w - word character (letter, digit, etc)
\W - opposite of \w
[^\w\W] - should always fail, because any character should belong to one of the character classes - \w or \W
Another snippets:
```
$.^
```
$ - assert position at the end of the string
^ - assert position at the sta... |
62,436 | <p>I am having a problem with the speed of accessing an association property with a large number of records.</p>
<p>I have an XAF app with a parent class called <code>MyParent</code>.</p>
<p>There are 230 records in <code>MyParent</code>.</p>
<p><code>MyParent</code> has a child class called <code>MyChild</code>.</p... | [
{
"answer_id": 78123,
"author": "Tim Jarvis",
"author_id": 10387,
"author_profile": "https://Stackoverflow.com/users/10387",
"pm_score": 3,
"selected": true,
"text": "<p>Firstly you are right to be sceptical that this operation should take this long, XPO on read operations should add onl... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6783/"
] | I am having a problem with the speed of accessing an association property with a large number of records.
I have an XAF app with a parent class called `MyParent`.
There are 230 records in `MyParent`.
`MyParent` has a child class called `MyChild`.
There are 49,000 records in `MyChild`.
I have an association defined... | Firstly you are right to be sceptical that this operation should take this long, XPO on read operations should add only between 30 - 70% overhead, and on this tiny amount of data we should be talking milli-seconds not seconds.
Some general perf tips are available in the DevExpress forums, and centre around object cach... |
62,437 | <p>I load some XML from a servlet from my Flex application like this:</p>
<pre><code>_loader = new URLLoader();
_loader.load(new URLRequest(_servletURL+"?do=load&id="+_id));
</code></pre>
<p>As you can imagine <code>_servletURL</code> is something like <a href="http://foo.bar/path/to/servlet" rel="nofollow norefe... | [
{
"answer_id": 62519,
"author": "grapefrukt",
"author_id": 914,
"author_profile": "https://Stackoverflow.com/users/914",
"pm_score": 2,
"selected": false,
"text": "<p>I'm not sure if this will be any different, but this is a cleaner way of achieving the same URLRequest:</p>\n\n<pre><code... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199623/"
] | I load some XML from a servlet from my Flex application like this:
```
_loader = new URLLoader();
_loader.load(new URLRequest(_servletURL+"?do=load&id="+_id));
```
As you can imagine `_servletURL` is something like <http://foo.bar/path/to/servlet>
In some cases, this URL contains accented characters (long story). I... | My friend Luis figured it out:
You should use encodeURI does the UTF8URL encoding
<http://livedocs.adobe.com/flex/3/langref/package.html#encodeURI()>
but not unescape because it unescapes to ASCII see
<http://livedocs.adobe.com/flex/3/langref/package.html#unescape()>
I think that is where we are getting a %E9 in the... |
62,447 | <p>Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation.</p>
<p>The log (catalina.out) says:</p>
<pre><code>Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomc... | [
{
"answer_id": 62488,
"author": "Stu Thompson",
"author_id": 2961,
"author_profile": "https://Stackoverflow.com/users/2961",
"pm_score": 0,
"selected": false,
"text": "<p>This screams class path issue, to me. Where exactly is your tomcat installed? (Give us command line printouts of wh... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation.
The log (catalina.out) says:
```
Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HO... | Seems like you've implemented a JMX service and tried to install it on your server.xml file but forgot to add the apache commons modeler jar to the server/lib directory (therefore the `ClassNotFoundException` for `org.apache.commons.modeler.Registry`). Check your server.xml file for anything you might have added, and t... |
62,449 | <p>When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads?</p>
<p>The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available for further incoming connections (and for every new incomin... | [
{
"answer_id": 62481,
"author": "Paul van Brenk",
"author_id": 1837197,
"author_profile": "https://Stackoverflow.com/users/1837197",
"pm_score": 0,
"selected": false,
"text": "<p>I would use a threadpool, this way you won't have to start a new thread every time (since this is kinda expen... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1271/"
] | When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads?
The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available for further incoming connections (and for every new incoming connecti... | The code that I've been using looks like this:
```
class Server
{
private AutoResetEvent connectionWaitHandle = new AutoResetEvent(false);
public void Start()
{
TcpListener listener = new TcpListener(IPAddress.Any, 5555);
listener.Start();
while(true)
{
IAsyncResult result = listener.Beg... |
62,490 | <p>I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the following form:</p>
<pre><code><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3... | [
{
"answer_id": 179495,
"author": "Ian McLaird",
"author_id": 18796,
"author_profile": "https://Stackoverflow.com/users/18796",
"pm_score": 2,
"selected": false,
"text": "<p>I have the same issue. For the moment, I've worked around it by writing a BasicHandler extension, and then walking... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5035/"
] | I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the following form:
```
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSche... | I have the same issue. For the moment, I've worked around it by writing a BasicHandler extension, and then walking the SOAPPart myself and moving the namespace reference up to a parent node. I don't *like* this solution, but it does seem to work.
I really hope somebody comes along and tells us what we have to do.
***... |
62,501 | <p>I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this: </p... | [
{
"answer_id": 62560,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": true,
"text": "<p>You can do it , the account needs to exist on the remote machine and you need to use the machine name for the domain name in ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6698/"
] | I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this:
```
//a... | You can do it , the account needs to exist on the remote machine and you need to use the machine name for the domain name in the LogonUser call. |
62,504 | <p>I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it?</p>
| [
{
"answer_id": 62572,
"author": "Rikalous",
"author_id": 4271,
"author_profile": "https://Stackoverflow.com/users/4271",
"pm_score": 1,
"selected": false,
"text": "<p>No - a query in Access is a single SQL statement. There is no way of creating a batch of several statements within one qu... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6613/"
] | I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it? | yes and no.
You can't do:
```
insert into foo (c1, c2, c3)
values ("v1a", "v2a", "v3a"),
("v1b", "v2b", "v3b"),
("v1c", "v2c", "v3c")
```
but you can do
```
insert into foo (c1, c2, c3)
select (v1, v2, v3) from bar
```
What does that get you if you don't already have the data in a table? Well, ... |
62,512 | <p>I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using <code>STL</code> techniques such as vectors.</p>
<p>Essentially I want my integer array dimensions to look like:</p>
<pre><code>[ x ][ y ][ z... | [
{
"answer_id": 62532,
"author": "ChrisN",
"author_id": 3853,
"author_profile": "https://Stackoverflow.com/users/3853",
"pm_score": 5,
"selected": true,
"text": "<p>Have a look at the Boost <a href=\"http://www.boost.org/doc/libs/release/libs/multi_array\" rel=\"noreferrer\">multi-dimensi... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6795/"
] | I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using `STL` techniques such as vectors.
Essentially I want my integer array dimensions to look like:
```
[ x ][ y ][ z ]
```
x and y are in the rang... | Have a look at the Boost [multi-dimensional array](http://www.boost.org/doc/libs/release/libs/multi_array) library. Here's an example (adapted from the Boost documentation):
```
#include "boost/multi_array.hpp"
int main() {
// Create a 3D array that is 20 x 30 x 4
int x = 20;
int y = 30;
int z = 4;
typedef... |
62,529 | <p>The RoR tutorials posit one model per table for the ORM to work.
My DB schema has some 70 tables divided conceptually into 5 groups of functionality
(eg, any given table lives in one and only one functional group, and relations between tables of different groups are minimised.)
So: should I design a model per conce... | [
{
"answer_id": 62677,
"author": "Clinton Dreisbach",
"author_id": 6262,
"author_profile": "https://Stackoverflow.com/users/6262",
"pm_score": 3,
"selected": false,
"text": "<p>Most likely, you should have 70 models. You could namespace the models to have 5 namespaces, one for each group,... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6941/"
] | The RoR tutorials posit one model per table for the ORM to work.
My DB schema has some 70 tables divided conceptually into 5 groups of functionality
(eg, any given table lives in one and only one functional group, and relations between tables of different groups are minimised.)
So: should I design a model per conceptua... | I cover this in one of my large apps by just making sure that the tables/models are conceptually grouped by name (with almost 1:1 table-model relationship). Example:
```
events
event_types
event_groups
event_attendees
etc...
```
That way when I'm using TextMate or whatever, the model files are nicely grouped togethe... |
62,567 | <p>What is the easiest way to compare strings in Python, ignoring case?</p>
<p>Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads).</p>
<p>I guess I'm looking for an equivalent to C's stricmp().</p>
<p>[Some more conte... | [
{
"answer_id": 62592,
"author": "Mark Biek",
"author_id": 305,
"author_profile": "https://Stackoverflow.com/users/305",
"pm_score": 0,
"selected": false,
"text": "<p>I'm pretty sure you either have to use .lower() or use a regular expression. I'm not aware of a built-in case-insensitive... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6984/"
] | What is the easiest way to compare strings in Python, ignoring case?
Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads).
I guess I'm looking for an equivalent to C's stricmp().
[Some more context requested, so I'll demon... | In response to your clarification...
You could use [ctypes](http://docs.python.org/lib/ctypes-ctypes-tutorial.html) to execute the c function "strcasecmp". Ctypes is included in Python 2.5. It provides the ability to call out to dll and shared libraries such as libc. Here is a quick example (Python on Linux; see link ... |
62,588 | <p>I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of <em>per server</em>. It's used for simple translation of data, but does spend some time during start-up loading things from the web.config file, etc. <em>The helper class is 100% thread-safe. Think of... | [
{
"answer_id": 62913,
"author": "Donny V.",
"author_id": 1231,
"author_profile": "https://Stackoverflow.com/users/1231",
"pm_score": 0,
"selected": false,
"text": "<p>I 'v done something like this in my own app in the past and it caused all kinds of weird errors.\nEvery user will have ac... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6897/"
] | I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of *per server*. It's used for simple translation of data, but does spend some time during start-up loading things from the web.config file, etc. *The helper class is 100% thread-safe. Think of it as a simp... | It's not wise to use application state unless you absolutely require it, things are much simpler if you stick to using per-request objects. Any addition of state to the helper classes could cause all sorts of subtle errors. Use the HttpContext.Current items collection and intialise it per request. A VB module would do ... |
62,599 | <p>How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls?</p>
<p><strong>Edit due to camainc's answer:</strong> I also have a constraint that I have to have all the code in a single project.</p>
<p><strong>Edit to finalise question:... | [
{
"answer_id": 62817,
"author": "camainc",
"author_id": 7232,
"author_profile": "https://Stackoverflow.com/users/7232",
"pm_score": 2,
"selected": true,
"text": "<p>I'm not sure if this is what you are asking, but this is how we do it.</p>\n\n<p>We namespace all of our projects in a cons... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6369/"
] | How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls?
**Edit due to camainc's answer:** I also have a constraint that I have to have all the code in a single project.
**Edit to finalise question:** As I suspected it isn't possible ... | I'm not sure if this is what you are asking, but this is how we do it.
We namespace all of our projects in a consistent manner, user controls are no different. We also namespace using the project settings window, although you could do it through a combination of the project window and in code.
Each solution gets a na... |
62,606 | <p>I'm using <code>int</code> as an example, but this applies to any value type in .Net</p>
<p>In .Net 1 the following would throw a compiler exception:</p>
<pre><code>int i = SomeFunctionThatReturnsInt();
if( i == null ) //compiler exception here
</code></pre>
<p>Now (in .Net 2 or 3.5) that exception has gone.</p>... | [
{
"answer_id": 62724,
"author": "ima",
"author_id": 5733,
"author_profile": "https://Stackoverflow.com/users/5733",
"pm_score": 1,
"selected": false,
"text": "<p>Compiler still generates warning when you compare non-nullable type to null, which is just the way it should be. May be your w... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/905/"
] | I'm using `int` as an example, but this applies to any value type in .Net
In .Net 1 the following would throw a compiler exception:
```
int i = SomeFunctionThatReturnsInt();
if( i == null ) //compiler exception here
```
Now (in .Net 2 or 3.5) that exception has gone.
I know why this is:
```
int? j = null; //null... | I don't think this is a compiler problem *per se*; an integer value is never null, but the idea of equating them isn't invalid; it's a valid function that always returns false. And the compiler knows; the code
```
bool oneIsNull = 1 == null;
```
compiles, but gives a compiler warning: `The result of the expression i... |
62,618 | <p>I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method</p>
<pre><code>copy /b 1.mp3+2.mp3 3.mp3
</code></pre>
<p>but it's a pain when there's a lot of them and their namings are inconsistent. The time never seems to come out right either.</p>
| [
{
"answer_id": 62635,
"author": "Thomas Owens",
"author_id": 572,
"author_profile": "https://Stackoverflow.com/users/572",
"pm_score": 3,
"selected": false,
"text": "<p>The time problem has to do with the ID3 headers of the MP3 files, which is something your method isn't taking into acco... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4230/"
] | I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method
```
copy /b 1.mp3+2.mp3 3.mp3
```
but it's a pain when there's a lot of them and their namings are inconsistent. The time never seems to come out right either. | As Thomas Owens pointed out, simply concatenating the files will leave multiple ID3 headers scattered throughout the resulting concatenated file - so the time/bitrate info will be wildly wrong.
You're going to need to use a tool which can combine the audio data for you.
[mp3wrap](http://mp3wrap.sourceforge.net/) woul... |
62,629 | <p>I need to determine when my Qt 4.4.1 application receives focus.</p>
<p>I have come up with 2 possible solutions, but they both don’t work exactly as I would like.</p>
<p>In the first possible solution, I connect the focusChanged() signal from qApp to a SLOT. In the slot I check the ‘old’ pointer. If it ‘0’, the... | [
{
"answer_id": 62820,
"author": "David Dibben",
"author_id": 5022,
"author_profile": "https://Stackoverflow.com/users/5022",
"pm_score": 0,
"selected": false,
"text": "<p>Looking at the Qt docs it seems that focus events are created each time a widget gets the focus, so the sample code y... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460958/"
] | I need to determine when my Qt 4.4.1 application receives focus.
I have come up with 2 possible solutions, but they both don’t work exactly as I would like.
In the first possible solution, I connect the focusChanged() signal from qApp to a SLOT. In the slot I check the ‘old’ pointer. If it ‘0’, then I know we’ve swit... | I think you need to track the [QEvent::ApplicationActivate](http://doc.qt.io/qt-4.8/qevent.html#Type-enum) event.
You can put an [event filter](http://doc.qt.io/qt-4.8/qobject.html#eventFilter) on your QApplication instance and then look for it.
```
bool
ApplicationWindow::eventFilter( QObject * watched, QEvent * eve... |
62,661 | <p>What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)?</p>
| [
{
"answer_id": 67873,
"author": "Corey Ross",
"author_id": 5927,
"author_profile": "https://Stackoverflow.com/users/5927",
"pm_score": 2,
"selected": false,
"text": "<p>I'm haven't used Java too much, but based on the <a href=\"http://keithp.com/~keithp/porterduff/p253-porter.pdf\" rel=\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7071/"
] | What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)? | I'm haven't used Java too much, but based on the [white paper from 1984](http://keithp.com/~keithp/porterduff/p253-porter.pdf), it should be a fairly straightforward mapping of render state blend modes.
There are of course more that you can do than just these, like normal alpha blending (SourceAlpha, InvSourceAlpha) o... |
62,689 | <p>I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) </p>
<p>Looking through the O'Reilly 'cow' books on C, I realize that I can't simply in... | [
{
"answer_id": 62723,
"author": "Kyle Cronin",
"author_id": 658,
"author_profile": "https://Stackoverflow.com/users/658",
"pm_score": 3,
"selected": false,
"text": "<p>It is possible.</p>\n\n<p>To set the nth bit, use OR:</p>\n\n<pre><code>x |= (1 << 5); // sets the 5th-from right\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.)
Looking through the O'Reilly 'cow' books on C, I realize that I can't simply index the bi... | Following on from what Kyle has said, you can use a macro to do the hard work for you.
>
> It is possible.
>
>
> To set the nth bit, use OR:
>
>
> x |= (1 << 5); // sets the 6th-from
> right
>
>
> To clear a bit, use AND:
>
>
> x &= ~(1 << 5); // clears
> 6th-from-right
>
>
> To flip a bit, use XOR:
>
> ... |
62,776 | <p>How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0?</p>
<p>I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. </p>
<p>What makes my head spin is how t... | [
{
"answer_id": 62833,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": -1,
"selected": false,
"text": "<p>It seems to me that you might be better off breaking this into smaller tasks/questions.\nYou have a few issues you are st... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7174/"
] | How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0?
I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel.
What makes my head spin is how to first determine... | With the aid of some heavy pair programming a colleague of mine and I came up with this, feel free to refactor.
The code is placed in the main form. The copyToolStripMenuItem\_Click method handles the Click event on the Copy menu item in the Edit menu.
```
/// <summary>
/// Recursively traverse a tree of cont... |
62,804 | <p>Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its <code>duration</code> type) format into the .NET TimeSpan object?</p>
<p>For example, P0DT1H0M0S which represents a duration of one hour, is converted into New TimeSpan(0,1,0,0,0).... | [
{
"answer_id": 63219,
"author": "user7658",
"author_id": 7658,
"author_profile": "https://Stackoverflow.com/users/7658",
"pm_score": 6,
"selected": true,
"text": "<p>This will convert from xs:duration to TimeSpan:</p>\n\n<pre><code>System.Xml.XmlConvert.ToTimeSpan(\"P0DT1H0M0S\")\n</code... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7105/"
] | Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its `duration` type) format into the .NET TimeSpan object?
For example, P0DT1H0M0S which represents a duration of one hour, is converted into New TimeSpan(0,1,0,0,0).
A Reverse converter... | This will convert from xs:duration to TimeSpan:
```
System.Xml.XmlConvert.ToTimeSpan("P0DT1H0M0S")
```
See <http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx> |
62,810 | <p>I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an <code>archive_exception</code> saying "class name too long". When I c... | [
{
"answer_id": 85626,
"author": "gbjbaanb",
"author_id": 13744,
"author_profile": "https://Stackoverflow.com/users/13744",
"pm_score": 0,
"selected": false,
"text": "<p>According to Jarl it works, check <a href=\"http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?fid=248794&d... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7224/"
] | I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an `archive_exception` saying "class name too long". When I change the prot... | Here's a patch given by Jarl at [CodeProject](http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?msg=2739150#xx2730536xx):
In RcfServer.cpp, before the line where RcfServer::handleSession() is defined (around line 792), insert the following code:
```
void serialize(SerializationProtocolOut & out, const Remote... |
62,814 | <p>Is there any difference between a binary semaphore and mutex or are they essentially the same?</p>
| [
{
"answer_id": 62883,
"author": "Mladen Janković",
"author_id": 6300,
"author_profile": "https://Stackoverflow.com/users/6300",
"pm_score": 9,
"selected": false,
"text": "<ul>\n<li>A <strong>mutex</strong> can be released only by <strong>the thread that had acquired it</strong>. <br></li... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7086/"
] | Is there any difference between a binary semaphore and mutex or are they essentially the same? | They are **NOT** the same thing. They are used for different purposes!
While both types of semaphores have a full/empty state and use the same API, their usage is very different.
**Mutual Exclusion Semaphores**
Mutual Exclusion semaphores are used to protect shared resources (data structure, file, etc..).
A M... |
62,916 | <p>I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when I try to logout I get this error message from the RubyCAS-Server:</p>
<pre><code>Camping Problem!
CASServer::Controllers::Logout.GET
ActiveRecord::StatementInvalid Mysql::Error: Unknown column 'username' in ... | [
{
"answer_id": 62914,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": 0,
"selected": false,
"text": "<p>Are you unable to use the <a href=\"http://msdn.microsoft.com/en-us/library/aa335422(VS.71).aspx\" rel=\"nofollow noreferr... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3842/"
] | I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when I try to logout I get this error message from the RubyCAS-Server:
```
Camping Problem!
CASServer::Controllers::Logout.GET
ActiveRecord::StatementInvalid Mysql::Error: Unknown column 'username' in 'where clause'... | Why not create your own template? I've done that with several types of forms, not just dialogs. It is a great way to give yourself a jump-start.
Create your basic dialog, keeping it as generic as possible, then save it as a template.
Here is an article that will help you:
<http://www.builderau.com.au/program/dotnet/... |
62,929 | <p>I am getting the following error trying to read from a socket. I'm doing a <code>readInt()</code> on that <code>InputStream</code>, and I am getting this error. Perusing the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.</p>
<p>I have acc... | [
{
"answer_id": 62996,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": 4,
"selected": false,
"text": "<p>Whenever I have had odd issues like this, I usually sit down with a tool like <a href=\"http://www.wireshark.org/\" rel=\"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am getting the following error trying to read from a socket. I'm doing a `readInt()` on that `InputStream`, and I am getting this error. Perusing the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.
I have access to the client log files and ... | There are several possible causes.
1. The other end has deliberately reset the connection, in a way which I will not document here. It is rare, and generally incorrect, for application software to do this, but it is not unknown for commercial software.
2. More commonly, it is caused by writing to a connection that the... |
62,936 | <p>For example: <code>man(1)</code>, <code>find(3)</code>, <code>updatedb(2)</code>? </p>
<p>What do the numbers in parentheses (Brit. "brackets") mean?</p>
| [
{
"answer_id": 62943,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 7,
"selected": false,
"text": "<p>The section the command is documented in the manual. The list of sections is documented on man's manual. For examp... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7370/"
] | For example: `man(1)`, `find(3)`, `updatedb(2)`?
What do the numbers in parentheses (Brit. "brackets") mean? | It's the section that the man page for the command is assigned to.
These are split as
1. General commands
2. System calls
3. C library functions
4. Special files (usually devices, those found in /dev) and drivers
5. File formats and conventions
6. Games and screensavers
7. Miscellanea
8. System administration command... |
62,940 | <p>Need to show a credits screen where I want to acknowledge the many contributors to my application. </p>
<p>Want it to be an automatically scrolling box, much like the credits roll at the end of the film.</p>
| [
{
"answer_id": 62978,
"author": "Phil Wright",
"author_id": 6276,
"author_profile": "https://Stackoverflow.com/users/6276",
"pm_score": 0,
"selected": false,
"text": "<p>A quick and dirty method would be to use a Panel with a long list of Label controls on it that list out the various pe... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Need to show a credits screen where I want to acknowledge the many contributors to my application.
Want it to be an automatically scrolling box, much like the credits roll at the end of the film. | A easy-to-use snippet would be to make a multiline textbox. With a timer you may insert line after line and scroll to the end after that:
```
textbox1.SelectionStart = textbox1.Text.Length;
textbox1.ScrollToCaret();
textbox1.Refresh();
```
Not the best method but it's simple and working. There are also some free con... |
62,963 | <p>Last year, Scott Guthrie <a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx" rel="noreferrer">stated</a> “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibili... | [
{
"answer_id": 64612,
"author": "user8456",
"author_id": 8456,
"author_profile": "https://Stackoverflow.com/users/8456",
"pm_score": -1,
"selected": false,
"text": "<p><code>DataContext x = new DataContext</code></p>\n\n<p>Something like this perhaps?</p>\n\n<p><code>var a = x.Where().wi... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5869/"
] | Last year, Scott Guthrie [stated](http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx) “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method.
I would like to mod... | The ability to change the underlying provider and thus modify the SQL did not make the final cut in LINQ to SQL. |
62,987 | <p>A project I'm working on at the moment involves refactoring a C# Com Object which serves as a database access layer to some Sql 2005 databases.</p>
<p>The author of the existent code has built all the sql queries manually using a string and many if-statements to construct the fairly complex sql statement (~10 joins... | [
{
"answer_id": 63009,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"http://www.google.com/search?q=dynamic+LINQ+tutorial\" rel=\"nofollow noreferrer\">LINQ</a> is the way t... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5005/"
] | A project I'm working on at the moment involves refactoring a C# Com Object which serves as a database access layer to some Sql 2005 databases.
The author of the existent code has built all the sql queries manually using a string and many if-statements to construct the fairly complex sql statement (~10 joins, >10 sub ... | I used C# and Linq to do something similar to get log entries filtered on user input (see [Conditional Linq Queries](https://stackoverflow.com/questions/11194/conditional-linq-queries)):
```
IQueryable<Log> matches = m_Locator.Logs;
// Users filter
if (usersFilter)
matches = matches.Where(l => l.UserName == combo... |
62,995 | <p>I am currently building in Version 3.5 of the .Net framework and I have a resource (.resx) file that I am trying to access in a web application. I have exposed the .resx properties as public access modifiers and am able to access these properties in the controller files or other .cs files in the web app. My questi... | [
{
"answer_id": 63062,
"author": "Joel Martinez",
"author_id": 5416,
"author_profile": "https://Stackoverflow.com/users/5416",
"pm_score": 2,
"selected": false,
"text": "<p>Expose the resource property you want to consume in the page as a protected page property. Then you can just do use... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7215/"
] | I am currently building in Version 3.5 of the .Net framework and I have a resource (.resx) file that I am trying to access in a web application. I have exposed the .resx properties as public access modifiers and am able to access these properties in the controller files or other .cs files in the web app. My question is... | ```cs
<%= Resources.<ResourceName>.<Property> %>
``` |
63,008 | <p>I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location.</p>
<p>I will not know which version of SQL Server will be installed on the machine where the application runs. Therefore, I need to f... | [
{
"answer_id": 63200,
"author": "Darrel Miller",
"author_id": 6819,
"author_profile": "https://Stackoverflow.com/users/6819",
"pm_score": 1,
"selected": false,
"text": "<p>One option, that may be a simpler solution, is to create a new database on your destination server and then RESTORE ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6389/"
] | I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location.
I will not know which version of SQL Server will be installed on the machine where the application runs. Therefore, I need to find the def... | What I discovered is that
```
Microsoft.SqlServer.Management.Smo.Server(ServerName).Settings.DefaultFile
```
only returns non-null when there is no path explicitly defined. As soon as you specify a path which is not the default, then this function returns that path correctly.
So, a simple workaround was to check w... |
63,011 | <p>I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. </p>
<p>Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser?</p>
| [
{
"answer_id": 63039,
"author": "Erik",
"author_id": 6733,
"author_profile": "https://Stackoverflow.com/users/6733",
"pm_score": 4,
"selected": true,
"text": "<p>Try <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval\" rel=\"nofollow noreferr... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7417/"
] | I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning.
Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser? | Try [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval) or [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/settimeout).
Here is an example:
```js
(show = (o) => setTimeout(() => {
console.log(o)
show(++o)
}, 1000))(1);
... |
63,043 | <p>Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project. </p>
| [
{
"answer_id": 63554,
"author": "Doanair",
"author_id": 4774,
"author_profile": "https://Stackoverflow.com/users/4774",
"pm_score": 0,
"selected": false,
"text": "<p>There are several serialization options in WCF: Data contract, XML Serialization and and raw data payload. Which of these ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7375/"
] | Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project. | I found that it doesn't work with internal/private types, but making my type public it worked fine. This means no anonymous types either :(
Using reflector I found the method ClassDataContract.IsNonAttributedTypeValidForSerialization(Type) that seems to make the decision. It's the last line that seems to be the killer... |
63,067 | <p>We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works.
The problem we are seeing is that it expects the requests to be formatted using Web Services Security, so we are ... | [
{
"answer_id": 63651,
"author": "Doanair",
"author_id": 4774,
"author_profile": "https://Stackoverflow.com/users/4774",
"pm_score": 2,
"selected": false,
"text": "<p>Funny you should ask this question. I asked Microsoft how to do this about a year ago. At the time, using .NET 3.0, it was... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works.
The problem we are seeing is that it expects the requests to be formatted using Web Services Security, so we are doin... | Funny you should ask this question. I asked Microsoft how to do this about a year ago. At the time, using .NET 3.0, it was not possible. Not sure if that changed in the 3.5 world. But, no, there was no physical way of adding security to the request and leaving the response empty.
At my previous employer we used a mode... |
63,104 | <p>When a previous Vim session crashed, you are greeted with the "Swap file ... already exists!" for each and every file that was open in the previous session.</p>
<p>Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of:</p>
<ul>
<li>If the swapped version doe... | [
{
"answer_id": 63341,
"author": "Chouser",
"author_id": 7624,
"author_profile": "https://Stackoverflow.com/users/7624",
"pm_score": 6,
"selected": true,
"text": "<p>I have vim store my swap files in a single local directory, by having this in my .vimrc:</p>\n\n<pre><code>set directory=~/... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6918/"
] | When a previous Vim session crashed, you are greeted with the "Swap file ... already exists!" for each and every file that was open in the previous session.
Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of:
* If the swapped version does not contain unsaved... | I have vim store my swap files in a single local directory, by having this in my .vimrc:
```
set directory=~/.vim/swap,.
```
Among other benefits, this makes the swap files easy to find all at once.
Now when my laptop loses power or whatever and I start back up with a bunch of swap files laying around, I just run my... |
63,150 | <p>While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this:</p>
<pre><code>public String appendWithDelimiter( Stri... | [
{
"answer_id": 63173,
"author": "Stu Thompson",
"author_id": 2961,
"author_profile": "https://Stackoverflow.com/users/2961",
"pm_score": 4,
"selected": false,
"text": "<p>Use an approach based on <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html\" rel=\"noref... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2041950/"
] | While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this:
```
public String appendWithDelimiter( String original, S... | ### Pre Java 8:
Apache's commons lang is your friend here - it provides a join method very similar to the one you refer to in Ruby:
[`StringUtils.join(java.lang.Iterable,char)`](http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#join(java.lang.Iterable,%20char))
---
###... |
63,166 | <p>I once had the task of determining the following performance parameters from inside a running application:</p>
<ul>
<li>Total virtual memory available</li>
<li>Virtual memory currently used</li>
<li>Virtual memory currently used by my process<hr></li>
<li>Total RAM available</li>
<li>RAM currently used</li>
<li>RAM ... | [
{
"answer_id": 64166,
"author": "Lanzelot",
"author_id": 7381,
"author_profile": "https://Stackoverflow.com/users/7381",
"pm_score": 10,
"selected": false,
"text": "<h2>Windows</h2>\n<p>Some of the above values are easily available from the appropriate Win32 API, I just list them here fo... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7381/"
] | I once had the task of determining the following performance parameters from inside a running application:
* Total virtual memory available
* Virtual memory currently used
* Virtual memory currently used by my process
---
* Total RAM available
* RAM currently used
* RAM currently used by my process
---
* % CPU curre... | Windows
-------
Some of the above values are easily available from the appropriate Win32 API, I just list them here for completeness. Others, however, need to be obtained from the Performance Data Helper library (PDH), which is a bit "unintuitive" and takes a lot of painful trial and error to get to work. (At least it... |
63,181 | <p>In Flex, I have an xml document such as the following:</p>
<pre><code>var xml:XML = <root><node>value1</node><node>value2</node><node>value3</node></root>
</code></pre>
<p>At runtime, I want to create a TextInput control for each node under root, and have the values ... | [
{
"answer_id": 64166,
"author": "Lanzelot",
"author_id": 7381,
"author_profile": "https://Stackoverflow.com/users/7381",
"pm_score": 10,
"selected": false,
"text": "<h2>Windows</h2>\n<p>Some of the above values are easily available from the appropriate Win32 API, I just list them here fo... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6448/"
] | In Flex, I have an xml document such as the following:
```
var xml:XML = <root><node>value1</node><node>value2</node><node>value3</node></root>
```
At runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far as I can tell I can't use BindingUt... | Windows
-------
Some of the above values are easily available from the appropriate Win32 API, I just list them here for completeness. Others, however, need to be obtained from the Performance Data Helper library (PDH), which is a bit "unintuitive" and takes a lot of painful trial and error to get to work. (At least it... |
63,206 | <p>If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?</p>
| [
{
"answer_id": 63227,
"author": "Stu Thompson",
"author_id": 2961,
"author_profile": "https://Stackoverflow.com/users/2961",
"pm_score": 2,
"selected": true,
"text": "<p>It should be as simple as looking at /System/Library/Frameworks/JavaVM.framework/Versions/</p>\n\n<p>E.g. from my mach... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7292/"
] | If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation? | It should be as simple as looking at /System/Library/Frameworks/JavaVM.framework/Versions/
E.g. from my machine:
```
manoa:~ stu$ ll /System/Library/Frameworks/JavaVM.framework/Versions/
total 56
774077 lrwxr-xr-x 1 root wheel 5 Jul 23 15:31 1.3 -> 1.3.1
167151 drwxr-xr-x 3 root wheel 102 Jan 14 2008 1.3.1
1... |
63,291 | <p>How do I select all the columns in a table that only contain NULL values for all the rows? I'm using <strong>MS SQL Server 2005</strong>. I'm trying to find out which columns are not used in the table so I can delete them.</p>
| [
{
"answer_id": 63312,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "<pre><code>SELECT cols\nFROM table\nWHERE cols IS NULL\n</code></pre>\n"
},
{
"answer_id": 63374,
"author": "Charle... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/299/"
] | How do I select all the columns in a table that only contain NULL values for all the rows? I'm using **MS SQL Server 2005**. I'm trying to find out which columns are not used in the table so I can delete them. | Here is the sql 2005 or later version: Replace ADDR\_Address with your tablename.
```
declare @col varchar(255), @cmd varchar(max)
DECLARE getinfo cursor for
SELECT c.name FROM sys.tables t JOIN sys.columns c ON t.Object_ID = c.Object_ID
WHERE t.Name = 'ADDR_Address'
OPEN getinfo
FETCH NEXT FROM getinfo into @col
... |
63,295 | <p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.
My cluster is under /portal/yadda.
I want anyone who goes to </p>
<pre><code>http://the.domain.com/
</code></pre>
<p>to be quickly redirected to </p>
<pre><code>http://the.domain.com/portal/
</code></pre>
<p>I have and index.html that does a post and... | [
{
"answer_id": 63362,
"author": "wolak",
"author_id": 7717,
"author_profile": "https://Stackoverflow.com/users/7717",
"pm_score": 0,
"selected": false,
"text": "<p>Does this help?\n<a href=\"http://docs.sun.com/source/816-5691-10/essearch.htm#25618\" rel=\"nofollow noreferrer\">http://do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7659/"
] | I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.
My cluster is under /portal/yadda.
I want anyone who goes to
```
http://the.domain.com/
```
to be quickly redirected to
```
http://the.domain.com/portal/
```
I have and index.html that does a post and redirect, but the user sometimes sees it.
Does a... | Does this help?
<http://docs.sun.com/source/816-5691-10/essearch.htm#25618>
---
To map a URL, perform the following steps:
Open the Class Manager and select the server instance from the drop-down list.
Choose the Content Mgmt tab.
Click the Additional Document Directories link.
The web server displays the Addition... |
63,303 | <p>I have a System.Diagnostics.Process object in a program targeted at the .Net framework 3.5</p>
<p>I have redirected both <code>StandardOutput</code> and <code>StandardError</code> pipes and I'm receiving data from them asynchronously. I've also set an event handler for the Exited event.</p>
<p>Once I call <code>P... | [
{
"answer_id": 1423665,
"author": "csharptest.net",
"author_id": 164392,
"author_profile": "https://Stackoverflow.com/users/164392",
"pm_score": 5,
"selected": false,
"text": "<p>The answer to this is that <a href=\"https://msdn.microsoft.com/en-us/library/system.diagnostics.datareceived... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a System.Diagnostics.Process object in a program targeted at the .Net framework 3.5
I have redirected both `StandardOutput` and `StandardError` pipes and I'm receiving data from them asynchronously. I've also set an event handler for the Exited event.
Once I call `Process.Start()` I want to go off and do other... | The answer to this is that [`e.Data` will be set to `null`](https://msdn.microsoft.com/en-us/library/system.diagnostics.datareceivedeventhandler%28v=vs.110%29.aspx):
```
static void proc_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
if( e.Data == null ) _exited.Set();
}
``` |
63,399 | <p>I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts.</p>
<p>Is there some way in which MySQL will return an </p>
<pre><code>INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd')
</code></pre>
<p>statement, l... | [
{
"answer_id": 63405,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": 4,
"selected": true,
"text": "<p>1) can you run mysqldump from exec or passthru<br />\n2) take a look at this: <a href=\"http://www.php-mysql-tutorial.com/p... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6681/"
] | I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts.
Is there some way in which MySQL will return an
```
INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd')
```
statement, like what `mysqldump` will return?... | 1) can you run mysqldump from exec or passthru
2) take a look at this: <http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php> |
63,447 | <p>How do I perform an <code>IF...THEN</code> in an <code>SQL SELECT</code> statement?</p>
<p>For example:</p>
<pre><code>SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
</code></pre>
| [
{
"answer_id": 63474,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 6,
"selected": false,
"text": "<pre><code>SELECT \n(CASE \n WHEN (Obsolete = 'N' OR InStock = 'Y') THEN 'YES'\n ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6522/"
] | How do I perform an `IF...THEN` in an `SQL SELECT` statement?
For example:
```
SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
``` | The `CASE` statement is the closest to IF in SQL and is supported on all versions of SQL Server.
```
SELECT CAST(
CASE
WHEN Obsolete = 'N' or InStock = 'Y'
THEN 1
ELSE 0
END AS bit) as Saleable, *
FROM Product
```
You only need to use... |
63,556 | <p>I have a class with a bunch of properties that look like this:</p>
<pre><code>public string Name
{
get { return _name; }
set { IsDirty = true; _name = value; }
}
</code></pre>
<p>It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out t... | [
{
"answer_id": 63564,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 2,
"selected": false,
"text": "<p>You could try setting up a code snippet to make it easy to create those.</p>\n"
},
{
"answer_id": 63600,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404/"
] | I have a class with a bunch of properties that look like this:
```
public string Name
{
get { return _name; }
set { IsDirty = true; _name = value; }
}
```
It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out the IsDirty=true; so that I... | **No. Not without writing considerably more (arcane?) code than the original version** (You'd have to use reflection to check for the attribute on the property and what not.. did I mention it being 'slower').. This is the kind of duplication I can live with.
MS has the same need for [raising events when a property is ... |
63,581 | <p>I'm using <a href="http://www.c6software.com/Products/PopBox/" rel="nofollow noreferrer">PopBox</a> for magnifying thumbnails on my page.
But I want my website to work even for users which turned javascript off.</p>
<p>I tried to use the following HTML code:</p>
<pre><code><a href="image.jpg">
<img ... | [
{
"answer_id": 63612,
"author": "Daniel Papasian",
"author_id": 7548,
"author_profile": "https://Stackoverflow.com/users/7548",
"pm_score": 2,
"selected": false,
"text": "<p>Put the onclick event onto the link itself, and return false from the handler if you don't want the default behavi... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4186/"
] | I'm using [PopBox](http://www.c6software.com/Products/PopBox/) for magnifying thumbnails on my page.
But I want my website to work even for users which turned javascript off.
I tried to use the following HTML code:
```
<a href="image.jpg">
<img src="thumbnail.jpg" pbsrc="image.jpg" onclick="Pop(...);"/>
</a>
`... | Just put the onclick on the a-tag:
```
<a href="image.jpg onclick="Pop()"; return false;"><img ...></a>
```
Make sure to return `false` either at the end of the function (here `Pop`) or inline like in the above example. This prevents the user from being redirected to the link by the `<a>`'s default behaviour. |
63,599 | <p>We have an issue using the <code>PEAR</code> libraries on <code>Windows</code> from <code>PHP</code>.</p>
<p>Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in <code>Mail.php</code>. We use PEAR on the path, rather than providing the full explicit path to individual... | [
{
"answer_id": 63627,
"author": "ceejayoz",
"author_id": 1902010,
"author_profile": "https://Stackoverflow.com/users/1902010",
"pm_score": 2,
"selected": false,
"text": "<p>As it's an OS level thing, I don't believe there's an easy way of doing this.</p>\n\n<p>You could try changing your... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7106/"
] | We have an issue using the `PEAR` libraries on `Windows` from `PHP`.
Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in `Mail.php`. We use PEAR on the path, rather than providing the full explicit path to individual PEAR files:
```
require_once('Mail.php');
```
Rath... | having 2 files with the same name in the include path is not a good idea, rename your files so the files that you wrote have different names from third party libraries. anyway for your current situation I think by changing the order of paths in your include path, you can fix this.
PHP searches for the files in the incl... |