unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
How to make Html rendering fast.
===
I am working on a web application developed on c#/asp.net. We are using third party controls for displaying Grids, Tabs, Trees and other complex controls in our pages. The problem is that these controls render a huge amount of Html. Due to this size of pages have grown heavily and browser takes a while to load a page. I want to find out some general techniques to make Html rendering in browser (IE, Firefox, etc) fast.
Note that all the pages have viewstate turned off. | 0 | [
2,
184,
20,
233,
13,
15895,
15307,
1512,
9,
800,
3726,
3726,
31,
589,
638,
27,
21,
2741,
3010,
885,
27,
272,
5910,
118,
472,
306,
9,
2328,
9,
95,
50,
568,
422,
346,
8671,
26,
17418,
7354,
18,
15,
6523,
18,
15,
1913,
17,
89,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using Interface Builder for UITableView's
===
I'm very early in the iPhone development learning process. I'm trying to get my head around various pieces. Right now I've just taken the basic NavigationController template and I'm trying to create a simple grouped table view with a couple of text fields. What I can't seem to do is to get Interface Builder to allow me to drop a UITableViewCell into a UITableView so that I can then add a text field to the Cell. Is this even possible (it would seem that its supposed to be given the fact that UITableViewCell is a draggable control)?
If not, does that mean all of that is code I will need to just write myself? | 0 | [
2,
568,
6573,
14960,
26,
13,
11193,
579,
4725,
22,
18,
800,
3726,
3726,
31,
22,
79,
253,
274,
19,
14,
21024,
522,
2477,
953,
9,
31,
22,
79,
749,
20,
164,
51,
157,
140,
617,
2491,
9,
193,
130,
31,
22,
195,
114,
658,
14,
2125,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Applescriptable mySQL client - low cost or free?
===
Can anyone recommend a MySQL front end client or OS X that is AppleScriptable? Preferably low cost or free.
| 0 | [
2,
4037,
8741,
579,
51,
18,
22402,
6819,
13,
8,
708,
1516,
54,
551,
60,
800,
3726,
3726,
92,
1276,
12360,
21,
51,
18,
22402,
431,
241,
6819,
54,
13,
759,
993,
30,
25,
4037,
8741,
579,
60,
6369,
4801,
708,
1516,
54,
551,
9,
3,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Gem update on Windows - is it broken?
===
This is a follow-up to [this question][1].
When I issue the **`gem update`** command on Windows, whenever it gets to a
gem whose latest version DOESN'T have Windows binaries, it'll attempt to
build the native extension which will, of course, fail. For example:
Updating sqlite3-ruby
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb update
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no
nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
The old pre-1.x behavior of asking for the required platform at least
made updating possible. Now I can't update at all unless I uninstall the
troublesome gems (currently sqlite3-ruby and hpricot), run the update,
then re-install the gems using the --version switch.
Does anyone have a solution to this conundrum or are we stuck with it?
[1]: http://stackoverflow.com/questions/43778/sqlite3-ruby-gem-failed-to-build-gem-native-extension | 0 | [
2,
8551,
11100,
27,
1936,
13,
8,
25,
32,
2023,
60,
800,
3726,
3726,
48,
25,
21,
1740,
8,
576,
20,
636,
1565,
1301,
500,
2558,
165,
500,
9,
76,
31,
1513,
14,
13,
1409,
1,
20231,
11100,
1,
1409,
1202,
27,
1936,
15,
6634,
32,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Signature capture possible in various mobile web browsers?
===
My company is considering offering a lightweight mobile web site for data entry in the field (we already have a thick-client mobile application). One hard requirement is that we must be able to capture a signature.
**Is there any prior art for capturing a signature, specifically inside a web page running inside a mobile web browser, across a wide variety of mobile devices/web browsers?** I am only asking for in-browser solutions, not thick-clients.
For obvious reasons, the device would be required to have a touchscreen.
Certainly there are many, many different mobile browsers out there with a wide variety of capabilities. The ideal solution would support as many browsers as possible and degrade gracefully based on browser capabilities.
I am already aware that certain versions of Flash might provide the drawing APIs needed for something like this, assuming the desired device's browser supports Flash.
I'm also aware of [a third party ActiveX/OCX control for Pocket IE][1] on Windows Mobile devices. It is necessary for the user to manually download/install the control within the browser before use. Unfortunate, but acceptable.
I'm not personally aware of many mobile browsers that support hosting a Java applet, but there are probably some. Again, based on the support for various Java APIs, perhaps this would be a possible avenue.
Javascript *could* do this, if the engine and processor are robust enough on the device.
Finally, total pipe-dream here, perhaps one could have the user take a picture of a signature using the mobile device's camera on a plain piece of paper and somehow count that as a valid signature. However, this would produce a bitmap image, as opposed to vectors which I'd likely be collecting in all other instances. Also, it would be pretty difficult, if not impossible/unreasonable, to integrate the taking of the photo via a camera app and upload that using the web browser app while associating that specific image with the rest of the data being captured.
Thanks.
[1]: http://www.bennet-tec.com/btproducts/WebSignature | 0 | [
2,
7810,
3683,
938,
19,
617,
3241,
2741,
16495,
18,
60,
800,
3726,
3726,
51,
237,
25,
5154,
4090,
21,
13613,
3241,
2741,
689,
26,
1054,
2792,
19,
14,
575,
13,
5,
458,
614,
57,
21,
2318,
8,
150,
18513,
38,
3241,
3010,
6,
9,
53,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Just how free is Adobe Flex exactly?
===
I hear conflicting comments about Flex being 'free'. What is the straight story on Flex? Is it proprietary? | 0 | [
2,
114,
184,
551,
25,
20299,
14409,
1890,
60,
800,
3726,
3726,
31,
990,
22297,
7534,
88,
14409,
142,
13,
22,
4639,
22,
9,
98,
25,
14,
1599,
609,
27,
14409,
60,
25,
32,
18856,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Best way to handle multilanguage support ?
===
I've been searching for a good moment on SO on how to do i18n support on my little application...
I know that Microsoft offers 'culture' classes, but you have to re-compile your application to include any new string you add. So, all I'm trying to do is to put all my strings in a external file and offers users the choice to translate the app without the need to recompile.
Is there an easy way to handle this ? Use XML, or INI-like ? any Tutorial available ? | 0 | [
2,
246,
161,
20,
3053,
1889,
7020,
555,
13,
60,
800,
3726,
3726,
31,
22,
195,
74,
5792,
26,
21,
254,
688,
27,
86,
27,
184,
20,
107,
31,
1087,
103,
555,
27,
51,
265,
3010,
9,
9,
9,
31,
143,
30,
7099,
2486,
13,
22,
12518,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which is more preferable to use in Python: lambda functions or nested functions ('def') ?
===
I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior.
Here are some trivial examples where they functionally do the same thing if either were found within another function:
**Lambda function**
>>> a = lambda x : 1 + x
>>> a(5)
6
**Nested function**
>>> def b(x): return 1 + x
>>> b(5)
6
Is there advantages to using one over the other? (Performance? Readability? Limitations? Consistency? etc.) Does it even matter? If doesn't then does that violate the Pythonic principle: [“There should be one—and preferably only one—obvious way to do it”][1].
[1]: http://en.wikipedia.org/wiki/Python_(programming_language)#Philosophy | 0 | [
2,
56,
25,
91,
6369,
579,
20,
275,
19,
20059,
45,
13,
24187,
3719,
54,
5618,
69,
3719,
13,
5,
22,
13862,
22,
6,
13,
60,
800,
3726,
3726,
31,
1555,
275,
13,
24187,
3719,
47,
1030,
275,
5618,
69,
3719,
30,
2260,
20,
1181,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I use django.core.urlresolvers.reverse with a function reference instead of a named URL pattern?
===
In my `urls.py` file, I have:
from myapp import views
...
(r'^categories/$', views.categories)
Where `categories` is a view function inside `myapp/views.py`. No other URLconf lines reference `views.categories`.
In a unit test file, I’m trying to grab this URL using `django.core.urlresolvers.reverse()`, instead of just copying '/categories/' (DRY and all that). So, I have:
from django.core.urlresolvers import reverse
from myapp import views
...
url = reverse(views.categories)
When I run my tests, I get a `NoReverseMatch` error:
NoReverseMatch: Reverse for '<function categories at 0x1082f30>' with arguments '()' and keyword arguments '{}' not found.
As far as I can tell from [the `reverse` documentation](http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse), I should be able to use a function reference like this. Any ideas what I’m doing wrong? | 0 | [
2,
184,
107,
31,
275,
3857,
14541,
9,
10375,
9,
911,
255,
99,
5594,
5498,
9,
99,
9453,
29,
21,
1990,
2801,
700,
16,
21,
377,
287,
6362,
3732,
60,
800,
3726,
3726,
19,
51,
13,
1,
911,
7532,
9,
6448,
1,
3893,
15,
31,
57,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to implement a COM interface with a .NET generics class?
===
I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class.
Is it possible to use a generic class as a COM implementation class?
(I know I could write a non-generic wrapper and export that to COM, but this adds another layer that I'd rather do without.)
[ComVisible(true)]
public interface IMyClass
{
...
}
[ComVisible(true), ComDefaultInterface(typeof(IMyClass))]
[ClassInterface(ClassInterfaceType.None)]
public class MyClass : BaseClass<X>, IMyClass
{
...
}
Error message:
<pre>Warning: Type library exporter encountered a type that derives
from a generic class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot
be exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)]
and exposing an explicit interface as the default interface to
COM using the ComDefaultInterface attribute.</pre> | 0 | [
2,
25,
32,
938,
20,
8713,
21,
13,
960,
6573,
29,
21,
13,
9,
2328,
12733,
18,
718,
60,
800,
3726,
3726,
31,
57,
14,
249,
6573,
56,
31,
22,
79,
749,
20,
233,
13,
960,
8,
3762,
3426,
9,
76,
31,
1131,
20,
7920,
14,
1001,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Checking for duplicates in a collection
===
Suppose you have a collection of classes:
class Foo
{
public string Bar;
public string Baz;
}
List<Foo> foolist;
And you want to check this collection to see if another entry has a matching Bar.
bool isDuplicate = false;
foreach (Foo f in foolist)
{
if (f.Bar == SomeBar)
{
isDuplicate = true;
break;
}
}
Contains() doesn't work because it compares the classes as whole.
Does anyone have a better way to do this (No LINQ).
| 0 | [
2,
9886,
26,
19429,
18,
19,
21,
1206,
800,
3726,
3726,
5787,
42,
57,
21,
1206,
16,
2684,
45,
718,
4310,
111,
13,
1,
317,
3724,
748,
73,
317,
3724,
19674,
73,
13,
1,
968,
1,
4120,
111,
1,
5345,
702,
73,
17,
42,
259,
20,
2631,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to search through archived files with Perl
===
What is your preferred method for reading through the contents of zipped directories with Perl ?
| 0 | [
2,
184,
20,
2122,
120,
10692,
6488,
29,
416,
255,
800,
3726,
3726,
98,
25,
154,
5981,
2109,
26,
1876,
120,
14,
8478,
16,
28693,
559,
1596,
29,
416,
255,
13,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Finalizer launched while its object was still being used
===
Today, on a training session on C#, the teacher showed us some code which contained a bug only when run on multiprocessors.
I'll summarize to say that sometimes, the compiler or the JIT screws up by calling the finalizer of a C# class object before returning from its called method.
The full code, given in Visual C++ 2005 documentation, will be posted as an "answer" to avoid making a very very large questions, but the essential are below:
The following class has a "Hash" property which will return a cloned copy of an internal array. At is construction, the first item of the array has a value of 2. In the destructor, its value is set to zero.
The point is: If you try to get the "Hash" property of "Example", you'll get a clean copy of the array, whose first item is still 2, as the object is being used (and as such, not being garbage collected/finalized):
public class Example
{
private int nValue;
public int N { get { return nValue; } }
// The Hash property is slower because it clones an array. When
// KeepAlive is not used, the finalizer sometimes runs before
// the Hash property value is read.
private byte[] hashValue;
public byte[] Hash { get { return (byte[])hashValue.Clone(); } }
public Example()
{
nValue = 2;
hashValue = new byte[20];
hashValue[0] = 2;
}
~Example()
{
nValue = 0;
if (hashValue != null)
{
Array.Clear(hashValue, 0, hashValue.Length);
}
}
}
But nothing is so simple...
The code using this class is wokring inside a thread, and of course, for the test, the app is heavily multithreaded:
public static void Main(string[] args)
{
Thread t = new Thread(new ThreadStart(ThreadProc));
t.Start();
t.Join();
}
private static void ThreadProc()
{
// running is a boolean which is always true until
// the user press ENTER
while (running) DoWork();
}
The DoWork static method is the code where the problem happens:
private static void DoWork()
{
Example ex = new Example();
byte[] res = ex.Hash; // [1]
// If the finalizer runs before the call to the Hash
// property completes, the hashValue array might be
// cleared before the property value is read. The
// following test detects that.
if (res[0] != 2)
{
// Oops... The finalizer of ex was launched before
// the Hash method/property completed
}
}
Once every 1,000,000 excutions of DoWork, apparently, the Garbage Collector does its magic, and tries to reclaim "ex", as it is not anymore referenced in the remaning code of the function, and this time, it is faster than the "Hash" get method. So what we have in the end is a clone of a zero-ed byte array, instead of having the right one (with the 1st item at 2).
My guess is that there is inlining of the code, which essentially replaces the line marked [1] in the DoWork function by something like:
// Supposed inlined processing
byte[] res2 = ex.Hash2;
// note that after this line, "ex" could be garbage collected,
// but not res2
byte[] res = (byte[])res2.Clone();
If we supposed Hash2 is a simple accessor coded like:
// Hash2 code:
public byte[] Hash2 { get { return (byte[])hashValue; } }
So, the question is: <b>Is this supposed to work that way in C#/.NET, or could this be considered as a bug of either the compiler of the JIT?</b>
| 0 | [
2,
426,
11907,
1601,
133,
82,
3095,
23,
174,
142,
147,
800,
3726,
3726,
786,
15,
27,
21,
838,
3723,
27,
272,
5910,
15,
14,
2197,
1908,
182,
109,
1797,
56,
3437,
21,
6256,
104,
76,
485,
27,
1889,
16835,
248,
18,
9,
31,
22,
211,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Differences between Ruby VMs
===
What are the advantages/disadvantages of the major Ruby VMs (things like features, compatibility, performance, and quirks?) I know there are also some bonus features like being able to use Java interfaces through JRuby, too. Those would also be helpful to note. Does any VM have a clear advantage at this point, or provide enough incentive to switch from using Matz' Ruby 1.8.x? | 0 | [
2,
4921,
128,
10811,
13,
20147,
18,
800,
3726,
3726,
98,
50,
14,
14683,
118,
2906,
1283,
17384,
14465,
16,
14,
394,
10811,
13,
20147,
18,
13,
5,
22309,
101,
967,
15,
13,
21618,
15,
956,
15,
17,
19321,
18,
60,
6,
31,
143,
80,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
is there a perl module for converting a perl data structure into a javascript one?
===
e.g. (Mason code):
16 % # convert our @cti data structure into a javascript one
17 var cti = [
18 % foreach my $cti_category (@cti) {
19 {
20 label: "<% $cti_category->{'label'} %>",
21 value: "<% $cti_category->{'value'} %>",
22 children: [
23 % foreach my $cti_type (@{$cti_category->{'children'}}) {
24 {
25 label: "<% $cti_type->{'label'} %>",
26 value: "<% $cti_type->{'value'} %>",
27 },
28 % }
29 ]
30 },
31 % }
32 ];
| 0 | [
2,
25,
80,
21,
416,
255,
12613,
26,
19583,
21,
416,
255,
1054,
1411,
77,
21,
8247,
8741,
53,
60,
800,
3726,
3726,
13,
62,
9,
263,
9,
13,
5,
540,
528,
1797,
6,
45,
347,
13,
11881,
6926,
8406,
318,
13,
1,
14468,
1054,
1411,
77... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Problem encrypting membership element in web.config
===
I am trying to encrypt the "system.web.membership" element within the Web.Config of our .Net application to secure username and password to Active Directory. I am using the aspnet_regiis command to encrypt, and have tried several different strings for the value of the "pe" option with no success. I have successfully encrypted the "connectstrings" element on my web.config.
Cmd
<pre>C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "connectionStrings" -site MySite -app /MyApp
Encrypting configuration section...
Succeeded!
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "membership" -site MySite -app /MyApp
Encrypting configuration section...
The configuration section 'membership' was not found.
Failed!
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "system.web.membership" -site MySite -app /MyApp
Encrypting configuration section...
The configuration section 'system.web.membership' was not found.
Failed!</pre>
Web.Config
<configuration>
...
<system.web>
...
<authentication mode="Forms">
<forms name=".ADAuthCookie"
timeout="30"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="MyUserName"
connectionPassword="MyPassowrd"/>
</providers>
</membership>
...
</system.web>
...
</configuration>
So what gives? What am I missing?
| 0 | [
2,
1448,
1957,
11435,
68,
4363,
4520,
19,
2741,
9,
14093,
2816,
800,
3726,
3726,
31,
589,
749,
20,
1957,
11435,
14,
13,
7,
10724,
9,
14113,
9,
6990,
2418,
7,
4520,
363,
14,
2741,
9,
14093,
2816,
16,
318,
13,
9,
2328,
3010,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Project dependency missing in deployment project
===
I've got a VS2008 deployment project that builds an installer for a couple of Windows services.
Each service references several different projects:
<pre>
CustomerName.MailSendingService
-> CustomerName.Network
-> CustomerName.Data
-> CustomerName.Security
CustomerName.ProductIntegrationService
-> CustomerName.Core
-> CustomerName.Security
</pre>
The Windows service projects, the projects they reference, and the deployment project are all in the same VS2008 solution.
I've added the primary output from the Windows service projects in the deployment project's file system editor.
My expectation is that the primary output for the Windows service projects would include the DLLs from the referenced projects. However, when the deployment project is built, the DLL from one of the referenced projects is missing. (CustomerName.ProductIntegrationService is missing CustomerName.Security)
Maddeningly, the DLLs for the other projects referenced by the Windows service are present; just one project's output is missing.
Why would just one project's output be missing? | 0 | [
2,
669,
26835,
2863,
19,
10475,
669,
800,
3726,
3726,
31,
22,
195,
330,
21,
4611,
2753,
10475,
669,
30,
1895,
18,
40,
16146,
106,
26,
21,
1335,
16,
1936,
687,
9,
206,
365,
7231,
238,
421,
2314,
45,
13,
1,
3515,
1,
7705,
7259,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
DataGrid Edit Problem
===
I have a DataGrid, with an ItemTemplate that has an image and label. In the EditItemTemplate the label is replaced by a textbox. My problem is that the edit template only shows when I click the Edit button the second time. What gives? | 0 | [
2,
1054,
16375,
9392,
1448,
800,
3726,
3726,
31,
57,
21,
1054,
16375,
15,
29,
40,
9101,
9577,
6554,
30,
63,
40,
1961,
17,
1899,
9,
19,
14,
9392,
2119,
79,
9577,
6554,
14,
1899,
25,
1141,
34,
21,
1854,
5309,
9,
51,
1448,
25,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why do small spaces keep showing up in my web pages?
===
This might be a stupid question but if there's a better or proper way to do this, I'd love to learn it.
I have run across this a few times, including recently, where small spaces show up in the rendered version of my HTML page. Intuitively I think these should not be there because outside of text or entities the formatting of a page's HTML shouldn't matter but apparently it does.
What I'm referring to is this - I have some Photoshop file from the client on how they want their site to look. They want it to look basically pixel perfect to the image in this file.
One of the places in the page calls for a menu bar, where each one does the changing bit on hovering, acts like a hyperlink, etc. In the Photoshop file this is one long bar, so a cheap and easy way to do this is to just split that segment into multiple images and then place them next to each other in the file.
So instinctively I lay it out like so (there's more to it but this is the gist)
<a href="page1.html"><img src="image1.png" /></a>
<a href="page2.html"><img src="image2.png" /></a>
<a href="page3.html"><img src="image3.png" /></a>
and so forth.
The problem is the images have this tiny space between them which is unacceptable since the client wants this thing pixel-perfect (and it just plain looks bad).
One way to get it to render properly is to remove the carriage returns between the images
<a href="page1.html"><img src="image1.png" /></a><a href="page2.html"><img src="image2.png" /></a><a href="page3.html"><img src="image3.png" /></a>
Which makes the images go right up against each other (the desired effect) but it makes the line incredibly long and the code more difficult to maintain (it wraps here in SO and this is a simplified version - the real one has longer filenames and JavaScript sprinkled in to do the hovering).
It seems to me that this shouldn't happen but it looks like the carriage return in the HTML is being rendered as a small empty space. And this happens in all browsers, looks like.
Am I right or wrong for thinking the two snippets above should render the same? And is there something I'm doing wrong? Maybe saving the file with the wrong encoding? Should I make every one of these links a perfectly positioned CSS element instead? | 0 | [
2,
483,
107,
284,
7644,
643,
3187,
71,
19,
51,
2741,
4434,
60,
800,
3726,
3726,
48,
530,
44,
21,
3553,
1301,
47,
100,
80,
22,
18,
21,
574,
54,
4119,
161,
20,
107,
48,
15,
31,
22,
43,
339,
20,
2484,
32,
9,
31,
57,
485,
464,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Visual Studio ">of" command causes solution explorer to go wacky
===
I'm working with a fairly large solution right now in Visual Studio 2005 and whenever I try to use the ">of" command in the toolbar search box it causes my solution explorer go haywire. Specifically, all of the folders start showing that there aren't any files in them anymore and I have to hit the "Refresh" button in order to get them all to show up. This is extremely annoying so I never use the ">of" command anymore, but a jump-to-file command sure does come in handy.
Has anyone else experienced this or have a better alternative to jumping to a specific file by filename?
Note: ReSharper is not an option. It is too slow on a solution of this size. I tried it out and each load up took 10-15 minutes.
| 0 | [
2,
3458,
1120,
13,
7,
1,
1041,
7,
1202,
4047,
4295,
8520,
20,
162,
13,
21921,
93,
800,
3726,
3726,
31,
22,
79,
638,
29,
21,
6647,
370,
4295,
193,
130,
19,
3458,
1120,
812,
17,
6634,
31,
1131,
20,
275,
14,
13,
7,
1,
1041,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linq To SQL caching VS multi-user application.
===
We develop Win32 application that access to SQL 2005 database through Linq to SQL. The issue is when 2 users access to same record (View and Edit)… User 1 update record (DataContext.SubmitChanges()), and we would like to update context of user 2… The solution that appears right now is to call DataContext.Refresh to sync object with SQL table… We wondering if other solution exist ?
Thank you | 0 | [
2,
6294,
1251,
20,
4444,
255,
1658,
7192,
4611,
1889,
8,
16704,
3010,
9,
800,
3726,
3726,
95,
2803,
628,
3125,
3010,
30,
1381,
20,
4444,
255,
812,
6018,
120,
6294,
1251,
20,
4444,
255,
9,
14,
1513,
25,
76,
172,
3878,
1381,
20,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Catching exceptions as expected program execution flow control?
===
I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the "*exception*". If you're expecting and planning for an exception, that would seem to indicate that your code should be refactored, at least in .NET...<br />
However. A recent scenario gave me pause. I posted this on msdn a while ago, but I'd like to generate more discussion about it and this is the perfect place!<br />
<br />
So, say you've got a database table which has a foreign key for several other tables (in the case that originally prompted the debate, there were 4 foreign keys pointing to it). You want to allow the user to delete, but only if there are NO foreign key references; you DON'T want to cascade delete.<br />
I normally just do a check to see if there are any references, and if there are, I inform the user instead of doing the delete. It's very easy and relaxing to write that in LINQ as related tables are members on the object, so Section.Projects and Section.Categories and et cetera is nice to type with intellisense and all...<br />
But the fact is that LINQ then has to hit potentially all 4 tables to see if there are any result rows pointing to that record, and hitting the database is obviously always a relatively expensive operation.<br />
<br/>
The lead on this project asked me to change it to just catch a SqlException with a code of 547 (foreign key constraint) and deal with it that way.<br />
<br/>
I was...<br/>
*resistant*.<br />
<br/>
But in this case, it's probably a lot more efficient to swallow the exception-related overhead than to swallow the 4 table hits... Especially since we have to do the check in every case, but we're spared the exception in the case when there are no children...<br />
Plus the database really should be the one responsible for handling referential integrity, that's its job and it does it well...<br />
So they won and I changed it.<br/>
<br />
On some level it still feels *wrong* to me though.<br />
<br/>
What do you guys think about expecting and intentionally handling exceptions? Is it okay when it looks like it'll be more efficient than checking beforehand? Is it more confusing to the next developer looking at your code, or less confusing? Is it safer, since the database might know about new foreign key constraints that the developer might not think to add a check for? Or is it a matter of perspective on what exactly you think best practice is?<br /> | 0 | [
2,
9436,
13392,
28,
1727,
625,
5769,
3312,
569,
60,
800,
3726,
3726,
31,
550,
427,
30,
7752,
13392,
20,
44,
6027,
27,
21,
1290,
2239,
17,
568,
105,
28,
3312,
7085,
23,
21,
896,
584,
9,
13392,
583,
101,
59,
378,
44,
15,
134,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sorting 2-D array in matlab w.r.t one column
===
How can i sort a matrix according to a particular column?
There is a sort function, but it sorts all columns independantly
let data =
1 3
5 7
-1 4
desired output (sort by first column)=
-1 4
1 3
5 7
output of sort(data)=
-1 3
1 4
5 7
How to go about it? | 0 | [
2,
2058,
68,
172,
8,
43,
7718,
19,
4277,
9086,
619,
9,
139,
9,
38,
53,
4698,
800,
3726,
3726,
184,
92,
31,
2058,
21,
8187,
496,
20,
21,
1498,
4698,
60,
80,
25,
21,
2058,
1990,
15,
47,
32,
14357,
65,
7498,
19,
19038,
1830,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Returning a const reference to an object instead of a copy
===
Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example:
class foo
{
private:
std::string name_;
public:
std::string name()
{
return name_;
}
};
Surely the getter would be better returning a `const std::string&`? The current method is returning a copy which isn't as efficient. Would returning a const reference instead cause any problems? | 0 | [
2,
2485,
21,
11608,
38,
2801,
20,
40,
3095,
700,
16,
21,
4344,
800,
3726,
3726,
4575,
302,
17455,
68,
109,
1797,
31,
281,
464,
109,
164,
815,
3195,
30,
4815,
21,
354,
43,
45,
45,
11130,
9,
301,
101,
48,
26,
823,
45,
718,
4310,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bind ASP.NET DropDownList DataTextField to method?
===
Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property? | 0 | [
2,
10193,
28,
306,
9,
2328,
2804,
2968,
5739,
1054,
11969,
1109,
20,
2109,
60,
800,
3726,
3726,
25,
80,
2774,
20,
57,
3755,
19,
40,
28,
306,
9,
2328,
2804,
2968,
5739,
57,
694,
66,
1854,
54,
1923,
4138,
20,
21,
2109,
27,
14,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Server-side DataTable Sorting in RichFaces
===
I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header.
<rich:datascroller for="instanceList" actionListener="#{pageDataModel.pageChange}"/>
<rich:dataTable id="instanceList" rows="10" value="#{pageDataModel}"
var="fieldValues" rowKeyVar="rowKey">
<rich:columns value="#{pageDataModel.columnNames}" var="column" index="idx">
<f:facet name="header">
<h:outputText value="#{column}"/>
</f:facet>
<h:outputText value="#{classFieldValues[idx]}" />
</rich:columns>
</rich:dataTable>
I already have a method on the bean for executing the sort.
public void sort(int column)
| 0 | [
2,
8128,
8,
1416,
1054,
5924,
2058,
68,
19,
2042,
6413,
18,
800,
3726,
3726,
31,
57,
21,
1054,
859,
29,
21,
7612,
234,
16,
7498,
17,
21,
1054,
12159,
106,
9,
184,
92,
31,
9240,
8128,
270,
2058,
68,
60,
31,
6369,
30,
32,
44,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the difference between Bool and Boolean types in C#
===
What is the difference between Bool and Boolean types in C#? | 0 | [
2,
98,
25,
14,
2841,
128,
1607,
1823,
17,
9827,
413,
210,
2551,
19,
272,
5910,
800,
3726,
3726,
98,
25,
14,
2841,
128,
1607,
1823,
17,
9827,
413,
210,
2551,
19,
272,
5910,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Clearing the Windows "Run" dialog history without rebooting
===
I am currently working on a program to immediately clear the list of previously-run-commands which appears in the Windows *Start* -> *Run* dialog. The procedure for clearing this list by removing the *HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU* key is [well documented][1]; however, before these changes take effect, it seems to be necessary to do one of the following:
1. Restart the computer
2. Select *Start* -> *Shut down*, and then select *Cancel*.
Neither of these is ideal for the task I am trying to accomplish: #1 is extremely disruptive to the user, and #2 appears to require additional user interaction.
Does anyone know how to immediately force a reload of this information without requiring any user interaction?
Things I have already tried:
----------------------------
- Monitoring the explorer.exe status using [procmon][2] while selecting *Shutdown* and then *Cancel*. I see Explorer writing to the RunMRU key, but have not been able to determine what triggers this.
- Numerous Google searches along the lines of "reload runmru without reboot". Most results still recommend method #1 above, although a few suggest #2.
- Limited MSDN API examination. The [RegFlushKey][3] call appears promising, but I haven't ever used it before, so I don't know if it will apply to registry information cached by different processes.
Any suggestions or other information would be greatly appreciated.
[1]: http://support.microsoft.com/kb/142298
[2]: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
[3]: http://msdn.microsoft.com/en-us/library/ms724867(VS.85).aspx | 0 | [
2,
8130,
14,
1936,
13,
7,
3169,
7,
28223,
447,
366,
25312,
68,
800,
3726,
3726,
31,
589,
871,
638,
27,
21,
625,
20,
1375,
1207,
14,
968,
16,
1343,
8,
3169,
8,
16239,
18,
56,
1780,
19,
14,
1936,
1637,
13680,
2483,
13,
8,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Datagrid usage sourced from SQL server.
===
I would like to know the best way to use a datagrid control linked to a combination (join) of data tables in a way that both simply allows both display, creation of new rows in underlying tables and deletion.
The datagrid appears to offer the latter capabilities but I have not found a way that I am happy with to do more than just display on one grid and offer specific seperate edit create and delete facilities.
Suppose for the sake of illustration that the database contains:-
Customer Table<br>
* CustomerID<br>
* CustomerName
Order Table<br>
* CustomerID<br>
* OrderLineItem<br>
* OrderLineQuanity
And that I want to lose the CustomerID for display purposes but would like to be able to create new customers and delete existing ones, perhaps with a confirmatory dialog.
| 0 | [
2,
1054,
16375,
7514,
1267,
43,
37,
4444,
255,
8128,
9,
800,
3726,
3726,
31,
83,
101,
20,
143,
14,
246,
161,
20,
275,
21,
1054,
16375,
569,
4727,
20,
21,
3733,
13,
5,
1636,
108,
6,
16,
1054,
7484,
19,
21,
161,
30,
156,
1659,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why pool Stateless session beans?
===
Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution stack. When the method returns the locals are removed from the stack and if some temporary objects were allocated they are garbage collected anyway.
From my perspective that doesn’t differ from calling method of the same single instance by separate threads. So why cannot a container use one instance of a bean instead of pooling a number of them?
| 0 | [
2,
483,
3067,
146,
923,
3723,
14685,
60,
800,
3726,
3726,
146,
923,
14685,
19,
8247,
107,
52,
643,
66,
146,
128,
81,
3029,
37,
14,
6819,
9,
86,
19,
21,
8619,
15984,
95,
530,
3563,
105,
28,
3916,
29,
508,
3195,
9,
206,
2109,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to stop Visual C++ build at first error?
===
I know I can compile individual source files, but sometimes -- say, when editing a header file used by many `.cpp` files -- multiple source files need to be recompiled. That's what Build is for.
Default behavior of the "Build" command in VC9 (Visual C++ 2008) is to attempt to compile all files that need it. Sometimes this just results in many failed compiles. I usually just watch for errors and hit ctrl-break to stop the build manually.
Is there a way to configure it such the build stops at the first error automatically?
| 0 | [
2,
184,
20,
747,
3458,
272,
20512,
1895,
35,
64,
7019,
60,
800,
3726,
3726,
31,
143,
31,
92,
26561,
1359,
1267,
6488,
15,
47,
1030,
13,
8,
8,
395,
15,
76,
9510,
21,
157,
106,
3893,
147,
34,
151,
13,
1,
9,
150,
3421,
1,
6488,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What parts of application you prefer to be extenralized as configuration and why?
===
What parts of your application are not coded?
I think one of the most obvious examples would be DB credentials - it's considered bad to have them hardcoded. And in most of situations it is easy to decide if you want something to be externalized or coded.For me the rules are simple. Some part of application should be externalized if:
1. it can and should be changed by non-developer, but not so often to be included in application settings defined in UI (DB credentials, service URLs, etc)
2. does not require programming laguage and seem unnatural being coded (localization)
Do you have anything to add?
This is a little related to [this question about spring cfg][1].
Spring configuration seems less obvious example for me, because in my practice it is never modified by anyone except developer. And the road of externalizing can take you far away, to the entire project being "configured", not coded - so where to stop?
So please post here some examples from your experience, when you got benefit from having something configured, not coded - like dependency injection configuration in spring, etc.
And if you use spring - how often configuration is changed without recompiling?
[1]: http://stackoverflow.com/questions/131975/what-are-benefits-of-dependency-injection-container | 0 | [
2,
98,
1341,
16,
3010,
42,
6369,
20,
44,
1396,
1316,
5284,
1333,
28,
8091,
17,
483,
60,
800,
3726,
3726,
98,
1341,
16,
154,
3010,
50,
52,
13,
22254,
60,
31,
277,
53,
16,
14,
127,
4674,
3770,
83,
44,
13,
9007,
5059,
43,
10107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to get a Windows Service to run an executable on a shared drive
===
I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried using the UNC notation (//machine_name/share_name/directory/runme.exe), but the process seems to hang. The service and shared drive are on Windows XP. Has anyone tackled this issue before? | 0 | [
2,
749,
20,
164,
21,
1936,
365,
20,
485,
40,
1396,
17194,
5924,
27,
21,
2592,
1493,
800,
3726,
3726,
31,
57,
272,
5910,
30,
129,
485,
19,
21,
1936,
365,
9,
31,
22,
79,
749,
20,
275,
14,
953,
17,
953,
13680,
108,
4120,
2684,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript: Trigger action on function exit
===
Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed?
I am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the function doesn't necessarily execute last, even if you put it at the end of the function call.
Example:
function doStuff()
{
blockUI();
ajaxCall();
unblockUI();
};
Is there a way for doStuff to listen for ajaxCall to complete, before firing the unBlockUI? As it is, it processes the function linearly, calling each object in order, then a separate thread is spawned to complete each one. So, though my AJAX call might take 10-15 seconds to complete, I am only blocking the user for just a split-second, due to the linear execution of the function.
There are less elegant ways around this...putting a loop to end only when a return value set by the AJAX function is set to true, or something of that nature. But that seems unnecessarily complicated and inefficient.
| 0 | [
2,
8247,
8741,
45,
7286,
1028,
27,
1990,
4350,
800,
3726,
3726,
25,
80,
21,
161,
20,
3834,
26,
21,
8247,
8741,
1990,
20,
4350,
60,
21,
7286,
30,
110,
44,
18161,
76,
21,
1990,
63,
1066,
60,
31,
589,
6314,
20,
275,
21,
4155,
657... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bug Fixing Time Allocation
===
We've been asked by a client to give us a time estimate on each and every bug we have.
Though we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have ensured that Highest priority bugs will be fixed in the time allotted.
I'm not a fan of allocating time to bugs, simply because:
1. It usually is inaccurate. It's very difficult to figure out how long it would take to fix.
2. Waste of time.
3. Affects code quality
4. Creates more bugs in the log run (We may miss certain things in our attempt to complete it in the alotted time).
How should we tackle this issue where we don't want to provide the number of hours per bug, but just a time frame as to what bugs will be fixed?
How do you allocate time to your bugs? Is it effective? Worth the time and effort?
| 0 | [
2,
6256,
20047,
85,
16840,
800,
3726,
3726,
95,
22,
195,
74,
411,
34,
21,
6819,
20,
590,
182,
21,
85,
10243,
27,
206,
17,
352,
6256,
95,
57,
9,
362,
95,
107,
57,
21,
309,
4345,
26,
6256,
20047,
17,
57,
11685,
85,
26,
32,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
On a WPF ComboBox, is it possible to set a different Foreground color for the textbox and the popup?
===
Basically my problem stems from a desire to have the textbox portion be white, and the drop down to be black. When I set the text to white, the drop down appears as I want it, but the text in the textbox itself is hardly readable. Setting the Foreground to black makes the drop down unreadable.
Is there a good way to handle this? I am still learning WPF.
![alt text][1]
[1]: http://us.f13.yahoofs.com/bc/441e6dc9mc20028d0/bc/My+Documents/ComboBox.png.png?bffO92IBPmLr8vTn | 0 | [
2,
27,
21,
619,
7721,
22621,
5309,
15,
25,
32,
938,
20,
309,
21,
421,
26,
62,
8810,
1665,
26,
14,
1854,
5309,
17,
14,
1675,
576,
60,
800,
3726,
3726,
11374,
51,
1448,
14181,
37,
21,
3150,
20,
57,
14,
1854,
5309,
2980,
44,
359,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I find the mime-type of a file with php?
===
Ok, so I have an index.php file which has to process many different file types. how do I guess the filetype based on the REQUEST_URI.
If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this
<?php
include('/www/site'.$_SERVER['REQUEST_URI']);
?>
How would I make that work correctly.
Should I test based on the extension of the file requested, or is there a way to get the filetype? | 0 | [
2,
184,
107,
31,
477,
14,
26193,
8,
4474,
16,
21,
3893,
29,
13,
26120,
60,
800,
3726,
3726,
5854,
15,
86,
31,
57,
40,
4348,
9,
26120,
3893,
56,
63,
20,
953,
151,
421,
3893,
2551,
9,
184,
107,
31,
2321,
14,
3893,
4474,
432,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python: Newbie wondering if his code is 'Pythonic"
===
This is really the first thing that I have written in python. I come from Java background. I don't want to just learn how to program java code with Python syntax. I want to learn how to program in a pythonic paradigm.
Could you guys please comment on how I can make the following code more pythonic?
from math import sqrt
# recursively computes the factors of a number
def factors(num):
factorList = []
numroot = int(sqrt(num)) + 1
numleft = num
# brute force divide the number until you find a factor
for i in range(2, numroot):
if num % i == 0:
# if we found a factor, add it to the list and compute the remainder
factorList.append(i)
numleft = num / i
break
# if we didn't find a factor, get out of here!
if numleft == num:
factorList.append(num)
return factorList
# now recursively find the rest of the factors
restFactors = factors(numleft)
factorList.extend(restFactors)
return factorList
# grabs all of the twos in the list and puts them into 2 ^ x form
def transformFactorList(factorList):
num2s = 0
# remove all twos, counting them as we go
while 2 in factorList:
factorList.remove(2)
num2s += 1
# simply return the list with the 2's back in the right spot
if num2s == 0: return factorList
if num2s == 1:
factorList.insert(0, 2)
return factorList
factorList.insert(0, '2 ^ ' + str(num2s))
return factorList
print transformFactorList(factors(#some number)) | 4 | [
2,
20059,
45,
78,
5893,
5712,
100,
33,
1797,
25,
13,
22,
6448,
96,
11151,
7,
800,
3726,
3726,
48,
25,
510,
14,
64,
584,
30,
31,
57,
642,
19,
20059,
9,
31,
340,
37,
8247,
2395,
9,
31,
221,
22,
38,
259,
20,
114,
2484,
184,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Href for Javascript links: "#" or "javascript:void(0)"?
===
When building a link that has the sole purpose to run javascript, is it better to:
<a href="#" onclick="myJsFunc();">Link</a>
Or
<a href="javascript:void(0)" onclick="myJsFunc();">Link</a>
| 0 | [
2,
746,
14057,
26,
8247,
8741,
6271,
45,
13,
7,
5910,
7,
54,
13,
7,
1004,
1385,
8741,
45,
2625,
1340,
5,
387,
6,
7,
60,
800,
3726,
3726,
76,
353,
21,
3508,
30,
63,
14,
5005,
2131,
20,
485,
8247,
8741,
15,
25,
32,
574,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sounds for build error/success in Visual C++?
===
On long Visual C++ builds, it would be really helpful to hear some sort of (optional) sounds for such build/compile results as:
- individual compile error
- file compile success/failure
- build success/failure
- batch build success/failure
Does anyone know how to generate sounds for these kinds of build occurrences in Visual C++ 2008?
| 0 | [
2,
2795,
26,
1895,
7019,
118,
29245,
19,
3458,
272,
20512,
60,
800,
3726,
3726,
27,
175,
3458,
272,
20512,
1895,
18,
15,
32,
83,
44,
510,
15600,
20,
990,
109,
2058,
16,
13,
5,
2594,
3309,
192,
6,
2795,
26,
145,
1895,
118,
11103,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the simplest way to make a HTTP GET request in Perl?
===
I have some code I've written in PHP for consuming our simple webservice, which I'd also like to provide in Perl for users who may prefer that language. What's the simplest method of making a HTTP request to do that? In PHP I can do it in one line with `file_get_contents()`.
Here's the entire code I want to port to Perl:
/**
* Makes a remote call to the our API, and returns the response
* @param cmd {string} - command string ID
* @param argsArray {array} - associative array of argument names and argument values
* @return {array} - array of responses
*/
function callAPI( $cmd, $argsArray=array() )
{
$apikey="MY_API_KEY";
$secret="MY_SECRET";
$apiurl="https://foobar.com/api";
// timestamp this API was submitted (for security reasons)
$epoch_time=time();
//--- assemble argument array into string
$query = "cmd=" .$cmd;
foreach ($argsArray as $argName => $argValue) {
$query .= "&" . $argName . "=" . urlencode($argValue);
}
$query .= "&key=". $apikey . "&time=" . $epoch_time;
//--- make md5 hash of the query + secret string
$md5 = md5($query . $secret);
$url = $apiurl . "?" . $query . "&md5=" . $md5;
//--- make simple HTTP GET request, put the server response into $response
$response = file_get_contents($url);
//--- convert "|" (pipe) delimited string to array
$responseArray = explode("|", $response);
return $responseArray;
} | 0 | [
2,
98,
22,
18,
14,
24384,
161,
20,
233,
21,
7775,
164,
3772,
19,
416,
255,
60,
800,
3726,
3726,
31,
57,
109,
1797,
31,
22,
195,
642,
19,
13,
26120,
26,
13,
17601,
318,
1935,
2741,
11449,
15,
56,
31,
22,
43,
67,
101,
20,
1181... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
windbg dr. watson minidump - requires pdb/dll originally built for installed version?
===
I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly?
My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getting tripped up on errors.
With !sym noisy on:
"image header does not match memory image header."
DBGENG: C:\...\XXX.dll image header does not match memory image header.
DBGENG: XXX.dll - Partial symbol image load missing image info
DBGHELP: Module is not fully loaded into memory.
DBGHELP: Searching for symbols using debugger-provided data.
DBGHELP: C:\...\XXX.pdb - mismatched pdb
Note I've build the pdb with the dll, they are from the same RELEASE directory (should I be building debug?)
Theses are release builds (as release builds are installed on the target and crashing) should I be somehow using the debug build dlls to get more symbol information? | 0 | [
2,
1511,
19924,
744,
9,
7413,
4236,
43,
11134,
13,
8,
4781,
351,
9007,
118,
43,
211,
912,
392,
26,
4066,
615,
60,
800,
3726,
3726,
31,
57,
21,
594,
2554,
3893,
37,
21,
2935,
22,
18,
3010,
4597,
9,
25,
32,
938,
26,
55,
20,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which programming language makes concurrent programming as easy as possible?
===
If you want to create programs with threads/processes that run parallel you have to learn about many stuff, like race conditions, locks, semaphors, monitors, deadlocks ....
Is there a language that makes creation of parallel programs as easy as object-oriented programming languages help creating complex architectures? Or which programming-languages has the best and simplest concepts to support you with this task? | 0 | [
2,
56,
3143,
816,
1364,
19513,
3143,
28,
2010,
28,
938,
60,
800,
3726,
3726,
100,
42,
259,
20,
1600,
1726,
29,
20396,
118,
16835,
160,
30,
485,
3821,
42,
57,
20,
2484,
88,
151,
3217,
15,
101,
764,
2039,
15,
12941,
15,
13,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the best way to implement an API in ASP.NET using MVC?
===
I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC.
The application will need an API so that a group of other apps can communicate with it. I've always built API's out just using a standard web service prior to this.
As a sidenote, I'm a little hesitant to plunge headfirst into the REST style of creating API's, for this particular instance at least. This application will likely need a concept of API versioning, and I think that the REST approach, where the API is essentially scattered across all the controllers of the site, is a little cumbersome in that regard. (But I'm not completely opposed to it if there is a good answer to the potential versioning potential requirement.)
So, what say ye, Stack Overflow denizens? | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
8713,
40,
21,
2159,
19,
28,
306,
9,
2328,
568,
307,
8990,
60,
800,
3726,
3726,
31,
22,
195,
74,
21,
11740,
28,
306,
9,
2328,
10058,
19,
14,
2741,
1997,
1061,
15,
17,
589,
568,
21,
78,
669,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Databinding 2 WPF ComboBoxes to 1 source without being "linked"
===
I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a different contact in each ComboBox; however, as soon as I change selection in one list the other list updates to the same contact.
I have tried different settings (OneWay vs. TwoWay) but so far nothing seems to work. Here is an excerpt of my XAML.
<Page.Resources>
<!-- This is a custom class inheriting from ObjectDataProvider -->
<wg:CustomersDataProvider x:Key="CompanyDataList" />
</Page.Resources>
<Grid>
<!--- other layout XAML removed -->
<ComboBox x:Name="Customer" Width="150"
ItemsSource="{Binding Source={StaticResource CompanyDataList},Path=Companies,Mode=OneWay}"
DisplayMemberPath="Name"
SelectedValuePath="Id"
IsSynchronizedWithCurrentItem="True"
SelectedValue="{Binding Path=Id, Mode=OneWay}"
VerticalAlignment="Bottom" />
<ComboBox x:Name="PrimaryContact" Width="150"
DataContext="{Binding ElementName=Customer,Path=Items,Mode=OneWay}"
ItemsSource="{Binding Path=Contacts,Mode=OneWay}"
DisplayMemberPath="FullName"
SelectedValuePath="Id"
IsSynchronizedWithCurrentItem="True"
SelectedValue="{Binding Path=Id,Mode=OneWay}" />
<ComboBox x:Name="AdminContact" Width="150"
DataContext="{Binding ElementName=OwnerCustomer,Path=Items,Mode=OneWay}"
ItemsSource="{Binding Path=Contacts,Mode=OneWay}"
DisplayMemberPath="FullName"
SelectedValuePath="Id"
IsSynchronizedWithCurrentItem="True"
SelectedValue="{Binding Path=Id,Mode=OneWay}" />
<!--- other layout XAML removed -->
</Grid>
I thought that creating a CollectionViewSource would be the way to go, but I have not been able to make that work. Is there a simple way to do this so the PrimaryContact and AdminContact aren't linked?
| 0 | [
2,
1054,
22260,
172,
619,
7721,
22621,
5309,
160,
20,
137,
1267,
366,
142,
13,
7,
6258,
69,
7,
800,
3726,
3726,
31,
57,
21,
1129,
8,
546,
8682,
12705,
113,
31,
57,
137,
22621,
5309,
9554,
1532,
37,
40,
3095,
18768,
12097,
26735,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Undoing a git rebase
===
Does anybody know how to easily undo a git rebase?
The only way that comes to mind is to go at it manually:
- git checkout the commit parent to both of the branches
- then create a temp branch from there
- cherry-pick all commits by hand
- replace the branch in which I rebased by the manually-created branch
In my current situation this is gonna work because I can easily spot commits from both branches (one was my stuff, the other was my colleague's stuff).
However my approach strikes me as suboptimal and error-prone (let's say I had just rebased with 2 of my own branches).
Any ideas? | 0 | [
2,
367,
537,
68,
21,
13,
10404,
302,
8436,
800,
3726,
3726,
630,
11181,
143,
184,
20,
2351,
367,
537,
21,
13,
10404,
302,
8436,
60,
14,
104,
161,
30,
1624,
20,
594,
25,
20,
162,
35,
32,
23671,
45,
13,
8,
13,
10404,
2631,
1320,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why isn't Selenium capturing my keystrokes?
===
I'm trying out the recorder of the latest Selenium IDE Firefox extension on win32/ff3.
On one page, currently I have to hit Enter to go to the next page, but it's not on a submit button, it's captured manually. This is not picked up by the recorder. I know I can enter it manually myself after recording, but why isn't this part of it? | 0 | [
2,
483,
2532,
22,
38,
23027,
14311,
12859,
51,
1246,
12962,
18,
60,
800,
3726,
3726,
31,
22,
79,
749,
70,
14,
14173,
16,
14,
5736,
23027,
14311,
13,
3448,
535,
18219,
3896,
27,
628,
3125,
118,
2460,
240,
9,
27,
53,
2478,
15,
871... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
When to use 'quote in Lisp
===
After making it through the major parts of an introductory Lisp book, I don't understand what the `(quote)` (or equivilant `'`) function does, yet it's been all over Lisp code that I've seen. What does it do? | 0 | [
2,
76,
20,
275,
13,
22,
8970,
591,
19,
2093,
3401,
800,
3726,
3726,
75,
544,
32,
120,
14,
394,
1341,
16,
40,
26958,
2093,
3401,
360,
15,
31,
221,
22,
38,
1369,
98,
14,
13,
1,
5,
8970,
591,
6,
1,
13,
5,
248,
13,
9629,
1755,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the best way to return XML from a controller's action in ASP.NET MVC?
===
What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it? | 0 | [
2,
98,
25,
14,
246,
161,
20,
788,
23504,
37,
21,
9919,
22,
18,
1028,
19,
28,
306,
9,
2328,
307,
8990,
60,
800,
3726,
3726,
98,
25,
14,
246,
161,
20,
788,
23504,
37,
21,
9919,
22,
18,
1028,
19,
28,
306,
9,
2328,
307,
8990,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I list all cron jobs for all users?
===
Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as `/etc/crontab`, and whatever's in `/etc/cron.d`. It would also be nice to see the specific commands run by `run-parts` in `/etc/crontab`.
Ideally, I'd like the output in a nice column form and ordered in some meaningful way.
I could then merge these listings from multiple servers to view the overall "schedule of events."
I was about to write such a script myself, but if someone's already gone to the trouble... | 0 | [
2,
184,
107,
31,
968,
65,
13,
19587,
4844,
26,
65,
3878,
60,
800,
3726,
3726,
25,
80,
21,
1202,
54,
40,
3149,
3884,
30,
129,
408,
55,
1418,
65,
16,
21,
1637,
14064,
329,
22,
18,
3758,
13,
19587,
4844,
35,
382,
60,
31,
22,
43... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Enforcing a strict timeout policy on a server side webrequest
===
We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing.
I'm leaning towards using an asynchronous WebRequest do to this, but I was wondering if there was a trick to doing it using a synchronous request.
Any advice? | 0 | [
2,
29296,
21,
8170,
85,
1320,
1486,
27,
21,
8128,
270,
2741,
99,
10351,
800,
3726,
3726,
95,
129,
376,
20,
645,
70,
20,
21,
203,
897,
346,
20,
11917,
21,
1923,
568,
760,
15,
207,
100,
95,
107,
52,
2588,
21,
1627,
363,
332,
79,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Visual Studio Refactoring: Remove Structured IF/End If
===
Is there and easy way to remove the **IF/End If** structured pairing.
Being able to do this in one keystroke would be nice (I also use Refactor! Pro)
Right now this is what I do:
1. Delete the **IF** line
2. Watch Visual Studio reformat the code to line up correctly taking into account that the **IF** is Missing.
3. Navigate to the **End If**
4. Delete the **End If** line
i.e. In the following example I want to change the code from
IF Value = True Then
DoSomething()
DoSomething2()
End IF
To
DoSomething()
DoSomething2()
| 0 | [
2,
3458,
1120,
302,
17455,
68,
45,
4681,
17784,
100,
118,
2451,
100,
800,
3726,
3726,
25,
80,
17,
2010,
161,
20,
4681,
14,
13,
1409,
821,
118,
2451,
100,
1409,
17784,
23028,
9,
142,
777,
20,
107,
48,
19,
53,
1246,
12962,
83,
44,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Display number with leading zeros.
===
Given:
a = 1
b = 10
c = 100
I want to display a leading zero for all numbers with less than 2 digits.
Essentially displaying
01
10
100
| 0 | [
2,
3042,
234,
29,
1005,
4606,
18,
9,
800,
3726,
3726,
504,
45,
21,
800,
137,
334,
800,
332,
272,
800,
808,
31,
259,
20,
3042,
21,
1005,
4606,
26,
65,
2116,
29,
787,
119,
172,
19076,
9,
7398,
17418,
13,
3026,
332,
808,
3,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Type double byte character into vbscript file
===
I need to convert → (&rarr) to a symbol I can type into a ANSI VBScript file. I am writing a script that translates a select set of htmlcodes to their actual double byte symbols using a regex. Many languages accomplish this using "\0x8594;"... what is the equivelent in VBScript?
| 0 | [
2,
1001,
1494,
34,
591,
925,
77,
13,
20468,
8741,
3893,
800,
3726,
3726,
31,
376,
20,
8406,
279,
525,
5932,
73,
13,
5,
1569,
525,
5932,
6,
20,
21,
4678,
31,
92,
1001,
77,
21,
40,
18,
49,
13,
20468,
8741,
3893,
9,
31,
589,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best practice for placement of display logic in a view in CakePHP
===
I have a CakePHP 1.2 application.
I'm running into the case where I need to do some logic to render things correctly in the view.
Example:
I have a table called Types. There are flags for various types, so each row has one or more BOOL fields set. For one type of type, I store the contents of an RTF in another field.
So when I display a listing of all typoes in the view, I want to create a link for the types that are the type where I store RTF. I don't want to show a link, otherwise.
Where is the best place for this logic?
I want to use html->link to create the link, but I can't use that inside of my model. Should the logic go in the model, and if so, should I be building HTML in my model, e.g. the link?
Thanks,
jpe | 0 | [
2,
246,
1345,
26,
10774,
16,
3042,
7085,
19,
21,
1418,
19,
8390,
26120,
800,
3726,
3726,
31,
57,
21,
8390,
26120,
137,
9,
135,
3010,
9,
31,
22,
79,
946,
77,
14,
610,
113,
31,
376,
20,
107,
109,
7085,
20,
16535,
564,
12044,
19,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is a good alternative for SourceSafe on a USB Drive?
===
I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria:
- Entire database can be held on a USB "pen" drive
- Does not require a central server
- Easy to backup and restore using standard backup tools
- Integrates with Visual Studio
- Has a small footprint
A good reference on setup would be good too. | 0 | [
2,
98,
25,
21,
254,
2676,
26,
1267,
18166,
27,
21,
182,
220,
1493,
60,
800,
3726,
3726,
31,
101,
20,
643,
51,
1267,
6488,
27,
21,
182,
220,
1493,
26,
14,
1295,
4091,
9,
20,
1231,
31,
57,
74,
568,
3458,
1267,
18166,
26,
48,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you perform address validation?
===
Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand, it seems like a task that would be necessary for several business requirements. | 0 | [
2,
184,
107,
42,
2985,
3218,
27999,
60,
800,
3726,
3726,
25,
32,
166,
938,
20,
2985,
3218,
13,
5,
23274,
15,
52,
13,
62,
8,
8079,
6,
27999,
60,
32,
2206,
101,
14,
14694,
234,
16,
3218,
13767,
15,
166,
19,
14,
182,
1056,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get top results for each group (in Oracle)
===
How would I be able to get N results for several groups in
an oracle query.
For example, given the following table:
|--------+------------+------------|
| emp_id | name | occupation |
|--------+------------+------------|
| 1 | John Smith | Accountant |
| 2 | Jane Doe | Engineer |
| 3 | Jack Black | Funnyman |
|--------+------------+------------|
There are many more rows with more occupations. I would like to get
three employees (lets say) from each occupation.
Is there a way to do this without using a subquery?
| 0 | [
2,
164,
371,
1736,
26,
206,
214,
13,
5,
108,
15759,
6,
800,
3726,
3726,
184,
83,
31,
44,
777,
20,
164,
13,
103,
1736,
26,
238,
1170,
19,
40,
15759,
25597,
9,
26,
823,
15,
504,
14,
249,
859,
45,
13,
1,
8,
8,
8,
8,
8,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can you use multiple VaryByCustom parameters when caching a user control?
===
I've been trying this a couple of different ways, but it's not working for some reason. Is it even possible? | 0 | [
2,
92,
42,
275,
1886,
7392,
779,
4636,
6015,
12905,
76,
1658,
7192,
21,
4155,
569,
60,
800,
3726,
3726,
31,
22,
195,
74,
749,
48,
21,
1335,
16,
421,
2847,
15,
47,
32,
22,
18,
52,
638,
26,
109,
1215,
9,
25,
32,
166,
938,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Ruby - equivalent of Python __str__() method?
===
In Ruby, is there the equivalent of the __str__() method that you can define on Python classes? | 0 | [
2,
10811,
13,
8,
4602,
16,
20059,
13,
1,
9729,
1,
5,
6,
2109,
60,
800,
3726,
3726,
19,
10811,
15,
25,
80,
14,
4602,
16,
14,
13,
1,
9729,
1,
5,
6,
2109,
30,
42,
92,
9267,
27,
20059,
2684,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How do I find the number of references that exist for a particular object?
===
I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? | 0 | [
2,
184,
107,
31,
477,
14,
234,
16,
7231,
30,
3182,
26,
21,
1498,
3095,
60,
800,
3726,
3726,
31,
57,
21,
1142,
16,
1797,
30,
3789,
140,
21,
13,
444,
16,
3916,
17,
31,
259,
20,
3746,
100,
80,
50,
186,
7231,
174,
18029,
140,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Single best programming asp-classic book?
===
Does anyone have a **good** classicasp book they can reccommend, including best practices, good design. I am stuck in Classicasp land and I want to make sure I do it right.
| 0 | [
2,
345,
246,
3143,
28,
306,
8,
19824,
360,
60,
800,
3726,
3726,
630,
1276,
57,
21,
13,
1409,
3264,
1409,
2732,
472,
306,
360,
59,
92,
6042,
960,
755,
43,
15,
215,
246,
5242,
15,
254,
704,
9,
31,
589,
4549,
19,
2732,
472,
306,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... |
Secure only Login.aspx for a site
===
1. Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS?
2. We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory.
3. Links to this will be helpful.
This is what we have done so far:
1. Setup SharePoint to use FBA against AD.
2. Moved Login Page to Secure/Login.aspx
3. Set the appropriate Login url in web.config as https://..../Secure/Login.aspx
This is not working and help is needed here.
However even if this works, how do we get the user back to http from https?
Kind regards,
Ashish Sharma | 0 | [
2,
4315,
104,
6738,
108,
9,
472,
306,
396,
26,
21,
689,
800,
3726,
3726,
137,
9,
25,
32,
938,
20,
4315,
104,
14,
6738,
108,
9,
472,
306,
396,
2478,
13,
5,
290,
14,
678,
1958,
6,
17,
52,
14,
979,
689,
19,
595,
18,
60,
172,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best way to check if server is reachable in .NET?
===
I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than three hours to which it clocks them out at the time of last activity.
My issue arises that when a user brings his machine back up from a sleep state (which fires the SystemEvents.PowerModeChanged event), the application attempts to clock the employee back in but the network connection isn't fully initialized at that time and the web-service call times out.
An obvious solution, albeit it a hack, would be to put a delay on the clock in but this wouldn't necessarily fix the problem across the board. What I am looking to do is a sort of "relentless" clock in where it will wait until it can see the server until it actually attempts to clock in.
What is the best method to determine if a connection to a web service can be made? | 0 | [
2,
246,
161,
20,
2631,
100,
8128,
25,
1470,
579,
19,
13,
9,
2328,
60,
800,
3726,
3726,
31,
57,
679,
21,
85,
10790,
3010,
19,
272,
5910,
30,
8534,
20,
21,
2741,
365,
27,
318,
8128,
19,
389,
20,
4229,
3716,
19,
118,
1320,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to prevent blank xmlns attributes in output from .NET's XmlDocument?
===
When generating XML from XmlDocument in .NET, a blank `xmlns` attribute appears the first time an element *without* an associated namespace is inserted; how can this be prevented?
Example:
XmlDocument xml = new XmlDocument();
xml.AppendChild(xml.CreateElement("root",
"whatever:name-space-1.0"));
xml.DocumentElement.AppendChild(xml.CreateElement("loner"));
Console.WriteLine(xml.OuterXml);
Output:
<root xmlns="whatever:name-space-1.0"><loner xmlns="" /></root>
Is there a solution applicable to the `XmlDocument` code, not something that occurs *after* converting the document to a string with `OuterXml`? | 0 | [
2,
184,
20,
2501,
6463,
23504,
2172,
13422,
19,
5196,
37,
13,
9,
2328,
22,
18,
23504,
28132,
60,
800,
3726,
3726,
76,
13500,
23504,
37,
23504,
28132,
19,
13,
9,
2328,
15,
21,
6463,
13,
1,
396,
8184,
2172,
1,
35,
14755,
1780,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Advantages to Using Private Static Methods
===
When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static?
Example:
foreach (XmlElement element in xmlDoc.DocumentElement.SelectNodes("sample"))
{
string first = GetInnerXml(element, ".//first");
string second = GetInnerXml(element, ".//second");
string third = GetInnerXml(element, ".//third");
}
...
private static string GetInnerXml(XmlElement element, string nodeName)
{
return GetInnerXml(element, nodeName, null);
}
private static string GetInnerXml(XmlElement element, string nodeName, string defaultValue)
{
XmlNode node = element.SelectSingleNode(nodeName);
return node == null ? defaultValue : node.InnerXml;
}
Is there any advantage to declaring the GetInnerXml() methods as static? No opinion responses please, I have an opinion.
| 0 | [
2,
14683,
20,
568,
932,
12038,
3195,
800,
3726,
3726,
76,
2936,
21,
718,
30,
63,
3117,
932,
3195,
15,
951,
20,
4136,
1797,
1052,
20669,
15,
30,
221,
22,
38,
4077,
14,
275,
16,
186,
4851,
2861,
15,
50,
80,
956,
54,
1912,
14683,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python Library Path
===
In ruby the library path is provided in $", in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import? | 0 | [
2,
20059,
1248,
2013,
800,
3726,
3726,
19,
10811,
14,
1248,
2013,
25,
1173,
19,
5579,
7,
15,
19,
416,
255,
32,
22,
18,
19,
13,
1,
108,
150,
13,
8,
184,
107,
42,
164,
14,
968,
16,
12074,
30,
20059,
19994,
26,
17113,
76,
42,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Should you always favor xrange() over range()?
===
Why or why not? | 0 | [
2,
378,
42,
550,
3654,
993,
8366,
5,
6,
84,
978,
5,
6,
60,
800,
3726,
3726,
483,
54,
483,
52,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Need good questions to ask a Flash developer
===
For an interview in a few, I'm not at all familiar with Flash development.
What would you ask? | 4 | [
2,
376,
254,
2346,
20,
1349,
21,
4433,
10058,
800,
3726,
3726,
26,
40,
2421,
19,
21,
310,
15,
31,
22,
79,
52,
35,
65,
3694,
29,
4433,
522,
9,
98,
83,
42,
1349,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
#ifdef vs #if - which is better/safer?
===
This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter...
Basically, we have some debug print statements which we turn off during normal development. Personally I prefer to do the following:
\\---- SomeSourceFile.cpp ----
#define DEBUG_ENABLED (0)
...
SomeFunction()
{
int someVariable = 5;
#if(DEBUG_ENABLED)
printf("Debugging: someVariable == %d", someVariable);
#endif
}
Some of the team prefer the following though:
\\---- SomeSourceFile.cpp ----
#undef DEBUG_ENABLED
\\#define DEBUG_ENABLED
...
SomeFunction()
{
int someVariable = 5;
#ifdef DEBUG_ENABLED
printf("Debugging: someVariable == %d", someVariable);
#endif
}
...which of those methods sounds better to you and why? My feeling is that the first is safer because there is always something defined and there's no danger it could destroy other defines elsewhere. | 0 | [
2,
6926,
821,
13862,
4611,
6926,
821,
13,
8,
56,
25,
574,
118,
1229,
2407,
60,
800,
3726,
3726,
48,
123,
44,
21,
1161,
16,
1034,
15,
47,
80,
22,
18,
21,
1142,
16,
21,
8918,
19,
318,
9664,
173,
17,
31,
3519,
100,
1276,
962,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does Chrome, Firefox and IE all render fixed-width SELECT controls differently?
===
I am **losing hair** on this one ... it seems that when I fix width an HTML SELECT control it renders it's width differently depending on the browser.
Any idea how to to standardize this without having to turn to multiple style sheets?
Here is what I am working with:
.combo
{
padding: 2px;
width: 200px;
}
.text
{
padding: 2px;
width: 200px;
}
This is my document type for the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| 0 | [
2,
483,
630,
13,
12985,
15,
535,
18219,
17,
13,
660,
65,
16535,
3535,
8,
3976,
43,
96,
5407,
8671,
12670,
60,
800,
3726,
3726,
31,
589,
13,
1409,
4341,
68,
627,
1409,
27,
48,
53,
13,
9,
9,
9,
32,
2206,
30,
76,
31,
6098,
9456... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can you make a DataGridView scroll one item at a time using the mouse wheel?
===
We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd like to do is scroll just one item at a time.
(We display images in the DataGridView, which are somewhat large. Because of this scroll three rows (a typical system setting) is too much, often causing the user to scroll to items they can't even see.)
I've tried a couple things already and haven't had much success so far. Here are some issues I've run into:
1. You can subscribe to MouseWheel events but there's no way to mark the event as handled and do my own thing.
2. You can override OnMouseWheel but this never appears to be called.
3. You might be able to correct this in the base scrolling code but it sounds like a messy job since other types of scrolling (e.g. using the keyboard) come through the same pipeline.
Anyone have a good suggestion?
| 0 | [
2,
184,
92,
42,
233,
21,
1054,
16375,
4725,
12159,
53,
9101,
35,
21,
85,
568,
14,
7567,
3556,
60,
800,
3726,
3726,
95,
22,
43,
101,
20,
84,
11891,
1054,
16375,
4725,
22,
18,
12838,
3257,
76,
568,
21,
7567,
3556,
29,
48,
569,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java Developer meets ObjectiveC on Mac OS
===
I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would just put this question out there: What Next?
More specifically, what books should I pick up, and are there any web resources that some folks could point me to? Some books that I am planning to purchase:
- [Programming in Objective-C 2.0][1]
- [Cocoa(R) Programming for Mac OS X (3rd Edition)][2]
Anyone familiar with these titles? Finally, I would be very interested in a summary of what I should be prepared to expect, once I embark on this journey. As someone that develops in Java using IntelliJ IDEA, what are some key differences I will notice as I move over to writing ObjectiveC code in Xcode? What's the differences between Mac OS desktop development and iPhone development? Being used to Java garbage collection, what should I know about ObjectiveC garbage collection / memory management. Any other language specific issues that anyone would like to point out? How about building UIs? Is it closer to Swing, building Visual C++ resource files that code interacts with, or is it more like some of the borland IDEs that will generate code for guis?
[1]: http://www.amazon.com/Programming-Objective-C-2-0-Developers-Library/dp/0321566157
[2]: http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1222367081&sr=1-1 | 0 | [
2,
8247,
10058,
5224,
7038,
150,
27,
1572,
13,
759,
800,
3726,
3726,
31,
57,
885,
19,
272,
20512,
151,
122,
1464,
15,
47,
158,
509,
31,
589,
2257,
21,
8247,
2306,
2335,
9,
504,
31,
258,
40,
21024,
15,
589,
1451,
20,
1573,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I use an event to cause a method to run?
===
So in my documentation it says:
"C#
public event TreeViewPlusNodeCheckedEventHandler NodeChecked()
You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree."
So how do I add a method to my code behind file that will run when a node is checked? The method I want to run is:
protected void TOCNodeCheckedServer(object sender, TreeViewPlusNodeEventArgs args)
{
TreeViewPlusNode aNode = args.Node;
if (!aNode.Checked)
return;
List<string> BaseLayers = new List<string>();
_arcTOCConfig.BaseDataLayers.CopyTo(BaseLayers);
List<MapResourceItem> mapResources = new List<MapResourceItem>();
if (BaseLayers.Contains(aNode.Text))
{
foreach (BaseDataLayerElement anEl in _arcTOCConfig.BaseDataLayers)
{
if (!aNode.Text.Equals(anEl.Name))
{
if (aNode.TreeViewPlus.Nodes.FindByValue(anEl.Name).Checked)
{
aNode.TreeViewPlus.Nodes.FindByValue(anEl.Name).Checked = false;
aNode.TreeViewPlus.Nodes.FindByValue(anEl.Name).Refresh();
MapResourceItem aMapResource = this.Map1.MapResourceManagerInstance.ResourceItems.Find(anEl.Name);
aMapResource.DisplaySettings.Visible = false;
this.Map1.RefreshResource(anEl.Name);
mapResources.Add(aMapResource);
this.Map1.MapResourceManagerInstance.ResourceItems.Remove(aMapResource);
}
else
{
MapResourceItem aMapResource = this.Map1.MapResourceManagerInstance.ResourceItems.Find(anEl.Name);
mapResources.Add(aMapResource);
this.Map1.MapResourceManagerInstance.ResourceItems.Remove(aMapResource);
}
}
}
foreach (MapResourceItem aMapResource in mapResources)
{
int count = this.Map1.MapResourceManagerInstance.ResourceItems.Count - 1;
this.Map1.MapResourceManagerInstance.ResourceItems.Insert(count, aMapResource);
this.Map1.MapResourceManagerInstance.CreateResource(aMapResource);
}
this.Map1.InitializeFunctionalities();
this.Map1.Refresh();
}
}
vs 2008
c#
.net 3.5 | 0 | [
2,
184,
92,
31,
275,
40,
807,
20,
1679,
21,
2109,
20,
485,
60,
800,
3726,
3726,
86,
19,
51,
13945,
32,
898,
45,
13,
7,
150,
5910,
317,
807,
1541,
4725,
13349,
251,
546,
12542,
69,
4943,
96,
290,
1252,
15421,
12542,
69,
5,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hosted CRM system with an API?
===
I apologize if this is slightly off-topic.
I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have email conversations with people that own these accounts - it would be great if our CRM interface would suddenly light up with the record of these conversations.
Here's my dream solution, let me know if this is possible:
- We have a "service" email alias; i'd want to add the "track@GreatCrmVendor.com" to that alias so that all emails are CC'd to our CRM vendor.
- In the admin UI for our app, I'd love to have access to the emails that the CRM vendor has captured for us - something like a REST-based web service call that aks "give me all email headers for customer with email X".
Do you know of such CRM vendor?
<b>Clarification</b>: I know how to build such a catch-all email account, parse the emails, record them in the database and all... I just don't want to invest the development time in it, I'm hoping we can just integrate with a good off-the-shelf solution.
Thanks! | 2 | [
2,
2812,
6186,
79,
329,
29,
40,
21,
2159,
60,
800,
3726,
3726,
31,
12059,
100,
48,
25,
1847,
168,
8,
3880,
596,
9,
31,
22,
79,
3935,
20,
477,
21,
2306,
8,
472,
8,
58,
8,
11449,
6186,
79,
329,
30,
92,
44,
2351,
5547,
29,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Should one prefer STL algorithms over hand-rolled loops?
===
I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that [stl algorithms are preferred][1], or at least he did in 2001. Of course, using them often means moving the loop body into a function or function object. Some may feel this is an unacceptable complication, while others may feel it better breaks down the problem.
So... should STL algorithms be preferred over hand-rolled loops?
[1]: http://www.ddj.com/cpp/184401446 | 0 | [
2,
378,
53,
6369,
354,
255,
15935,
84,
224,
8,
8694,
69,
19661,
60,
800,
3726,
3726,
31,
2260,
20,
44,
2078,
91,
13,
22,
1106,
22,
19661,
84,
32,
106,
9922,
19,
2346,
279,
6709,
235,
119,
31,
107,
26,
1,
14322,
5,
6,
15,
800... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Semantic merge tool
===
Background: In my job, we use SVN, C# and VisualStudio. Part of my task regularly involves global renames. Often I end up with a broken build after renaming something and then merging in changes.
The question: is there a solution out there that can look at my changes, notice the global rename and then apply that to the edit that others have made while merging them in?
Another way to get much the same effect would be some sort of reactor log and then apply that to the incoming edits.
The tool need not be perfect, even if it just noted any references in their edits that referred to something that I have edited would be valuable | 0 | [
2,
17220,
12666,
5607,
800,
3726,
3726,
2395,
45,
19,
51,
1205,
15,
95,
275,
13,
18,
16578,
15,
272,
5910,
17,
3458,
21026,
9,
141,
16,
51,
3005,
4217,
6569,
2062,
302,
7259,
18,
9,
478,
31,
241,
71,
29,
21,
2023,
1895,
75,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I discover if there are other devices on my local sub-net?
===
I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better? | 0 | [
2,
184,
92,
31,
6297,
100,
80,
50,
89,
4690,
27,
51,
375,
972,
8,
2328,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
10265,
21,
4155,
21,
367,
306,
27581,
51,
12138,
3646,
37,
21,
982,
115,
2955,
109,
5010,
9,
31,
22,
79,
5154,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the best way to remove <br> tags from the end of a string?
===
The .NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.)
What's the best way to do this? (I can think of ways to do this, but I'm sure they're not the best.) | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
4681,
13,
1,
5145,
1,
3383,
18,
37,
14,
241,
16,
21,
3724,
60,
800,
3726,
3726,
14,
13,
9,
2328,
2741,
329,
31,
22,
79,
638,
27,
2965,
14,
241,
4155,
20,
6367,
13,
15895,
13,
29850,
1854,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to call a long-running external program from Excel / VBA
===
What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally,
1. A model dialog box that let's the user know that the process is executing.
2. If the executable fails, the user should receive a notification.
3. A timeout should be enforced.
4. A cancel button should be on the dialog box.
But any best-practices are welcome. I'm interested in solutions with calling either a .dll or an .exe. Preferably something that works with Excel '03 or earlier, but I'd love to hear a reason to move to a later version as well.
| 0 | [
2,
184,
20,
645,
21,
175,
8,
11325,
4886,
625,
37,
20700,
13,
118,
566,
969,
800,
3726,
3726,
98,
25,
14,
246,
161,
20,
485,
40,
4886,
625,
37,
20700,
9,
32,
530,
485,
26,
238,
902,
9,
98,
22,
18,
14,
246,
8,
4899,
5183,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is Google App Engine a worthy platform for a Lifestreaming app?
===
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of cron jobs is a nuisance. Would I be better off using Django on a co-loc and dealing with my own DB scaling? | 0 | [
2,
25,
8144,
4865,
1406,
21,
14358,
2452,
26,
21,
201,
11260,
68,
4865,
60,
800,
3726,
3726,
31,
22,
79,
353,
21,
201,
11260,
68,
4865,
30,
129,
8847,
3303,
125,
7503,
16,
17058,
26,
7503,
16,
3878,
15,
17,
2955,
1054,
8,
2160,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Merging contacts in SQL table without creating duplicate entries
===
I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person.
Ideally, I would like to call something simple like
UPDATE MailingListSubscription
SET PersonID = @DestPerson
WHERE PersonID = @SourcePerson
However, if the destination person already exists in this table with the same ListID as the source person, a duplicate entry will be made. How can I perform this action without creating duplicated entries? (ListID, PersonID is the primary key)
| 0 | [
2,
18842,
11894,
19,
4444,
255,
859,
366,
2936,
19429,
11399,
800,
3726,
3726,
31,
57,
21,
859,
30,
2763,
104,
81,
7498,
13,
8,
21,
968,
1340,
17,
840,
1340,
9,
76,
21,
840,
25,
3901,
29,
226,
19,
14,
329,
15,
31,
23,
20,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MS Access Data Access Limitations
===
I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a little concerned about data integrity and concurrent access.
Will I likely run into problems with my .NET import process (using LINQ/ADO.NET/?) when it is trying to pull data out of the MDB at the same time someone else is saving a row? How does Access's locking work?
I know, I know - Access sucks. | 0 | [
2,
4235,
1381,
1054,
1381,
14070,
800,
3726,
3726,
31,
57,
21,
669,
193,
130,
113,
31,
22,
43,
101,
20,
44,
777,
20,
2201,
11295,
70,
16,
40,
1381,
6018,
30,
21,
203,
897,
346,
2374,
2027,
20,
1718,
82,
676,
9,
80,
129,
1720,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Source Control on the IBM i (iSeries)
===
On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible. | 0 | [
2,
1267,
569,
27,
14,
10233,
31,
13,
5,
49,
8231,
6,
800,
3726,
3726,
27,
14,
2741,
270,
95,
50,
638,
27,
1017,
1267,
569,
9,
130,
15,
31,
259,
20,
196,
98,
92,
44,
677,
26,
14,
31,
8231,
270,
9,
98,
25,
154,
3839,
1267,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript - JScript - Whats the difference???
===
I have always wondered what the heck is the difference between JScript and JavaScript. | 0 | [
2,
8247,
8741,
13,
8,
487,
8741,
13,
8,
98,
18,
14,
2841,
60,
60,
60,
800,
3726,
3726,
31,
57,
550,
3519,
98,
14,
16490,
25,
14,
2841,
128,
487,
8741,
17,
8247,
8741,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Difference between ref and out parameters in .NET
===
What is the difference between ref and out parameters in .NET? What are the situations where one can be more useful than the other? Can anybody illustrate with a code snippet where one can be used and another can't? | 0 | [
2,
2841,
128,
13,
14057,
17,
70,
12905,
19,
13,
9,
2328,
800,
3726,
3726,
98,
25,
14,
2841,
128,
13,
14057,
17,
70,
12905,
19,
13,
9,
2328,
60,
98,
50,
14,
8329,
113,
53,
92,
44,
91,
4811,
119,
14,
89,
60,
92,
11181,
15620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading 32bit Packed Binary Data On 64bit System
===
I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit architecture), but not on a 64 bit box. Is there a "preferred" way of doing this?
| 0 | [
2,
1876,
2512,
3326,
9402,
14171,
1054,
27,
4384,
3326,
329,
800,
3726,
3726,
31,
22,
79,
6314,
20,
2757,
21,
20059,
272,
3896,
30,
11137,
9402,
14171,
1054,
13,
5,
242,
25,
8214,
28,
13,
10346,
18,
16,
13,
10346,
18,
6,
17,
94,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to preserve stack space with well design?
===
I'm programming in C for RAM limited embedded microcontroller with RTOS.
I regularly break my code to short functions, but every function calling require to more stack memory.
Every task needs his stack, and this is one of the significant memory consumers in the project.
Is there an alternative to keep the code well organized and readable, still preserve the memory? | 0 | [
2,
184,
20,
6224,
7566,
726,
29,
134,
704,
60,
800,
3726,
3726,
31,
22,
79,
3143,
19,
272,
26,
2843,
1317,
12138,
2899,
12898,
1252,
29,
761,
262,
18,
9,
31,
4217,
1442,
51,
1797,
20,
502,
3719,
15,
47,
352,
1990,
2555,
4077,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I run ASP.NET 2.0 and 3.5 code on the same website?
===
Can I run ASP.NET 2.0 and 3.5 code on the same website? ...or, do I need to separate them by applications, and/or servers? | 0 | [
2,
92,
31,
485,
28,
306,
9,
2328,
172,
9,
387,
17,
203,
9,
264,
1797,
27,
14,
205,
2271,
60,
800,
3726,
3726,
92,
31,
485,
28,
306,
9,
2328,
172,
9,
387,
17,
203,
9,
264,
1797,
27,
14,
205,
2271,
60,
13,
9,
9,
9,
248,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How does any application (chrome, flash, etc) get a time resolution better then the system time resolution?
===
This article on microsoft's tech net site supplies an exe that will calculate your windows machine's minimum time resolution - this should be the smallest "tick" available to any application on that machine:
[http://technet.microsoft.com/en-us/sysinternals/bb897568.aspx][1]
The result of running this app on my current box is 15.625 ms. I have also run tests against Internet Explorer and gotten the exact same resolution from the Date() javascript function.
What is confusing is that the SAME test I ran against IE gives back much finer resolution for Google's Chrome browser (resolution of 1ms) and for a flash movie running in IE (1ms). Can anyone explain how any application can get a clock resolution better then the machine's clock? If so, is there some way I can get a consistantly better resolution in browsers other then Chrome (without using flash)?
[1]: http://technet.microsoft.com/en-us/sysinternals/bb897568.aspx | 0 | [
2,
184,
630,
186,
3010,
13,
5,
12985,
15,
4433,
15,
2722,
6,
164,
21,
85,
4302,
574,
94,
14,
329,
85,
4302,
60,
800,
3726,
3726,
48,
2002,
27,
7099,
22,
18,
6145,
4275,
689,
4852,
40,
1396,
62,
30,
129,
18469,
154,
1936,
1940,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Lost Classics: Out of Print Books?
===
[On Lisp][1] is well regarded as an advanced Lisp book. The author put it into the public domain, and it is now available from an on-deman printer ([Lulu.com][2]).
What other classic books are we missing out on because they're out of print, and which ones are available on-line or on-demand?
[1]: http://www.lulu.com/content/3060872
[2]: http://www.lulu.com/ | 4 | [
2,
529,
10980,
45,
70,
16,
4793,
964,
60,
800,
3726,
3726,
636,
218,
2093,
3401,
500,
2558,
165,
500,
25,
134,
3950,
28,
40,
2255,
2093,
3401,
360,
9,
14,
1314,
442,
32,
77,
14,
317,
4603,
15,
17,
32,
25,
130,
904,
37,
40,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?
===
How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?
To manually perform the operation I can follow the steps described in
[link text][1]
Open Device Manager with devmgmt.msc
Double-click Ports (COM & LPT).
Right-click the port I want, and then click Properties.
On the Port Settings tab, if I want to change the COM port number (for example, from COM1 to COM51), I click the Advanced button, and then select the COM port number I need from the list.
But, how can I do the job with a program? Is there an API to do the job?
Thank you.
[1]: http://technet.microsoft.com/en-us/library/cc754755.aspx "http://technet.microsoft.com/en-us/library/cc754755.aspx" | 0 | [
2,
184,
20,
625,
6732,
1326,
4169,
21,
204,
101,
13,
960,
4246,
20,
21,
1825,
5956,
1295,
19,
7099,
1936,
60,
800,
3726,
3726,
184,
20,
625,
6732,
1326,
4169,
21,
204,
101,
13,
960,
4246,
20,
21,
1825,
5956,
1295,
19,
7099,
1936... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is MSVCRT under Windows like glibc (libc) under *nix?
===
I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same .DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogous to glibc/libc.so under *nix.
Why do Windows programs have to bring along their C libraries with them, instead of just sharing the system-wide libc? | 0 | [
2,
25,
4235,
8990,
5256,
131,
1936,
101,
13,
6441,
7229,
13,
5,
8326,
150,
6,
131,
1637,
14064,
60,
800,
3726,
3726,
31,
3086,
340,
464,
1936,
1726,
30,
10194,
19,
4235,
8990,
5256,
13,
5,
248,
66,
91,
866,
4602,
18,
6,
29,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sprite / Character animation in Silverlight (v2)
===
We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have.
Is key framing the animations our only option here? And if it is, what's the best way to do it? Hundreds of individual png's or is there some way in Silverlight to draw just a portion of a larger image? | 0 | [
2,
27902,
13,
118,
925,
6236,
19,
1172,
3130,
13,
5,
710,
135,
6,
800,
3726,
3726,
95,
57,
21,
1172,
3130,
172,
669,
13,
5,
5128,
6,
30,
129,
4077,
21,
865,
16,
925,
6236,
9,
92,
1276,
5601,
21,
254,
161,
20,
107,
48,
9,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a way to automatically import ICS into Google Calendar?
===
I don't see any obvious way to import ICS files into Google Calendar from the API docs here:
[http://code.google.com/apis/calendar/developers_guide_protocol.html][1]
And I'd greatly prefer not to have to parse them myself just to send the appointments into GCal. I'm looking for a programmatic solution, not something like import plugins for Thunderbird, Outlook, etc. Third party APIs to do the ICS parsing are acceptable. Any ideas?
[1]: http://code.google.com/apis/calendar/developers_guide_protocol.html | 0 | [
2,
25,
80,
21,
161,
20,
7499,
9010,
13,
8354,
77,
8144,
7036,
60,
800,
3726,
3726,
31,
221,
22,
38,
196,
186,
4674,
161,
20,
9010,
13,
8354,
6488,
77,
8144,
7036,
37,
14,
21,
2159,
9765,
18,
235,
45,
636,
21127,
6903,
9375,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I closely achieve ?: from C++/C# in Python?
===
In C# I could easily write the following:
string stringValue = string.IsDefaultOrNull( otherString ) ? defaultString : otherString;
Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement? | 0 | [
2,
184,
92,
31,
3368,
4689,
13,
60,
45,
37,
272,
20512,
118,
150,
5910,
19,
20059,
60,
800,
3726,
3726,
19,
272,
5910,
31,
110,
2351,
2757,
14,
249,
45,
3724,
3724,
15165,
800,
3724,
9,
403,
13862,
9708,
248,
4215,
211,
5,
89,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which list<Object> implementation will be the fastest for one pass write, read, then destroy?
===
What is the fastest list<Object> implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the list will then be destroyed.
I know that the Big O notation for get is O(1) and add is O(1) for an ArrayList, while LinkedList is O(n) for get and O(1) for add. Does the iterator behave with the same Big O notation?
| 0 | [
2,
56,
968,
1,
23793,
1,
6123,
129,
44,
14,
7518,
26,
53,
1477,
2757,
15,
1302,
15,
94,
4407,
60,
800,
3726,
3726,
98,
25,
14,
7518,
968,
1,
23793,
1,
6123,
13,
5,
108,
8247,
6,
19,
21,
12705,
113,
14,
968,
129,
44,
679,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CherryPy server name tag
===
When running a CherryPy app it will send server name tag something like CherryPy/version
Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else?
like MyAppName/version (CherryPy/version) | 0 | [
2,
9257,
6448,
8128,
204,
3383,
800,
3726,
3726,
76,
946,
21,
9257,
6448,
4865,
32,
129,
2660,
8128,
204,
3383,
301,
101,
9257,
6448,
118,
10898,
25,
32,
938,
20,
302,
7259,
118,
2549,
23716,
30,
37,
14,
4865,
366,
17579,
68,
9257... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mathematica Downvalue Lhs
===
Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in
For example:
a[1]=2;
a[2]=3;
BuiltInIDoNotKnowOf[a] returns {1,2} | 0 | [
2,
5057,
5996,
12630,
125,
15165,
644,
252,
18,
800,
3726,
3726,
630,
11181,
143,
100,
80,
25,
21,
392,
8,
108,
1990,
19,
5057,
5996,
12630,
26,
1017,
14,
644,
252,
18,
16,
125,
15165,
1761,
13,
5,
14506,
186,
1337,
6,
60,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LinqToSql and WCF
===
Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app?
I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message classes, and the like which reduces the benefit you get from not having to write your data access code.
Is there a good way to do it currently? Are we stuck waiting for the Entity Framework? | 0 | [
2,
6294,
1251,
262,
18,
22402,
17,
11801,
410,
800,
3726,
3726,
363,
40,
13,
103,
8,
5259,
4865,
30,
1364,
275,
16,
21,
11801,
410,
365,
20,
10001,
29,
14,
6018,
15,
98,
25,
14,
246,
1345,
161,
16,
544,
275,
16,
6294,
1251,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.