unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
What is the best way to remotely manage a Sqlite DB?
===
We have an Sqlite DB on our Linux/PHP production webserver. What is the best way to manage it remotely? I've found some server wrappers are available and some applications claim to offer remote access methods. Any suggestions? | 0 | [
2,
98,
25,
14,
246,
161,
20,
23288,
4705,
21,
4444,
10601,
13,
9007,
60,
800,
3726,
3726,
95,
57,
40,
4444,
10601,
13,
9007,
27,
318,
13024,
118,
26120,
637,
2741,
10321,
106,
9,
98,
25,
14,
246,
161,
20,
4705,
32,
23288,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using Microsoft SMS Sender to send out smses in batch?
===
I understand that we can use SMS Sender in command line mode. But i been getting this error same as this article http://www.oreillynet.com/pub/a/wireless/2003/10/10/sms.html
The smssender.exe will use the last device that was successfully used to send messages in the Windows version of SMS Sender. But I tried it many times, and smssender.exe always complains that no last device was used.
Anyone have any idea about this?
| 0 | [
2,
568,
7099,
7613,
18,
2660,
106,
20,
2660,
70,
7613,
7202,
19,
13064,
60,
800,
3726,
3726,
31,
1369,
30,
95,
92,
275,
7613,
18,
2660,
106,
19,
1202,
293,
3740,
9,
47,
31,
74,
1017,
48,
7019,
205,
28,
48,
2002,
7775,
6903,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Regex to validate the index of a website vs. a specific page
===
I'm looking for a regex that will allow me to validate whether or not a string is the reference to a website address, or a specific page in that website.
So it would match:
- http://google.com
- ftp://google.com
- http://google.com/
- http://lots.of.subdomains.google.com
But not:
- http://google.com/search.whatever
- ftp://google.com/search.whatever
- http://lots.of.subdomains.google.com/search.whatever
Any ideas? I can't quite figure out how to handle allowing the / at the end of the URL. | 0 | [
2,
7953,
1706,
20,
7394,
1373,
14,
4348,
16,
21,
2271,
4611,
9,
21,
1903,
2478,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
7953,
1706,
30,
129,
1655,
55,
20,
7394,
1373,
1472,
54,
52,
21,
3724,
25,
14,
2801,
20,
21,
2271,
3218,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
if statements in mysql?
===
is there an if statement when it comes to mysql query statements?
when i am updating a table record, i want to only update certain columns if they have a value to be updated.
for example, i want an update table function, and there is a table for volunteers and a table for people who just want email updates.
i want to use the same function (there will be a function that only deals w/ the upd queries) and is it possible to do this in theory...
if you are updating volunteer table, only update these columns, if mailing_list, then update these
i know this can by done using an if statement w/ two query statements, based on what table you're updating, but i am wondering is it possible to use only one query statement w/ the conditionals in it to update the appropriate columns in the table.
this may sound like something you would dream about, let me know.
thanks. | 0 | [
2,
100,
9015,
19,
51,
18,
22402,
60,
800,
3726,
3726,
25,
80,
40,
100,
3331,
76,
32,
1624,
20,
51,
18,
22402,
25597,
9015,
60,
76,
31,
589,
71,
43,
1880,
21,
859,
571,
15,
31,
259,
20,
104,
11100,
1200,
7498,
100,
59,
57,
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... |
Java MessageFormat - How can I insert values between single quotes?
===
I'm having a problem using the java.text.MessageFormat object.
I'm trying to create SQL insert statements. The problem is, when I do something like this:
MessageFormat messageFormat = "insert into {0} values ( '{1}', '{2}', '{3}', {4} )";
Object[] args = { str0, str1, str2, str3, str4 };
String result = messageFormat.format(args);
I get this for the value of `result`:
"insert into <str0> values ( {1}, {2}, {3}, <str4> )"
As you can see, the problem is that any of the target locations that are enclosed by single quotes do not get replaced by arguments. I have tried using double single quotes like this: `''{1}''` and escaped characters like this: `\'{1}\'` but it still gives the same result.
How can I resolve this issue? For the record, I am using JDK 6u7. | 0 | [
2,
8247,
2802,
23588,
13,
8,
184,
92,
31,
14692,
4070,
128,
345,
18901,
60,
800,
3726,
3726,
31,
22,
79,
452,
21,
1448,
568,
14,
8247,
9,
11969,
9,
3845,
18,
1303,
23588,
3095,
9,
31,
22,
79,
749,
20,
1600,
4444,
255,
14692,
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... |
Best practices for handling variable size arrays in c / c++?
===
If I have an array of a fixed size depending on how it is defined and used, I typically use one of two ways to reference it.
Array type 1: Since it is a fixed size based on a define, I just use that define in all my loops referencing it.
#define MAXPLAYERS 4
int playerscores[MAXPLAYERS];
for(i=0;i<MAXPLAYERS;++i)
{
.... do something with each player
}
Array type 2: Since this array can grow as items are added to it, I use the sizeof to count the number of entries in it. The size would be converted to a constant by the compiler so there shouldn't be any runtime penalty to doing it this way.
typedef struct
{
fields....
}MYSTRUCT_DEF;
MYSTRUCT_DEF mystruct[]={
{entry 1},
{entry 2},
{entry 3...n}
};
for(i=0;i<(sizeof(mystruct)/sizeof(MYSTRUCT_DEF));++i)
{
..... do something with each entry
}
Is there a more elegant solution to handling processing of arrays without going past the end or stopping too early. Thoughts? Comments?
| 0 | [
2,
246,
5242,
26,
7988,
7612,
1072,
7718,
18,
19,
272,
13,
118,
272,
20512,
60,
800,
3726,
3726,
100,
31,
57,
40,
7718,
16,
21,
3535,
1072,
4758,
27,
184,
32,
25,
2811,
17,
147,
15,
31,
2442,
275,
53,
16,
81,
2847,
20,
2801,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 way to get code folding in Delphi 7?
===
I know this is a long shot - but is there any way at all to get code folding into Delphi 7?
I'm working on some .. "suboptimal" .. code. Sometimes I really need to fold bits away to grok a stupid-long procedure. Currently I'm pasting code into Notepad++, which works, but it would be nice to have it in the IDE. | 0 | [
2,
25,
80,
186,
161,
20,
164,
1797,
14516,
19,
23030,
453,
60,
800,
3726,
3726,
31,
143,
48,
25,
21,
175,
999,
13,
8,
47,
25,
80,
186,
161,
35,
65,
20,
164,
1797,
14516,
77,
23030,
453,
60,
31,
22,
79,
638,
27,
109,
13,
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... |
Scaling solutions for MySQL (Replication, Clustering)
===
At the [startup][1] I'm working at we are now considering scaling solutions for our database. Things get somewhat confusing (for me at least) with MySQL, which has the [MySQL cluster][2], [replication][3] and [MySQL cluster replication][4] (from ver. 5.1.6), which is an asynchronous version of the MySQL cluster. The MySQL manual explains some of the differences in its [cluster FAQ][5], but it is hard to ascertain from it when to use one or the other.
I would appreciate any advice from people who are familiar with the differences between those solutions and what are the pros and cons, and when do you recommend to use each.
[1]: http://www.octabox.com
[2]: http://dev.mysql.com/doc/refman/5.0/en/faqs-mysql-cluster.html
[3]: http://dev.mysql.com/doc/refman/5.0/en/replication.html
[4]: http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication.html
[5]: http://dev.mysql.com/doc/refman/5.0/en/faqs-mysql-cluster.html#qandaitem-22-10-3 | 0 | [
2,
26829,
6776,
26,
51,
18,
22402,
13,
5,
99,
20669,
15,
7460,
68,
6,
800,
3726,
3726,
35,
14,
636,
13680,
576,
500,
2558,
165,
500,
31,
22,
79,
638,
35,
95,
50,
130,
5154,
26829,
6776,
26,
318,
6018,
9,
564,
164,
4131,
18084,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Upgrade Subversion 1.4.3 to 1.5.2 on Debian (hosted account)
===
I'm trying to upgrade my subversion server (I have it hosted with Dreamhost)
This is what I run:
- wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2
- wget http://subversion.tigris.org/downloads/subversion-deps-1.5.2.tar.bz2
- tar -xjf subversion-1.5.2.tar.bz2
- tar -xjf subversion-deps-1.5.2.tar.bz2
- cd subversion-1.5.2
- ./configure --prefix=/usr/bin --with-libs=/usr/bin/openssl --with-ssl
But I'm unable to continue any further because of this error:
- checking for C compiler default output file name...
- **configure: error: C compiler cannot create executables**
- See `config.log' for more details.
- configure failed for neon
Since I'm no expert with Linux, I'm not sure how to proceed.
So the question is: what is the best way to upgrade (given the constraints of being with this hosted provider). | 0 | [
2,
9483,
972,
10898,
137,
9,
300,
9,
240,
20,
137,
9,
264,
9,
135,
27,
121,
10035,
13,
5,
25219,
2176,
6,
800,
3726,
3726,
31,
22,
79,
749,
20,
9483,
51,
972,
10898,
8128,
13,
5,
49,
57,
32,
2812,
29,
1868,
11694,
6,
48,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to handle a class name conflict when porting old code?
===
I'm trying to port an old library (that doesn't use namespaces as far as I can tell) to modern compilers. One of my targets can't tell the difference between System::TObject and ::TObject (without a namespace). System::TObject is native to the compiler.
I've tried a using directive, i.e. using ::TObject;
But that doesn't do it.
The obvious solution is to wrap all the original library in a namespace and then calling it by name- that should avoid the ambiguity. But is that the wisest solution? Is there any other solution? Adding a namespace would require changing a bunch of files and I don't know if it would have unwanted repercussions later. | 0 | [
2,
184,
20,
3053,
21,
718,
204,
2930,
76,
1295,
68,
315,
1797,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1295,
40,
315,
1248,
13,
5,
887,
1437,
22,
38,
275,
204,
5582,
18,
28,
463,
28,
31,
92,
494,
6,
20,
773,
21486,
18,
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... |
password encryption in iphone apps
===
I need to store the user's password in my iphone app.
When posting an app to the app store, I have to tell Apple if there's encryption in the app for export purposes.
I don't want my app to be restricted to US only, but I also don't want to store or send passwords over the net in clear text.
So basically the question is, can I encrypt passwords in a way that will not get my app restricted? | 0 | [
2,
20884,
24420,
19,
21024,
4865,
18,
800,
3726,
3726,
31,
376,
20,
1718,
14,
4155,
22,
18,
20884,
19,
51,
21024,
4865,
9,
76,
15669,
40,
4865,
20,
14,
4865,
1718,
15,
31,
57,
20,
494,
4037,
100,
80,
22,
18,
24420,
19,
14,
486... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
XMLHTTP in VB6, ??? in C# .Net 2005?
===
I'm trying to convert some code that worked great in VB, but I can't figure out what objects to use in .Net.
Dim oXMLHttp As XMLHTTP
oXMLHttp = New XMLHTTP
oXMLHttp.open "POST", "https://www.server.com/path", False
oXMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHttp.send requestString
Basically, I want to send an XML file to a server, then store the response that it returns. Can anyone point me in the right direction on this? | 0 | [
2,
23504,
21127,
19,
13,
20468,
379,
15,
13,
60,
60,
60,
19,
272,
5910,
13,
9,
2328,
812,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
8406,
109,
1797,
30,
577,
374,
19,
13,
20468,
15,
47,
31,
92,
22,
38,
1465,
70,
98,
3916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 quantify difference between two images?
===
Here's what I would like to do:
I'm taking pictures with a webcam at regular intervals. Sort of like a time lapse thing. However, if nothing has really changed, that is, the picture pretty much *looks* the same, I don't want to store the latest snapshot.
I imagine there's some way of quantifying the difference, and I would have to empirically determine a threshold.
I'm looking for simplicity rather than perfection.
I'm using python. | 0 | [
2,
184,
92,
31,
9836,
38,
8612,
2841,
128,
81,
3502,
60,
800,
3726,
3726,
235,
22,
18,
98,
31,
83,
101,
20,
107,
45,
31,
22,
79,
741,
3104,
29,
21,
2741,
8760,
35,
1290,
15899,
9,
2058,
16,
101,
21,
85,
13,
17057,
584,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to detect intermittent time out problem in web applications?
===
Have a n-tire web application and search often times out after 30 secs. How to detect the root cause of the problem? | 0 | [
2,
184,
20,
9092,
19667,
85,
70,
1448,
19,
2741,
3767,
60,
800,
3726,
3726,
57,
21,
13,
103,
8,
1388,
99,
2741,
3010,
17,
2122,
478,
436,
70,
75,
712,
9265,
18,
9,
184,
20,
9092,
14,
5900,
1679,
16,
14,
1448,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
C# Equivalent of the following statement please
===
Could you please show me the C# Equivalent of this VB.NET code:
Public Partial Class Index
Inherits System.Web.Mvc.Viewpage(Of List(Of Task))
End Class
I am not sure where/how to add it in for C#:
public partial class DirList : System.Web.Mvc.ViewPage
{
}
The code is suppose to tell the class to expect a list of tasks from the controller... | 0 | [
2,
272,
5910,
4602,
16,
14,
249,
3331,
2247,
800,
3726,
3726,
110,
42,
2247,
298,
55,
14,
272,
5910,
4602,
16,
48,
13,
20468,
9,
2328,
1797,
45,
317,
7284,
718,
4348,
17569,
18,
329,
9,
14113,
9,
79,
8990,
9,
4725,
6486,
5,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Argument-parsing helpers for C/UNIX
===
I know of the following:
- the venerable `getopt(3)`
- the extended `getopt_long`
- glibc's <a href="http://www.gnu.org/software/libtool/manual/libc/Argp.html">`argp`</a> parser for unix-style argument vectors
- <a href="http://developer.gnome.org/arch/misc/popt.html">popt</a> from the GNOME project
I'm sure there's more that I haven't used or even heard of; a quick Google search reveals <a href="http://www.purposeful.co.uk/software/gopt/">Gopt</a>, <a href="http://argtable.sourceforge.net/">argtable</a>, and <a href="http://michael.dipperstein.com/optlist/">Optlist</a>.
Personally, I like `argp` best, and every program I wrote using `getopt`/`getopt_long` (beyond a certain baseline of complexity) has been converted to use `argp`. It's more widely available than `popt`, more powerful than `getopt_long`, well-documented, consistent with all the GNU-style conventions, and very flexible. On the downside, it's far from the easiest to use (thanks to being so flexible), and the code to support it is quite verbose (as are many things in C).
What do you use, and why? | 0 | [
2,
5476,
8,
3574,
18,
68,
448,
445,
26,
272,
118,
1020,
4028,
800,
3726,
3726,
31,
143,
16,
14,
249,
45,
13,
8,
14,
26078,
13,
1,
834,
3880,
38,
5,
240,
6,
1,
13,
8,
14,
1984,
13,
1,
834,
3880,
38,
1,
2701,
1,
13,
8,
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... |
Question about strange OpenGL ES behavior in iPhone app.
===
I'm making a simple 2D game for the iPhone. It's based on CrashLanding... so it's basically a background texture and a few rectangular textures moving around.
I have this bizarre little graphics problem: some of the small 2d items (can assume just rectangles) moving around get this little flashing black bar on top of them (the background texture is almost completely white so the little bar is noticable).
The textures I'm using are small (~1Kb) pngs.
Has anyone else run into this? Is this a common openGL issue? Thanks very much! | 0 | [
2,
1301,
88,
2578,
368,
8430,
13,
160,
3257,
19,
21024,
4865,
9,
800,
3726,
3726,
31,
22,
79,
544,
21,
1935,
172,
43,
250,
26,
14,
21024,
9,
32,
22,
18,
432,
27,
4597,
618,
68,
9,
9,
9,
86,
32,
22,
18,
11374,
21,
2395,
127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Easiest way to front Weblogic 9.2 with apache 2.x
===
I want to put Apache 2.2.9 in front of a Weblogic 9.2 server on Windows XP. What does it take to do that ?<br>
I probably need mod_proxy on the apache side ? <br>
As far as Weblogic and apache are concerned, is there something similar to mod_jk ?<br>
I would like this setup so that I can introduce some filtering later on. But for now, the goal is to allow other computers to access weblogic appserver so that Apache forwards all requests coming to it (at a certain URL) to Weblogic.
I have done this several times earlier BUT have forgotten how I did it.
Thanks for any pointers, | 0 | [
2,
27237,
161,
20,
431,
2741,
24268,
561,
9,
135,
29,
17140,
172,
9,
396,
800,
3726,
3726,
31,
259,
20,
442,
17140,
172,
9,
135,
9,
518,
19,
431,
16,
21,
2741,
24268,
561,
9,
135,
8128,
27,
1936,
23045,
9,
98,
630,
32,
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... |
"Inline" Class Instantiation in PHP? (For Ease of Method Chaining)
===
An idiom commonly used in OO languages like Python and Ruby is instantiating an object and chaining methods that return a reference to the object itself, such as:
s = User.new.login.get_db_data.get_session_data
In PHP, it is possible to replicate this behavior like so:
$u = new User();
$s = $u->login()->get_db_data()->get_session_data();
Attempting the following results in `syntax error, unexpected T_OBJECT_OPERATOR`:
$s = new User()->login()->get_db_data()->get_session_data();
It seems like this could be accomplished using static methods, which is probably what I'll end up doing, but I wanted to check the lazyweb: **Is there actually a clean, simple way to instantiate PHP classes "inline" (as shown in the above snippet)** for this purpose?
If I do decide to use static methods, **is it too sorcerous to have a class's static method return an instantiation of the class itself**? (Effectively writing my own constructor-that-isn't-a-constructor?) It feels kind of dirty, but if there aren't too many scary side effects, I might just do it.
I guess I could also pre-instantiate a UserFactory with a get_user() method, but I'm curious about solutions to what I asked above. | 0 | [
2,
13,
7,
108,
1143,
7,
718,
6322,
49,
857,
19,
13,
26120,
60,
13,
5,
1106,
6378,
16,
2109,
2858,
68,
6,
800,
3726,
3726,
40,
28380,
2524,
147,
19,
13,
4328,
2556,
101,
20059,
17,
10811,
25,
6322,
49,
1880,
40,
3095,
17,
2858,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Any good online C reference manual?
===
I've studied C programming in college some years ago and have developed some medium applications back then (nothing serious). Now I have to develop some more 'advanced' C applications (involving posix trheads and rpc), but right now I'm a little rusty even with the basics.
Does anyone know of any good online C reference manual? This may help me get in tune faster. | 0 | [
2,
186,
254,
2087,
272,
2801,
5132,
60,
800,
3726,
3726,
31,
22,
195,
1449,
272,
3143,
19,
314,
109,
122,
1464,
17,
57,
885,
109,
4152,
3767,
97,
94,
13,
5,
8297,
2055,
6,
9,
130,
31,
57,
20,
2803,
109,
91,
13,
22,
1283,
268... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Automagic unit tests for upholding Object method contracts in Java?
===
When developing Java applications, I often override Object methods (usually equals and hashCode). I would like some way to systematically check that I'm adhering to the contract for Object methods for every one of my classes. For example, I want tests that assert that for equal objects, the hash code is also equal. I'm using the JUnit test framework, so preferably I'd like some JUnit solution where I can automatically generate these tests, or some test case that can somehow visit all of my classes and make sure that the contract is upheld. | 0 | [
2,
3108,
21200,
1237,
4894,
26,
71,
14681,
3095,
2109,
8712,
19,
8247,
60,
800,
3726,
3726,
76,
3561,
8247,
3767,
15,
31,
478,
84,
11891,
3095,
3195,
13,
5,
13075,
2747,
18,
17,
19170,
9375,
6,
9,
31,
83,
101,
109,
161,
20,
2535... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Daemon Threads Explanation
===
In the Python documentation:<br>
<http://www.python.org/doc/2.5.2/lib/thread-objects.html>
it says:
It states "A thread can be flagged as a ``daemon thread''. The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread."
Does anyone have a clearer explanation of what that means or a practical example showing where you would want to set threads as daemonic? | 0 | [
2,
13127,
20396,
5764,
800,
3726,
3726,
19,
14,
20059,
13945,
45,
1,
5145,
1,
13,
1,
21127,
6903,
6483,
9,
6448,
11570,
9,
5583,
118,
13799,
15718,
9,
264,
9,
9298,
8326,
118,
96,
10647,
8,
23793,
18,
9,
15895,
1,
32,
898,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Should I create a business for the side work / consultancy work I am getting?
===
I'm getting some rather serious consulting work on the side of my main job. Serious in that I'm filling out NDAs and service agreements for the small-ish company I'm being contracted by. The guy I'm getting the work from wanted to know if I had a business to associate the work/payments/contract with, and when I said no he somewhat recommended it - but with no real reason.
So, should I start a business for my consultancy work? What are the advantages/disadvantages of that? Corporation, LLC, what? How much paperwork, time, and money is it to start a business? (I'm in the USA) | 2 | [
2,
378,
31,
1600,
21,
508,
26,
14,
270,
170,
13,
118,
26625,
170,
31,
589,
1017,
60,
800,
3726,
3726,
31,
22,
79,
1017,
109,
864,
2055,
11146,
170,
27,
14,
270,
16,
51,
407,
1205,
9,
2055,
19,
30,
31,
22,
79,
7702,
70,
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... |
Add a IIS host header to website programmatically
===
I would like to setup a admin page (ASP.NET/C#) that can add IIS host headers to the website that the admin page is hosted on. Is this possible? | 0 | [
2,
3547,
21,
595,
18,
2015,
157,
106,
20,
2271,
625,
6732,
1326,
800,
3726,
3726,
31,
83,
101,
20,
18161,
21,
21,
43,
2160,
2478,
13,
5,
472,
306,
9,
2328,
118,
150,
5910,
6,
30,
92,
3547,
595,
18,
2015,
157,
445,
20,
14,
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,
0,
0... |
What's the best way to copy/fill a large array with a smaller array in C#?
===
I have a large int[] array and a much smaller int[] array. I want to fill up the large array with values from the small array, by repeat copying the small array into the large array until it is full (so that large[0] = large[13] = large[26] ... = small[0] etc.). I already have a simple method:
int iSource = 0;
for (int i = 0; i < destArray.Length; i++)
{
if (iSource >= sourceArray.Length)
{
iSource = 0; // reset if at end of source
}
destArray[i] = sourceArray[iSource++];
}
But I need something more elegant, and hopefully faster. | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
4344,
118,
19971,
21,
370,
7718,
29,
21,
2012,
7718,
19,
272,
5910,
60,
800,
3726,
3726,
31,
57,
21,
370,
19,
38,
2558,
500,
7718,
17,
21,
212,
2012,
19,
38,
2558,
500,
7718,
9,
31,
259,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using LIMIT when searching by a unique field
===
Given a table structure like this:
CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`username` varchar(16) NOT NULL,
`password` char(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
);
Is there any use in using the LIMIT keyword when searching by username, or is the DB smart enough to know that there can only possibly be one result, and therefore stop searching once it's found one?
SELECT * FROM `user` WHERE `username` = 'nick';
-- vs --
SELECT * FROM `user` WHERE `username` = 'nick' LIMIT 1; | 0 | [
2,
568,
4496,
76,
5792,
34,
21,
2619,
575,
800,
3726,
3726,
504,
21,
859,
1411,
101,
48,
45,
1600,
859,
13,
1,
16704,
1,
13,
5,
13,
1,
1340,
1,
19,
38,
5,
1036,
6,
28839,
52,
16203,
3108,
1,
28461,
15,
13,
1,
7259,
1,
4033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 query a model based off the controller name
===
I've been refactoring my models and controllers in an effort to remove code duplication, and so far it seems to be all peachy creamy. Currently I've got a bit of code that is common to two of my controllers, like so:
def process_filters
# Filter hash we're going to pass to the model
filter_to_use = {}
# To process filters, we first query the model to find out what filters
# we should be looking for, as the model knows what we can filter.
Iso.available_filters.each do |filter|
# We should have our array with our filter listing.
# Check the purchase order model for a description
filter_name = filter[0][:filter_name]
# Filters are stored in a session variable, this way filters survive
# page reloads, etc. First thing we do, is set the session if new filters
# have been set for the filter.
session_name = session_filter_name( filter_name )
if params[session_name]
if params[session_name] == 'All'
session[session_name] = nil
else
session[session_name] = params[session_name]
filter_to_use[filter_name] = params[session_name]
end
elsif session[session_name]
# If params aren't read, we still need to filter based off the users
# session
filter_to_use[filter_name] = session[session_name]
end
end
# Just using this variable for now until I can refactor the helper code
# so that this is passed in.
@current_filter_values = filter_to_use
filter_to_use[:page] = @current_page
@isos = Iso.find_filtered( filter_to_use )
if @isos.out_of_bounds?
filter_to_use[:page] = session[:previous_page] = @current_page = 1
@isos = Iso.find_filtered( filter_to_use )
end
end
Now this code is exactly the same as code in another controller, except for the model reference (in this case Iso). Is there someway I can make that model reference dynamic?
Basically I'ld like to replace the Iso references (including the @iso variable) to something based off controller.controller_name or similar. | 0 | [
2,
184,
20,
25597,
21,
1061,
432,
168,
14,
9919,
204,
800,
3726,
3726,
31,
22,
195,
74,
302,
17455,
68,
51,
2761,
17,
9919,
18,
19,
40,
2150,
20,
4681,
1797,
1052,
20669,
15,
17,
86,
463,
32,
2206,
20,
44,
65,
13868,
93,
5262,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Building windows c++ libraries without a runtime?
===
I'm trying to create a c++ library for use on windows/MSVC.
My problem is that it seems that in order to link properly, I need to distribute a bunch of different versions, linked against different versions of MSVC's c++ runtimes - single and multi-threaded, debug and release, different compiler versions, various other security and other options.
I'd love to just distribute maybe two, 32 bit and 64 bit.
My idea is to maybe use a different new operator (say, mynew) and custom allocators for all my STL types. When creating the lib, /nodefaultlib. Then, when linking in from a parent project, require them to thunk mynew to new, and my stl allocator to the standard one (or one of their choosing). I guess I'd need to do delete, and a few other functions. Naturally I'd provide an example thunking implementation with the library, but this would hopefully save everyone a lot of headache.
Is this possible? Has anyone ever tried this? Is there a best practices for library creation/distribution on windows/MSVC?
| 0 | [
2,
353,
1936,
272,
20512,
8649,
366,
21,
485,
891,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
272,
20512,
1248,
26,
275,
27,
1936,
118,
79,
18,
8990,
9,
51,
1448,
25,
30,
32,
2206,
30,
19,
389,
20,
3508,
7428,
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... |
What is the best way to use the .SaveChanges() method in ADO.Net Data Services?
===
Does anyone have some good information on the usage of the .SaveChanges() method?
I am experiencing a variety of issues when attempting to use the .SaveChanges() method on my data context object. I am taking data from an existing data source, creating the appropriate EntityFramework/DataService objects, populating those created objects with data, adding those objects to the context and then saving that data by calling .SaveChanges.
The scenarios I've come up with (and the problems associated with them) are as such ... In each scenario I have a foreach loop that is taking data from rows in a DataTable and generating the objects, attaching them to the context as they go. (note: three objects a "member" and two "addresses" that are attached via a SetLink call) - basically this is a conversion tool to take data from one data store and massage it into a data store that is exposed by Data Services.
- Call .SaveChanges() without any parameters once at the end of the foreach loop (i.e. outside the loop)
- OutOfMemory error about 1/3 of the way (30,000 out of 90,000 saves) - not sure how that is happening though as each save item is a seperate SQL call to the database, what is there to run out of memory on?
- Call .SaveChanges() without any parameters once per loop
- This works, but takes absolutly forever (8 hours for 90,000 saves)
- Call .SaveChanges(SaveChangesOption.Batch) once at the end of the foreach loop
- Same OutOfMemory error, but without any saves to the database
- Call .SaveChanges(SaveChangesOption.Batch) once per loop
- 404 not found error
- Call .SaveChanges(SaveChangesOption.Batch) once per 10 loops
- 400 Bad Request error (occassionally)
- OutOfMemory after a number of itterations
- A number of random attempts to create the context once per loop, or have it as a variable at the start of the loop or have it as a private member variable that is available.
- Differing results, unable to quantify, none really that good
What is the prefered method of calling .SaveChanges() from a client object when doing a large data load like this? Is there something I'm not getting about how .SaveChanges() works? Can anyone provide more details on how once should be utilizing this function and what (if any) are the limitations to saving data via Data Services?
| 0 | [
2,
98,
25,
14,
246,
161,
20,
275,
14,
13,
9,
19863,
16229,
18,
5,
6,
2109,
19,
21,
537,
9,
2328,
1054,
687,
60,
800,
3726,
3726,
630,
1276,
57,
109,
254,
676,
27,
14,
7514,
16,
14,
13,
9,
19863,
16229,
18,
5,
6,
2109,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
robust programming techniques
===
Is there a good website, textbook, or other reference for coding practices which can help minimise errors? (No, I couldn't find an answer to this on stackoverflow, or through google searches)
I'm talking about <i>ways to structure the code</i>, rather than things like code reviews/unit testing/etc.
<b>Example</b>: Structuring an if test to place the CONST on the left of the logical expression. If the programmer accidentally types '=' rather than '==', a complation error will result:
if (CONST == variable) -> compile error if accidentally type '='
if (variable = CONST) -> not detected by complier, always evaluates to true
| 0 | [
2,
15313,
3143,
4212,
800,
3726,
3726,
25,
80,
21,
254,
2271,
15,
19059,
15,
54,
89,
2801,
26,
13,
15458,
5242,
56,
92,
448,
4236,
79,
2628,
11908,
60,
13,
5,
251,
15,
31,
711,
22,
38,
477,
40,
1623,
20,
48,
27,
7566,
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... |
XML Data Binding with Namespaces
===
I want to use data binding with an XML document to populate a simple form that shows details about a list of people. I've got it all set up and working like so right now:
<Window x:Class="DataBindingSample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1">
<Window.Resources>
<XmlDataProvider x:Key="xmlProvider" XPath="People" Source="c:\someuri.xml"/>
</Window.Resources>
<Grid>
<ListBox Name="personList" ItemsSource="{Binding Source={StaticResource xmlProvider}, XPath=Person}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding XPath=Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GroupBox Header="GroupBox" Name="groupBox1" DataContext="{Binding ElementName=personList, Path=SelectedItem}">
<Grid>
<TextBox Name="nameText" Text="{Binding XPath=Name}"/>
<ComboBox Name="genderCombo" Text="{Binding XPath=Gender}">
<ComboBoxItem>Male</ComboBoxItem>
<ComboBoxItem>Female</ComboBoxItem>
</ComboBox>
</Grid>
</GroupBox>
</Grid>
</Window>
(All position/layout elements have been removed for clarity)
Now this works great! If I provide it with some XML that matches the paths provided I get a list of names in the listbox that show both the name and gender in the appropriate fields when clicked. The problem comes when I start to try and use namespaces in my XML source. The XAML then changes to look like this:
<Window x:Class="DataBindingSample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1">
<Window.Resources>
<XmlNamespaceMappingCollection x:Key="namespaceMappings">
<XmlNamespaceMapping Uri="http://www.mynamespace.com" Prefix="mns"/>
</XmlNamespaceMappingCollection>
<XmlDataProvider x:Key="xmlProvider" XmlNamespaceManager="{StaticResource namespaceMappings}" XPath="mns:People" Source="c:\someuriwithnamespaces.xml"/>
</Window.Resources>
<Grid>
<ListBox Name="personList" ItemsSource="{Binding Source={StaticResource xmlProvider}, XPath=mns:Person}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding XPath=mns:Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GroupBox Header="GroupBox" Name="groupBox1" DataContext="{Binding ElementName=personList, Path=SelectedItem}">
<Grid>
<TextBox Name="nameText" Text="{Binding XPath=mns:Name}"/>
<ComboBox Name="genderCombo" Text="{Binding XPath=mns:Gender}">
<ComboBoxItem>Male</ComboBoxItem>
<ComboBoxItem>Female</ComboBoxItem>
</ComboBox>
</Grid>
</GroupBox>
</Grid>
</Window>
With this code (and the appropriately namespaced xml, of course) the Listbox still displays the names properly, but clicking on those names no longer updates the Name and Gender fields! My suspicion is that somehow the xml namespace is reacting adversely to the groupbox's DataContext, but I'm not sure why or how. Does anyone know how to use XML namespaces in this context? | 0 | [
2,
23504,
1054,
8728,
29,
204,
5582,
18,
800,
3726,
3726,
31,
259,
20,
275,
1054,
8728,
29,
40,
23504,
4492,
20,
1675,
12383,
21,
1935,
505,
30,
1285,
3289,
88,
21,
968,
16,
148,
9,
31,
22,
195,
330,
32,
65,
309,
71,
17,
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... |
why won't it post these results?
===
I am having trouble grabbing the values from the form once processed. I need your help.
function updateUser($table, $id) {
if($_POST) {
processUpdate($table, $id);
} else {
updateForm($table, $id);
}
}
function processUpdate($table, $id) {
print $table; //testing
print $id; //testing
$email=addslashes($HTTP_POST_VARS['email']);
$lname=addslashes($HTTP_POST_VARS['lname']);
$fname=addslashes($HTTP_POST_VARS['fname']);
print $lname;
//which table do we update
switch($table) {
case "maillist":
$result = mysql_query("UPDATE $table SET email='$email', lname='$lname', fname='$fname' WHERE id='$id'")
or die(mysql_error());
break;
}
}
The function updateForm($table, $id); just outputs the form, has email, lname, fname fields. And when you process the form, the action is the same, w/ the table and id being passed thru the url, so it GET's the id and table that way, and for lname, fname, and email, it should grab it via post.
But for some reason, it does not post the values.
| 0 | [
2,
483,
230,
22,
38,
32,
678,
158,
1736,
60,
800,
3726,
3726,
31,
589,
452,
2572,
9910,
14,
4070,
37,
14,
505,
382,
16697,
9,
31,
376,
154,
448,
9,
1990,
11100,
16704,
5,
4403,
5924,
15,
5579,
1340,
6,
13,
1,
100,
5,
4403,
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... |
Real-world examples of Scala applications?
===
Has anyone out there worked on, or know of any real-world Scala applications? There has been a lot of talk lately, and I have even gone so far as to start learning it. I'd like to know if there are any real-world indicators out there as to whether my benefit from learning scala will be purely academic, or whether this skill will be worth something on a resume in the future. | 4 | [
2,
683,
8,
4423,
3770,
16,
25975,
3767,
60,
800,
3726,
3726,
63,
1276,
70,
80,
577,
27,
15,
54,
143,
16,
186,
683,
8,
4423,
25975,
3767,
60,
80,
63,
74,
21,
865,
16,
930,
10434,
15,
17,
31,
57,
166,
1042,
86,
463,
28,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pick what unit to display a value in?
===
I have a value and I known that it's units is
meters^(mn/md) * kg^(kn/kd) * s^(sn/sd) * K^(Kn/Kd) * A^(An/Ad)
The question is how to pick how to break down the units into something more compact
for instance if
md=kd=sd=Kd=Ad=1
mn=Kn=An=0
kn=1
sn=-1
I can use N/m
I suspect that this is some subset of a discreet optimization problem. | 0 | [
2,
184,
20,
2036,
98,
1237,
20,
3042,
21,
1923,
19,
60,
800,
3726,
3726,
31,
57,
21,
1923,
17,
31,
167,
30,
32,
22,
18,
1398,
25,
4322,
1,
5,
79,
103,
118,
79,
43,
6,
1637,
2997,
1,
5,
197,
103,
118,
197,
43,
6,
1637,
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... |
NHibernate Order By question
===
Ok, so I have an nHibernate ICriteria that returns an object. I want to order by a single property but NOT asc or desc I want certain values of the propterty to come to the top of the repeater based on the selection. Like if I choose "video" I want all records with videos to come to the top.
Now, can I do this in the query? or the repeater? ICriteria?
Thanks for your help. | 0 | [
2,
12109,
15191,
8820,
389,
34,
1301,
800,
3726,
3726,
5854,
15,
86,
31,
57,
40,
12109,
15191,
8820,
31,
16063,
9605,
30,
4815,
40,
3095,
9,
31,
259,
20,
389,
34,
21,
345,
1354,
47,
52,
28,
150,
54,
1746,
150,
31,
259,
1200,
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... |
Where and how does Windows XP store wep/wpa keys?
===
Like the title says Where and How (i.e. if encrypted, with what method) does Windows Vista store WEP/WPA Keys? | 0 | [
2,
113,
17,
184,
630,
1936,
23045,
1718,
95,
306,
118,
499,
1060,
5534,
60,
800,
3726,
3726,
101,
14,
581,
898,
113,
17,
184,
13,
5,
49,
9,
62,
9,
100,
29403,
15,
29,
98,
2109,
6,
630,
1936,
13520,
1718,
95,
306,
118,
499,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Open source random number generation algorithm in C++?
===
I need to generate random numbers in the range 1 - 10000 continuously with out duplication.
Any recommendations? | 0 | [
2,
368,
1267,
5477,
234,
2782,
9083,
19,
272,
20512,
60,
800,
3726,
3726,
31,
376,
20,
7920,
5477,
2116,
19,
14,
978,
137,
13,
8,
332,
3993,
11738,
29,
70,
1052,
20669,
9,
186,
12121,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
VB.NET Strong-typed collection
===
I want to create a collection in VB.NET, but I only want it to accept objects of a certain type. For example, I want to create a class called "FooCollection" that acts like a collection in every way, but only accepts objects of type "Foo".
I thought I could do this using generics, using the following syntax:
Public Class FooCollection(Of type As Foo)
Inherits CollectionBase
...
End Class
But I get an error when I compile it that I "must implement a default accessor", so clearly there's something missing. I don't want to specify the type it accepts when I instantiate - I want the FooCollection itself to specific that it only accepts Foo objects. I've seen it done in C# with a strong-typed list, so maybe all I'm looking for is VB.NET syntax.
Thanks for your help! | 0 | [
2,
13,
20468,
9,
2328,
966,
8,
4474,
43,
1206,
800,
3726,
3726,
31,
259,
20,
1600,
21,
1206,
19,
13,
20468,
9,
2328,
15,
47,
31,
104,
259,
32,
20,
3440,
3916,
16,
21,
1200,
1001,
9,
26,
823,
15,
31,
259,
20,
1600,
21,
718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 an equivalent to Thread.sleep when dealing with Eclipse Jobs?
===
I am writing Eclipse plugins where there are quite a few running jobs.
In some cases, I want the job to "sleep" for a while at the current point of execution and continue from that spot (rather than reschedule the job and start it from scratch).
My understanding is that using Thread.sleep within Eclipse jobs is quite deprecated.
Is there an acceptable alternative to accomplishing this? | 0 | [
2,
25,
80,
40,
4602,
20,
9322,
9,
21092,
76,
5746,
29,
11652,
4844,
60,
800,
3726,
3726,
31,
589,
1174,
11652,
10922,
108,
18,
113,
80,
50,
1450,
21,
310,
946,
4844,
9,
19,
109,
1871,
15,
31,
259,
14,
1205,
20,
13,
7,
21092,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 insert emoticons in LaTeX?
===
I know it's a long shot, but is there some package or means to insert emoticons into a LaTeX document? | 0 | [
2,
184,
20,
14692,
3579,
9440,
4710,
19,
456,
396,
60,
800,
3726,
3726,
31,
143,
32,
22,
18,
21,
175,
999,
15,
47,
25,
80,
109,
6030,
54,
1108,
20,
14692,
3579,
9440,
4710,
77,
21,
456,
396,
4492,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Cross-component Communication in a View (MVC)
===
What are some best practices to orchestrate the interaction between complex components that are in your View?
I'm not talking about simple widgets like a combo box or a grid control but components that are made up of multiple widgets and that may deserve being unit tested on their own.
Would you:
1. Define abstract interfaces for each component, let the Controller hook them up via dependency injection to let them directly talk to one another via method calls? *The components are therefore aware of other components' interfaces.*
2. Define events that each component can fire and let the Controller directly hook them up via event listeners on one another? *The components therefore have event handlers attached to other components' event sinks.*
3. Define abstract interfaces for each component, define events that they can fire and let the Controller listen on all events and perform method calls on the interfaces? *The components therefore are completely agnostic towards other components.*
4. A classic application of the Observer pattern?
5. Anything else?
| 0 | [
2,
919,
8,
11103,
218,
2291,
3291,
19,
21,
1418,
13,
5,
79,
8990,
6,
800,
3726,
3726,
98,
50,
109,
246,
5242,
20,
2156,
591,
14,
7754,
128,
1502,
5090,
30,
50,
19,
154,
1418,
60,
31,
22,
79,
52,
1582,
88,
1935,
4807,
43,
306... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create the migrations for a legacy database?
===
I am currently developing a Rails application using a database that was designed before I was aware of Rails existence.
I have currently created some migrations to add some new tables and new columns to existing tables.
I would like to have the migrations to recreate the full database.
Which steps should I follow?
Should I create all the migrations by hand? | 0 | [
2,
184,
107,
31,
1600,
14,
8443,
18,
26,
21,
7780,
6018,
60,
800,
3726,
3726,
31,
589,
871,
3561,
21,
2240,
18,
3010,
568,
21,
6018,
30,
23,
1006,
115,
31,
23,
3854,
16,
2240,
18,
3012,
9,
31,
57,
871,
679,
109,
8443,
18,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you maintain your multi-language application?
===
How do you keep the spoken languages strings in your program up to date?
Is there an inexpensive way? Where can you find people to do the conversions over time? | 0 | [
2,
184,
107,
42,
4027,
154,
1889,
8,
7020,
3010,
60,
800,
3726,
3726,
184,
107,
42,
643,
14,
4050,
2556,
7887,
19,
154,
625,
71,
20,
1231,
60,
25,
80,
40,
25985,
161,
60,
113,
92,
42,
477,
148,
20,
107,
14,
6263,
18,
84,
85,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
asp.net and HTTP compression
===
What are my options when it comes to implementing page compression is asp.net.Right now I have a custom home grown httpmodule and its not very mature.
Google links me to [MbCompression][1]. The project has few views and downloads which discourages me a bit.
[1]: http://www.codeplex.com/MbCompression | 0 | [
2,
28,
306,
9,
2328,
17,
7775,
14864,
800,
3726,
3726,
98,
50,
51,
6368,
76,
32,
1624,
20,
17333,
2478,
14864,
25,
28,
306,
9,
2328,
9,
4183,
130,
31,
57,
21,
5816,
213,
3651,
7775,
19673,
62,
17,
82,
52,
253,
8615,
9,
8144,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Persisting an environment variable through ruby
===
I am trying to set my dos environment variable in ruby which persists after the script exits. For example if I want a ruby script set_abc_env.rb to set environment variable ABC to blah, I expect to have the following:
C:> echo %ABC%
C:> set_abc_env.rb
C:> echo %ABC%
blah
How do I do this? | 0 | [
2,
22084,
68,
40,
2307,
7612,
120,
10811,
800,
3726,
3726,
31,
589,
749,
20,
309,
51,
107,
18,
2307,
7612,
19,
10811,
56,
22084,
18,
75,
14,
3884,
4350,
18,
9,
26,
823,
100,
31,
259,
21,
10811,
3884,
309,
1,
21880,
1,
219,
710... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
execv() and const-ness
===
I often use the **execv()** function in C++ but if some of the arguments are in C++ strings. It annoys me that I cannot do this:
const char args[4];
args[0] = "/usr/bin/whatever";
args[1] = filename.c_str();
args[2] = someparameter.c_str();
args[3] = 0;
execv(args[0], args);
This doesn't compile because execv() takes **char *const argv[]** which is not compatible with const char * so I have to copy my std::strings to character arrays using strdup() which is a pain.
Does anyone know the reason for this ?
| 0 | [
2,
1396,
62,
12732,
5,
6,
17,
11608,
38,
8,
720,
800,
3726,
3726,
31,
478,
275,
14,
13,
1409,
1706,
62,
12732,
5,
6,
1409,
1990,
19,
272,
20512,
47,
100,
109,
16,
14,
10553,
50,
19,
272,
20512,
7887,
9,
32,
13,
28328,
18,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linq and heavy blobs
===
I have this Document table with some meta data for the document in it and also the document content as a blob.
then I use lucene.Net to query my documents; which in return gives me a list of Guids to my Document table and also two fields containing the highlighted html versions of the document name and extract with the search keywords highlighted.
then I use linq to join this result with my document table fields to get a list to show as the search result. stupid thing is linq tries to load the blob to the document although it's not used in the join.
I'm thinking of two options, neither of them I like:
- move my blob to a new table and link it 1-1 to the document table. which I don't like because the limitation in linq is forcing me to change my db structure.
- add a new dbml with a "LiteDocument" table in it and remove the blob from the document table in dbml; which I don't like because I have two places to maintain if document table has a change.
I was wondering if there is a better way to do this? here are the code snippets:
public class LuceneSearchResult
{
public Guid DocumentID { get; set; }
public string FormattedDocumentFileName { get; set; }
public string FormattedDocumentExtract { get; set; }
}
and
public IList Search(string searchPhrase, Guid? ProductId)
{
searchPhrase = PrepareSearchPhraseWithThesaurus(searchPhrase);
var result = RunLuceneQuery(searchPhrase, ProductId);
var dc = new ChinaHcpDataContext();
var docs =
from r in result
join d in dc.Documents on r.DocumentID equals d.DocumentID
select
new
{
d.DocumentID,
TradeNameEN = d.TradeProduct != null ? d.TradeProduct.TradeNameEN : "",
TradeNameZH = d.TradeProduct != null ? d.TradeProduct.TradeNameZH : "",
d.DocumentFileName,
d.InsertedDateUtc,
d.Size,
DocumentDisplayText = r.FormattedDocumentFileName,
DocumentSelectionReason = r.FormattedDocumentExtract
};
return docs.ToList();
}
| 0 | [
2,
6294,
1251,
17,
1278,
334,
10904,
18,
800,
3726,
3726,
31,
57,
48,
4492,
859,
29,
109,
7618,
1054,
26,
14,
4492,
19,
32,
17,
67,
14,
4492,
2331,
28,
21,
334,
10904,
9,
94,
31,
275,
18515,
556,
9,
2328,
20,
25597,
51,
4374,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the best way to get your new commercial software product some exposure?
===
What is the best way to get your new commercial software product some exposure? | 0 | [
2,
98,
25,
14,
246,
161,
20,
164,
154,
78,
1439,
2306,
2374,
109,
6587,
60,
800,
3726,
3726,
98,
25,
14,
246,
161,
20,
164,
154,
78,
1439,
2306,
2374,
109,
6587,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Database backup of a mysql database in VB.Net.
===
How do you create a database backup of a mysql database in VB.Net? | 0 | [
2,
6018,
10119,
16,
21,
51,
18,
22402,
6018,
19,
13,
20468,
9,
2328,
9,
800,
3726,
3726,
184,
107,
42,
1600,
21,
6018,
10119,
16,
21,
51,
18,
22402,
6018,
19,
13,
20468,
9,
2328,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Why isn't my .net-calculated MD5 hash equivalent to the hash calculated on a web site?
===
I am trying to generate equivalent MD5 hashes in both JavaScript and .Net. Not having done either, I decided to use against a third party calculation - this [web site][1] for the word "password". I will add in salts later, but at the moment, I can't get the .net version to match up with the web site's hash:
5f4dcc3b5aa765d61d8327deb882cf99
I'm guessing it is an encoding problem, but I've tried about 8 different variations of methods for calculating an MD5 hash in .Net, and none of them match what I have obtained in JavaScript (or from the web site). This [MSDN example][2] is one of the methods I have tried, which results in this hash which i have commonly received:
7c6a180b36896a0a8c02787eeafb0e4c
Bonus question: what encoding/format would be best to store hashed values in a database?
[1]: http://www.johnmaguire.us/tools/hashcalc/index.php?strtohash=password&mode=hash
[2]: http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx | 0 | [
2,
483,
2532,
22,
38,
51,
13,
9,
2328,
8,
16304,
13045,
8138,
264,
19170,
4602,
20,
14,
19170,
10785,
27,
21,
2741,
689,
60,
800,
3726,
3726,
31,
589,
749,
20,
7920,
4602,
8138,
264,
63,
438,
18,
19,
156,
8247,
8741,
17,
13,
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... |
Books to learn statistics
===
for somebody having background in math - inluding Probabilities - and COmputer Science, what are the steps to learn - or even more, to understand - Statistics? what books are good? what books cover, later, advanced topics?
Thanks | 0 | [
2,
964,
20,
2484,
5818,
800,
3726,
3726,
26,
8861,
452,
2395,
19,
5057,
13,
8,
19,
2377,
3258,
895,
969,
9168,
3808,
13,
8,
17,
1428,
762,
15,
98,
50,
14,
2382,
20,
2484,
13,
8,
54,
166,
91,
15,
20,
1369,
13,
8,
5818,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... |
Is java.util.regexp efficient enough?
===
I need to do a lot of searches of certain patterns in source files while the user is changing them, so I need to do regexp matching that is efficient in time and memory. The pattern repeats itself so should be compiled once, but I need to be able to retrieve subparts (rather than just confirm a match)
I'm considering using java.util.regexp or the Jakarta perl5util (if it still exists, been a few years since I used it), or perhaps the Eclipse search engine though I doubt that ti's smarter.
Is there any significant performance difference between the two? | 0 | [
2,
25,
8247,
9,
14255,
9,
12463,
6899,
8243,
511,
60,
800,
3726,
3726,
31,
376,
20,
107,
21,
865,
16,
19994,
16,
1200,
6282,
19,
1267,
6488,
133,
14,
4155,
25,
4226,
105,
15,
86,
31,
376,
20,
107,
7953,
6899,
10120,
30,
25,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 strip out the domain name from a URL in php (trying again)?
===
Ive asked this question before, but I discovered a problem with the top answer. Its been suggested I use parse_url() to get the domain part of any URL. The problem is, the function wont work if the url doesn't start with http://
Are there any alternatives to using the parse_url function? The only I can see, is adding http:// to the url if its not there before feeding it into the function. | 0 | [
2,
184,
107,
42,
4998,
70,
14,
4603,
204,
37,
21,
287,
6362,
19,
13,
26120,
13,
5,
5840,
68,
188,
6,
60,
800,
3726,
3726,
5568,
411,
48,
1301,
115,
15,
47,
31,
1848,
21,
1448,
29,
14,
371,
1623,
9,
82,
74,
2347,
31,
275,
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... |
JUnit and junit.framework.TestSuite - No runnable methods
===
I've made some unit tests (in test class). The tutorial I've read said that I should make a TestSuite for the unittests.
Odd is that when I'm running the unit test directly (selecting the test class - Run as jUnit test) everything is working fine, altough when I'm trying the same thing with the test suite there's always an exception: java.lang.Exception: No runnable methods.
Here is the code of the test suite:
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test suite for com.xxx.yyyy.test");
//$JUnit-BEGIN$
suite.addTestSuite(TestCase.class);
//$JUnit-END$
return suite;
}
}
Any ideas why this isn't working ? | 0 | [
2,
7446,
242,
17,
7446,
242,
9,
8361,
3783,
9,
10543,
12352,
62,
13,
8,
90,
485,
103,
579,
3195,
800,
3726,
3726,
31,
22,
195,
117,
109,
1237,
4894,
13,
5,
108,
1289,
718,
6,
9,
14,
29724,
31,
22,
195,
1302,
87,
30,
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... |
Bulding a LINQ query programatically without local variables tricking me
===
Fascinating (to me) situation..
Assume my objects are in perfect working order (i.e. TDD makes me think they work).
I have a list that I create like this (except indented properly):
var result = from v in vendors
from p in v.Products
orderby p.Name
select p;
This works - I get all products from all vendors.
Now I have a list of conditions, built up at runtime by the user. Let's apply them:
foreach (Attribute a in requiredAttributes)
{
result = result.Where(p => p.Attributes.Contains(a));
}
This may be primitive, but I thought it'd work. However, after this foreach loop is finished, when you enumerate "result" it will contain all products that has the LAST Attribute of the requiredAttributes collection in it's Attributes property (also a collection).
To me, this smells like "a" is overwritten somewhere with each trip trough the loop, and only the last one applies.
Short of somehow writing an extension method to IEnumerable<T> called ContainsAll(IEnumerable<T>) or something to that effect, how can I achieve what I want, which is basically a logical AND, giving me only those products that has ALL the required attributes?
Thanks!
| 0 | [
2,
11183,
3258,
21,
6294,
1251,
25597,
625,
721,
8438,
366,
375,
12157,
5514,
68,
55,
800,
3726,
3726,
20712,
13,
5,
262,
55,
6,
1858,
9,
9,
7158,
51,
3916,
50,
19,
2107,
638,
389,
13,
5,
49,
9,
62,
9,
15596,
43,
1364,
55,
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... |
Where is the itoa function in Linux ?
===
itoa() is a really handy function to convert a number to a string. Linux does not seem to have itoa(), is there an equivalent function or do I have to use sprintf(str, "%d", num) ? | 0 | [
2,
113,
25,
14,
32,
6941,
1990,
19,
13024,
13,
60,
800,
3726,
3726,
32,
6941,
5,
6,
25,
21,
510,
20277,
1990,
20,
8406,
21,
234,
20,
21,
3724,
9,
13024,
630,
52,
2260,
20,
57,
32,
6941,
5,
6,
15,
25,
80,
40,
4602,
1990,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can u inline a recursive function ?
===
inline int factorial(int n)
{
if(!n) return 1;
else return n*factorial(n-1);
}
As i was reading [this][1], found that the above code would lead to "infinite compilation" if not handled by compiler correctly.
How does the compiler decide whether to inline a function or not ?
[1]: http://www.amazon.com/Design-Evolution-C-Bjarne-Stroustrup/dp/0201543303/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1223616411&sr=8-1 | 0 | [
2,
92,
287,
19,
1143,
21,
302,
24244,
1990,
13,
60,
800,
3726,
3726,
19,
1143,
19,
38,
3932,
2815,
5,
6391,
13,
103,
6,
13,
1,
100,
5,
187,
103,
6,
788,
137,
73,
962,
788,
13,
103,
2483,
17455,
2815,
5,
103,
8,
165,
6,
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... |
How to acquire specific revision of a newly added file from CVS via command line?
===
One of our internally written tool is fed a cvs commit trace of the form:
Checking in src/com/package/AFile.java;
/home/cvs/src/com/package/AFile.java,v <-- Afile.java
new revision: 1.1.2.56; previous revision: 1.1.2.55
done
The tool then acquires the file from cvs by issuing a "cvs update -r 1.1.2.56" command in a working directory that already have specific branch of code checked-out.
This commands work correctly if there is an existing version of AFile.java in working directory. But when we get a trace of a file that has no version in working directory the command is not able to acquire the file.
Is there a way to do it? | 0 | [
2,
184,
20,
8942,
1903,
11323,
16,
21,
2771,
905,
3893,
37,
13,
12732,
18,
1197,
1202,
293,
60,
800,
3726,
3726,
53,
16,
318,
17739,
642,
5607,
25,
6068,
21,
13,
12732,
18,
9686,
5565,
16,
14,
505,
45,
9886,
19,
13,
18,
5453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 mysql, can you divide one alias, by another?
===
I have a multi-table query, similar to this (simplified version)
SELECT columns, count(table2.rev_id) As rev_count, sum(table2.rev_rating) As sum_rev_rating
FROM table1
LEFT JOIN table2
ON table1.dom_id = table2.rev_domain_from
WHERE dom_lastreview != 0 AND rev_status = 1
GROUP BY dom_url
ORDER BY sum_rev_rating/rev_count DESC
The problem is in the ORDER BY clause. This causes a mysql error to show, which is as follows:
> Reference 'sum_ rev_ rating' not supported (reference to group function) | 0 | [
2,
19,
51,
18,
22402,
15,
92,
42,
8918,
53,
15794,
15,
34,
226,
60,
800,
3726,
3726,
31,
57,
21,
1889,
8,
5924,
25597,
15,
835,
20,
48,
13,
5,
11268,
615,
6,
5407,
7498,
15,
2468,
5,
5924,
135,
9,
14587,
1,
1340,
6,
28,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
jqeury selector regular expressions
===
I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with the jquery selector.
I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is? | 0 | [
2,
487,
1251,
5630,
93,
23946,
1290,
13832,
800,
3726,
3726,
31,
589,
75,
13945,
27,
568,
23003,
54,
1290,
13832,
13,
5,
1270,
562,
27,
14,
5340,
20513,
6,
29,
14,
487,
8190,
93,
23946,
9,
31,
57,
292,
26,
48,
992,
47,
57,
74,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best Role-Based Access Control (RBAC) database model
===
What is the best database schema to track role-based access controls for a web application?
I am using Rails, but the RBAC plugin linked by Google looks unmaintained (only 300 commits to SVN; latest was almost a year ago).
The concept is simple enough to implement from scratch, yet complex and important enough that it's worth getting right.
So how do others architect and implement their RBAC model? | 0 | [
2,
246,
597,
8,
1281,
1381,
569,
13,
5,
7549,
1738,
6,
6018,
1061,
800,
3726,
3726,
98,
25,
14,
246,
6018,
23874,
20,
792,
597,
8,
1281,
1381,
8671,
26,
21,
2741,
3010,
60,
31,
589,
568,
2240,
18,
15,
47,
14,
13,
7549,
1738,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 testing, formatting all strings with XXXXX
===
We are try to look at optimizing our localization testing.
Our QA group had a suggestion of a special mode to force all strings from the resources to be entirely contained of X. We already API hijack LoadString, and the MFC implementation of it, so doing it should not be a major hurdle.
My question is how would you solve the formatting issues?
Examples -
CString str ;
str . LoadString ( IDS_MYSTRING ) ;
where IDS_MYSTRING is "Hello World", should return "XXXXX XXXXX"
where IDS_MYSTRING is "Hello\nWorld", should return "XXXXX\nXXXXX"
where IDS_MYSTRING is "Hello%dWorld", should return "XXXXX%dXXXXX"
where IDS_MYSTRING is "Hello%.2fWorld", should return "XXXXX%.2fXXXXX"
where IDS_MYSTRING is "Hello%%World", should return "XXXXX%%XXXXX"
So in summary the string should work if used in a printf or Format statement, it should honor escape characters.
So this is a pure code questions, C++/MFC,
CString ConvertStringToXXXX ( const CString& aSource )
{
CString lResult = aSource ;
// Insert your code here
return lResult ;
}
I know this could be done using tools on the .RC files, but we want to build English, then run like so -
application -L10NTEST | 0 | [
2,
375,
1829,
4431,
15,
2595,
1203,
65,
7887,
29,
13,
8962,
13290,
800,
3726,
3726,
95,
50,
1131,
20,
361,
35,
19259,
3335,
318,
375,
1829,
4431,
9,
318,
7234,
214,
41,
21,
10910,
16,
21,
621,
3740,
20,
558,
65,
7887,
37,
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... |
Searching byte[]
===
Searching for a string within a string is extremely well supported in .NET but what do you do when the data you need to search isn't a string?
I have binary data arriving in regular chunks via a NetworkStream. Packets are binary but they all start with a signature sequence of bytes. I accumulate the chunks into a larger buffer and look for the start-of-packet signature.
What I'm really looking for is the `byte[]` equivalent to the `String.IndexOf(ss)` method. I have a nasty feeling I'm going to have to implement this myself with a loop and a state machine.
Any suggestions? Over to you! | 0 | [
2,
5792,
34,
591,
2558,
500,
800,
3726,
3726,
5792,
26,
21,
3724,
363,
21,
3724,
25,
3898,
134,
1827,
19,
13,
9,
2328,
47,
98,
107,
42,
107,
76,
14,
1054,
42,
376,
20,
2122,
2532,
22,
38,
21,
3724,
60,
31,
57,
14171,
1054,
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... |
Installing ASP.Net 2.0 after IIS
===
I just got a dedicated server from a hosting company, and for some reason, it didn't have IIS installed.
It did have .Net 2.0, though.
So I installed IIS, but now my ASP.net websites won't work.
I just get a 404, no event log entries, nothing...
I noticed in the redistributable package information that:
"To access the features of ASP.NET, IIS with the latest security updates must be installed prior to installing the .NET Framework"
I also can't uninstall .Net, it just won't let me...
Is there a way to reinstall .Net 2.0, or somehow do whatever it is it does to IIS to make it work?
Thanks!
Daniel | 0 | [
2,
25429,
28,
306,
9,
2328,
172,
9,
387,
75,
595,
18,
800,
3726,
3726,
31,
114,
330,
21,
2360,
8128,
37,
21,
10637,
237,
15,
17,
26,
109,
1215,
15,
32,
223,
22,
38,
57,
595,
18,
4066,
9,
32,
144,
57,
13,
9,
2328,
172,
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... |
PHPUnit - Unit Testing with items that need to send headers
===
I'm currently working with PHPUnit to try and develop tests alongside what I'm writing, however, I'm currently working on writing the Session Manager, and am having issues doing so...
The constructor for the Session handling class is
private function __construct()
{
if (!headers_sent())
{
session_start();
self::$session_id = session_id();
}
}
However, as PHPUnit sends out text before it starts the testing, any testing on this Object returns a failed test, as the HTTP "Headers" have been sent... | 0 | [
2,
13,
26120,
15464,
13,
8,
1237,
4431,
29,
3755,
30,
376,
20,
2660,
157,
445,
800,
3726,
3726,
31,
22,
79,
871,
638,
29,
13,
26120,
15464,
20,
1131,
17,
2803,
4894,
2387,
98,
31,
22,
79,
1174,
15,
207,
15,
31,
22,
79,
871,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to revoke individual code ownership
===
Reading this [another question][1], I wondered me about this opposite.
I was in a project mainly driven by only one guru developer. Then, me and another three people were added to the project. But the time went on and for every feature needed, its implementation required constantly intervention of him because we were not very knowledgeable on the system. Besides, the architecture and design of the system lacked of clarity and I would say (very confident) there were areas where they became pretty convoluted, really.
Assuming enough competent people, how to handle the case where only one guru knows everything about the design and implementation of one relatively complex project?
[1]: http://stackoverflow.com/questions/190090/how-to-revoke-collective-code-ownership | 0 | [
2,
184,
20,
3867,
8416,
1359,
1797,
5074,
800,
3726,
3726,
1876,
48,
636,
14945,
1301,
500,
2558,
165,
500,
15,
31,
3519,
55,
88,
48,
2794,
9,
31,
23,
19,
21,
669,
2011,
5355,
34,
104,
53,
10334,
10058,
9,
94,
15,
55,
17,
226,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
PHPUnit - Testing abstract Classes
===
How do I test an abstract class works in PHPUnit?
I'd expect that I'd have to create some sort of object as part of the test? though - I've no idea the best practice for this, or if phpunit allows for this | 0 | [
2,
13,
26120,
15464,
13,
8,
4431,
8502,
2684,
800,
3726,
3726,
184,
107,
31,
1289,
40,
8502,
718,
693,
19,
13,
26120,
15464,
60,
31,
22,
43,
4186,
30,
31,
22,
43,
57,
20,
1600,
109,
2058,
16,
3095,
28,
141,
16,
14,
1289,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you effectively model inheritance in a database?
===
What are the best practices for modeling inheritance in databases?
What are the trade-offs (e.g. queriability)?
What ways could you put your database "on rails" on use "convention over configuration" for inheritance?
(I'm most interested in SQL Server and .NET, but I also want to understand how other platforms address this issue.) | 0 | [
2,
184,
107,
42,
5463,
1061,
13852,
19,
21,
6018,
60,
800,
3726,
3726,
98,
50,
14,
246,
5242,
26,
12807,
13852,
19,
6018,
18,
60,
98,
50,
14,
1238,
8,
13328,
13,
5,
62,
9,
263,
9,
13,
8190,
49,
4091,
6,
60,
98,
2847,
110,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 determine the file size from an attachment to a POP3 message
===
I'm writing a program to read from a POP3 mailbox and upload the email message into my ticketing system. I would like to then take the attachments and upload them as well. I've got all the information I need except the file size.
Is there a way to determine the file size from the mail message? I am taking the attachment, decoding the base64 encoded string and breaking it into a byte array to store in database. If there is another way to determine the file size, I'm willing to try that too.
I'm working in C# and .NET 3.5.
Thanks!!! | 0 | [
2,
184,
20,
3746,
14,
3893,
1072,
37,
40,
14575,
20,
21,
1675,
240,
2802,
800,
3726,
3726,
31,
22,
79,
1174,
21,
625,
20,
1302,
37,
21,
1675,
240,
4216,
5309,
17,
71,
8294,
14,
8517,
2802,
77,
51,
6133,
68,
329,
9,
31,
83,
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... |
C++ : Finding out decorated names
===
How can I find out the decorated name that will be asigned to each method name ? I'm trying to find out what the decorated name is , so that I may export it , in a DLL . | 0 | [
2,
272,
20512,
13,
45,
3007,
70,
6933,
1817,
800,
3726,
3726,
184,
92,
31,
477,
70,
14,
6933,
204,
30,
129,
44,
21,
13472,
20,
206,
2109,
204,
13,
60,
31,
22,
79,
749,
20,
477,
70,
98,
14,
6933,
204,
25,
13,
15,
86,
30,
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,
0,
0,
0... |
Video API For Building Video-Conference App
===
I'm going to be building an application within the next six months that will be functioning as a 2-way video-conferencing system, as well as sharing some other data back and forth. I'll probably be using some sort of relatively expensive USB webcam, and am aware of the USB Video Class Device standard, which seems to the way to go.
Now, what can I use to program against that (or some other direction)? OS is not that important as it is not decided (will choose to fit overall needs), nor is language. Network will be VPN, worst case 256kbps symmetrical. Ideally it would handle encoding and compression too, but basically I'm just looking for some sort of starting point to begin research (have just found TAPI and H.323 so far, not sure of best way to program them). | 0 | [
2,
763,
21,
2159,
26,
353,
763,
8,
23670,
4865,
800,
3726,
3726,
31,
22,
79,
228,
20,
44,
353,
40,
3010,
363,
14,
328,
490,
818,
30,
129,
44,
14175,
28,
21,
172,
8,
1443,
763,
8,
14093,
16695,
6302,
329,
15,
28,
134,
28,
612... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Blurry fonts problem
===
Problem is described and demonstrated on the following links:
[Paul Stovell WPF: Blurry Text Rendering ][1]
[www.gamedev.net forum][2]
I would like to collect all possible solutions for this problem. Microsoft Expression Blend uses WPF but fonts look readable.
One solution maybe to always use dark background. Are there any more solutions?
[1]: http://www.paulstovell.com/blog/wpf-why-is-my-text-so-blurry
[2]: http://www.gamedev.net/community/forums/topic.asp?topic_id=445078 | 0 | [
2,
619,
7721,
10330,
622,
9978,
18,
1448,
800,
3726,
3726,
1448,
25,
745,
17,
6861,
27,
14,
249,
6271,
45,
636,
9606,
15426,
211,
619,
7721,
45,
10330,
622,
1854,
15307,
13,
500,
2558,
165,
500,
636,
6483,
9,
5128,
14438,
9,
2328,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Explicit multi-core C# applications
===
Is there any *easy* way to explicitly make an already threaded application utilise a multicore environment? (if avaliable).
The first problem would be how do I determine if my runtime environment supports multi-core applications?
If I then determine that I can use multi core functionality, can I explicitly assign threads to run on different cores? If so Is the thread communication handled by the OS/Hardware or do I have to get my hands dirty? | 0 | [
2,
14990,
1889,
8,
10375,
272,
5910,
3767,
800,
3726,
3726,
25,
80,
186,
1637,
18385,
2483,
161,
20,
13108,
233,
40,
614,
9322,
69,
3010,
13,
14255,
2628,
21,
1889,
10375,
2307,
60,
13,
5,
821,
21,
18506,
579,
6,
9,
14,
64,
1448... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Windows swapping redundantly?
===
This may not be strictly programming related but more OS-structure related.
Running Vista 32 bit on a brand new laptop with 3GB of memory, Running idle the system consumes about 40% of its memory. Other then the fact that this is outrageous on its own right, the OS **should be able to fit all of the processes nicely into memory** and not need to swap to disk EVER.
Yet looking at the task manager I see processes having page faults all the time. Not many but still. for instance explorer.exe has one every second approximately.
Why is that? Why does the OS feel the need to swap out pages although it has plenty of physical memory? | 0 | [
2,
1936,
10143,
5574,
24295,
102,
60,
800,
3726,
3726,
48,
123,
52,
44,
10369,
3143,
1597,
47,
91,
13,
759,
8,
13971,
1597,
9,
946,
13520,
2512,
1142,
27,
21,
2209,
78,
12294,
29,
203,
11400,
16,
1912,
15,
946,
18652,
14,
329,
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... |
Getting the string representation of a type at runtime in Scala
===
In Scala, is it possible to get the string representation of a type at runtime? I am trying to do something along these lines:
def printTheNameOfThisType[T]() = {
println(T.toString)
} | 0 | [
2,
1017,
14,
3724,
5442,
16,
21,
1001,
35,
485,
891,
19,
25975,
800,
3726,
3726,
19,
25975,
15,
25,
32,
938,
20,
164,
14,
3724,
5442,
16,
21,
1001,
35,
485,
891,
60,
31,
589,
749,
20,
107,
301,
303,
158,
1560,
45,
6312,
4793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Object.hashCode() portable across VMs, JDKs and OSs?
===
An interesting issue came up recently. We came across some code that is using hashCode() as a salt source for MD5 encryption but this begs the question: will hashCode() return the same value for the same object on different VMs, different JDK versions and operating systems? Even if its not guaranteed, has it changed at any point up til now? | 0 | [
2,
25,
3095,
9,
25436,
9375,
5,
6,
13469,
464,
13,
20147,
18,
15,
487,
43,
4020,
17,
19504,
60,
800,
3726,
3726,
40,
4883,
1513,
281,
71,
1989,
9,
95,
281,
464,
109,
1797,
30,
25,
568,
19170,
9375,
5,
6,
28,
21,
2693,
1267,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding more than 1 piece of data to a single node in a linked-list?
===
I am trying to store more than 1 piece of information in a single node in my linked-list. All of the examples in my textbook seem to illustrate adding only 1 piece of data per node. I'm assuming it is possible to add more?
For example, using the Collections API to store an integer I would do the following:
LinkedList <Integer>linky = new LinkedList<Integer>();
int num1 = 2, num2 = 22, num3 = 25, num4 = 1337;
linky.add(num1);
How would I go about adding num2, num3, and num4 to the same first element in the list? Thanks guys. | 0 | [
2,
4721,
91,
119,
137,
1855,
16,
1054,
20,
21,
345,
15421,
19,
21,
4727,
8,
5739,
60,
800,
3726,
3726,
31,
589,
749,
20,
1718,
91,
119,
137,
1855,
16,
676,
19,
21,
345,
15421,
19,
51,
4727,
8,
5739,
9,
65,
16,
14,
3770,
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 to manipulate images at pixel level in C#?
===
How to manipulate images at pixel level in C#?
I need to be able to read/modify each bitmap pixel RGB values separately.
Code sample appreciated.
Thanks in advance! | 0 | [
2,
184,
20,
18468,
3502,
35,
18146,
662,
19,
272,
5910,
60,
800,
3726,
3726,
184,
20,
18468,
3502,
35,
18146,
662,
19,
272,
5910,
60,
31,
376,
20,
44,
777,
20,
1302,
118,
13670,
8612,
206,
1142,
15022,
18146,
761,
11400,
4070,
107... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Adding HTML entities using CSS content
===
How do you use the CSS `content` property to add html entities?
I have a number of links which I make into a breadcrumb style list by adding an arrow before each.
<div class="breadcrumbs">
<a>One</a>
<a>Two</a>
<a>Three</a>
</div>
Which has the following style applied to it:
.breadcrumbs a:before {
content: '> ';
}
The problem is that when the breadcrumb list gets long and wraps to the next line, the arrow is left on the preceding line. The obvious solution is to change the space into a non-breaking space, but this doesn't work:
.breadcrumbs a:before {
content: '>& nbsp;'; /* but without that space (markdown doesn't like it) */
}
It actually outputs ` ` onto the screen. I've got around this with other strange characters (like ») by pasting the character in directly, but how do you paste a ` ` ? | 0 | [
2,
4721,
13,
15895,
12549,
568,
272,
18,
18,
2331,
800,
3726,
3726,
184,
107,
42,
275,
14,
272,
18,
18,
13,
1,
25424,
1,
1354,
20,
3547,
13,
15895,
12549,
60,
31,
57,
21,
234,
16,
6271,
56,
31,
233,
77,
21,
5988,
25241,
220,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 get Emacs style key bindings in Visual Studio?
===
Settings? Plug-ins? | 0 | [
2,
184,
92,
31,
164,
13,
62,
6893,
18,
1034,
1246,
8728,
18,
19,
3458,
1120,
60,
800,
3726,
3726,
12410,
60,
10922,
8,
108,
18,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
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,
0,
0,
0,
0,
0... |
Is git-svn dcommit after merging in git dangerous?
===
My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says:
"Running git-merge or git-pull is NOT recommended on a branch you plan to dcommit from. Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you've made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch."
Does this mean I cannot create a local branch from svn/trunk (or a branch), hack away, merge back into svn/trunk, then dcommit? I understand that svn users will see the same mess that merges in svn pre 1.5.x have always been, but are there any other drawbacks? That last sentence worries me, too. Do people routinely do these kinds of things? | 0 | [
2,
25,
13,
10404,
8,
18,
16578,
13,
43,
960,
5130,
75,
18842,
19,
13,
10404,
3342,
60,
800,
3726,
3726,
51,
11933,
26,
749,
70,
13,
10404,
8,
18,
16578,
25,
14,
2150,
923,
18842,
17,
1686,
68,
9,
94,
31,
2711,
30,
169,
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... |
How Can I test my web site for SQL injection attacks?
===
What automated tools are there? | 0 | [
2,
184,
92,
31,
1289,
51,
2741,
689,
26,
4444,
255,
13646,
3080,
60,
800,
3726,
3726,
98,
14904,
4672,
50,
80,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Specify parts of the header that have to be signed and/or encrypted in WCF with binding that support standards
===
Using Ws2007HttpBinding and securing the service, the WSDL file generated shows in the policy section that all the ws-addressing headers and the body will be signed, and that the body will be encrypted.
<sp:SignedParts>
<sp:Body />
<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
</sp:SignedParts>
<sp:EncryptedParts>
<sp:Body />
</sp:EncryptedParts>
We would like to specify which headers have to be signed and/or encrypted, like it is possible in Apache rampart. For custom header or body elements, it is possible using annotations in the code, but for these elements that are added by the binding itself, is is possible? | 0 | [
2,
19077,
1341,
16,
14,
157,
106,
30,
57,
20,
44,
908,
17,
118,
248,
29403,
19,
11801,
410,
29,
8728,
30,
555,
3364,
800,
3726,
3726,
568,
619,
18,
2727,
21127,
22260,
17,
13498,
14,
365,
15,
14,
619,
18,
8643,
3893,
6756,
1285,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Perl: HTML Scraping from an Authenticated website
===
While HTML Scraping is pretty well-documented from what I can see, and I understand the concept and implementation of it, what is the best method for scraping from content that is tucked away behind authentication forms. I refer to scraping from content that I legitimately have access to, so a method for automatically submitting login data is what I'm looking for.
All I can think of is setting up a proxy, capturing the throughput from a manual login, then setting up a script to spoof that throughput as part of the HTML scraping execution. As far as language goes, it would likely be done in Perl.
Has anyone had experience with this, or just a general thought?
**Edit**
This has been [answered before][1] but with .NET. While it validates how I think it should be done, does anyone have Perl script to do this?
[1]: http://stackoverflow.com/questions/61217/getting-html-from-a-page-behind-a-login | 0 | [
2,
416,
255,
45,
13,
15895,
25611,
37,
40,
14351,
1669,
2271,
800,
3726,
3726,
133,
13,
15895,
25611,
25,
1772,
134,
8,
28132,
69,
37,
98,
31,
92,
196,
15,
17,
31,
1369,
14,
2420,
17,
6123,
16,
32,
15,
98,
25,
14,
246,
2109,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 store multiple values in a perl hash table.
===
Up until recently, I've been storing multiple values into different hashes with the same keys as follows:
%boss = (
"Allan" => "George",
"Bob" => "George",
"George" => "lisa" );
%status = (
"Allan" => "Contractor",
"Bob" => "Part-time",
"George" => "Full-time" );
and then I can reference `$boss("Bob")` and `$status("Bob")` but this gets unwieldy if there's a lot of properties each key can have and I have to worry about keeping the hashes in sync.
Is there a better way for storing multiple values in a hash? I could store the values as
"Bob" => "George:Part-time"
and then disassemble the strings with split, but there must be a more elegant way.
| 0 | [
2,
184,
92,
31,
1718,
1886,
4070,
19,
21,
416,
255,
19170,
859,
9,
800,
3726,
3726,
71,
163,
1989,
15,
31,
22,
195,
74,
25615,
1886,
4070,
77,
421,
63,
438,
18,
29,
14,
205,
5534,
28,
2415,
45,
13,
11881,
10349,
18,
800,
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... |
Restore SVN backups from multiple files.
===
I have a very large (~6GB) SVN repository, for which I've written a batch file script to do an incremental backup each day. The script checks when the last backup was run and dumps only the revisions since then.
The files are named: `backup-{lower_revision}-{higher_revision}.svn` eg: `backup-156-162.svn`, `backup-163-170.svn`.
This means that I have quite a lot of small dump files, which I guess is fine (better than a lot of 6GB dump files), but I'm a little bit worried about how much work it would be to restore from these backups should I need to.
To reduce the total number of files, I've taken to doing a full dump on the first of each month, but still, should I need to restore on the 30th, that's gonna be 30 dump files which could take a while.
What I have been considering is:
- Manual:
`svnadmin load c:\myRepo < backup-1-10.svn`
*wait*
`svnadmin load c:\myRepo < backup-11-24.svn`
*wait*
etc...
- Batch file to make the above process a bit less tedious
- Appending each of the files together and doing one load (if that is even possible?)
What would be the best way to work with these files, should I need to restore?
*ps: the OS is Windows* | 0 | [
2,
8454,
13,
18,
16578,
10119,
18,
37,
1886,
6488,
9,
800,
3726,
3726,
31,
57,
21,
253,
370,
13,
5,
1,
379,
11400,
6,
13,
18,
16578,
24869,
15,
26,
56,
31,
22,
195,
642,
21,
13064,
3893,
3884,
20,
107,
40,
29977,
10119,
206,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 your favorite hot-key in Netbeans?
===
Following the topic http://stackoverflow.com/questions/98220/what-is-your-favorite-hot-key-in-eclipse , what is your favorite hot-keys in Netbeans? | 0 | [
2,
98,
25,
154,
3839,
1047,
8,
4237,
19,
4275,
863,
5950,
60,
800,
3726,
3726,
249,
14,
8303,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3804,
18411,
118,
608,
8,
403,
8,
4314,
8,
1473,
5771,
2119,
8,
7010,
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... |
A simple, medium secure,login protocol??
===
I asked [here][1] about a protocol that I was asked to implement, and how secure it was. Since it seemed clear from the very beginning that it was shit. Being so I ask:
Can you guys point me to some very simple login protocol (I am null at cryptography systems)?? I am developing both server and client side of the application and I have my own messengering system, so I have enough freedom.
Only 2 special characteristics for your suggestions.
1.- Simple: the network this application is going to run over is not specially insecure and I only want to avoid the sending of the password in plain text
2.- If possible, not a too long interchange of messages. The shorter, the better.
Thanks in advance, as always
[1]: http://stackoverflow.com/questions/188043/security-crytography-stupid-challege-response-protocol | 0 | [
2,
21,
1935,
15,
4152,
4315,
15,
5567,
108,
8494,
60,
60,
800,
3726,
3726,
31,
411,
636,
6836,
500,
2558,
165,
500,
88,
21,
8494,
30,
31,
23,
411,
20,
8713,
15,
17,
184,
4315,
32,
23,
9,
179,
32,
890,
1207,
37,
14,
253,
997,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 much of an operating system could be written in, say, Python?
===
This is a pretty-much theoretical question, but..
**How much of an operating system could be written in a language like Python, Ruby, Perl, or Lisp, Haskell etc?**
It seems like a lot of the stuff like init.d could trivially be done in a scripting language. I think one of the firewall-device-OS's (pfSense, perhaps?) uses PHP for its system-configuration (including on boot). And one could argue that "emacs is an OS, mostly written in Lisp"..
Of course there are bits that would have to be assembly/C, but how much could be regular .py/rb/.pl/.el/.hk files..? It might not have the best performance, but it would be, by far, the most easiest-to-modify OS ever... | 4 | [
2,
184,
212,
16,
40,
2455,
329,
110,
44,
642,
19,
15,
395,
15,
20059,
60,
800,
3726,
3726,
48,
25,
21,
1772,
8,
18422,
9482,
1301,
15,
47,
9,
9,
13,
1409,
1544,
212,
16,
40,
2455,
329,
110,
44,
642,
19,
21,
816,
101,
20059,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 CDialog from Java using JNI
===
I have an application that needs to open a CDialog written inside a DLL. The problem is that when DoModal() is called inside the DLL, the program crashes with: "Debug Assertion Failed!". Does anyone have any idea how can i get the CDialog opened? Thank you! | 0 | [
2,
368,
1745,
549,
5567,
37,
8247,
568,
487,
889,
800,
3726,
3726,
31,
57,
40,
3010,
30,
2274,
20,
368,
21,
1745,
549,
5567,
642,
572,
21,
13,
43,
211,
9,
14,
1448,
25,
30,
76,
107,
20756,
5,
6,
25,
227,
572,
14,
13,
43,
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... |
Is there a way to write a group by query in LinqToSql grouping not on a scalar value?
===
I have those maps in my repository.
public IQueryable<AwType> GetAwTypes()
{
return from awt in _db.AwTypes
select new AwType
{
Id = awt.Id,
Header = awt.Header,
Description = awt.Description
};
}
public IQueryable<Aw> GetAws()
{
return from aw in _db.Aws
select new Aw
{
Id = aw.Id,
Bw = (from bw in GetBws()
where bw.Id == aw.Bw
select bw
).SingleOrDefault(),
AwType = (from awt in GetAwTypes()
where awt.Id == awAwType
select awt
).SingleOrDefault(),
AwAttribute = aw.AwAttribute
};
}
In service I want to get count of Bws grouped by AwType as `List<KeyValuePair<AwType, int>>`.
When I call that linq query :
var awGroups = from aw in _repository.GetAws()
group aw by aw.AwType into newGroup
select newGroup;
List<KeyValuePair<AwType, int>> RetGroups = new List<KeyValuePair<AwType, int>>();
foreach (var group in awGroups)
{
RetGroups.Add(new KeyValuePair<AwType, int>(group.Key, group.Count()));
}
return RetGroups;
I get an error that is saying I can't group by on an object I have to group by a scalar value like aw.AwType.Id.
Is there a way to get "AwType, int" pairs in one call? | 0 | [
2,
25,
80,
21,
161,
20,
2757,
21,
214,
34,
25597,
19,
6294,
1251,
262,
18,
22402,
19288,
52,
27,
21,
28960,
1923,
60,
800,
3726,
3726,
31,
57,
273,
6867,
19,
51,
24869,
9,
317,
13,
5312,
622,
579,
1,
3885,
4474,
1,
164,
3885,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_lisp + clisp
===
How to to configure apache + mod_lisp + clisp and set up a "Hello World!"? I couldn't find any complete howto on the subject. Thanks. | 0 | [
2,
17140,
2754,
7226,
1,
3159,
306,
2754,
19391,
3401,
800,
3726,
3726,
184,
20,
20,
1065,
15951,
17140,
2754,
7226,
1,
3159,
306,
2754,
19391,
3401,
17,
309,
71,
21,
13,
7,
11515,
126,
187,
7,
60,
31,
711,
22,
38,
477,
186,
127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Add Custom Controls to MoviePlayer
===
I am trying to figure out how to add a custom control to the iPhone MoviePlayer.
For an example of what I am trying to do see the following image.
![alt text][1]
[1]: http://www.maclife.com/files/u53/06_player.jpg
I am trying to add something like the controls on the right and left of the basic movie controls.
I had done this in the Open SDK by adding a subclass to the playerview, but now in the official SDK and Apple moving to MPMoviePlayerController I am not sure how to do it.
Also with my old 1.x firmware way it required me to capture touch events and hide/show the control myself. I am hoping there is a way that would do this with the standard controls, but if not, that is fine.
Thanks in advance. | 0 | [
2,
3547,
5816,
8671,
20,
1308,
14049,
800,
3726,
3726,
31,
589,
749,
20,
1465,
70,
184,
20,
3547,
21,
5816,
569,
20,
14,
21024,
1308,
14049,
9,
26,
40,
823,
16,
98,
31,
589,
749,
20,
107,
196,
14,
249,
1961,
9,
13,
187,
2558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 stream of header/footer in a WordprocessingDocument
===
I need to know how I get the stream of the headers and footers of a WordprocessingDocument. I get the MainDocument by the MainDocumentPart of a WordprocessingDocument. Do you know how I get the header? I tried to use the method GetPartsOfType<HeaderPart> but it returned null.
Greets
Sebastian | 0 | [
2,
184,
107,
31,
164,
14,
3766,
16,
157,
106,
118,
3670,
106,
19,
21,
833,
16835,
68,
28132,
800,
3726,
3726,
31,
376,
20,
143,
184,
31,
164,
14,
3766,
16,
14,
157,
445,
17,
1749,
445,
16,
21,
833,
16835,
68,
28132,
9,
31,
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... |
XML Text Format
===
Does anyone know of a good program where I can paste in xml (getting it from a System.out in my java class) and it will format the xml so it's not a really long line of text? | 0 | [
2,
23504,
1854,
2595,
800,
3726,
3726,
630,
1276,
143,
16,
21,
254,
625,
113,
31,
92,
640,
62,
19,
23504,
13,
5,
27380,
32,
37,
21,
329,
9,
1320,
19,
51,
8247,
718,
6,
17,
32,
129,
2595,
14,
23504,
86,
32,
22,
18,
52,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How do I use or resolve issues with visual form inheritance in Delphi?
===
I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):
1. In the .pas file of a form, I would change the form to inherit from some other form, but it wouldn't get the components from the ancestor form.
2. For certain descendant forms, I would get the following error message when opening the form at design time: "Error creating form: Ancestor for 'TAncestorForm' not found." I would have to first manually open the ancestor form, and then I could open the descendant form. | 0 | [
2,
184,
107,
31,
275,
54,
9854,
1549,
29,
3458,
505,
13852,
19,
23030,
60,
800,
3726,
3726,
31,
22,
195,
74,
638,
27,
21,
669,
19,
23030,
453,
113,
31,
417,
20,
57,
1997,
17569,
5090,
37,
89,
1997,
9,
31,
23,
777,
20,
164,
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... |
Getting all direct Reports from Active Directory
===
I'm trying to get all the direct reports of a User through Active Directory, recursively.
So given a user, i will end up with a list of all users who have this person as manager or who have a person as manager who has a person as manager ... who eventually has the input user as manager.
My current attempt is rather slow:
private static Collection<string> GetDirectReportsInternal(string userDN, out long elapsedTime)
{
Collection<string> result = new Collection<string>();
Collection<string> reports = new Collection<string>();
Stopwatch sw = new Stopwatch();
sw.Start();
long allSubElapsed = 0;
string principalname = string.Empty;
using (DirectoryEntry directoryEntry = new DirectoryEntry(string.Format("LDAP://{0}",userDN)))
{
using (DirectorySearcher ds = new DirectorySearcher(directoryEntry))
{
ds.SearchScope = SearchScope.Subtree;
ds.PropertiesToLoad.Clear();
ds.PropertiesToLoad.Add("directReports");
ds.PropertiesToLoad.Add("userPrincipalName");
ds.PageSize = 10;
ds.ServerPageTimeLimit = TimeSpan.FromSeconds(2);
SearchResult sr = ds.FindOne();
if (sr != null)
{
principalname = (string)sr.Properties["userPrincipalName"][0];
foreach (string s in sr.Properties["directReports"])
{
reports.Add(s);
}
}
}
}
if (!string.IsNullOrEmpty(principalname))
{
result.Add(principalname);
}
foreach (string s in reports)
{
long subElapsed = 0;
Collection<string> subResult = GetDirectReportsInternal(s, out subElapsed);
allSubElapsed += subElapsed;
foreach (string s2 in subResult)
{
result.Add(s2);
}
}
sw.Stop();
elapsedTime = sw.ElapsedMilliseconds + allSubElapsed;
return result;
}
Essentially, this function takes a distinguished Name as input (CN=Michael Stum, OU=test, DC=sub, DC=domain, DC=com), and with that, the call to ds.FindOne() is slow.
I found that it is a lot faster to search for the userPrincipalName. My Problem: sr.Properties["directReports"] is just a list of strings, and that is the distinguishedName, which seems slow to search for.
I wonder, is there a fast way to convert between distinguishedName and userPrincipalName? Or is there a faster way to search for a user if I only have the distinguishedName to work with? | 0 | [
2,
1017,
65,
1744,
2813,
37,
1348,
16755,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
65,
14,
1744,
2813,
16,
21,
4155,
120,
1348,
16755,
15,
302,
24244,
102,
9,
86,
504,
21,
4155,
15,
31,
129,
241,
71,
29,
21,
968,
16,
65,
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... |
Mapping computed properties in Linq-to-SQL to actuall SQL statements
===
I have created some extra functionality on my Linq-to-SQL classes to make things easier as I develop my applications. For example I have defined a property that retrieves active contracts from a list of contracts. However if I try to use this property in a lambda expression or in general in a query it either throws an exception that there is no SQL statement matching that property or it generates one query per item (= a lot of roundtrips to the server).
The queries themselves are not overly complex f.ex:
var activeContracts = customer.Contracts.Where(w => w.ContractEndDate == null);
Whereas I would like it to read as:
var activeContracts = customer.ActiveContracts;
The main reason for me doing this is because it will minimize logical errors on my part and if I in the future want to change what defines an active contract I don't have to redo a lot of code.
Is there a way to specify on a property what SQL it should genereate. Or is there a way to make sure it is usable in a query like below?
var singleContractCustomers = db.Customers.Where(w => w.ActiveContracts.Count() == 1); | 0 | [
2,
13305,
26331,
3704,
19,
6294,
1251,
8,
262,
8,
18,
22402,
20,
3463,
255,
4444,
255,
9015,
800,
3726,
3726,
31,
57,
679,
109,
2230,
18548,
27,
51,
6294,
1251,
8,
262,
8,
18,
22402,
2684,
20,
233,
564,
4950,
28,
31,
2803,
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... |
Hobbit monitoring - multiple graphs per test?
===
I'm not sure how familiar people are with the hobbit monitoring system - http://hobbitmon.sourceforge.net/ - but I've got a tricky question.
I've got a custom test, which returns two NCV values. One value normally returns ~300 milliseconds, the other one returns 500 000 euro. Obviously, these two values don't graph very well together. :)
Question is, can hobbit display two graphs for this one test? If so, how do I do it?
Thanks. | 0 | [
2,
13908,
3326,
8984,
13,
8,
1886,
7210,
18,
416,
1289,
60,
800,
3726,
3726,
31,
22,
79,
52,
562,
184,
3694,
148,
50,
29,
14,
13908,
3326,
8984,
329,
13,
8,
7775,
6903,
1807,
220,
3326,
2111,
9,
12097,
1106,
834,
9,
2328,
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 do I use micro-state accounting in linux?
===
I would like to access micro-state accounting timers programmatically on Linux. I guess the first part of the question is where are these available? Which kernel versions and distros? Which hardware platforms? The second part is how to actually go about accessing the timers? What is the system call?
Here is a (somewhat old) page [describing micro-state accounting][1], but I couldn't find the system call described there.
[1]: http://www.gelato.unsw.edu.au/IA64wiki/MicroStateAccounting | 0 | [
2,
184,
107,
31,
275,
2899,
8,
3859,
10090,
19,
13024,
60,
800,
3726,
3726,
31,
83,
101,
20,
1381,
2899,
8,
3859,
10090,
85,
1224,
625,
6732,
1326,
27,
13024,
9,
31,
2321,
14,
64,
141,
16,
14,
1301,
25,
113,
50,
158,
904,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.