unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
To ternary or not to ternary?
===
I'm personally an advocate of the ternary operator: () ? : ; I do realize that it has it's place, but I have come across many programmers that are completely againt ever using it, and some that use it too often.
What are your feelings on it? What interesting code have you seen using it? | 0 | [
2,
20,
13,
8766,
1857,
54,
52,
20,
13,
8766,
1857,
60,
800,
3726,
3726,
31,
22,
79,
7200,
40,
7645,
16,
14,
13,
8766,
1857,
6022,
45,
13,
5,
6,
13,
60,
13,
45,
13,
73,
31,
107,
4007,
30,
32,
63,
32,
22,
18,
209,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
ASP.net Web App undo support
===
I have a simple web form that has a several fields and a gridview on it. I also have a save and cancel button.
I would like a way to undo what was done to the data on the form when the user presses cancel. This is simple enough with the fields however since changes to the gridview happen in real time against the database I do not know how to get undo functionality.
I have thought of storing the changes to gridview in viewstate but I would rather not because of the extra space requirement.
I have also thought of a temporary table that would stored the changes then roll them back as needed.
Does anyone have an idea how to get undo functionality from the form? | 0 | [
2,
28,
306,
9,
2328,
2741,
4865,
367,
537,
555,
800,
3726,
3726,
31,
57,
21,
1935,
2741,
505,
30,
63,
21,
238,
2861,
17,
21,
7354,
4725,
27,
32,
9,
31,
67,
57,
21,
2079,
17,
14815,
5167,
9,
31,
83,
101,
21,
161,
20,
367,
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... |
What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean?
===
I tried this in mysql:
mysql> alter table region drop column country_id;
And got this:
ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to
'./product/region' (errno: 150)
Any ideas? Foreign key stuff? | 0 | [
2,
98,
630,
51,
18,
22402,
7019,
332,
1811,
13,
5,
5608,
3993,
6,
45,
7019,
27,
302,
7259,
16,
13,
22,
9,
118,
4120,
111,
22,
13,
5,
29992,
251,
45,
4354,
6,
884,
60,
800,
3726,
3726,
31,
794,
48,
19,
51,
18,
22402,
45,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 the best way to get a list of running processes in unix with python?
===
I'm trying:
import commands
print commands.getoutput("ps -u 0")
But it doesn't work on os x. | 0 | [
2,
56,
25,
14,
246,
161,
20,
164,
21,
968,
16,
946,
5102,
19,
22540,
29,
20059,
60,
800,
3726,
3726,
31,
22,
79,
749,
45,
9010,
14294,
4793,
14294,
9,
3060,
1320,
4881,
5,
7,
1919,
13,
8,
291,
713,
7,
6,
47,
32,
1437,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Flex: Is it possible to modify an embedded icon and use the modified icon in a button?
===
Just that, if you embed an icon:
[Embed(source='icons/checkmark.png')]
private static var CheckMark:Class;
You end up with a dynamic class. You can pretty easily assign the icon to a button at runtime by calling the setStyle method:
var btn:Button = new Button();
btn.setStyle("icon", CheckMark);
But what if you wanted to alter the icon at runtime, like changing it's alpha value or even redrawing pixels, before assigning it to the button?
So far I can't find a satisfactory answer... | 0 | [
2,
14409,
45,
25,
32,
938,
20,
17579,
40,
12138,
9801,
17,
275,
14,
5372,
9801,
19,
21,
5167,
60,
800,
3726,
3726,
114,
30,
15,
100,
42,
11911,
69,
40,
9801,
45,
636,
1503,
4283,
5,
12097,
3726,
22,
49,
12124,
118,
12542,
4527,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Compile error in VS.NET 2008 (VB.NET) that I can't get rid of!!
===
I can't shake this error when compiling my Visual Studio.NET 2008 solution. The project that's generating the error is a VB.NET Web Application in a 12 project solution (mixed types and languages).
I've tried all the tricks I can find on google, and the obvious of removing the directoy and folder manually.
I'm running Vista Business 32 with VS.NET 2008 SP1. This just started happening out of the blue today and I've rebooted a bunch and even re-applied SP1 for VS.NET.
Any ideas or has anybody seen this?
vbc : **error BC31019**: **Unable to write to output file** 'G:\Projects\TCA.NET\TcaNet\WebUI\obj\Debug\TcaNet.WebUI.pdb': **Unspecified error** | 0 | [
2,
26561,
7019,
19,
4611,
9,
2328,
570,
13,
5,
20468,
9,
2328,
6,
30,
31,
92,
22,
38,
164,
6681,
16,
19015,
800,
3726,
3726,
31,
92,
22,
38,
4657,
48,
7019,
76,
24378,
51,
3458,
1120,
9,
2328,
570,
4295,
9,
14,
669,
30,
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... |
Open Source C++ to C# compiler/converter
===
Even if it requires manual input. Is there any good-enough option available? | 0 | [
2,
368,
1267,
272,
20512,
20,
272,
5910,
21486,
118,
1126,
8122,
106,
800,
3726,
3726,
166,
100,
32,
4781,
5132,
6367,
9,
25,
80,
186,
254,
8,
23680,
4255,
904,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How to update object with no data contexts
===
Entity framework provides great flexibility to update data in the same datacontext
Dim personA = (from p in datacontext.Person where p.PersonID = 1 select p)
personA.name = txtName.value
datacontext.savechanges()
If I have to move this Update function to Service layer which only takes "Person" in the request, what would be the best way to assign my "Person" request object into the datacontext without doing the deep copying again?
| 0 | [
2,
184,
20,
11100,
3095,
29,
90,
1054,
4141,
18,
800,
3726,
3726,
9252,
6596,
1927,
374,
19401,
20,
11100,
1054,
19,
14,
205,
1054,
1126,
11969,
5937,
17249,
800,
13,
5,
2665,
351,
19,
1054,
1126,
11969,
9,
7276,
113,
351,
9,
7276... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 I free pointer returned by getpwuid() in Linux?
===
After I call getpwuid(uid), I have a reference to a pointer. Should I free that when I don't use it anymore? Reading the man pages, it says that it makes reference to some static area, that may be overwritten by subsequent calls to the same functions, so I'm sure sure if I should touch that memory area.
Thanks. | 0 | [
2,
378,
31,
551,
454,
106,
587,
34,
164,
17230,
5661,
43,
5,
6,
19,
13024,
60,
800,
3726,
3726,
75,
31,
645,
164,
17230,
5661,
43,
5,
5661,
43,
6,
15,
31,
57,
21,
2801,
20,
21,
454,
106,
9,
378,
31,
551,
30,
76,
31,
221,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 access argc and argv in c++ from a library function
===
I'm writing a library which is to be dynamically loaded in C++.
I'd like to read argc and argv (for debugging reasons) from within my code, however I do not have access to the main function. Is there any way to retrieve the command line (both Windows and Linux solution would be nice).
Thanks,
Dan | 0 | [
2,
184,
92,
31,
1381,
13,
10663,
150,
17,
13,
10663,
710,
19,
272,
20512,
37,
21,
1248,
1990,
800,
3726,
3726,
31,
22,
79,
1174,
21,
1248,
56,
25,
20,
44,
7782,
1326,
8572,
19,
272,
20512,
9,
31,
22,
43,
101,
20,
1302,
13,
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... |
Localization in OpenSocial gadget app
===
I'm trying to add multi-language support to an OpenSocial application. I see that I can link to my own message bundles in the gadget XML markup, but how do I actually extract values from them? | 0 | [
2,
375,
1829,
19,
368,
11559,
25661,
4865,
800,
3726,
3726,
31,
22,
79,
749,
20,
3547,
1889,
8,
7020,
555,
20,
40,
368,
11559,
3010,
9,
31,
196,
30,
31,
92,
3508,
20,
51,
258,
2802,
10194,
18,
19,
14,
25661,
23504,
943,
576,
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,
0,
0,
0,
0,
0,
0,
0... |
Django/Python - Grouping objects by common set from a many-to-many relationships
===
This is a part algorithm-logic question (how to do it), part implementation question (how to do it best!). I'm working with Django, so I thought I'd share with that.
In Python, it's worth mentioning that the problem is somewhat related to [how-do-i-use-pythons-itertoolsgroupby][1].
Suppose you're given two Django Model-derived classes:
from django.db import models
class Car(models.Model):
mods = models.ManyToManyField(Representative)
and
from django.db import models
class Mods(models.Model):
...
How does one get a list of Cars, grouped by Cars with a common set of Mods?
I.e. I want to get a class likeso:
Cars_by_common_mods = [
{ mods: { a }, cars: { W1, W2 } },
{ mods: { a, b }, cars: { X1, X2, X3 }, },
{ mods: { b }, cars: { Y1, Y2 } },
{ mods: { a, b, c }, cars: { Z1 } },
]
I've been thinking of something like:
def cars_by_common_mods():
cars = Cars.objects.all()
mod_list = []
for car in cars:
mod_list.append( { 'car': car, 'mods': list(car.mods.all()) }
ret = []
for key, mods_group in groupby(list(mods), lambda x: set(x.mods)):
ret.append(mods_group)
return ret
However, that doesn't work because (perhaps among other reasons) the groupby doesn't seem to group by the mods sets. I guess it has to be sorted to work with groupby. All to say, I'm confident there's something simple and elegant out there that will be both enlightening and illuminating.
*Cheers & thanks!*
[1]: http://stackoverflow.com/questions/773/how-do-i-use-pythons-itertoolsgroupby | 0 | [
2,
3857,
14541,
118,
6448,
11570,
13,
8,
19288,
3916,
34,
757,
309,
37,
21,
151,
8,
262,
8,
14842,
5833,
800,
3726,
3726,
48,
25,
21,
141,
9083,
8,
24268,
1301,
13,
5,
1544,
20,
107,
32,
6,
15,
141,
6123,
1301,
13,
5,
1544,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 any thing such as SELECT LAST in sql query?
===
I am using sybase database to query the daily transaction report. I had subquery within my script.
Here as it goes:
SELECT orders.accountid ,items.x,etc
(SELECT charges.mistotal FROM charges where items.id = charges.id)
FROM items,orders
WHERE date = '2008-10-02'
Here I am getting the error message as **Subquery cannot return more than one values**.
My values are 7.50, 25.00
I want to return the 25.00...but when i use
(SELECT TOP 1 charges.mistotal FROM charges where items.id = charges.id)
My result is 7.50 but I want to return 25.00
Does anyone has any better suggestion....
| 0 | [
2,
25,
80,
186,
584,
145,
28,
5407,
236,
19,
4444,
255,
25597,
60,
800,
3726,
3726,
31,
589,
568,
10315,
8436,
6018,
20,
25597,
14,
1954,
12799,
1330,
9,
31,
41,
972,
8190,
93,
363,
51,
3884,
9,
235,
28,
32,
1852,
45,
5407,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Enumerated types as constants across web services?
===
I'm working on a project where I'm trying to avoid hard-coding DB IDs in a .NET service-oriented project. There are some instances where I **need** to set ID values through code but I don't want to just hard code the IDs since I've done that before and it lead to DB alignment nightmares when the auto-incrementing IDs were changed when the DB was dumped to a new system.
What I want to do is create an enumerated constants that store the IDs as so that at the worst, only 1 file has to be updated if the DB is ever changed instead of trying to go through thousands upon thousands of lines of code to replace any ID in the system.
This will work on a single system, but in my company's service oriented environment, enumerations don't serialize with their values, just their names.
What is the best way to share IDs across a web service? I'd like to use either enumerations (the ideal situation) or constants in some way, but I can't seem to get this to work. I could make a web method that returns the IDs, but sending a web request for every ID and then serializing the response and deserializing on the client machine just sounds like a bad idea. | 0 | [
2,
26940,
69,
2551,
28,
3587,
18,
464,
2741,
687,
60,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
669,
113,
31,
22,
79,
749,
20,
2658,
552,
8,
15458,
13,
9007,
13,
9178,
19,
21,
13,
9,
2328,
365,
8,
6800,
669,
9,
80,
50,
109... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 check for key being held down on startup in Java
===
I'm trying to write a resolution selection dialog that pops up when a program first starts up. To prevent boring the user, I want to implement the fairly standard feature that you can turn off that dialog with a checkbox, but get it back by holding down the alt key at startup.
Unfortunately, there is no obvious way to ask java whether a given key is **currently being pressed**. You can only register to be informed of new key presses via a KeyListener, but that doesn't help if the keypress starts before the app launches. | 0 | [
2,
184,
20,
2631,
26,
1246,
142,
269,
125,
27,
20205,
19,
8247,
800,
3726,
3726,
31,
22,
79,
749,
20,
2757,
21,
4302,
3155,
28223,
30,
1675,
18,
71,
76,
21,
625,
64,
3244,
71,
9,
20,
2501,
13081,
14,
4155,
15,
31,
259,
20,
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... |
What works of entertaining fiction best depict programmers?
===
Like anybody I like a good book or movie, especially if they have the cool programmer guy who ends up saving the world and getting the girl at the same time. Unfortunately, most works of fiction, especially movies, are really bad at getting the details right. Or sometimes they are just laughably wrong.
So I ask: what books/movies/other media are both entertaining and get the details right, or at least not so wrong as to make it impossible to enjoy? Is there a tipping point? What tradeoffs are acceptable between Silicon Valley and Hollywood? | 2 | [
2,
98,
693,
16,
15677,
3209,
246,
20444,
17968,
18,
60,
800,
3726,
3726,
101,
11181,
31,
101,
21,
254,
360,
54,
1308,
15,
1118,
100,
59,
57,
14,
2700,
17968,
1244,
72,
3451,
71,
7599,
14,
126,
17,
1017,
14,
695,
35,
14,
205,
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... |
How do you localize a database driven website
===
I've been playing with the .NET built in localization features and they seem to all rely on putting data in resx files.
But most systems can't rely on this because they are database driven. So how do you solve this issue? Is there a built in .NET way, or do you create a translations table in SQL and do it all manually? And if you have to do this on the majority of your sites, is there any reason to even use the resx way of localization?
An example of this is I have an FAQ list on my site, I keep this list in the database so I can easily add/remove more, but by putting it in the database, I have no good way have translating this information into multiple languages. | 0 | [
2,
184,
107,
42,
375,
2952,
21,
6018,
5355,
2271,
800,
3726,
3726,
31,
22,
195,
74,
791,
29,
14,
13,
9,
2328,
392,
19,
375,
1829,
967,
17,
59,
2260,
20,
65,
12139,
27,
3873,
1054,
19,
10719,
396,
6488,
9,
47,
127,
1242,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 svn command would list all the files modified on a branch?
===
In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.
How do I get a list of all files that were changed on the branch compared to what's on the trunk? I do not want to see files that were changed on the trunk between when the branch was created and "now". | 0 | [
2,
98,
13,
18,
16578,
1202,
83,
968,
65,
14,
6488,
5372,
27,
21,
1686,
60,
800,
3726,
3726,
19,
13,
18,
16578,
15,
31,
57,
21,
1686,
56,
23,
679,
15,
395,
35,
11323,
1024,
24606,
9,
9686,
18,
46,
94,
117,
27,
14,
1686,
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... |
String problem with SQL Reader?
===
Function FillAdminAccount() As Boolean
FillAdminAccount = True
Try
SQLconn.ConnectionString = "connect timeout=9999999;" & _
"data source=" & DefaultIserver & ";" & _
"initial catalog=" & DefaultIdBase & "; " & _
"user id=jmradomes;" & _
"password=jmradomes;" & _
"persist security info=True; " & _
"packet size=4096"
SQLconn.Open()
SQLcmd.CommandType = CommandType.Text
SQLcmd.CommandText = "Select distinct username, cast(convert(varchar,userpassword) as varchar) as 'userpassword' from " & tblUsersList & " where usertype='MainAdmin'"
SQLcmd.Connection = SQLconn
SQLreader = SQLcmd.ExecuteReader
While SQLreader.Read = True
CurrentAdminUser = SQLreader("username").ToString
CurrentAdminPass = SQLreader("userpassword").ToString 'PROBLEM
End While
Catch ex As Exception
ErrorMessage(ex)
Finally
If SQLconn.State = ConnectionState.Open Then SQLconn.Close()
If SQLreader.IsClosed = False Then SQLreader.Close()
End Try
End Function 'FillAdminAccount
Please see the line with the comment PROBLEM. On this code, the output is equal to *"userpassword*. As you can see, there is no quotation mark on the right and **I wonder why**. By the way, the data type of the userpassword in the database is BINARY. Wish you could help me on this. Thank you..x_x | 0 | [
2,
3724,
1448,
29,
4444,
255,
7765,
60,
800,
3726,
3726,
1990,
3509,
1283,
2160,
29148,
5,
6,
28,
9827,
413,
210,
3509,
1283,
2160,
29148,
800,
1151,
1131,
4444,
255,
1126,
103,
9,
25996,
872,
11130,
800,
13,
7,
25996,
85,
1320,
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... |
TSQL: How do I do a self-join in XML to get a nested document?
===
I have a SQL Server 2005 table like this:
create table Taxonomy(
CategoryId integer primary key,
ParentCategoryId integer references Taxonomy(CategoryId),
CategoryDescription varchar(50)
)
with data looking like
<table border="1">
<tr><td>CategoryId</td><td>ParentCategoryId</td><td>CategoryDescription</td></tr>
<tr><td>123</td><td>null</td><td>foo</td></tr?
<tr><td>345</td><td>123</td><td>bar</td></tr>
</table><br/>
I'd like to query it into an xml document like this:
<taxonomy>
<category categoryid="123" categorydescription="foo">
<category id="455" categorydescription="bar"/>
</category>
</taxonomy>
Is it possible to do this with FOR XML AUTO, ELEMENTS? Or do I need to use FOR XML EXPLICIT?
| 0 | [
2,
13,
38,
18,
22402,
45,
184,
107,
31,
107,
21,
1119,
8,
1636,
108,
19,
23504,
20,
164,
21,
5618,
69,
4492,
60,
800,
3726,
3726,
31,
57,
21,
4444,
255,
8128,
812,
859,
101,
48,
45,
1600,
859,
26802,
5,
3230,
1340,
13820,
1256... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 move your Javascript files to a different main domain that you also own?
===
I've noticed that just in the last year or so, many major websites have made the same change to the way their pages are structured. Each has moved their Javascript files from being hosted on the same domain as the page itself, to being hosted on a differently named domain.
## It's not simply parallelization ##
Now, there is a well known technique of spreading the components of your page across multiple domains to parallelize downloading. [Yahoo recommends it][1] as do many others. For instance, **www.example.com** is where your HTML is hosted, then you put images on **images.example.com** and javascripts on **scripts.example.com**. This gets around the fact that most browsers limit the number of simultaneous connections per server in order to be good net citizens.
The above is *not* what I am talking about.
## It's not simply redirection to a content delivery network ##
What I am talking about is hosting Javascripts specifically on an entirely different domain. Let me be specific. Just in the last year or so I've noticed that:
**youtube.com** has moved its .JS files to **ytimg.com**
**cnn.com** has moved its .JS files to **cdn.turner.com**
**weather.com** has moved its .JS files to **j.imwx.com**
Now, I know about content delivery networks like [Akamai][2] who specialize in outsourcing this for large websites. (The name "cdn" in Turner's special domain clues us in to the importance of this concept here).
But note with these examples, each site has its own specifically registered domain for this purpose, and its not the domain of a content delivery network or other infrastructure provider. In fact, if you try to load the home page off most of these script domains, they usually redirect back to the main domain of the company. And if you reverse lookup the IPs involved, they don't appear to point to the a CDN company's servers.
## Why do I care? ##
Having formerly worked at two different security companies, I have been made paranoid of malicious Javascripts.
As a result, I follow the practice of whitelisting sites that I will allow Javascript (and other active content such as Java) to run on. As a result, to make a site like cnn.com work, I have to manually put *.cnn.com into a list. It's a pain in the behind, but I prefer it over the alternative.
When folks used things like scripts.cnn.com to parallelize, that worked fine, and all was well. And when folks used subdomains off the CDN company domains, I could just permit the CDN company's main domain with a * in front as well and kill many birds with one stone (such as *.edgesuite.net and *.akamai.com).
Now I have discovered that (as of 2008) this is not enough. Now I have to poke around in the source code of a page I want to whitelist, and figure out what "secret" domain (or domains) that site is using to store their Javascripts (and sometimes CSS) on. In some cases I have to permit three different domains to make a site work.
## Why did all these major sites start doing this? ##
[1]: http://developer.yahoo.com/performance/rules.html#split
[2]: http://www.akamai.com | 0 | [
2,
483,
780,
154,
8247,
8741,
6488,
20,
21,
421,
407,
4603,
30,
42,
67,
258,
60,
800,
3726,
3726,
31,
22,
195,
2711,
30,
114,
19,
14,
236,
159,
54,
86,
15,
151,
394,
13931,
57,
117,
14,
205,
753,
20,
14,
161,
66,
4434,
50,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Improving the quality of code?
===
So, in reading this site, it seems that the shop in which I work does a lot of things wrong and some things right. How can I improve the code that I work with from my colleagues? The only thing I can think of is to lead by example - start using Boost, etc. Any other thoughts? | 0 | [
2,
9273,
14,
2190,
16,
1797,
60,
800,
3726,
3726,
86,
15,
19,
1876,
48,
689,
15,
32,
2206,
30,
14,
2546,
19,
56,
31,
170,
630,
21,
865,
16,
564,
1389,
17,
109,
564,
193,
9,
184,
92,
31,
3545,
14,
1797,
30,
31,
170,
29,
37,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Extract all string from a java project
===
I have a rather big number of source files that I need parse and extract all string literals and put them in a file as constant. For exemple:
Label l = new Label("Cat");
Would become:
Label l = new Label(Constants.CAT);
And in Constants.java I would have:
String CAT = "Cat";
I could write some sort of parser (using ant replace task maybe)? But I wondered if an IDE already does this sort of thing automatically. | 0 | [
2,
10962,
65,
3724,
37,
21,
8247,
669,
800,
3726,
3726,
31,
57,
21,
864,
580,
234,
16,
1267,
6488,
30,
31,
376,
2017,
870,
17,
10962,
65,
3724,
20665,
18,
17,
442,
105,
19,
21,
3893,
28,
3587,
9,
26,
1396,
1503,
5106,
45,
1899... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Apache mod_rewrite to catch XML requests
===
How do I create a apache RewriteRule that catches any request URL ending in .xml, strips off the .xml and passes it to a specific script?
http://www.example.com/document.xml, becomes http://www.example.com/document passed to script.php | 0 | [
2,
17140,
7226,
1,
99,
23716,
20,
2949,
23504,
12279,
800,
3726,
3726,
184,
107,
31,
1600,
21,
17140,
27891,
16154,
30,
12195,
186,
3772,
287,
6362,
3119,
19,
13,
9,
396,
8184,
15,
15383,
168,
14,
13,
9,
396,
8184,
17,
3789,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
ListBox with Grid as ItemsPanelTemplate produces weird binding errors
===
I've got a ListBox control and I'm presenting a fixed number of ListBoxItem objects in a grid layout. So I've set my ItemsPanelTemplate to be a Grid.
I'm accessing the Grid from code behind to configure the RowDefinitions and ColumnDefinitions.
So far it's all working as I expect. I've got some custom IValueConverter implementations for returning the Grid.Row and Grid.Column that each ListBoxItem should appear in.
However I get weird binding errors sometimes, and I can't figure out exactly why they're happening, or even if they're in my code.
Here's the error I get:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
Can anybody explain what's going on?
Oh, and, here's my XAML:
<UserControl.Resources>
<!-- Value Converters -->
<v:GridRowConverter x:Key="GridRowConverter" />
<v:GridColumnConverter x:Key="GridColumnConverter" />
<v:DevicePositionConverter x:Key="DevicePositionConverter" />
<v:DeviceBackgroundConverter x:Key="DeviceBackgroundConverter" />
<Style x:Key="DeviceContainerStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Grid.Row" Value="{Binding Path=DeviceId, Converter={StaticResource GridRowConverter}}" />
<Setter Property="Grid.Column" Value="{Binding Path=DeviceId, Converter={StaticResource GridColumnConverter}}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border CornerRadius="2" BorderThickness="1" BorderBrush="White" Margin="2" Name="Bd"
Background="{Binding Converter={StaticResource DeviceBackgroundConverter}}">
<TextBlock FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Path=DeviceId, Converter={StaticResource DevicePositionConverter}}" >
<TextBlock.LayoutTransform>
<RotateTransform Angle="270" />
</TextBlock.LayoutTransform>
</TextBlock>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="Bd" Property="BorderThickness" Value="2" />
<Setter TargetName="Bd" Property="Margin" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Border CornerRadius="3" BorderThickness="3" Background="#FF333333" BorderBrush="#FF333333" >
<Grid ShowGridLines="False">
<Grid.RowDefinitions>
<RowDefinition Height="15" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Image Margin="20,3,3,3" Source="Barcode.GIF" Width="60" Stretch="Fill" />
</StackPanel>
<ListBox ItemsSource="{Binding}" x:Name="lstDevices" Grid.Row="1"
ItemContainerStyle="{StaticResource DeviceContainerStyle}"
Background="#FF333333"
SelectedItem="{Binding SelectedDeviceResult, ElementName=root, Mode=TwoWay}"
>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.LayoutTransform>
<RotateTransform Angle="90" />
</Grid.LayoutTransform>
</Grid>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</Border>
</UserControl>
| 0 | [
2,
968,
5309,
29,
7354,
28,
3755,
3206,
532,
9577,
6554,
6700,
5455,
8728,
11908,
800,
3726,
3726,
31,
22,
195,
330,
21,
968,
5309,
569,
17,
31,
22,
79,
12310,
21,
3535,
234,
16,
968,
5309,
2119,
79,
3916,
19,
21,
7354,
9106,
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... |
Programmatically Sort Start Menu
===
I'm looking to sort the start menu alphabetically using C#. I've read about deleting the registry key
`HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder`
but when I tried it on my machine it doesn't appear to do much of anything. Does anyone have any other ideas as to what must be done in order to sort the Start Menu? | 0 | [
2,
625,
6732,
1326,
2058,
799,
11379,
800,
3726,
3726,
31,
22,
79,
699,
20,
2058,
14,
799,
11379,
27169,
102,
568,
272,
5910,
9,
31,
22,
195,
1302,
88,
121,
1336,
68,
14,
18269,
1246,
13,
1,
11321,
3987,
1,
12980,
5011,
1,
22019... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 exactly do you do when your team leader is incompetent?
===
One of your team members has been appointed "technical lead" or "team lead" yet he is technically incompetent and lacks major leadership skills.
By technically incompetent, I mean that the person doesn't know the difference between an abstract class and an interface, doesn't understand why coupling should be avoided, doesn't understand the concept of cohesion, provides solutions without taking some time to think, doesn't understand why we should favor composition over inheritance and doesn't get design patterns (except the singleton pattern).
Plus that person has over 10 years of "experience" (Yes, I did put that word in quotes because he's given a whole different dimension of what experience really is)
I'm dealing with such a person @ work. It's taking away the passion I have for this profession.
How do you react? What do you do? I'm very curious...
| 0 | [
2,
98,
1890,
107,
42,
107,
76,
154,
173,
1156,
25,
29269,
60,
800,
3726,
3726,
53,
16,
154,
173,
443,
63,
74,
929,
13,
7,
22307,
672,
7,
54,
13,
7,
6575,
672,
7,
768,
24,
25,
12345,
29269,
17,
1792,
18,
394,
2399,
3207,
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... |
Updating two tables in a many-to-one relationship through a view in PostgreSQL
===
I have two tables: `foos` and `bars`, and there is a many-to-one relationship between them: each `foo` can have many `bars`. I also have a view `foobars`, which joins these two tables (its query is like `select foo.*, bar.id from foos, bars where bar.foo_id=foo.id`).
I have a rule on inserting to `foobars` such that the “foo” part is inserted to `foos` as a new row, and “bar” part, which consists of a couple of bar-id's separated by commas is split, and for each such part a link between it and the appropriate `foo` is created (I use a procedure to do that).
This works great for inserts. I have a problem, however, when it comes to updating the whole thing. The `foo` part of the rule is easy. However, I don't know how to deal with the multiple `bar`s part. When I try to do something like `DELETE FROM bars WHERE foo_id=new.foo_id` in the rule, I end deleting everything from the table `bars`.
What am I doing wrong? Is there a way of achieving what I need? Finally, is my approach to the whole thing sensible?
(I do this overcomplicated thing with the view because the data I get is in the form of “`foo` and all its `bar`s”, but the user must see just `foobars`.) | 0 | [
2,
71,
43,
1880,
81,
7484,
19,
21,
151,
8,
262,
8,
849,
1429,
120,
21,
1418,
19,
678,
6879,
18,
22402,
800,
3726,
3726,
31,
57,
81,
7484,
45,
13,
1,
4120,
759,
1,
17,
13,
1,
1850,
18,
1,
15,
17,
80,
25,
21,
151,
8,
262,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 create a Jet ODBC link to a SQL Server view with periods in the field names?
===
I need to create an ODBC link from an Access 2003 (Jet) database to a SQL Server hosted view which contains aliased field names containing periods such as:
Seq.Group
In the SQL source behind the view, the field names are encased in square brackets...
SELECT Table._Group AS [Seq.Group]
...so SQL Server doesn't complain about creating the view, but when I try to create an ODBC link to it from the Jet DB (either programmatically or via the Access 2003 UI) I receive the error message:
> 'Seq.Group' is not a valid name. Make
> sure that it does not include invalid
> characters or punctuation and that it
> is not too long.
Unfortunately, I cannot modify the structure of the view because it's part of another product, so I am stuck with the field names the way that they are. I *could* add my own view with punctuation-free field names, but I'd really rather not modify the SQL Server at all because then that becomes another point of maintenance every time there's an upgrade, hotfix, etc. Does anyone know a better workaround? | 0 | [
2,
184,
107,
31,
1600,
21,
4797,
12340,
7229,
3508,
20,
21,
4444,
255,
8128,
1418,
29,
7302,
19,
14,
575,
1817,
60,
800,
3726,
3726,
31,
376,
20,
1600,
40,
12340,
7229,
3508,
37,
40,
1381,
973,
13,
5,
10307,
6,
6018,
20,
21,
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... |
How to check if there is any read/write activity for a specific harddrive with C#?
===
I'm curious how to assess if there is any read- or write-activity for a specific harddrive at a given moment with .NET / C#. Second it would be interesting to assess the actual speed of access.
Any ideas? | 0 | [
2,
184,
20,
2631,
100,
80,
25,
186,
1302,
118,
23716,
2358,
26,
21,
1903,
552,
14573,
29,
272,
5910,
60,
800,
3726,
3726,
31,
22,
79,
7686,
184,
20,
13029,
100,
80,
25,
186,
1302,
8,
54,
2757,
8,
19348,
26,
21,
1903,
552,
1457... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
ASP.NET Deployment
===
For the last couple of months I have been writing an intranet site for my college with lots of reports for staff about students. It is all going well but once a week (ish) I am having to go to IT get them to log into IIS stop the application pool, clear out the website folder, clear out the temporary asp.NET cache and replace the website with the new one. Not a big job but I would prefer to do it myself as and when I want.
I don't know much about ASP.NET deployment and IIS is there a way for me to update the website myself (keeping the system live if possible)? Last time I looked at this I think I found the files were locked within the website directory.
What do the different publish options achieve? | 0 | [
2,
28,
306,
9,
2328,
10475,
800,
3726,
3726,
26,
14,
236,
1335,
16,
818,
31,
57,
74,
1174,
40,
14369,
2328,
689,
26,
51,
314,
29,
7503,
16,
2813,
26,
1138,
88,
573,
9,
32,
25,
65,
228,
134,
47,
382,
21,
877,
13,
5,
1595,
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... |
Java development in a Perl shop: How to select the right tool?
===
My group is a Perl shop in an organization that is very heterogenous. Although we support the odd Java, PHP, or Python installation, we're using Perl for nearly all of our web applications and systems/data marshalling tasks. All of our boxes are Linux, although we interface with IIS systems as well.
We're coming under some pressure from management to move to Java for at least some of our work. I'd like to use the right tool for the right task, but for our work, and due to our collective experience, Perl seems like the right task for everything.
My initial thought is to use Java for applications that are open to the organization at large, since there is more Java mindshare *out there* than Perl.
Does anyone have similar experience? If I'm given the choice, what kinds of tasks should we start with applying Java? What kinds of tasks should we insist on sticking with Perl? Does it make any difference? Why or why not?
| 0 | [
2,
8247,
522,
19,
21,
416,
255,
2546,
45,
184,
20,
5407,
14,
193,
5607,
60,
800,
3726,
3726,
51,
214,
25,
21,
416,
255,
2546,
19,
40,
1165,
30,
25,
253,
14154,
1863,
1291,
9,
419,
95,
555,
14,
4210,
8247,
15,
13,
26120,
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... |
ASP.NET WSAT (Website Administration Tool) and Custom Membership Providers
===
I'm building an ASP.NET MVC applicaiton that will have custom role and membership providers. I have been looking into adminstration tools to save us some time, [WSAT][1] has crossed my path. It looks good at a glance, it's all open source and very simple if it doesn't work I can fix it myself.
First question is have any of you used WSAT for a product system in the past. Is it worth while, should I consider it and what reasons are there for not using it?
Second question, does anyone know how well WSAT works with custom providers?
Thanks for your feedback.
[1]: http://www.codeplex.com/AspNetWSAT | 0 | [
2,
28,
306,
9,
2328,
619,
10833,
13,
5,
14113,
9097,
1603,
5607,
6,
17,
5816,
4363,
13488,
800,
3726,
3726,
31,
22,
79,
353,
40,
28,
306,
9,
2328,
307,
8990,
4865,
16904,
49,
444,
30,
129,
57,
5816,
597,
17,
4363,
13488,
9,
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... |
How to remove TFS source control bindings for a solution from the command line
===
Is there a command-line approach for having VS 2008 remove TFS source control bindings from a solution file and the constituent project files? I need something that I can run from a batch file so that I don't have to open the solution and click the 2 prompts to permanently remove the bindings. | 0 | [
2,
184,
20,
4681,
13,
11720,
18,
1267,
569,
8728,
18,
26,
21,
4295,
37,
14,
1202,
293,
800,
3726,
3726,
25,
80,
21,
1202,
8,
1143,
2141,
26,
452,
4611,
570,
4681,
13,
11720,
18,
1267,
569,
8728,
18,
37,
21,
4295,
3893,
17,
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... |
Removing .svn folders from project for deployment
===
I'm using subversion (TortoiseSVN) and I want to remove the .svn folders from my project for deployment, is there an automated way of doing this using subversion or do I have to create a custom script for this? | 0 | [
2,
9096,
13,
9,
18,
16578,
19294,
18,
37,
669,
26,
10475,
800,
3726,
3726,
31,
22,
79,
568,
972,
10898,
13,
5,
2153,
38,
16238,
18,
16578,
6,
17,
31,
259,
20,
4681,
14,
13,
9,
18,
16578,
19294,
18,
37,
51,
669,
26,
10475,
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... |
Google Analytics in ASP.Net
===
I have a web page in which people go to register to my site. there is server side validation to accept them. then I need to call some Javascript to tell GA that user was or was not registered. later I need stats on success in registration.
How can I call the GA function on my server side C# code?
thanks
Ali | 0 | [
2,
8144,
26320,
19,
28,
306,
9,
2328,
800,
3726,
3726,
31,
57,
21,
2741,
2478,
19,
56,
148,
162,
20,
2243,
20,
51,
689,
9,
80,
25,
8128,
270,
27999,
20,
3440,
105,
9,
94,
31,
376,
20,
645,
109,
8247,
8741,
20,
494,
4369,
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... |
linqtosql, timespan, aggregates ... can it be done?
===
Can this be done w/ linqtosql?
SELECT City, SUM(DATEDIFF(minute,StartDate,Completed)) AS Downtime
FROM Incidents
GROUP BY City
| 0 | [
2,
6294,
1251,
262,
18,
22402,
15,
436,
3206,
15,
8544,
18,
13,
9,
9,
9,
92,
32,
44,
677,
60,
800,
3726,
3726,
92,
48,
44,
677,
619,
118,
6294,
1251,
262,
18,
22402,
60,
5407,
136,
15,
3907,
5,
43,
1669,
6021,
5,
5556,
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,
0... |
Exporting MSAccess Tables as Unicode with Tilde delimiter
===
I want to export the contents of several tables from MSAccess2003.
The tables contain unicode Japanese characters.
I want to store them as tilde delimited text files.
I can do this manually using File/Export and, in the 'Advanced' dialog selecting tilde as Field Delimiter and the Unicode as the Code Page.
I can store this as an Export Specification, but this seems to be table specific.
I want to export many tables using VBA Code.
So far I have tried:
Sub ExportTables()
Dim lTbl As Long
Dim dBase As Database
Dim TableName As String
Set dBase = CurrentDb
For lTbl = 0 To dBase.TableDefs.Count
'If the table name is a temporary or system table then ignore it
If Left(dBase.TableDefs(lTbl).Name, 1) = "~" Or _
Left(dBase.TableDefs(lTbl).Name, 4) = "MSYS" Then
'~ indicates a temporary table
'MSYS indicates a system level table
Else
TableName = dBase.TableDefs(lTbl).Name
DoCmd.TransferText acExportDelim, "UnicodeTilde", TableName, "c:\" + TableName + ".txt", True
End If
Next lTbl
Set dBase = Nothing
End Sub
When I run this I get an exception:
Run-time error '3011':
The Microsoft Jet database engine could not find the object "Allowance1#txt'. Make sure the object exists and that you spell its name and the path name correctly.
If I debug at this point, TableName is 'Allowance1', as expected.
I guess my UnicodeTilde export specification is table specific, so I can't use it for multiple tables.
What is the solution? Should I use something else, other than TransferText, or perhaps create the export specification programatically?
Any help appreciated.
| 0 | [
2,
7487,
68,
4235,
20604,
7484,
28,
28010,
29,
9189,
546,
121,
20565,
106,
800,
3726,
3726,
31,
259,
20,
7487,
14,
8478,
16,
238,
7484,
37,
4235,
20604,
3325,
9,
14,
7484,
3717,
28010,
1095,
1766,
9,
31,
259,
20,
1718,
105,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 get the "td" in a table element with jquery?
===
I need to get the "td" element of a table. I do not have the ability to add a mouseover or onclick event to the "td" element, so I need to add them with JQUERY.
I need JQUERY to add the mouseover and onclick event to the all "td" elements in the table.
Thats what I need, maybe someone can help me out? | 0 | [
2,
184,
107,
31,
164,
14,
13,
7,
38,
43,
7,
19,
21,
859,
4520,
29,
487,
8190,
93,
60,
800,
3726,
3726,
31,
376,
20,
164,
14,
13,
7,
38,
43,
7,
4520,
16,
21,
859,
9,
31,
107,
52,
57,
14,
2165,
20,
3547,
21,
7567,
2549,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
One coding style policy, many beautification tools?
===
Are there any projects that help to show that two code beautification tools are configured to produce identical results?
For example, suppose that a project has mandated a particular coding style. Further suppose that the developers of this project are free to use whatever development environment they feel makes them most productive. This means that several source code beautifier tools will be in play. The team would like to ensure that each developer produces code that complies with the "official" coding style. Is there any support for helping them?
| 0 | [
2,
53,
13,
15458,
1034,
1486,
15,
151,
7821,
38,
4634,
4672,
60,
800,
3726,
3726,
50,
80,
186,
2314,
30,
448,
20,
298,
30,
81,
1797,
7821,
38,
4634,
4672,
50,
28895,
20,
2213,
6323,
1736,
60,
26,
823,
15,
5787,
30,
21,
669,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
My form doesn't properly display when it is launched from another thread
===
Here's the situation:
I'm developing a simple application with the following structure:
- FormMain (startup point)
- FormNotification
- CompleFunctions
Right?
Well, in **FormMain** I have the following function:
private void DoItInNewThread(ParameterizedThreadStart pParameterizedThreadStart, object pParameters, ThreadPriority pThreadPriority)
{
Thread oThread = new Thread(pParameterizedThreadStart);
oThread.CurrentUICulture = Settings.Instance.Language;
oThread.IsBackground = true;
oThread.Priority = pThreadPriority;
oThread.Name = "μRemote: Background operation";
oThread.Start(pParameters);
}
So, everytime that I need to call a time consuming method located on **ComplexFunctions** I do the following:
// This is FormMain.cs
string strSomeParameter = "lala";
DoItInNewThread(new ParameterizedThreadStart(ComplexFunctions.DoSomething), strSomeParameter, ThreadPriority.Normal);
The other class, FormNotification, its a Form that display some information of the process to the user.
This FormNotification could be called from FormMain or ComplexFunctions.
Example:
// This is ComplexFunctions.cs
public void DoSomething(string pSomeParameter)
{
// Imagine some time consuming task
FormNotification formNotif = new FormNotification();
formNotif.Notify();
}
FormNotify has a timer, so, after 10 seconds closes the form. I'm not using formNotif.ShowDialog because I don't want to give focus to this Form.
You could check [this link][1] to see what I'm doing in Notify.
Ok, here's the problem:
When I call **FormNotify** from **ComplexFunction** which is called from another Thread in **FormMain** ... this **FormNotify** disappears after a few milliseconds.
It's the same effect that when you do something like this:
using(FormSomething formSomething = new FormSomething)
{
formSomething.Show();
}
**How can avoid this?**
These are possible solutions that I don't want to use:
- Using Thread.Sleep(10000) in FormNotify
- Using FormNotif.ShowDialog()
This is a simplified scenario (FormNotify does some other fancy stuff that just stay for 10 seconds, but they are irrelevant to see the problem).
Thanks for your time!!!
And please, sorry my english.
[1]: http://stackoverflow.com/questions/156046/show-a-form-without-stealing-focus-in-c | 0 | [
2,
51,
505,
1437,
22,
38,
7428,
3042,
76,
32,
25,
1601,
37,
226,
9322,
800,
3726,
3726,
235,
22,
18,
14,
1858,
45,
31,
22,
79,
3561,
21,
1935,
3010,
29,
14,
249,
1411,
45,
13,
8,
505,
6232,
13,
5,
13680,
576,
454,
6,
13,
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... |
Defining custom actions in Selenium
===
I have a Selenium test case that enters dates into a date selector made up of three pulldowns (year, month, and day).
select validity_Y label=2008
select validity_M label=08
select validity_D label=08
This part gets repeated a lot throughout the test case. I'd like to reduce it by defining my custom action "selectValidity", so that I can have less redundancy, something like
selectValidity 2008,08,08
What is the best (easiest, cleanest) way to add macros or subroutines to a test case?
| 0 | [
2,
14684,
5816,
3078,
19,
23027,
14311,
800,
3726,
3726,
31,
57,
21,
23027,
14311,
1289,
610,
30,
8104,
4076,
77,
21,
1231,
23946,
117,
71,
16,
132,
2201,
2968,
18,
13,
5,
731,
15,
1617,
15,
17,
208,
6,
9,
5407,
19058,
1,
93,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Programming Contests (with prizes)
===
I've had a go at solving the [Eternity puzzle][1] (1,000,000 GBP price) and [Netflix Prize][2] ($1,000,000) in the past. I didn't win either!
What other contests with prizes do you know about / have competed in yourself?
[1]: http://en.wikipedia.org/wiki/Eternity_puzzle
[2]: http://www.netflixprize.com/ | 0 | [
2,
3143,
3013,
18,
13,
5,
1410,
14101,
6,
800,
3726,
3726,
31,
22,
195,
41,
21,
162,
35,
17533,
14,
636,
62,
8766,
856,
9164,
500,
2558,
165,
500,
13,
5,
165,
11623,
14857,
306,
2162,
6,
17,
636,
2328,
410,
13541,
1507,
500,
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... |
No output to console from a WPF application?
===
I'm using Console.WriteLine() from a very simple WPF test application, but when I execute the application from the command line, I'm seeing nothing being written to the console. Does anyone know what might be going on here?
I can reproduce it by creating a WPF application in VS 2008, and simply adding Console.WriteLine("text") anywhere that get executed. Any ideas?
All I need for right now is something as simple as Console.WriteLine(). I realize I could use log4net or somet other logging solution, but I really don't need that much functionality for this application.
**Edit:** I should have remembered that Console.WriteLine() is for console applications. Oh well, no stupid questions, right? :-)
I'll just use System.Diagnostics.Trace.WriteLine() and DebugView for now. | 0 | [
2,
90,
5196,
20,
8650,
37,
21,
619,
7721,
3010,
60,
800,
3726,
3726,
31,
22,
79,
568,
8650,
9,
23716,
1143,
5,
6,
37,
21,
253,
1935,
619,
7721,
1289,
3010,
15,
47,
76,
31,
15644,
14,
3010,
37,
14,
1202,
293,
15,
31,
22,
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... |
Experience with CSLA in a WPF/WCF application
===
Has anyone used CSLA in an application that has a WPF front end and a WCF wire for entities?
If so, which "entity framework" did you use? (nHibernate, Linq, etc...)
What were the hang-ups? What did it help you with?
I am concerned with implementing this for an application, not knowing how data-binding, validation with UI/entities, or deffered loading will react.
We are also worried about the message sizes coming over WCF, especially with the depth of our entities.
Are there any stress tests out there? I am trying to figure out what size application/entities this is really designed for.
If you can help answer any of these questions it would be greatly appreciated. | 0 | [
2,
1496,
29,
272,
18,
531,
19,
21,
619,
7721,
118,
499,
8940,
3010,
800,
3726,
3726,
63,
1276,
147,
272,
18,
531,
19,
40,
3010,
30,
63,
21,
619,
7721,
431,
241,
17,
21,
11801,
410,
6511,
26,
12549,
60,
100,
86,
15,
56,
13,
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... |
When designing business applications, is a 'google style' search appropriate?
===
"Business applications" is a little broad I know, let me narrow a bit:
For example, say we are developing a suite of accounting tools. Search requirements are generally on account number, user name, street address, amount owed etc.
Is implementing a "search engine style" single text box search the preferred option, or should I use a specific search query that is contextual to each tool in my application?
| 0 | [
2,
76,
15026,
508,
3767,
15,
25,
21,
13,
22,
16111,
4875,
1034,
22,
2122,
4593,
60,
800,
3726,
3726,
13,
7,
18717,
3767,
7,
25,
21,
265,
2748,
31,
143,
15,
408,
55,
2868,
21,
1142,
45,
26,
823,
15,
395,
95,
50,
3561,
21,
616... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Combine multiple LINQ expressions from an array
===
I'm trying to combine a list of functions like so.
I have this:
Func<int, bool>[] criteria = new Func<int, bool>[3];
criteria[0] = i => i % 2 == 0;
criteria[1] = i => i % 3 == 0;
criteria[2] = i => i % 5 == 0;
And I want this:
Func<int, bool>[] predicates = new Func<int, bool>[3];
predicates[0] = i => i % 2 == 0;
predicates[1] = i => i % 2 == 0 && i % 3 == 0;
predicates[2] = i => i % 2 == 0 && i % 3 == 0 && i % 5 == 0;
So far I've got the following code:
Expression<Func<int, bool>>[] results = new Expression<Func<int, bool>>[criteria.Length];
for (int i = 0; i < criteria.Length; i++)
{
results[i] = f => true;
for (int j = 0; j <= i; j++)
{
Expression<Func<int, bool>> expr = b => criteria[j](b);
var invokedExpr = Expression.Invoke(
expr,
results[i].Parameters.Cast<Expression>());
results[i] = Expression.Lambda<Func<int, bool>>(
Expression.And(results[i].Body, invokedExpr),
results[i].Parameters);
}
}
var predicates = results.Select(e => e.Compile()).ToArray();
Console.WriteLine(predicates[0](6)); // Returns true
Console.WriteLine(predicates[1](6)); // Returns false
Console.WriteLine(predicates[2](6)); // Throws an IndexOutOfRangeException
Does anyone know what I'm doing wrong? | 0 | [
2,
12287,
1886,
6294,
1251,
13832,
37,
40,
7718,
800,
3726,
3726,
31,
22,
79,
749,
20,
12287,
21,
968,
16,
3719,
101,
86,
9,
31,
57,
48,
45,
2414,
150,
1,
6391,
15,
1607,
1823,
1,
2558,
500,
9157,
800,
78,
2414,
150,
1,
6391,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 do a "git export" (like "svn export")
===
I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the `.git` repository directory. There are at least three methods I know of:
1. `git clone` followed by removing the `.git` repository directory.
* [`git checkout-index`](http://www.kernel.org/pub/software/scm/git/docs/git-checkout-index.html) alludes to this functionality but starts with "Just read the desired tree into the index..." which I'm not entirely sure how to do.
* [`git-export`](http://code.google.com/p/git-export/) is a third party script that essentially does a `git clone` into a temporary location followed by `rsync --exclude='.git'` into the final destination.
None of these solutions really strike me as being satisfactory. The closest one to `svn export` might be option 1, because both those require the target directory to be empty first. But option 2 seems even better, assuming I can figure out what it means to read a tree into the index. | 0 | [
2,
184,
20,
107,
21,
13,
7,
10404,
7487,
7,
13,
5,
1403,
13,
7,
18,
16578,
7487,
7,
6,
800,
3726,
3726,
31,
22,
195,
74,
5712,
1472,
80,
25,
21,
254,
13,
7,
10404,
7487,
7,
4295,
30,
9695,
21,
4344,
16,
21,
1541,
366,
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... |
Using ASP.NET Dynamic Data site on Windows XP IIS?
===
I have a Dynamic Data website built in Visual Studio 2008 using .NET 3.5 SP1. The site works OK on my Vista machine, but I get the following error when running it on a Windows XP machine:
> Server Error in '/FlixManagerWeb'
> Application.
> -------------------------------------------------------------------------------- The resource cannot be found.
> Description: HTTP 404. The resource
> you are looking for (or one of its
> dependencies) could have been removed,
> had its name changed, or is
> temporarily unavailable. Please
> review the following URL and make sure
> that it is spelled correctly.
>
> Requested URL: /FlixManagerWeb
> -------------------------------------------------------------------------------- Version Information: Microsoft .NET
> Framework Version:2.0.50727.3053;
> ASP.NET Version:2.0.50727.3053
I have added the .* -> aspnet_isapi.dll mapping in the site config, made sure that it is an "application," but that did not help. Anyone have any luck running a Dynamic Data website on Windows XP? What (if anything) special is required to get it to work? | 0 | [
2,
568,
28,
306,
9,
2328,
7782,
1054,
689,
27,
1936,
23045,
595,
18,
60,
800,
3726,
3726,
31,
57,
21,
7782,
1054,
2271,
392,
19,
3458,
1120,
570,
568,
13,
9,
2328,
203,
9,
264,
3782,
165,
9,
14,
689,
693,
5854,
27,
51,
13520,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 we still program with flat files?
===
Why are flat text files the state of the art for representing source code?
Sure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created.
It seems to me that some form of XML or binary data could represent lots of ideas that are very difficult to track, otherwise.
For instance, you could embed UML diagrams right into your code. They could be generated semi-automatically, and annotated by the developers to highlight important aspects of the design. Interaction diagrams in particular. Heck, embedding any user drawing might make things more clear.
Another idea is to embed comments from code reviews right into the code.
There could be all sorts of aids to make merging multiple branches easier.
Something I'm passionate about is not just tracking code coverage, but also looking at the parts of code covered by an automated test. The hard part is keeping track of that code, even as the source is modified. For instance, moving a function from one file to another, etc. This can be done with GUIDs, but they're rather intrusive to embed right in the text file. In a rich file format, they could be automatic and unobtrusive.
So why are there no IDEs (to my knowledge, anyway) which allow you to work with code in this way? | 0 | [
2,
483,
107,
95,
174,
625,
29,
1844,
6488,
60,
800,
3726,
3726,
483,
50,
1844,
1854,
6488,
14,
146,
16,
14,
415,
26,
3793,
1267,
1797,
60,
562,
13,
8,
14,
782,
16835,
248,
17,
21486,
376,
20,
196,
21,
1844,
3893,
5442,
16,
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... |
FitNesse Wiki Per Project or Company?
===
For a company with many development projects, should you create multiple FitNesse wikis (one for each project/product) or contain them all within a large wiki for everything?
Advantages of one large wiki is the ability to easily link to other products in the company and that it is a one-stop location for all the FitNesse tests.
Alternatively, the advantages of multiple wikis is it becomes easier to divide automation of the tests to multiple servers, it becomes easier to branch the wiki along with a project branch / tag.
I'm interested in the advantages and disadvantages of these two possibilities or a well thought out alternative (e.g. not "just combine the wiki roots together somehow"). | 0 | [
2,
11331,
62,
13,
17375,
416,
669,
54,
237,
60,
800,
3726,
3726,
26,
21,
237,
29,
151,
522,
2314,
15,
378,
42,
1600,
1886,
11331,
62,
13,
17375,
18,
13,
5,
849,
26,
206,
669,
118,
14086,
6,
54,
3717,
105,
65,
363,
21,
370,
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... |
Integrated Help - Merged Help Indexes
===
If anyone has had more than a couple of Microsoft tools or products installed (or a local install of the MSDN library) side by side, you might have noticed that opening help (hitting F1) or opening, say, SQL Server Books Online causes the help indexes to be re-indexed - this is usually after installing a new product or tool.
This can be a really, really time consuming exercise!
Does anyone know a way to prevent or opt out having combined help indexes?
At best, even just preventing the reindexing at all? | 0 | [
2,
5547,
448,
13,
8,
3901,
448,
4348,
160,
800,
3726,
3726,
100,
1276,
63,
41,
91,
119,
21,
1335,
16,
7099,
4672,
54,
1985,
4066,
13,
5,
248,
21,
375,
16146,
16,
14,
4235,
43,
103,
1248,
6,
270,
34,
270,
15,
42,
530,
57,
271... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Run custom Javascript whenever a client-side ASP.NET validator is triggered?
===
Is there a way to run some custom Javascript whenever a client-side ASP.NET validator (RequiredFieldValidator, RangeValidator, etc) is triggered?
Basically, I have a complicated layout that requires I run a custom script whenever a DOM element is shown or hidden. I'm looking for a way to automatically run this script when a validator is displayed. (I'm using validators with Display="dynamic") | 0 | [
2,
485,
5816,
8247,
8741,
6634,
21,
6819,
8,
1416,
28,
306,
9,
2328,
7394,
3457,
25,
15164,
60,
800,
3726,
3726,
25,
80,
21,
161,
20,
485,
109,
5816,
8247,
8741,
6634,
21,
6819,
8,
1416,
28,
306,
9,
2328,
7394,
3457,
13,
5,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
HTTPHandler to Retrieve Download File from another server?
===
I would like to provide downloadable files to website users, but want to hide the URL of the files from the user... I'm thinking an HTTPHanlder could do the trick, but is it possible to retrieve a file from an external server and stream it to the user?
Perhaps somebody can give me a hint at how to accomplish this, or point me to a resource where its been done before?
Thanks heaps
Greg
| 0 | [
2,
7775,
3203,
1252,
20,
11917,
7121,
3893,
37,
226,
8128,
60,
800,
3726,
3726,
31,
83,
101,
20,
1181,
27795,
6488,
20,
2271,
3878,
15,
47,
259,
20,
3077,
14,
287,
6362,
16,
14,
6488,
37,
14,
4155,
9,
9,
9,
31,
22,
79,
1440,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
HTML - display an image as large as possible while preserving aspect ratio
===
I'd like to have an HTML page which displays a single PNG or JPEG image. I want the image to take up the whole screen but when I do this:
<img src="whatever.jpeg" width="100%" height="100%" />
It just stretches the image and messes up the aspect ratio. How do I solve this so the image has the correct aspect ratio while scaling to the maximum size possible ?
| 0 | [
2,
13,
15895,
13,
8,
3042,
40,
1961,
28,
370,
28,
938,
133,
17936,
7289,
4825,
800,
3726,
3726,
31,
22,
43,
101,
20,
57,
40,
13,
15895,
2478,
56,
9412,
21,
345,
351,
2723,
54,
487,
20427,
1961,
9,
31,
259,
14,
1961,
20,
247,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 know if the HTTP Compression is Working?
===
How do you know if the HTTP Compression setup is working? Is there any tool I can use to see the compressed page before it is uncompressed by the browser? are there any tools to measure the amount compressed and response speed? | 0 | [
2,
184,
107,
42,
143,
100,
14,
7775,
14864,
25,
638,
60,
800,
3726,
3726,
184,
107,
42,
143,
100,
14,
7775,
14864,
18161,
25,
638,
60,
25,
80,
186,
5607,
31,
92,
275,
20,
196,
14,
18472,
2478,
115,
32,
25,
367,
960,
5890,
69,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Syntax highlighting code with Javascript
===
What Javascript libraries can you recommend for syntax highlighting <code> blocks in HTML?
(One suggestion per answer please). | 0 | [
2,
22649,
23102,
1797,
29,
8247,
8741,
800,
3726,
3726,
98,
8247,
8741,
8649,
92,
42,
12360,
26,
22649,
23102,
279,
255,
38,
73,
9375,
1569,
263,
38,
73,
5198,
19,
13,
15895,
60,
13,
5,
849,
10910,
416,
1623,
2247,
6,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is it good practice to use the XOR (^) operator in Java for boolean checks?
===
I personally like the 'exclusive or' operator when it makes sense in context of boolean checks because of its conciseness. I much prefer to write
if (boolean1 ^ boolean2)
{
//do it
}
than
if((boolean1 && !boolean2) || (boolean2 && !boolean1))
{
//do it
}
but I often get confused looks (from other experienced java developers, not just the newbies), and sometimes comments about how it should only be used for bitwise operations. I'm curious as to the best practices others use around the '^' operator.
| 0 | [
2,
25,
32,
254,
1345,
20,
275,
14,
993,
248,
13,
5,
1,
6,
6022,
19,
8247,
26,
9827,
413,
210,
16602,
60,
800,
3726,
3726,
31,
7200,
101,
14,
13,
22,
29548,
54,
22,
6022,
76,
32,
1364,
1259,
19,
4141,
16,
9827,
413,
210,
1660... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Help:How to make ODBC connection in web.Config file.
===
I was to make crystal reporting with sybase database. I will use reportviewer to view those report. I am stuck on how to make ODBC connection in web.config file.
I had done with winforms but i am still learning. Just looking for help.
Thanks inb advance | 0 | [
2,
448,
45,
1544,
20,
233,
12340,
7229,
2760,
19,
2741,
9,
14093,
2816,
3893,
9,
800,
3726,
3726,
31,
23,
20,
233,
4282,
6670,
29,
10315,
8436,
6018,
9,
31,
129,
275,
1330,
4725,
106,
20,
1418,
273,
1330,
9,
31,
589,
4549,
27,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Giving character to your unit tests
===
I have been thinking a lot about unit testing and how to improve the readability of the unit tests. I thought why not give a character to the classes in the unit test to clarify what they do.
Here is a simple unit test that I wrote:
[TestFixture]
public class when_dave_transfers_money_from_wamu_account_to_the_woodforest_account
{
[Test]
public void should_increase_the_amount_in_woodforest_account_when_transaction_successfull()
{
Dave dave = new Dave();
Wamu wamu = new Wamu();
wamu.Balance = 150;
wamu.AddUser(dave);
Woodforest woodforest = new Woodforest();
woodforest.AddUser(dave);
FundTransferService.Transfer(100, wamu, woodforest);
Assert.AreEqual(wamu.Balance, 50);
Assert.AreEqual(woodforest.Balance, 100);
}
}
Here is the Dave class:
/// <summary>
/// This is Dave!
/// </summary>
public class Dave : User
{
public Dave()
{
FirstName = "Dave";
LastName = "Allen";
}
}
The unit test name clearly serves the purpose. But, maybe I want to dig a little deeper and assign the Wamu and Woodforest accounts to Dave whenever Dave is created. The problem is that it will move away from readability as I will have to use index values to refer to the account.
What are your thoughts on making this more readable?
| 0 | [
2,
1438,
925,
20,
154,
1237,
4894,
800,
3726,
3726,
31,
57,
74,
1440,
21,
865,
88,
1237,
4431,
17,
184,
20,
3545,
14,
1302,
4091,
16,
14,
1237,
4894,
9,
31,
289,
483,
52,
590,
21,
925,
20,
14,
2684,
19,
14,
1237,
1289,
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... |
How do you put { and } in a format string
===
I'm trying to generate some code at runtime where I put in some boiler-plate stuff and the user is allowed to enter the actual working code. My boiler-plate code looks something like this:
using System;
public class ClassName
{
public double TheFunction(double input)
{
// user entered code here
}
}
Ideally, I think I want to use string.Format to insert the user code and create a unique class name, but I get an exception on the format string unless it looks like this:
string formatString = @"
using System;
public class ClassName
{0}
public double TheFunction(double input)
{0}
{2}
{1}
{1}";
Then I call string.Format like this:
string entireClass = string.Format(formatString, "{", "}", userInput);
This is fine and I can deal with the ugliness of using {0} and {1} in the format string in place of my curly braces except that now my user input cannot use curly braces either. Is there a way to either escape the curly braces in my format string, or a good way to turn the curly braces in the user code into {0}'s and {1}'s?
BTW, I know that this kind of thing is a security problem waiting to happen, but this is a Windows Forms app that's for internal use on systems that are not connected to the net so the risk is acceptable in this situation. | 0 | [
2,
184,
107,
42,
442,
13,
1,
17,
13,
1,
19,
21,
2595,
3724,
800,
3726,
3726,
31,
22,
79,
749,
20,
7920,
109,
1797,
35,
485,
891,
113,
31,
442,
19,
109,
11755,
8,
13095,
3217,
17,
14,
4155,
25,
1159,
20,
2830,
14,
3463,
638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 would you compare IP address?
===
For my server app, I need to check if an ip address is in our blacklist.
What is the most efficient way of comparing ip addresses? Would converting the IP address to integer and comparing them efficient? | 0 | [
2,
184,
83,
42,
11590,
15735,
3218,
60,
800,
3726,
3726,
26,
51,
8128,
4865,
15,
31,
376,
20,
2631,
100,
40,
15735,
3218,
25,
19,
318,
319,
5739,
9,
98,
25,
14,
127,
8243,
161,
16,
15047,
15735,
12636,
60,
83,
19583,
14,
15735,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Sticky mouse when dragging controls in VS2005
===
Maybe this is a dumb question, but I have the following behavior in Visual Studio 2005 while designing forms:
1 - Drop a control onto the form (suppose it's a Label, just for discussion)
2 - Drag that label to a specific location (aligning w/other controls, whatever)
3 - Release the mouse button
4 - The control is still stuck to the mouse!!!
To get it un-stuck from the mouse, I have to hit ESC, which restores the Label to it's original location.
This is driving me nuts. I literally have to use the arrow keys to move each control into place, pixel-by-pixel. I don't observe this behavior anywhere else in VS2005, nor do I observe it in the OS in general.
Please tell me there is some tiny checkbox buried somewhere that will turn off this behavior. | 0 | [
2,
19087,
7567,
76,
13052,
8671,
19,
4611,
2835,
800,
3726,
3726,
913,
48,
25,
21,
9317,
1301,
15,
47,
31,
57,
14,
249,
3257,
19,
3458,
1120,
812,
133,
15026,
1997,
45,
137,
13,
8,
2804,
21,
569,
1204,
14,
505,
13,
5,
18,
576,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 build farm for checking open source apps against different OS'es?
===
I have an Open Source app and I have it working on Windows, Linux and Macintosh ( it's in C++ and built with gcc ). I've only tested it on a few different flavors of Linux so I don't know if it compiles and runs on all different Linux versions. Is there a place where I can upload my code and have it tested across a bunch of different systems like other Linux flavors and things like, Solaris, FreeBSD and other operating systems?
What would be great is if I can have it directly connect to my svn repository and grab the latest code and then email me back any compile errors generated and what the OS was that it had a problem with.
I would be happy to just know it compiles as it is a GUI based app so I wouldn't expect it to actually be ran and tested.
| 0 | [
2,
25,
80,
1895,
1937,
26,
9886,
368,
1267,
4865,
18,
149,
421,
13,
759,
22,
160,
60,
800,
3726,
3726,
31,
57,
40,
368,
1267,
4865,
17,
31,
57,
32,
638,
27,
1936,
15,
13024,
17,
24024,
13,
5,
32,
22,
18,
19,
272,
20512,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SPARC assembly
===
I've been curious in the past few months in trying my hand at doing some assembly for the SPARC processor (either V8 or V9). My question is this, I have no access to a SPARC machine, is there an emulator & assembler/linker for SPARC running on an x86(Linux)? I've looked at QEMU but Im not too sure as this is what I need/ | 0 | [
2,
13,
18,
22773,
1475,
800,
3726,
3726,
31,
22,
195,
74,
7686,
19,
14,
640,
310,
818,
19,
749,
51,
224,
35,
845,
109,
1475,
26,
14,
13,
18,
22773,
14762,
13,
5,
18840,
566,
457,
54,
566,
518,
6,
9,
51,
1301,
25,
48,
15,
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... |
define a .NET extension method with solution scope
===
I have a few 'helper' style extension methods I use quite regularly now *(they are mostly quite simple, intuitive, and work for good not evil, so please don't have this descend into a discussion around whether or not I should use them).* They are largely extending core .NET CLR classes.
Currently, I have to copy the 'ExtensionMethods.cs' file that holds my extension methods to each new project within a solution to be able to use them in multiple projects.
Is it possible to define an extension to work over multiple projects within a solution, or wrap them in an 'extensions' dll, or are they confined to the scope of project? | 0 | [
2,
9267,
21,
13,
9,
2328,
3896,
2109,
29,
4295,
9914,
800,
3726,
3726,
31,
57,
21,
310,
13,
22,
14593,
106,
22,
1034,
3896,
3195,
31,
275,
1450,
4217,
130,
1637,
5,
2077,
50,
1555,
1450,
1935,
15,
13,
24392,
15,
17,
170,
26,
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 I pass data between activities in Windows Workflow?
===
I'm not completely sure I understand the workflow way of doing things, but if it's a pipeline n filter style model I should be able to pass data (even strings) from one activity to another.
Does anyone know how to do this? Bonus points for a video!
I hope this is possible. If WF were the same as my idea of it then it would be extremely useful. | 0 | [
2,
184,
107,
31,
1477,
1054,
128,
1648,
19,
1936,
170,
9990,
60,
800,
3726,
3726,
31,
22,
79,
52,
1524,
562,
31,
1369,
14,
170,
9990,
161,
16,
845,
564,
15,
47,
100,
32,
22,
18,
21,
12250,
13,
103,
11945,
1034,
1061,
31,
378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?
===
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to plague us is getting everyone up to speed in terms of getting their development environment configured and having all the right eggs installed, etc.
I'm looking for ways to simplify this process and make it less error prone. Both zc.buildout and virtualenv look like they would be good tools for addressing this problem but both seem to concentrate primarily on the python-specific issues. We have a couple of small subprojects in other languages (Java and Ruby specifically) as well as numerous python extensions that have to be compiled natively (lxml, MySQL drivers, etc). In fact, one of the biggest thorns in our side has been getting some of these extensions compiled against appropriate versions of the shared libraries so as to avoid segfaults, malloc errors and all sorts of similar issues. It doesn't help that out of 4 people we have 4 different development environments -- 1 leopard on ppc, 1 leopard on intel, 1 ubuntu and 1 windows.
Ultimately what would be ideal would be something that works roughly like this, from the dos/unix prompt:
$ git clone [repository url]
...
$ python setup-env.py
...
that then does what zc.buildout/virtualenv does (copy/symlink the python interpreter, provide a clean space to install eggs) then installs all required eggs, including installing any native shared library dependencies, installs the ruby project, the java project, etc.
Obviously this would be useful for both getting development environments up as well as deploying on staging/production servers.
Ideally I would like for the tool that accomplishes this to be written in/extensible via python, since that is (and always will be) the lingua franca of our team, but I am open to solutions in other languages.
So, my question then is: does anyone have any suggestions for better alternatives or any experiences they can share using one of these solutions to handle larger/broader install bases? | 0 | [
2,
50,
80,
186,
89,
254,
2676,
18,
20,
2052,
150,
9,
29361,
1320,
17,
118,
248,
6599,
219,
710,
26,
25429,
538,
8,
6448,
11570,
29411,
60,
800,
3726,
3726,
31,
589,
21,
322,
16,
21,
173,
30,
25,
88,
20,
3394,
21,
8434,
16,
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... |
.NET multiplication optimization
===
Does the compiler optimize out any multiplications by 1? That is, consider:
int a = 1;
int b = 5 * a;
Will the expression 5 * a be optimized into just 5? If not, will it if a is defined as:
const int a = 1;
| 0 | [
2,
13,
9,
2328,
25432,
21597,
800,
3726,
3726,
630,
14,
21486,
22864,
70,
186,
25432,
18,
34,
137,
60,
30,
25,
15,
3563,
45,
19,
38,
21,
800,
137,
73,
19,
38,
334,
800,
331,
1637,
21,
73,
129,
14,
1803,
331,
1637,
21,
44,
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... |
What is "lambda binding" in Python?
===
I understand what are lambda functions in Python, but I can't find what is the meaning of "lambda binding" by searching the Python docs.
A link to read about it would be great.
A trivial explained example would be even better.
Thank you. | 0 | [
2,
98,
25,
13,
7,
24187,
8728,
7,
19,
20059,
60,
800,
3726,
3726,
31,
1369,
98,
50,
13,
24187,
3719,
19,
20059,
15,
47,
31,
92,
22,
38,
477,
98,
25,
14,
1813,
16,
13,
7,
24187,
8728,
7,
34,
5792,
14,
20059,
9765,
18,
9,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a good Minimal Server-Side Javascript Framework?
===
So I was writing a web app with web.py that uses plenty of client-side javascript, and my database is on couchdb so the queries are in javascript too, and eventually I just got to thinking, why not skip the python and go all javascript? Besides, some functions need to run once on the client and again on the server to make sure you're not spoofing, so why translate between javascript and python?
So I'm looking for a simple lightweight javascript web framework. All I really need is the url routing, request and response stuff (standard wsgi?), and a way to hook into a big http server like nginx. What do you guys recommend? | 0 | [
2,
98,
22,
18,
21,
254,
8663,
8128,
8,
1416,
8247,
8741,
6596,
60,
800,
3726,
3726,
86,
31,
23,
1174,
21,
2741,
4865,
29,
2741,
9,
6448,
30,
2027,
7062,
16,
6819,
8,
1416,
8247,
8741,
15,
17,
51,
6018,
25,
27,
4914,
9007,
86,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Software for creating PNG 8bit transparent images?
===
I'm looking for software to create PNG8 format transparent images as per [this article](http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/).
**NOTE:** I need a linux solution myself, but please submit answers for other OSes.
| 0 | [
2,
2306,
26,
2936,
351,
2723,
469,
3326,
14862,
3502,
60,
800,
3726,
3726,
31,
22,
79,
699,
26,
2306,
20,
1600,
351,
2723,
457,
2595,
14862,
3502,
28,
416,
636,
1565,
2002,
500,
5,
21127,
6903,
6483,
9,
9097,
3132,
9,
960,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a Perl socket resolve hostnames under Linux?
===
I have a (from what I can tell) perfectly working Linux setup (Ubuntu 8.04) where all tools (nslookup, curl, wget, firefox, etc) are able to resolve addresses. Yet, the following code fails:
$s = new IO::Socket::INET(
PeerAddr => 'stackoverflow.com',
PeerPort => 80,
Proto => 'tcp',
);
die "Error: $!\n" unless $s;
I verified the following things:
- Perl is able to resolve addresses with gethostbyname (ie the code below works):
`my $ret = gethostbyname('stackoverflow.com');
print inet_ntoa($ret);`
- The original source code works under Windows
- This is how it supposed to work (ie. it should resolve hostnames), since LWP tries to use this behavior (in fact I stumbled uppon the problem by trying to debug why LWP wasn't working for me)
- Running the script doesn't emit DNS requests (so it doesn't even try to resolve the name). Verified with Wireshark | 0 | [
2,
184,
630,
21,
416,
255,
18482,
9854,
2015,
7259,
18,
131,
13024,
60,
800,
3726,
3726,
31,
57,
21,
13,
5,
2665,
98,
31,
92,
494,
6,
5759,
638,
13024,
18161,
13,
5,
4502,
1020,
2473,
469,
9,
3277,
6,
113,
65,
4672,
13,
5,
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... |
VB6 Integration with MSBuild
===
So this is a question for anyone who has had to integrate the building/compilation of legacy projects/code in a Team Build/MSBuild environment - specifically, Visual Basic 6 applications/projects.
<i>Outside</i> of writing a custom build Task (which I am not against) does anyone have any suggestions on how best to integrate compilation and versioning of legacy VB6 projects into MSBuild builds?
I'm aware of the FreeToDev msbuild tasks at <a href="http://www.codeplex.com/freetodevtasks">CodePlex</a> but they've been withdrawn at the moment.
Ideally I'm looking to version and compile the code as well as capture the compilation output (especially errors) for the msbuild log.
I've seen advice on encapsulating this functionality in a custom task, but really wondered if anyone has tried another solution (aside from executing shell commands) -
In essence, does anyone have a "cleaner" solution?
Ideally, executing commands using <EXEC> would be a last resort.. | 0 | [
2,
13,
20468,
379,
8078,
29,
4235,
29361,
800,
3726,
3726,
86,
48,
25,
21,
1301,
26,
1276,
72,
63,
41,
20,
18399,
14,
353,
118,
11103,
49,
10832,
16,
7780,
2314,
118,
9375,
19,
21,
173,
1895,
118,
79,
18,
29361,
2307,
13,
8,
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... |
Emulation of lex like functionality in perl or python.
===
Here's the deal. Is there a way to have strings tokenized in a line based on multiple regexes?
One example:
I have to get all href tags, their corresponding text and some other text based on a different regex.
So I have 3 expressions and would like to tokenize the line and extract tokens of text matching every expression.
I have actually done this using flex (not to be confused with Adobe), which is an implementation of the good old lex. lex provides
an elegant way to do this by executing "actions" based on expressions. One can control the way
lex reading a file too (block / line based read).
The problem is that flex actually produces C/ C++ code which actually does the tokenizing job. I have a
make file which wraps all these things.
I was wondering if perl /python can in some way do the same thing. Its just that I would like to do everything
I like in a single programming language itself.
Tokenizing is just one of the things that I want to do as part of my application.
Apart from perl or python can any language (functional also) do this?
I did read about PLY and ANTLR here (http://stackoverflow.com/questions/34081/parsing-where-can-i-learn-about-it#34085).
But is there a way to do it naturally in python itself? pardon my ignorance, but are these tools used in any popular products / services?
Thank you. | 0 | [
2,
3579,
11123,
16,
13492,
101,
18548,
19,
416,
255,
54,
20059,
9,
800,
3726,
3726,
235,
22,
18,
14,
1183,
9,
25,
80,
21,
161,
20,
57,
7887,
20,
2853,
1333,
19,
21,
293,
432,
27,
1886,
7953,
1706,
160,
60,
53,
823,
45,
31,
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... |
Generating Random Numbers in Objective-C
===
I'm a java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In java I would use the method:
Random.nextInt(74)
I'm not interested in a discussion about seeds or true randomness, just how you accomplish the same task in Objective-C. I've scoured The Google, and it just seems to be lots of different and conflicting bits of information. | 0 | [
2,
13500,
5477,
2116,
19,
7038,
8,
150,
800,
3726,
3726,
31,
22,
79,
21,
8247,
157,
2011,
15,
17,
31,
259,
21,
161,
20,
7920,
21,
8452,
8,
2195,
5555,
234,
128,
713,
17,
8871,
9,
19,
8247,
31,
83,
275,
14,
2109,
45,
5477,
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... |
Rails Request Initialization
===
We all hear a lot about scaling issues in Rails.
I was just curious what the actual costs in handling a HTTP request is in the Rails framework. Meaning, what has to happen for each and every request which comes in? Is there class parsing? Configuration? Database Connection establishment? | 0 | [
2,
2240,
18,
3772,
2104,
1829,
800,
3726,
3726,
95,
65,
990,
21,
865,
88,
26829,
1549,
19,
2240,
18,
9,
31,
23,
114,
7686,
98,
14,
3463,
4227,
19,
7988,
21,
7775,
3772,
25,
19,
14,
2240,
18,
6596,
9,
1813,
15,
98,
63,
20,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Oracle considers empty strings to be NULL while SQL Server does not - How is this best handled?
===
I have to write a component that re-creates SQL Server tables (structure and data) in an Oracle database.
Translating the data types from SQL Server to Oracle is not a problem. However, a critical difference between Oracle and SQL Server is causing a major headache. SQL Server considers a blank string ("") to be different from a NULL value, so a char column can be defined as NOT NULL and yet still include blank strings in the data.
Oracle considers a blank string to be the same as a NULL value, so if a char column is defined as NOT NULL, you cannot insert a blank string. This is causing my component to break whenever a NOT NULL char column contains a blank string in the original SQL Server data.
So far my solution has been to not use NOT NULL in any of my mirror Oracle table definitions, but I need a more robust solution. This has to be a code solution, so the answer can't be "use so-and-so's SQL2Oracle product".
How would you solve this problem? | 0 | [
2,
15759,
11944,
2424,
7887,
20,
44,
16203,
133,
4444,
255,
8128,
630,
52,
13,
8,
184,
25,
48,
246,
9006,
60,
800,
3726,
3726,
31,
57,
20,
2757,
21,
5912,
30,
302,
8,
6037,
7759,
4444,
255,
8128,
7484,
13,
5,
13971,
17,
1054,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Django admin site not displaying ManyToManyField relationship
===
I'm working on what I think is a pretty standard django site, but am having trouble getting my admin section to display the proper fields.
Here's my models.py:
class Tech(models.Model):
name = models.CharField(max_length = 30)
class Project(models.Model):
title = models.CharField(max_length = 50)
techs = models.ManyToManyField(Tech)
In other words, a Project can have different Tech objects and different tech objects can belong to different Projects (Project X was created with Python and Django, Project Y was C# and SQL Server)
However, the admin site doesn't display any UI for the Tech objects. Here's my admin.py:
class TechInline(admin.TabularInline):
model = Tech
extra = 5
class ProjectAdmin(admin.ModelAdmin):
fields = ['title']
inlines = []
list_display = ('title')
admin.site.register(Project, ProjectAdmin)
I've tried adding the `TechInline` class to the `inlines` list, but that causes a
> 'TechInLine' not defined
Error. Also tried adding `techs` to the `fields` list, but that gives a
> no such table: projects_project_techs
Error. I verified, and there is no `projects_project_techs` table, but there is a `projects_tech` one. Did something perhaps get screwed up in my syncdb?
I am using Sqlite as my database if that helps. | 0 | [
2,
3857,
14541,
21,
43,
2160,
689,
52,
17418,
151,
262,
14842,
1109,
1429,
800,
3726,
3726,
31,
22,
79,
638,
27,
98,
31,
277,
25,
21,
1772,
1236,
3857,
14541,
689,
15,
47,
589,
452,
2572,
1017,
51,
21,
43,
2160,
1050,
20,
3042,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 ADTs that you know of are not Implemented in the the OpenJDK7 Spec ?
===
What Abstract Datatypes that you know of are not currently Implemented in JDK6 nor OpenJDK7? | 0 | [
2,
98,
21,
43,
38,
18,
30,
42,
143,
16,
50,
52,
6807,
19,
14,
14,
368,
728,
43,
197,
465,
12737,
13,
60,
800,
3726,
3726,
98,
8502,
1054,
4474,
18,
30,
42,
143,
16,
50,
52,
871,
6807,
19,
487,
43,
197,
379,
2127,
368,
728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Symbolic math lib
===
I have a planed project that will need to manipulate symbolic expressions like:
a * b = c^2 + sin(d)
I'm wondering what libs are out there for this kind of thing.
Two that I found a while ago are openaxiom and FriCAS. neither of these seem like a good fit. An ideal lib would be a light as possible. At a minimum it must be able to define expressions as some type of data structure and, once values are assigned to the variables, evaluate expressions. I would prefer that it have as many of the following as possible:
- tools to transform expressions and ensure that the transformations are algebraically valid.
- tools to perform differentiation
- tools to parse expressions from text
- have some form of re-wright rule engine
- be able to "compile" expressions for fast execution
- emit C code that equates to execution
- emit ASM for the same
C linkage is a major boon but C++ would do, other options (C#,lisp) might work but are *way* less desirable | 0 | [
2,
12882,
5057,
13,
8326,
800,
3726,
3726,
31,
57,
21,
944,
69,
669,
30,
129,
376,
20,
18468,
12882,
13832,
101,
45,
21,
1637,
334,
800,
272,
1,
135,
2754,
3278,
5,
43,
6,
31,
22,
79,
5712,
98,
13,
8326,
18,
50,
70,
80,
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 to simulate a Delphi breakpoint in code?
===
I am pretty sure I have seen this before, but I haven't found out / remembered how to do it. I want to have a line of code that when executed from the Delphi debugger I want the debugger to pop-up like there was a break point on that line.
Something like:
FooBar := Foo(Bar);
SimulateBreakPoint; // Cause break point to occur in Delphi IDE if attached
WriteLn('Value: ' + FooBar);
Hopefully that makes sense. I know I could use an exception, but that would be a lot more overhead then I want. It is for some demonstration code.
Thanks in advance! | 0 | [
2,
184,
20,
24969,
21,
23030,
1442,
3132,
19,
1797,
60,
800,
3726,
3726,
31,
589,
1772,
562,
31,
57,
541,
48,
115,
15,
47,
31,
2933,
22,
38,
216,
70,
13,
118,
3082,
184,
20,
107,
32,
9,
31,
259,
20,
57,
21,
293,
16,
1797,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 kill a process by name instead of PID?
===
For example, sometimes when I try to start Firefox it says a Firefox process is already running. So I have to do this:
jeremy@jeremy-desktop:~$ ps aux | grep firefox
jeremy 7451 25.0 27.4 170536 65680 ? Sl 22:39 1:18 /usr/lib/firefox-3.0.1/firefox
jeremy 7578 0.0 0.3 3004 768 pts/0 S+ 22:44 0:00 grep firefox
jeremy@jeremy-desktop:~$ kill 7451
What I'd like is a command that would do all that for me. It would take an input string and grep for it (or whatever) in the list of processes, and would kill all the processes in the output:
jeremy@jeremy-desktop:~$ killbyname firefox
I tried doing it in PHP but exec('ps aux') seems to only show processes that have been executed with exec() in the PHP script itself (so the only process it shows is itself.) | 0 | [
2,
184,
92,
31,
1177,
21,
953,
34,
204,
700,
16,
13,
11031,
60,
800,
3726,
3726,
26,
823,
15,
1030,
76,
31,
1131,
20,
799,
535,
18219,
32,
898,
21,
535,
18219,
953,
25,
614,
946,
9,
86,
31,
57,
20,
107,
48,
45,
6996,
1,
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... |
How do I check if an integer is even or odd?
===
How best can I check if an integer is even or odd in C? I considered how I'd do this in JAVA, but I couldn't come up with an answer either. Thanks. | 0 | [
2,
184,
107,
31,
2631,
100,
40,
13820,
25,
166,
54,
4210,
60,
800,
3726,
3726,
184,
246,
92,
31,
2631,
100,
40,
13820,
25,
166,
54,
4210,
19,
272,
60,
31,
724,
184,
31,
22,
43,
107,
48,
19,
8247,
15,
47,
31,
711,
22,
38,
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,
0,
0,
0,
0,
0,
0,
0... |
How can I tell if SP1 has been installed on VS2008?
===
How can I tell if SP1 has been installed on VS2008? e.g. If I'm working on a co-worker's machine - how can I tell if he/she has installed SP1 for VS2008? | 0 | [
2,
184,
92,
31,
494,
100,
3782,
165,
63,
74,
4066,
27,
4611,
2753,
60,
800,
3726,
3726,
184,
92,
31,
494,
100,
3782,
165,
63,
74,
4066,
27,
4611,
2753,
60,
13,
62,
9,
263,
9,
100,
31,
22,
79,
638,
27,
21,
326,
8,
22560,
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... |
Rails Console Doesn't Automatically Load Models For 2nd DB
===
I have a Rails project which has a Postgres database for the actual application but which needs to pull a heck of a lot of data out of an Oracle database.
database.yml looks like
development:
adapter: postgresql
database: blah blah
...
oracle_db:
adapter: oracle
database: blah blah
My models which descend from data on the Oracle DB look something like
class LegacyDataClass < ActiveRecord::Base
establish_connection "oracle_db"
set_primary_key :legacy_data_class_id
has_one :other_legacy_class, :foreign key => :other_legacy_class_id_with_funny_column_name
...
end
Now, by habit I often do a lot of my early development (and this is early development) by coding for a bit and then playing in the Rails console. For example, after defining all the associations for LegacyDataClass I'll start trying things like `a = LegacyDataClass.find(:first); puts a.some_association.name`. Unexpectedly, this dies with LegacyDataClass not being already loaded.
I can then `require 'LegacyDataClass'` which fixes the problem until I either need to `reload!`, which won't actually reload it, or until I open a new instance of the console.
Thus the questions:
* **Why** does this happen? Clearly there is some Rails magic I am not understanding.
* What is the convenient Rails **workaround**? | 0 | [
2,
2240,
18,
8650,
1437,
22,
38,
7499,
6305,
2761,
26,
172,
706,
13,
9007,
800,
3726,
3726,
31,
57,
21,
2240,
18,
669,
56,
63,
21,
678,
6879,
18,
6018,
26,
14,
3463,
3010,
47,
56,
2274,
20,
2201,
21,
16490,
16,
21,
865,
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... |
Error: initializer element is not computable at load time
===
I have in a function that takes a struct, and I'm trying to store its variables in an array, but I get this when I run gcc -Wall -ansi -pedantic-errors -Werror
int detect_prm(Param prm) {
int prm_arr[] = {prm.field1, prm.field2, prm.field3};
return 0;
}
I get Error: initializer element is not computable at load time when I try to compile the above. It looks fine to me, whats wrong?
| 0 | [
2,
7019,
45,
2104,
11907,
4520,
25,
52,
6479,
1982,
579,
35,
6305,
85,
800,
3726,
3726,
31,
57,
19,
21,
1990,
30,
1384,
21,
13,
10346,
15,
17,
31,
22,
79,
749,
20,
1718,
82,
12157,
19,
40,
7718,
15,
47,
31,
164,
48,
76,
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... |
How do you balance the conflicting needs of backwards compatibility and innovation?
===
I work on an application that has a both a GUI (graphical) and API (scripting) interface. Our product has a very large installed base. Many customers have invested a lot of time and effort into writing scripts that use our product.
In all of our designs and implementation, we (understandably) have a very strict requirement to maintain 100% **backwards compatibility**. A script which ran before must continue to run in exactly the same way, without any modification, when we introduce a new software version.
Unfortunately, this requirement sometimes ties our hands behind our back, as it really restricts out ability to **innovate** and come up with new and better ways of doing things.
For example, we might come up with a better (and more usable) way of achieving a task which is already possible. It would be desirable to make this better way the default way, but we can't do this as it may have backwards compatibility implications. So we are stuck with leaving the new (better) way as a mode, that the user must "turn on" before it becomes available to them. Unless they read the documentation or online help (which many customers don't do), this new functionality will remain hidden forever.
I know that Windows Vista annoyed a lot of people when it first came out, because of all the software and peripherals which didn't work on it, even when they worked on XP. It received a pretty bad reception because of this. But you can see that Microsoft have also succeeded in making some great innovations in Vista, at the expense of backwards compatibility for a lot of users. They took a risk. Did it pay off? Did they make the right decision? I guess only time will tell.
Do you find yourself balancing the conflicting needs of innovation and backwards compatibility? How do you handle the juggling act? | 0 | [
2,
184,
107,
42,
4468,
14,
22297,
2274,
16,
12207,
13,
21618,
17,
7666,
60,
800,
3726,
3726,
31,
170,
27,
40,
3010,
30,
63,
21,
156,
21,
9457,
13,
5,
12084,
192,
6,
17,
21,
2159,
13,
5,
8741,
68,
6,
6573,
9,
318,
2374,
63,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 invoke a java method when given the method name as a string?
===
If I have two variables:
Object obj;
String methodName = "getName";
Without knowing the class of `obj`, how can I call the method identified by `methodName` on it?
The method being called has no parameters, and a `String` return value - a getter for a Java bean. | 0 | [
2,
184,
107,
31,
28371,
21,
8247,
2109,
76,
504,
14,
2109,
204,
28,
21,
3724,
60,
800,
3726,
3726,
100,
31,
57,
81,
12157,
45,
3095,
5122,
728,
73,
3724,
2109,
7259,
800,
13,
7,
3060,
7259,
7,
73,
366,
2506,
14,
718,
16,
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... |
What are your language "hangups"?
===
I've read some of the recent language vs. language questions with interest... [Perl vs. Python][1], [Python vs. Java][2], [Can one language be better than another?][3]
One thing I've noticed is that a lot of us have *very superficial* reasons for disliking languages. We notice these things at first glance and they turn us off. We shun what are probably perfectly good languages as a result of features that we'd probably learn to love or ignore in 2 seconds if we bothered.
Well, I'm as guilty as the next guy, if not more. Here goes:
- Ruby: All the Ruby example code I see uses the `puts` command, and that's a sort of childish Yiddish anatomical term. So as a result, I can't take Ruby code seriously even though I should.
- Python: The first time I saw it, I smirked at the whole significant whitespace thing. I avoided it for the next several years. Now I hardly use anything else.
- Java: I don't like identifiersThatLookLikeThis. I'm not sure why exactly.
- Lisp: I have trouble with all the parentheses. Things of different importance and purpose (function declarations, variable assignments, etc.) are not syntactically differentiated and I'm too lazy to learn what's what.
- Fortran: uppercase everything hurts my eyes. I know modern code doesn't have to be written like that, but most example code is...
- Visual Basic: it bugs me that `Dim` is used to declare variables, since I remember the good ol' days of GW-BASIC when it was *only* used to dimension arrays.
What languages *did* look right to me at first glance? Perl, C, QBasic, JavaScript, assembly language, BASH shell, FORTH.
Okay, now that I've aired my dirty laundry... I want to hear yours. **What are your language hangups? What superficial features bother you? How have you gotten over them?**
[1]: http://stackoverflow.com/questions/150043/python-v-perl#150103
[2]: http://stackoverflow.com/questions/136977/after-c-python-or-java#137343
[3]: http://stackoverflow.com/questions/157207/can-one-language-be-better-than-another | 4 | [
2,
98,
50,
154,
816,
13,
7,
7065,
15699,
7,
60,
800,
3726,
3726,
31,
22,
195,
1302,
109,
16,
14,
1764,
816,
4611,
9,
816,
2346,
29,
1163,
9,
9,
9,
636,
1432,
255,
4611,
9,
20059,
500,
2558,
165,
500,
15,
636,
6448,
11570,
46... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 2005 locks up when attaching to process
===
I have a simple C++ DLL that implements a few custom actions for a WiX installer.
Debugging the custom actions is usually simple: put up a temporary dialog box at the beginning of the action, and attach to the process when the dialog box appears.
But today, whenever I attach to the process, I get the "Microsoft Visual Studio is Busy" bubble appearing at the bottom of the screen. I cannot figure out where this is coming from. Any ideas? | 0 | [
2,
3458,
1120,
812,
12941,
71,
76,
19514,
68,
20,
953,
800,
3726,
3726,
31,
57,
21,
1935,
272,
20512,
13,
43,
211,
30,
8713,
18,
21,
310,
5816,
3078,
26,
21,
4807,
396,
16146,
106,
9,
121,
16254,
2762,
14,
5816,
3078,
25,
951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 typedef a pointer to method which returns a pointer the method?
===
Basically I have the following class:
class StateMachine {
...
StateMethod stateA();
StateMethod stateB();
...
};
The methods stateA() and stateB() should be able return pointers to stateA() and stateB().
How to typedef the StateMethod? | 0 | [
2,
184,
20,
1001,
13862,
21,
454,
106,
20,
2109,
56,
4815,
21,
454,
106,
14,
2109,
60,
800,
3726,
3726,
11374,
31,
57,
14,
249,
718,
45,
718,
146,
20442,
13,
1,
13,
9,
9,
9,
146,
5909,
1807,
43,
146,
58,
5,
6,
73,
146,
590... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
WPF: Slider doesnt raise MouseLeftButtonDown or MouseLeftButtonUp
===
I tried this XAML:
<Slider Width="250" Height="25" Minimum="0" Maximum="1" MouseLeftButtonDown="slider_MouseLeftButtonDown" MouseLeftButtonUp="slider_MouseLeftButtonUp" />
And this C#:
private void slider_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
sliderMouseDown = true;
}
private void slider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
sliderMouseDown = false;
}
The sliderMouseDown variable never changes because the MouseLeftButtonDown and MouseLeftButtonUp events are never raised. How can I get this code to work when a user has the left mouse button down on a slider to have a bool value set to true, and when the mouse is up, the bool is set to false?
| 0 | [
2,
619,
7721,
45,
3295,
106,
5886,
3972,
7567,
9742,
811,
444,
2968,
54,
7567,
9742,
811,
444,
576,
800,
3726,
3726,
31,
794,
48,
13,
6791,
8184,
45,
13,
1,
18,
1210,
1157,
9456,
3726,
7,
9798,
7,
2947,
3726,
7,
1811,
7,
5187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Dynamic breadcrumb generation - how to do?
===
I'm in the early phases of developing a brand spanking new site with Spring + Tiles. The site needs dynamically generated breadcrumbs.
What I mean by dynamic is that the user may reach a certain site from multiple starting points. If I have views for Customers, Orders and Products, the user could reach a Product directly:
Products -> Product xyz
or the user could reach a product through a customer's order:
Customers -> John Doe -> Orders -> Order 123 -> Product xyz
What is the best way to achieve breadcrumbs like these in a java environment? I've previously done this by using a request attribute (a Vector of Url objects) that is filled with the Urls in each action/servlet of my webapp (like in the action List of Products). I'm not happy with this solution as it requires adding code to each controller/action for generating the breadcrumb trail. And in a case like viewing a product of given order of given customer, the if-then-else logic needed to determine the trail is awful.
Are there any libraries that I could use? | 0 | [
2,
7782,
5988,
25241,
220,
2782,
13,
8,
184,
20,
107,
60,
800,
3726,
3726,
31,
22,
79,
19,
14,
274,
14795,
16,
3561,
21,
2209,
28361,
68,
78,
689,
29,
1573,
2754,
14836,
9,
14,
689,
2274,
7782,
1326,
6756,
5988,
25241,
4562,
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... |
Sawtooth Surveys
===
I'm guessing this won't apply to 99.99% of anyone that sees this. I've been doing some Sawtooth survey programming at work and I've been needing to create a webpage that shows some aggregate data from the completed surveys. I was just wondering if anyone else has done this using the flat files that Sawtooth generates and how you went about doing it. I only know very basic perl and the server I use does not have PHP so I'm somewhat at a loss for solutions. Anything you've got would be helpful. | 0 | [
2,
441,
15808,
14490,
800,
3726,
3726,
31,
22,
79,
19523,
48,
230,
22,
38,
5645,
20,
7787,
9,
26014,
16,
1276,
30,
6895,
48,
9,
31,
22,
195,
74,
845,
109,
441,
15808,
3431,
3143,
35,
170,
17,
31,
22,
195,
74,
12210,
20,
1600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 are local styles being ignored when using forms authentication in asp.net?
===
I have some styles applied to html for example
<body style="background: #C3DAF9;">
and when I use forms authentication it is ignored. If I put the style into an external .css file then it works.
This doesn't seem like normal behaviour to me. | 0 | [
2,
483,
50,
375,
6443,
142,
5424,
76,
568,
1997,
27963,
19,
28,
306,
9,
2328,
60,
800,
3726,
3726,
31,
57,
109,
6443,
2435,
20,
13,
15895,
26,
823,
13,
1,
9760,
1034,
3726,
7,
1958,
8810,
45,
6926,
150,
240,
43,
2565,
518,
73,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Advice on splitting up a process involving multiple actors into Use Cases
===
Let's say I am modelling a process that involves a conversation or exchnage between two actors. For this example, I'll use something easily understandable:-
1. Supplier creates a price list,
2. Buyer chooses some items to buy and sends a Purchase Order,
3. Supplier receives the purchase order and sends the goods.
4. Supplier sends an invoice
5. Buyer receives the invoice and makes a payment
Of course each of those steps in itself could be quick complicated. How would you split this up into use cases in your requirements document?
If this process was treated as a single use-case it could fill a book.
Alternatively, making a use case out of each of the above steps would hide some of the essential interaction and flow that should be captured. Would it make sense to have a use case that starts at "Received a purchase order" and finishes at "Send an Invoice" and then another that starts at "Receive an Invoice" and ends at "Makes a Payment"?
Any advice? | 0 | [
2,
4978,
27,
17282,
71,
21,
953,
4838,
1886,
4977,
77,
275,
1871,
800,
3726,
3726,
408,
22,
18,
395,
31,
589,
23089,
21,
953,
30,
6569,
21,
2735,
54,
1396,
673,
103,
1303,
128,
81,
4977,
9,
26,
48,
823,
15,
31,
22,
211,
275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
In .NET is there a way to enable Assembly.Load tracing?
===
In .NET is there a way to enable Assembly.Load tracing? I know while running under the debugger it gives you a nice message like "Loaded 'assembly X'" but I want to get a log of the assembly loads of my running application outside the debugger, preferably intermingled with my Debug/Trace log messages.
I'm tracing out various things in my application and I basically want to know what action triggered a particular assembly to be loaded. | 0 | [
2,
19,
13,
9,
2328,
25,
80,
21,
161,
20,
9240,
1475,
9,
8294,
20005,
60,
800,
3726,
3726,
19,
13,
9,
2328,
25,
80,
21,
161,
20,
9240,
1475,
9,
8294,
20005,
60,
31,
143,
133,
946,
131,
14,
121,
2345,
11356,
32,
2352,
42,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 do I need for a compliant email header
===
I am trying to send an email from a site I am building, but it ends up in the yahoo spam folder. It is the email that sends credentials. What can I do to legitimize it?
$header = "From: site <sales@site.com>\r\n";
$header .= "To: $name <$email>\r\n";
$header .= "Subject: $subject\r\n";
$header .= "Reply-To: site <sales@site.com>" . "\r\n";
$header .= "MIME-VERSION: 1.0\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$phpversion = phpversion();
$header .= "X-Mailer: PHP v$phpversion\r\n";
mail($email,$subject,$body,$header); | 0 | [
2,
98,
107,
31,
376,
26,
21,
13,
25509,
8517,
157,
106,
800,
3726,
3726,
31,
589,
749,
20,
2660,
40,
8517,
37,
21,
689,
31,
589,
353,
15,
47,
32,
3451,
71,
19,
14,
23553,
6954,
79,
19294,
9,
32,
25,
14,
8517,
30,
11350,
5059... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
C++ Which is faster: Stack allocation or Heap allocation
===
This question may sound fairly noobish, but this is a debate I had with another coder I work with.
I was taking care to stack allocate things where I could, instead of heap allocating them. He was talking to me and watching over my shoulder and commented that it wasn't necessary because they are the same performance wise.
I was always under the impression that growing the stack was constant time, and heap allocation's performance depended on the current complexity of the heap for both allocation (finding a hole of the proper size) and de-allocating (collapsing holes to reduce fragmentation, as many std library implementations take time to do this during deletes if I am not mistaken).
This strikes me as something that would probably be very compiler dependent. For this project in particular I am using a Metrowerks compiler for the PPC architecture. Insight on this combination would be most helpful, but in general, for GCC, and MSVC++, what is the case? Is heap allocation not as performant as stack allocation? Is there no difference? Or are the differences so minute it becomes pointless micro-optimization. | 0 | [
2,
272,
20512,
56,
25,
4233,
45,
7566,
16840,
54,
15414,
16840,
800,
3726,
3726,
48,
1301,
123,
646,
6647,
90,
111,
23092,
15,
47,
48,
25,
21,
4503,
31,
41,
29,
226,
1797,
139,
31,
170,
29,
9,
31,
23,
741,
781,
20,
7566,
65,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.