unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
What features would you like to see Delphi Compiler?
===
Delphi(as Language) has it's own syntax and features, and other languages have their own too.
as Delphi developer, what do you like to have in Delphi compiler?
and if you are not a Delphi developer, what feature may make you starting using Delphi?
Here's my short list
Main Features:
-----------------------
1. Cross platform compiler (Revive Kylix) Windows/Linux/Mac.
2. Native support for 64bit Processors (it may be in the next Delphi version as mentioned in Delphi roadmap).
3. Advanced support for newer multi cores CPUs.
4. Inline declaration of variables such as:
var MyObj := new TMyClass.Create() (Similar to C);
5. Multiples assignment:
X := Y := Z := 1;
6. Lambda expressions (same as C# 3).
7. Automatic properties (same as C# 3).
I'm sure many have their own list, so let's start dreaming ;-) | 0 | [
2,
98,
967,
83,
42,
101,
20,
196,
23030,
21486,
60,
800,
3726,
3726,
23030,
5,
472,
816,
6,
63,
32,
22,
18,
258,
22649,
17,
967,
15,
17,
89,
2556,
57,
66,
258,
266,
9,
28,
23030,
10058,
15,
98,
107,
42,
101,
20,
57,
19,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Convert all strings in List<string> to lower case using LINQ?
===
I saw a code snippet yesterday in one of the responses here on StackOverflow that intrigued me. It was something like this:
List<string> myList = new List<string> {"aBc", "HELLO", "GoodBye"};
myList.ForEach(d=>d.ToLower());
I was hoping I could use it to convert all items in myList to lowercase. However, it doesn't happen... after running this, the casing in myList is unchanged.
So my question is whether there IS a way, using LINQ and Lambda expressions to easily iterate through and modify the contents of a list in a manner similar to this.
Thanks,
Max | 0 | [
2,
184,
20,
8406,
65,
7887,
19,
968,
1,
11130,
1,
20,
987,
610,
568,
6294,
1251,
60,
800,
3726,
3726,
31,
441,
21,
1797,
13,
29061,
7124,
19,
53,
16,
14,
13231,
235,
27,
7566,
2549,
9990,
30,
21415,
55,
9,
32,
23,
301,
101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Compression API on the iPhone
===
Is there a compression API available for use on the iPhone? We're building some RESTful web services for our iPhone app to talk to, but we want to compress at least some of the conversations for efficiency.
I don't care what the format (ZIP, LHA, whatever) is, and it does not need to be secure. | 0 | [
2,
14864,
21,
2159,
27,
14,
21024,
800,
3726,
3726,
25,
80,
21,
14864,
21,
2159,
904,
26,
275,
27,
14,
21024,
60,
95,
22,
99,
353,
109,
760,
1566,
2741,
687,
26,
318,
21024,
4865,
20,
930,
20,
15,
47,
95,
259,
20,
26060,
35,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find client IP and SOAP call info from a Delphi web service
===
I have a Delphi Web Server setup and running, publishing Web Services, and I want to know some stuff on the calls to the web services:
* The IP address of the client who calls the web service.
* Some SOAP information on the call, such as username and password.
How can I get this information from within the service code? My class is inheriting from TSoapDataModule, so I figure there's a way to get that info through it. Still, I can't find how.
TMyAppServerDataModule = class(TSoapDataModule, ITMyAppServerDataModule ,
IAppServerSOAP, IAppServer, ITMySOAPWebService)
// ...my working components and methods... //
end;
| 0 | [
2,
477,
6819,
15735,
17,
6447,
645,
15404,
37,
21,
23030,
2741,
365,
800,
3726,
3726,
31,
57,
21,
23030,
2741,
8128,
18161,
17,
946,
15,
3107,
2741,
687,
15,
17,
31,
259,
20,
143,
109,
3217,
27,
14,
3029,
20,
14,
2741,
687,
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... |
How to persist a calculated GEOMETRY or GEOGRAPHY column
===
I'm trying to create a table under SQL Server 2008 containing a **GEOMETRY** column and a calculated variation thereof.
Considering the following table where the calculated column returns a buffered geometry:
CREATE TABLE [dbo].[Test] (
[Geometry] GEOMETRY NOT NULL,
[Buffer] FLOAT NOT NULL,
[BufferedGeometry] AS ([Geometry].STBuffer([Buffer])) PERSISTED
);
The problem with this is it results in the following error:
> Msg 4994, Level 16, State 1, Line 2
> Computed column 'BufferedGeometry' in
> table 'Test' cannot be persisted
> because the column type, 'geometry',
> is a non-byte-ordered CLR type.
I have search BOL and the web and can't seem to find a solution to my problem. I really would like it to be persisted so I can index it effectively. I could set it in code, but then I have the possibility of inconsistent data as I require both values at some point in time.
Anyone played with this and know a solution or workaround? | 0 | [
2,
184,
20,
22084,
21,
10785,
11689,
54,
11320,
4698,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
859,
131,
4444,
255,
8128,
570,
3503,
21,
13,
1409,
834,
25564,
1409,
4698,
17,
21,
10785,
7893,
80,
1041,
9,
5154,
14,
249,
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... |
Moving to office with a shared network - what should I look out for?
===
We're moving to cheap office space that provides a lot of stuff: receptionist, copiers, printers, microwave and internet access - all of it shared with strangers.
What should I ask to find out if the network is safe to use, and if it's not inherently safe, what can I do to make it safe? | 0 | [
2,
1219,
20,
488,
29,
21,
2592,
982,
13,
8,
98,
378,
31,
361,
70,
26,
60,
800,
3726,
3726,
95,
22,
99,
1219,
20,
9148,
488,
726,
30,
1927,
21,
865,
16,
3217,
45,
25331,
15,
5326,
1944,
18,
15,
12925,
18,
15,
19530,
17,
2620,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 convert an existing website, deployed to multiple servers, to be SVN managed and not blow away user files?
===
I have an existing website that uses the same code base, but is deployed in a number of different configurations on different servers. Each configuration has a set of users, and they can upload personal files. The files are stored in an "uploaded files" directory on each server, and this directory is stuck in right next to the code that runs the site.
I am trying to bring the codebase into Subversion so we can manage things better, and also use SVN to make deployment easier as well, however, on each server the user files will be different. I understand that the best way to handle this would be to store the user files elsewhere, but at this point, that isn't an option.
So, with that in mind, how can I use Subversion in light of this situation? | 0 | [
2,
184,
92,
31,
8406,
40,
3149,
2271,
15,
6698,
20,
1886,
17595,
15,
20,
44,
13,
18,
16578,
1471,
17,
52,
4459,
229,
4155,
6488,
60,
800,
3726,
3726,
31,
57,
40,
3149,
2271,
30,
2027,
14,
205,
1797,
1000,
15,
47,
25,
6698,
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... |
CSS Positioning Question
===
I'd like to align label/value pairs in the center without using absolute positioning (see screen shot). In that screen shot I positioned the value (ie. $4,500/wk) absolute and then floated the label right up against it. But absolute doesn't work so well in IE and I've heard it's not a good technique.
But how can I acheive this effect where the labels are all justified right without absolute?
![alt text][1]
[1]: http://www.amherstparents.org/files/shot.jpg | 3 | [
2,
272,
18,
18,
649,
68,
1301,
800,
3726,
3726,
31,
22,
43,
101,
20,
23389,
1899,
118,
15165,
7473,
19,
14,
459,
366,
568,
7070,
649,
68,
13,
5,
1798,
2324,
999,
6,
9,
19,
30,
2324,
999,
31,
12125,
14,
1923,
13,
5,
660,
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... |
Properties page not displaying in Visual Studio 2008
===
I'm using Visual Studio 2008 Team Development Edition and my Project properties page will not display. I right-clicked the project name and selected "Properties" and no page displayed as it normally would. Also, when I double-click the Settings.settings the normal Settings GUI does not display. I only see the XML in the Settings.settings file. Please Help. Thanks. | 0 | [
2,
3704,
2478,
52,
17418,
19,
3458,
1120,
570,
800,
3726,
3726,
31,
22,
79,
568,
3458,
1120,
570,
173,
522,
1322,
17,
51,
669,
3704,
2478,
129,
52,
3042,
9,
31,
193,
8,
150,
10129,
69,
14,
669,
204,
17,
1704,
13,
7,
10890,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 memory efficient replacement of java.lang.String?
===
After reading [this old article][1] measuring the memory consumption of several object types, I was amazed to see how much memory `Strings` use in Java:
length: 0, {class java.lang.String} size = 40 bytes
length: 7, {class java.lang.String} size = 56 bytes
While the article has some tips to minimize this, I did not find them entirely satisfying. It seems to be wasteful to use `char[]` for storing the data. The obvious improvement for most western languages would be to use `byte[]` and an encoding like UTF-8 instead, as you only need a single byte to store the most frequent characters then instead of two bytes.
Of course one could use `String.getBytes("UTF-8")` and `new String(bytes, "UTF-8")`. Even the overhead of the String instance itself would be gone. But then there you lose very handy methods like `equals()`, `hashCode()`, `length()`, ...
Sun has a [patent][2] on `byte[]` representation of Strings, as far as I can tell.
> **Frameworks for efficient representation of string objects in Java programming environments**
> ... The techniques can be implemented to create Java string objects as arrays of one-byte characters when it is appropriate ...
But I failed to find an API for that patent.
Why do I care?
In most cases I don't. But I worked on applications with huge caches, containing lots of Strings, which would have benefitted from using the memory more efficiently.
Does anybody know of such an API? Or is there another way to keep your memory footprint for Strings small, even at the cost of CPU performance or uglier API?
Please don't repeat the suggestions from the above article:
- own variant of `String.intern()` (possibly with `SoftReferences`)
- storing a single `char[]` and exploiting the current `String.subString(.)` implementation to avoid data copying (nasty ;)
[1]: http://www.javaworld.com/javaworld/javatips/jw-javatip130.html?page=2
[2]: http://www.freepatentsonline.com/6751790.html | 0 | [
2,
25,
80,
21,
1912,
8243,
4610,
16,
8247,
9,
9949,
9,
11130,
60,
800,
3726,
3726,
75,
1876,
636,
1565,
315,
2002,
500,
2558,
165,
500,
9937,
14,
1912,
8330,
16,
238,
3095,
2551,
15,
31,
23,
17378,
20,
196,
184,
212,
1912,
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... |
Using WPF Validation rules and disabling a 'Save' button
===
I have a page where a few textboxes cannot be empty before clicking a Save button.
<TextBox...
<TextBox.Text>
<Binding Path ="LastName" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<local:StringRequiredValidationRule />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
My rule works. I have a red border around my textbox until I enter a value. So now I want to add this validation rule to my other text boxes.
Now, how do I disable the Save button until the page has no errors? I do not know what to check to see if there are any validation errors.
| 0 | [
2,
568,
619,
7721,
27999,
1761,
17,
1460,
58,
8599,
21,
13,
22,
19863,
22,
5167,
800,
3726,
3726,
31,
57,
21,
2478,
113,
21,
310,
1854,
5309,
160,
1967,
44,
2424,
115,
25590,
21,
2079,
5167,
9,
13,
1,
11969,
5309,
9,
9,
9,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to round/ceil/floor a bcmath number ?
===
Is there any library function for this purpose, so I don't do it by hand and risk ending in TDWTF?
echo ceil(31497230840470473074370324734723042.6);
// Expected result
31497230840470473074370324734723043
// Prints
<garbage>
| 0 | [
2,
184,
20,
560,
118,
1105,
947,
118,
15767,
21,
2726,
14825,
234,
13,
60,
800,
3726,
3726,
25,
80,
186,
1248,
1990,
26,
48,
2131,
15,
86,
31,
221,
22,
38,
107,
32,
34,
224,
17,
2029,
3119,
19,
15596,
499,
11720,
60,
8117,
400... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are your most common uses for regular expressions?
===
I'm building up a library of filters for a validation class in PHP, some of them using regular expressions. I have a lot of filters in mind, but I also don't want to potentially miss any. What do you most often use regular expressions to check? Note: I'm not looking for the actual regex code, just what you use it for. | 0 | [
2,
98,
50,
154,
127,
757,
2027,
26,
1290,
13832,
60,
800,
3726,
3726,
31,
22,
79,
353,
71,
21,
1248,
16,
21062,
26,
21,
27999,
718,
19,
13,
26120,
15,
109,
16,
105,
568,
1290,
13832,
9,
31,
57,
21,
865,
16,
21062,
19,
594,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to write default structure values multiple times using fwrite()
===
I want to write a default structure, N times, to a file, using fwrite.
typedef struct foo_s {
uint32 A;
uint32 B;
char desc[100];
}foo_t;
void init_file(FILE *fp, int N)
{
foo_t foo_struct = {0};
foo_struct.A = -1;
foo_struct.B = 1;
fwrite(&foo_struct, sizeof(foo_struct), N, fp);
}
The above code does not write foo_struct N times to the file stream fp.
Instead it writes N*sizeof(foo_struct) bytes starting from &foo_struct to fp.
Can anyone tell how to achieve the same with a single fwrite.
Thanks
Aman Jain
| 0 | [
2,
184,
20,
2757,
12838,
1411,
4070,
1886,
436,
568,
398,
23716,
5,
6,
800,
3726,
3726,
31,
259,
20,
2757,
21,
12838,
1411,
15,
13,
103,
436,
15,
20,
21,
3893,
15,
568,
398,
23716,
9,
1001,
13862,
13,
10346,
4310,
111,
1,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Disable MOSS auto import of colleagues
===
Upon AD Import for SharePoint, MOSS does this automatically: "Office SharePoint Server 2007 automatically adds your manager, peers, and direct reports as your colleagues". How do I disable this automatically so it's a clean list of colleagues? | 0 | [
2,
1460,
579,
8188,
3108,
9010,
16,
8493,
800,
3726,
3726,
685,
21,
43,
9010,
26,
1891,
3132,
15,
8188,
630,
48,
7499,
45,
13,
7,
17047,
1891,
3132,
8128,
624,
7499,
10621,
154,
1382,
15,
14491,
15,
17,
1744,
2813,
28,
154,
8493,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Freeing in an atexit()
===
Is there any point to freeing memory in an atexit() function?
I have a global variable that gets malloc'ed after startup. I could write an atexit() function to free it, but isn't the system going to reclaim all that memory when the program exits anyway?
Is there any benefit to being tidy and actively cleaning it up myself?
| 0 | [
2,
551,
68,
19,
40,
35,
1706,
242,
5,
6,
800,
3726,
3726,
25,
80,
186,
454,
20,
551,
68,
1912,
19,
40,
35,
1706,
242,
5,
6,
1990,
60,
31,
57,
21,
2062,
7612,
30,
3049,
3668,
2499,
22,
69,
75,
20205,
9,
31,
110,
2757,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Loop from 0x0000 to 0xFFFF
===
I'd like a loop that uses a UInt16 (ushort) to loop through all of its values. However, this doesn't do it:
for( ushort i = 0; i < UInt16.MaxValue; i++ )
{
// do something
}
The problem is that the loop will quit when i == 0xFFFF and not "do something".
If I change the 'for' statement to "for(ushort i = 0; i <= UInt16.MaxValue; i++ )", then it becomes an infinite loop because i never gets to 0x10000 because ushorts only go to 0xFFFF.
I could make 'i' an int and cast it or assign it to a ushort variable in the loop.
Any suggestions? | 0 | [
2,
5293,
37,
713,
396,
21903,
20,
713,
396,
2460,
2460,
800,
3726,
3726,
31,
22,
43,
101,
21,
5293,
30,
2027,
21,
287,
6391,
1091,
13,
5,
291,
10849,
6,
20,
5293,
120,
65,
16,
82,
4070,
9,
207,
15,
48,
1437,
22,
38,
107,
32,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Your least favorite C++ Coding guideline
===
As a counterpart to [C++ Coding Guideline 102][1], which of the [101 guidelines of Sutter & Alexandrescu][2] do you violate or ignore most often, and why?
[1]: http://stackoverflow.com/questions/215470/c-coding-guideline-102
[2]: http://www.gotw.ca/publications/c++cs.htm | 0 | [
2,
154,
639,
3839,
272,
20512,
13,
15458,
3378,
1143,
800,
3726,
3726,
28,
21,
14661,
20,
636,
150,
20512,
13,
15458,
3378,
1143,
10913,
500,
2558,
165,
500,
15,
56,
16,
14,
636,
12811,
12629,
16,
13,
18,
13274,
279,
19586,
17763,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Detail Level of Use Case Documentation
===
I am making a strong effort to discipline my projects and create a Vision/Scope document at the onset. Included in this are the use case diagrams. Just listing out the use cases has really helped me fully see all the requirements that the customer is asking for, and it has opened up dialog.
I am wondering about how detailed the use case should be. If I am making a web application and the user will login to see a report, do I list all the columns on the report in the use case description?
If not, then when would I document those details? | 0 | [
2,
6110,
662,
16,
275,
610,
13945,
800,
3726,
3726,
31,
589,
544,
21,
966,
2150,
20,
7927,
51,
2314,
17,
1600,
21,
2750,
118,
11555,
4492,
35,
14,
16848,
9,
506,
19,
48,
50,
14,
275,
610,
14161,
18,
9,
114,
9554,
70,
14,
275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mySQL get information from multiple tables in one query
===
I'm terribly new to SQL, and cannot seem to get the desired information out, after trying a few different google searches, and reading through some SQL tutorials.
I think it involves some sort of joins, but cannot get them straight.
Given the following sample tables:
Table 1(Activity):
ID Who What When
001 John Created 2008-10-01<br>
001 Bill Closed 2008-10-02<br>
001 John Updated 2008-10-03<br>
002 Bill Created 2008-10-04<br>
002 John Updated 2008-10-05<br>
002 Bill Closed 2008-10-06<br>
Table 2(Tasks):
ID Created Status
001 2008-10-01 Closed
002 2008-10-04 Closed
Table 3(Comments:
ID When Comment<br
001 2008-10-01 "I'm creating a new task"
001 2008-10-02 "I have completed the task"
001 2008-10-03 "Nice job"
002 2008-10-04 "I'm creating a second task"
002 2008-10-05 "This task looks too easy"
002 2008-10-06 "I have completed this easy task"
What SQL (mySQL if it makes any difference) query would I use to find out who had done something on a task that had been closed?
The results would be something like:
Who What ID When Comment
Bill Updated 002 2008-10-03 "Nice job"
Any help would be much appreciated.
Thanks in advance. | 0 | [
2,
51,
18,
22402,
164,
676,
37,
1886,
7484,
19,
53,
25597,
800,
3726,
3726,
31,
22,
79,
19629,
78,
20,
4444,
255,
15,
17,
1967,
2260,
20,
164,
14,
9264,
676,
70,
15,
75,
749,
21,
310,
421,
8144,
19994,
15,
17,
1876,
120,
109,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C++ Error Handling -- Good Sources of Example Code?
===
Just about every piece of example code everywhere omits error handling (because it "confuses the issue" that the example code is addressing). My programming knowledge comes primarily from books and web sites, and you seldom see any error handling in use at all there, let alone good stuff.
Where are some places to see good examples of C++ error handling code? Specific books, specific open-source projects (preferably with the files and functions to look at), and specific web pages or sites will all be gratefully accepted. | 0 | [
2,
272,
20512,
7019,
7988,
13,
8,
8,
254,
2662,
16,
823,
1797,
60,
800,
3726,
3726,
114,
88,
352,
1855,
16,
823,
1797,
6417,
13,
8560,
38,
18,
7019,
7988,
13,
5,
4451,
32,
13,
7,
1126,
13072,
18,
14,
1513,
7,
30,
14,
823,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best way to utilize single codebase for multiple web sites
===
What is the best method for utilizing a single code base for multiple websites?
We have validation and session management libraries that we use on multiple websites. Is there a best practice for keeping a single copy rather than having to maintain updates of local copies for each website? | 0 | [
2,
246,
161,
20,
13151,
345,
1797,
8436,
26,
1886,
2741,
3259,
800,
3726,
3726,
98,
25,
14,
246,
2109,
26,
19894,
21,
345,
1797,
1000,
26,
1886,
13931,
60,
95,
57,
27999,
17,
3723,
1097,
8649,
30,
95,
275,
27,
1886,
13931,
9,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Wininet's INTERNET_OPTION_IGNORE_OFFLINE doesn't work?
===
I'm trying to get Wininet to ignore Internet Explorer's "Work Offline" mode, for both HTTP and FTP.
So I'm trying to use InternetSetOption() with INTERNET_OPTION_IGNORE_OFFLINE. The documentation says "This is used by InternetQueryOption and InternetSetOption with a request handle." However, you can't get a request handle because if IE is in Work Offline mode then InternetConnect() will always return a null handle. Without a connection handle you can't get a request handle. So I tried using it with an InternetOpen() handle and a NULL handle. Both failed with ERROR_INTERNET_INCORRECT_HANDLE_TYPE.
Is there a way to get this option to work? I found a reference on an MS newsgroup from 2003 that INTERNET_OPEN_TYPE_PRECONFIG is "broken". 5 years later with IE8 beta 2 and they still haven't fixed it? Or am I doing it wrong.
| 0 | [
2,
628,
1149,
38,
22,
18,
2620,
1,
2594,
3309,
1,
23565,
99,
1,
1299,
1143,
1437,
22,
38,
170,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
628,
1149,
38,
20,
7174,
2620,
8520,
22,
18,
13,
7,
3783,
168,
1143,
7,
3740,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the COBOL "Bible"?
===
As a C++ programmer, I always refer to *The C++ Programming Language* by Bjarne Stroustrup as my C++ "Bible". It's not necessarily the best tutorial. It's not the official specification. It's not necessarily even the best reference. But I believe most C++ programmers would agree that it is regarded as authoritative.
Is there a similarly regarded "Bible" for COBOL? | 0 | [
2,
98,
22,
18,
14,
326,
6966,
13,
7,
220,
3426,
7,
60,
800,
3726,
3726,
28,
21,
272,
20512,
17968,
15,
31,
550,
5017,
20,
1637,
124,
272,
20512,
3143,
816,
2483,
34,
13,
11741,
18295,
354,
6947,
38,
7964,
28,
51,
272,
20512,
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... |
std::string erase last character fails?
===
I'm trying to change user input in wildcard form `("*word*")` to a regular expression format. To that end, I'm using the code below to strip off the `'*'` at the beginning and end of the input so that I can add the regular expression characters on either end:
string::iterator iter_begin = expressionBuilder.begin();
string::iterator iter_end = expressionBuilder.end();
iter_end--;
if ((char)*iter_begin == '*' && (char)*iter_end == '*')
{
expressionBuilder.erase(iter_begin);
expressionBuilder.erase(iter_end);
expressionBuilder = "\\b\\w*" + expressionBuilder + "\\w*\\b";
}
However, the call to `"expressionBuilder.erase(iter_end)"` does *not* erase the trailing `'*'` from the input string so I wind up with an incorrect regular expression. What am I doing wrong here? `"(char)*iter_end == '*'"` must be true for the code inside the if statment to run (which it does), so why doesn't the same iterator work when passed to erase()? | 0 | [
2,
354,
43,
45,
45,
11130,
23593,
236,
925,
13614,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
753,
4155,
6367,
19,
23003,
505,
13,
1,
5,
7,
2483,
9587,
2483,
7,
6,
1,
20,
21,
1290,
1803,
2595,
9,
20,
30,
241,
15,
31,
22,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Asp.Net jQuery $.getJSON sometimes causes full page postback?
===
I'm writing an ASP.NET webforms app, and I'm using jQuery for my AJAX calls. This is working well, but on some occasions, the $.getJSON call is causing a full page postback. I am not using the ASP.NET AJAX library anywhere in the app. I can't reproduce the problem on a consistent basis, and am not sure what is causing it. Here is the jQuery code I am using. Anyone run across this before? Is is possible the previous AJAX call might not have completed, and requests are overlapping?
function getActionMismatch(id) {
setPageElementVisibility();
$(".ActionDetailArea").slideUp("fast");
$("#AjaxLoader_Action").show();
$.getJSON("Main.aspx?Callback=GetMismatch",
{ MismatchId: id },
function(result) {
$("#adMismatchId").text(result.MismatchId);
$("#adAuthMerchId").text(result.AuthorizationMerchantId);
$("#adSttlMerchId").text(result.SettlementMerchantId);
$("#adCreateDate").text(formatJSONDate(Date(result.AppendDts)));
$(".ActionDetailArea").slideDown('fast', toggleBlock('...click Adjust Promo to enter details', true));
$("#AjaxLoader_Action").hide();
}
);
return false;
} | 0 | [
2,
28,
306,
9,
2328,
487,
8190,
93,
5579,
9,
3060,
728,
528,
1030,
4047,
503,
2478,
678,
1958,
60,
800,
3726,
3726,
31,
22,
79,
1174,
40,
28,
306,
9,
2328,
2741,
4190,
18,
4865,
15,
17,
31,
22,
79,
568,
487,
8190,
93,
26,
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... |
User "greater than or equals" or just "greater than"
===
I remember from C days that we were encouraged to use
i > -1
instead of
i >= 0
because of performance.
Does this still apply in the C# .NET world? What are the performance implications of using one over the other with today's compilers? i.e. Is the compiler clever enough to optimize these for you?
(As an aside try and type the question "use >= or >" into the question field on Stack Overflow and see what happens.) | 0 | [
2,
4155,
13,
7,
6894,
106,
119,
54,
2747,
18,
7,
54,
114,
13,
7,
6894,
106,
119,
7,
800,
3726,
3726,
31,
1518,
37,
272,
509,
30,
95,
46,
5623,
20,
275,
31,
13,
1,
13,
8,
165,
700,
16,
31,
13,
1,
3726,
713,
185,
16,
956,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 MOQ documentation?
===
Where can I find comprehensive documentation for MOQ? I'm just starting with mocking and am having difficulty getting my head around it. I've read through all the links at http://code.google.com/p/moq/wiki/QuickStart but can't seem to find a tutorial or gentle introduction.
I have also looked briefly at Rhino Mocks but found it very confusing. | 0 | [
2,
113,
25,
14,
1873,
1251,
13945,
60,
800,
3726,
3726,
113,
92,
31,
477,
7041,
13945,
26,
1873,
1251,
60,
31,
22,
79,
114,
1422,
29,
18446,
17,
589,
452,
6967,
1017,
51,
157,
140,
32,
9,
31,
22,
195,
1302,
120,
65,
14,
6271,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 tool/method to search for a specific word in a codebase
===
What tool/method do you recommend to find/replace values in your code? If code is on Linux/Unix, are find and grep the best method?
I'm currently using Dreamweaver find and replace and it's sloooow. | 0 | [
2,
246,
5607,
118,
5909,
1807,
43,
20,
2122,
26,
21,
1903,
833,
19,
21,
1797,
8436,
800,
3726,
3726,
98,
5607,
118,
5909,
1807,
43,
107,
42,
12360,
20,
477,
118,
99,
5119,
4070,
19,
154,
1797,
60,
100,
1797,
25,
27,
13024,
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... |
jsf login times out
===
Ok simple question. I have a JSF application, containing a login page. The problem is if the user loads the login page, leaves it for a while, then tries to login the session expires and a ViewExpiredException is thrown. I could redirect back to the login when this happens, but that isn't very smooth. How can I allow this flow to properly login without an additional attempt? | 0 | [
2,
487,
18,
410,
6738,
108,
436,
70,
800,
3726,
3726,
5854,
1935,
1301,
9,
31,
57,
21,
487,
18,
410,
3010,
15,
3503,
21,
6738,
108,
2478,
9,
14,
1448,
25,
100,
14,
4155,
19069,
14,
6738,
108,
2478,
15,
2084,
32,
26,
21,
133,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 definative book on assembly language and Computer Architecture
===
I am taking a Computer Architecture course next semester and besides the required book I also like to get some other resources.
It seems that there tends to be one book that stands above the rest in most areas of computing,(The Dragon Book, K&R).
So I am wondering if there is a consensus on a definitive book on asm and computer architecture? | 0 | [
2,
98,
25,
14,
121,
5617,
3366,
360,
27,
1475,
816,
17,
1428,
2607,
800,
3726,
3726,
31,
589,
741,
21,
1428,
2607,
674,
328,
13738,
17,
3410,
14,
1390,
360,
31,
67,
101,
20,
164,
109,
89,
2566,
9,
32,
2206,
30,
80,
14261,
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... |
Correct way to use custom functor with std::generate_n() algorithm?
===
The following code compiles correctly under VC++ 8 on XPSP3, but running it causes a runtime error.
My header looks like:
#include <stdexcept>
#include <iterator>
#include <list>
template<typename T>
class test_generator
{
public:
typedef T result_type;
prime_generator( void )
{
std::generate_n( std::back_inserter( tests ), 100, rand );
value = tests.begin();
}
result_type operator()( void )
{
if( value == tests.end() )
{
throw std::logic_error( "" );
}
}
private:
std::list<T> tests;
typename std::list<T>::iterator value;
};
My implementation looks like:
#include <functional>
#include <algorithm>
#include <iostream>
#include <deque>
#include "test.h"
int main()
{
test_generator<double> test;
std::deque<double> tests;
std::generate_n( std::back_inserter( tests ), 10, test );
return 0;
}
This compiles fine, it generates an exception (not the logic_error exception defined in the header).
If I change the implementation to use a function instead of a functor, it works:
int main()
{
std::deque<int> tests;
std::generate_n( std::back_inserter( tests ), 10, rand );
return 0;
}
What's wrong with using a functor here? | 0 | [
2,
4456,
161,
20,
275,
5816,
2414,
150,
2153,
29,
354,
43,
45,
45,
17083,
1373,
1,
103,
5,
6,
9083,
60,
800,
3726,
3726,
14,
249,
1797,
26561,
18,
12044,
131,
13,
8990,
20512,
469,
27,
23045,
3401,
240,
15,
47,
946,
32,
4047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Autostart Smart Client application
===
Have a standard smart client application that we want to autostart when a user logs into their machine on our network. I've tried the following keys:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Micrisoft\Windows\CurrentVersion\Run
HKCU\Software\Micrisoft\Windows\CurrentVersion\Policy\Explorer\Run
etc...
The startup key is something like:
J:\Application\NewApp.application on a shared drive or UNC path \\\server1\Application\NewApp.application
I've tried changing the file specified to the setup.exe file, a batch file that starts it, a delayed batch file, and even a small .exe created to start the NewApp.application file after a delay via Process.Start().
If i run these options manually once logged in, all work just fine, however none works when logging into the machine (as is the goal).
Anyone got any ideas? | 0 | [
2,
3108,
13680,
3978,
6819,
3010,
800,
3726,
3726,
57,
21,
1236,
3978,
6819,
3010,
30,
95,
259,
20,
3108,
13680,
76,
21,
4155,
18893,
77,
66,
1940,
27,
318,
982,
9,
31,
22,
195,
794,
14,
249,
5534,
45,
13,
11321,
10363,
1,
12980... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Build "exit" page using Classic ASP avoiding major Cross Site Scripting pitfalls
===
I'm working on updating a classic ASP web page used by a number of sub-sites maintained at the company I work for.
The purpose of the page is to notify the user that they are leaving "our" site and going to another site. It's basically a disclaimer, but due to resource limitations and time limitations I can't add the disclaimer to every site we manage.
This is the crux of the problem. The current code pulls a variable from the query string to create the "continue" link in the new window. This obviously creates many problems in the form of cross site scripting.
How do I approach this update to eliminate most (if not all) of the cross site scripting issues using vbScript/ASP.
The code I'm using is below.
<%@ Language = vbScript %>
<% Option Explicit %>
<%
Dim strLink
strLink = Request.QueryString("site")
strLink = Replace(strLink, "<", "<")
strLink = Replace(strLink, ">", ">")
strLink = Replace(strLink, chr(34), "")
strLink = Replace(strLink, "script", "", 1, -1, 1)
strLink = Replace(strLink, "onclick", "", 1, -1, 1)
strLink = Replace(strLink, "ondblclick", "", 1, -1, 1)
strLink = Replace(strLink, "onmousedown", "", 1, -1, 1)
strLink = Replace(strLink, "onmouseover", "", 1, -1, 1)
strLink = Replace(strLink, "onmousemove", "", 1, -1, 1)
strLink = Replace(strLink, "onmouseout", "", 1, -1, 1)
strLink = Replace(strLink, "onkeypress", "", 1, -1, 1)
strLink = Replace(strLink, "onkeydown", "", 1, -1, 1)
strLink = Replace(strLink, "onkeyup", "", 1, -1, 1)
strLink = Replace(strLink, "onfocus", "", 1, -1, 1)
strLink = Replace(strLink, "onblur", "", 1, -1, 1)
strLink = Replace(strLink, "&&", "")
strLink = Replace(strLink, "##", "")
strLink = Replace(strLink, "&#", "")
%>
<a href="<%= strLink %>">Continue</a> | 0 | [
2,
1895,
13,
7,
1706,
242,
7,
2478,
568,
2732,
28,
306,
10298,
394,
919,
689,
3884,
68,
4175,
5660,
18,
800,
3726,
3726,
31,
22,
79,
638,
27,
71,
43,
1880,
21,
2732,
28,
306,
2741,
2478,
147,
34,
21,
234,
16,
972,
8,
18,
635... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database Design - Hard Coded Row ID
===
What's everyone take on tieing code enum's to row ID's in a database table? I'm really looking for a cleaner alternative. What if for example your static rows in a given table are ID's 1,2,3, and then that table gets filled with user transactional data using ID's 4-100, and then you later want to add a new row ID which in your local production database is row ID 4, but when that row goes to a customers database it will have to be 101...well that kinda breaks everything.
So how do you handle static locked rows in a table that also gets filled with transactional data?
Thanks,
MeshMan
| 0 | [
2,
6018,
704,
13,
8,
552,
13,
22254,
3131,
4924,
800,
3726,
3726,
98,
22,
18,
1266,
247,
27,
3795,
68,
1797,
1957,
723,
22,
18,
20,
3131,
4924,
22,
18,
19,
21,
6018,
859,
60,
31,
22,
79,
510,
699,
26,
21,
19585,
2676,
9,
98,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Git how do I find modified files betwen local and remote
===
Here are 2 different questions but I think they are related.
1. When using git how do I find which changes I have committed locally but haven't yet pushed to a remote branch? I'm looking for something similar to the Mercurial command "hg outgoing"
2. When using git how do I find what changes a remote branch has prior to doing a pull? I'm looking for something similar to the Mercurial command "hg incoming"
Also for 2. is there a way to see what is available and then cherry-pick the changes I want to pull? | 0 | [
2,
568,
13,
10404,
184,
107,
31,
477,
5372,
6488,
5676,
5036,
375,
17,
5388,
800,
3726,
3726,
235,
50,
172,
421,
2346,
47,
31,
277,
59,
50,
1597,
9,
137,
9,
76,
568,
13,
10404,
184,
107,
31,
477,
56,
1693,
31,
57,
4164,
6680,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 set up an asp.net mvc app with Subversion?
===
I plan to have 2 projects.
1. mbtech.crm.mvc
2. mbtech.crm.tests
I will have a solution named mbtech.crm
What is the best way to set these up so that I can track them in Subversion?
Option 1 (then where does my solution file go)?<br>
- mbtech.crm.mvc<br>
- tags<br>
- trunk<br>
- branches<br>
- mbtech.crm.tests<br>
- tags<br>
- trunk<br>
- branches<br>
<br>
Option 2<br>
- mbtech.crm<br>
- trunk<br>
mbtech.crm.sln<br>
- mbtech.crm.mvc<br>
- mbtech.crm.tests<br>
- tags<br>
- branches<br>
| 0 | [
2,
184,
107,
31,
309,
71,
40,
28,
306,
9,
2328,
307,
8990,
4865,
29,
972,
10898,
60,
800,
3726,
3726,
31,
944,
20,
57,
172,
2314,
9,
137,
9,
14023,
6524,
9,
6711,
79,
9,
79,
8990,
172,
9,
14023,
6524,
9,
6711,
79,
9,
10543,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Window Handle and window dimension
===
The MFC application that i created is dialog based. Just one dialog thats all. How do I get the window handle to this window, while the application is performing the InitDialog. I need to find out its dimension as well. GetForegroundWindow not necessarily gives you the handle to this window that is loading up
| 0 | [
2,
1463,
3053,
17,
1463,
9547,
800,
3726,
3726,
14,
307,
7061,
3010,
30,
31,
679,
25,
28223,
432,
9,
114,
53,
28223,
30,
18,
65,
9,
184,
107,
31,
164,
14,
1463,
3053,
20,
48,
1463,
15,
133,
14,
3010,
25,
2955,
14,
19,
242,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to generate a Makefile with source in sub-directories using just one makefile.
===
I have source in a bunch of subdirectories like:
src/widgets/apple.cpp
src/widgets/knob.cpp
src/tests/blend.cpp
src/ui/flash.cpp
In the root of the project I want to generate a single Makefile using a rule like:
%.o: %.cpp
$(CC) -c $<
build/test.exe: build/widgets/apple.o build/widgets/knob.o build/tests/blend.o src/ui/flash.o
$(LD) build/widgets/apple.o .... build/ui/flash.o -o build/test.exe
When I try this it does not find a rule for build/widgets/apple.o. Can I change something so that the %.o: %.cpp is used when it needs to make build/widgets/apple.o ?
| 0 | [
2,
184,
20,
7920,
21,
233,
16877,
29,
1267,
19,
972,
8,
10197,
1596,
568,
114,
53,
233,
16877,
9,
800,
3726,
3726,
31,
57,
1267,
19,
21,
7653,
16,
972,
10197,
1596,
101,
45,
13,
18,
5453,
118,
3976,
43,
3060,
18,
118,
24212,
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... |
Is non multiple of machine word primitives good idea?
===
Let's say you have a dynamic language (similar to common scripting languages) and want to write a compiler for it. Is it good idea to reserve some bits of a machine word for something like type tags? Especially for microcontrollers and similar devices, is it a good idea?
I can think of some advantages like reduced storage for type information, somewhat easier memory management (maybe even gc) and easier debugging. But would these justify the overhead on common arithmetic operations or other operations which needs the full word? Note that a bytecode VM will be much worse in this regard since there is much more performance overhead. So don't suggest it ;)
It is not like some would write a numerical intense code for a microcontroller-class hardware anyway but still... | 0 | [
2,
25,
538,
1886,
16,
1940,
833,
11473,
18,
254,
882,
60,
800,
3726,
3726,
408,
22,
18,
395,
42,
57,
21,
7782,
816,
13,
5,
19107,
20,
757,
3884,
68,
2556,
6,
17,
259,
20,
2757,
21,
21486,
26,
32,
9,
25,
32,
254,
882,
20,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use C# to delete files from remote computer
===
I'm trying to delete a directory that contains XML files from a remote computer. My code compiles and runs fine, but when I go to get a list of XML files in the path I specify, it is not returning anything. Am I missing something permission wise? I have ran it from my computer logged on as myself and from another computer logged on as a different user. Both accounts have full control over the directory that contains the XML files.
I'm using .NET 2.0.
static void Main(string[] args) {
string directory, ext = ".xml"; // have tried xml and .xml
if (args.Length != 1) {
// do absolutely nothing if we do not exactly 1 argument
} else {
Console.WriteLine("Argument accepted.");
directory = args[0];
// make sure the directory passed is valid
if (ValidateDirectory(directory)) {
Console.WriteLine("Directory is valid.");
DeleteFiles(directory, ext);
}
}
Console.WriteLine("Done.");
}
static bool ValidateDirectory(string d) {
return Regex.IsMatch(d, @""); // I removed my regex - it validates properly
}
static void DeleteFiles(string d, string ext) {
DirectoryInfo di;
FileInfo[] fi;
di = new DirectoryInfo(d);
fi = di.GetFiles(ext);
Console.WriteLine("Number of files = " + fi.Length + ".");
foreach (FileInfo f in fi) {
try {
Console.WriteLine(f.FullName);
f.Delete();
} catch (Exception ex) {
// do nothing when there is an exception
// just do not want it to quit
Console.WriteLine(ex.ToString());
}
}
} | 0 | [
2,
275,
272,
5910,
20,
27448,
6488,
37,
5388,
1428,
800,
3726,
3726,
31,
22,
79,
749,
20,
27448,
21,
16755,
30,
1588,
23504,
6488,
37,
21,
5388,
1428,
9,
51,
1797,
26561,
18,
17,
1461,
1123,
15,
47,
76,
31,
162,
20,
164,
21,
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... |
Automatic Deployment Resources
===
I know enough to know that we need to get our application to deploy with a single user action. However, I **don't** know:
1. What are some good tools to use in a .NET shop?
2. How do you manage config changes for each of your environments?
Can someone point me to some good resources for continous integration. I'd like to see some theory as well as a step by step practical guide.
**Edit:**
I'm in need to automated a web deployment right now; however, I'd also like to learn how to do this for desktop apps. | 0 | [
2,
6715,
10475,
2566,
800,
3726,
3726,
31,
143,
511,
20,
143,
30,
95,
376,
20,
164,
318,
3010,
20,
17617,
29,
21,
345,
4155,
1028,
9,
207,
15,
31,
13,
1409,
804,
22,
38,
1409,
143,
45,
137,
9,
98,
50,
109,
254,
4672,
20,
275... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Need help making Jython (dom4j) script more graceful :)
===
I have started using Jython as it seems to be a excellent language, and has proved to be so far.
I am using dom4j to manipulate and retrieve data from the DOM of a bunch of HTML files I have on disk. I have wrote the below script to check threw the DOM using Xpath for **H1** tags and grab text, if a **H1** tag is not present in the DOM it then searches for the **title** tag and grabs the text from that.
I am very new to Jython but I am sure there is way to perform the required task a lot more graceful than the below method, If I am right in thinking this, is there someone that can show me a better way to do it?
elemHolder = dom.createXPath('//xhtml:h1')
elemHolder.setNamespaceURIs(map)
elem = elemHolder.selectSingleNode(dom)
if elem != None:
h1 = elem.getText()
else:
elemHolder = dom.createXPath('//xhtml:title')
elemHolder.setNamespaceURIs(map)
elem = elemHolder.selectSingleNode(dom)
if elem != None:
title = elem.getText()
else:
title = "Page does not contain a H1 or title tag"
If anyone could help it would be great. Cheers | 0 | [
2,
376,
448,
544,
487,
93,
11570,
13,
5,
5555,
300,
728,
6,
3884,
91,
22609,
13,
45,
6,
800,
3726,
3726,
31,
57,
373,
568,
487,
93,
11570,
28,
32,
2206,
20,
44,
21,
5977,
816,
15,
17,
63,
3432,
20,
44,
86,
463,
9,
31,
589,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 configure multiple SSL sites on the same server without a wildcard certificate?
===
I've set up multiple ssl sites on iis using Servier Bindings as per this article: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/8d9f2a8f-cd23-448c-b2c7-f4e87b9e2d2c.mspx?mfr=true
I have two different ssl certs for the two sites installed but when I browse to either site I get the same certificate. Is there any way to configure this without buying a wildcard cert?
| 0 | [
2,
25,
80,
186,
161,
20,
1065,
15951,
1886,
13,
18,
18,
255,
3259,
27,
14,
205,
8128,
366,
21,
23003,
6259,
60,
800,
3726,
3726,
31,
22,
195,
309,
71,
1886,
13,
18,
18,
255,
3259,
27,
595,
18,
568,
24975,
106,
8728,
18,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
A Strategy against Policy and a Policy against Strategy
===
When I first discovered the Strategy pattern, I was amazed of the seemingly endless possibilities it offered to me and my programs. I could better encapsulate my models' behaviour and even exchange this behaviour on the fly. But the strategy could also be used to to provide traits and payload to the containing object - data that was declared in a superclass. Life was fine.
class MyMonsterAI { float const see_radius_; virtual void attack () = 0; /* .. */ };
class ElveAI { ElveAI() : see_radius_(150.0f) {} /* ... */ };
class CycloneAI { CycloneAI() : see_radius_(50.0f) {} /* ... */ };
class Monster { MyMonsterAI* ai_; };
And along came the Policy pattern and it would allow me even greater flexibility in supplying parameters to a containing class - whole classes, outfitted however I liked, albeit dynamically exchanging the behaviour... that was not too easy (unless part of the policy was to have a strategy!).
class MyMonsterTrait { typedef typename ElveAI AI; };
template< class MonsterTrait >
class Monster : public MonsterTrait::AI
{
void idle (void) { attack(); }
};
Both patterns seem to be very powerful to me and I like to use both, in different circumstances. But I'm not sure if there are particular/typical/more-practical applications for either at some situations.
**I am wondering: where do you use strategies and where policies? Where are either better suited?**
| 0 | [
2,
21,
4427,
149,
1486,
17,
21,
1486,
149,
4427,
800,
3726,
3726,
76,
31,
64,
1848,
14,
4427,
3732,
15,
31,
23,
17378,
16,
14,
9688,
11340,
13086,
32,
1434,
20,
55,
17,
51,
1726,
9,
31,
110,
574,
1957,
4666,
18,
12383,
51,
276... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 reference current object in xaml
===
I cant' figure out how to reference the current instance object defined by the xaml file in the xaml file.
I have a converter that I want to send in the current instance as the parameter object.
{Binding Path=<bindingObject>, Converter={x:Static namespace:Converter.Instance}, ConverterParameter=this}
In this code this is converted to a string instead of a reference to the current instance object.
Thanks
John | 0 | [
2,
184,
20,
2801,
866,
3095,
19,
13,
6791,
8184,
800,
3726,
3726,
31,
2973,
22,
1465,
70,
184,
20,
2801,
14,
866,
4851,
3095,
2811,
34,
14,
13,
6791,
8184,
3893,
19,
14,
13,
6791,
8184,
3893,
9,
31,
57,
21,
25893,
30,
31,
259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
convert XmlNode to XNode?
===
Anyone know off the top of their heads how to convert a System.Xml.XmlNode to System.Xml.Linq.XNode? | 0 | [
2,
8406,
23504,
251,
546,
20,
993,
251,
546,
60,
800,
3726,
3726,
1276,
143,
168,
14,
371,
16,
66,
4153,
184,
20,
8406,
21,
329,
9,
396,
8184,
9,
396,
8184,
251,
546,
20,
329,
9,
396,
8184,
9,
1226,
1251,
9,
396,
251,
546,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Blending RDF and ORM approaches
===
I'm working on a team investigating a technology stack for a green-field systems integration project. Part of our favored technology stack use Hibernate to persist its internal state and exposes hooks into the Hibernate transactions so that business entities stay synchronized with the state of this utility. Great, except we need to maintain information about entities of an unknown type and link that data to the predefined types. We need a scalable data store that does not require the schema to be defined upfront. The sweet spot would be to blend RDF data and Hibernate managed entities.
Have you faced a similar requirement and what approaches can you recommend?
Any RDF/ORM blend would need to support infrequent large-scale queries for reporting and data exploration and also frequent focused read and write operations in support of transactions. | 0 | [
2,
25359,
13,
897,
410,
17,
54,
79,
7501,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
173,
12490,
21,
1099,
7566,
26,
21,
647,
8,
1109,
1242,
8078,
669,
9,
141,
16,
318,
13757,
1099,
7566,
275,
4148,
2102,
8820,
20,
22084,
82,
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 a callback function and how do I use it with OOP
===
I want to use the [php simple HTML DOM parser][1] to grab the image, title, date, and description from each article on a page full of articles. When looking at the API I notice it has a set_callback which Sets a callback function. However im not sure what this does or how I would use it? In one of the examples its used to call a function which strips out some stuff, im wondering if you have to use this to call all functions?
I guess im wondering why I use this, and what does it do as I have never come across a callback function before!
[1]: http://simplehtmldom.sourceforge.net/manual_api.htm | 0 | [
2,
98,
25,
21,
645,
1958,
1990,
17,
184,
107,
31,
275,
32,
29,
13,
21709,
800,
3726,
3726,
31,
259,
20,
275,
14,
636,
26120,
1935,
13,
15895,
11859,
2017,
4104,
500,
2558,
165,
500,
20,
4931,
14,
1961,
15,
581,
15,
1231,
15,
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... |
Can i have url_for use a prefix option in Ruby on Rails.
===
In a project I am working on, Apache is set up to only forward requests that come in as /prefix/* to mongrel. How can I tell ruby on rails to generate all URLs with that that prefix?
I have the routes set up for forward to the correct controller action by doing this:
map.connect 'sfc/:controller/:action'
but that doesn't seem to affect the way that the url writer generates the URLs.
Any ideas? | 0 | [
2,
92,
31,
57,
287,
6362,
1,
1106,
275,
21,
14315,
4255,
19,
10811,
27,
2240,
18,
9,
800,
3726,
3726,
19,
21,
669,
31,
589,
638,
27,
15,
17140,
25,
309,
71,
20,
104,
917,
12279,
30,
340,
19,
28,
13,
118,
3515,
18594,
118,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 make reCAPTCHA work with a ValidationGroup in ASP.Net (captcha)
===
I am using the ASP.Net plugin and control provided by [reCAPTCHA][1]. I can successfully get the control to work if the submit button on the web form is not in a validationgroup. There is no validationgroup attribute for the reCAPTCHA control.
Has anybody had any success with this or any solutions to get the reCAPTCHA control to work when there is a validationgroup on the web form?
[1]: http://recaptcha.net | 0 | [
2,
184,
20,
233,
302,
4666,
38,
1651,
170,
29,
21,
27999,
8024,
19,
28,
306,
9,
2328,
13,
5,
4666,
38,
1651,
6,
800,
3726,
3726,
31,
589,
568,
14,
28,
306,
9,
2328,
10922,
108,
17,
569,
1173,
34,
636,
99,
4666,
38,
1651,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 this code is not working ?
===
Hi guys I wrote this code and i have two errors.
1-Invalid rank specifier: expected ',' or ']'
2-Cannot apply indexing with [] to an expression of type 'int'
can you help please
{
static void Main(string[] args)
{
ArrayList numbers = new ArrayList();
foreach (int number in new int[12] {10,9,8,7,6,5,4,3,2,1}) ------error No. 1
{
numbers.Add(number);
}
numbers.Insert(numbers.Count - 1, 75);
numbers.Remove(7);
numbers.RemoveAt(6);
for(int i=0; i<numbers.Count; i++)
{
int number = (int) number[i];--------error No.2
Console.WriteLine(number);
}
}
}
}
| 0 | [
2,
483,
48,
1797,
25,
52,
638,
13,
60,
800,
3726,
3726,
4148,
2776,
31,
738,
48,
1797,
17,
31,
57,
81,
11908,
9,
137,
8,
108,
18506,
43,
2839,
12737,
16292,
45,
1727,
13,
22,
15,
22,
54,
13,
22,
500,
22,
172,
8,
1245,
1270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 is the max size of a SOAP message determined?
===
I'm using NuSOAP on PHP 5.2.6 and I'm seeing that the max message size is only 1000 bytes (which makes it tough to do anything meaningful). Is this set in the endpoint's WSDL or is this something I can configure in NuSOAP? | 0 | [
2,
184,
25,
14,
2049,
1072,
16,
21,
6447,
2802,
2734,
60,
800,
3726,
3726,
31,
22,
79,
568,
3152,
656,
2552,
27,
13,
26120,
331,
9,
135,
9,
379,
17,
31,
22,
79,
2078,
30,
14,
2049,
2802,
1072,
25,
104,
6150,
34,
3231,
13,
5,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
gem install taking like forever!
===
For some weeks now I simply can't run gem install in windows.
It stucks in this line:
C:\Windows\System32>gem install rails --version 2.1.2
Bulk updating Gem source index for: http://gems.rubyforge.org/
Any ideas waht it could be? | 0 | [
2,
8551,
16146,
741,
101,
3818,
187,
800,
3726,
3726,
26,
109,
1342,
130,
31,
1659,
92,
22,
38,
485,
8551,
16146,
19,
1936,
9,
32,
4549,
18,
19,
48,
293,
45,
272,
45,
1,
27508,
18,
1,
10724,
3125,
1,
20231,
16146,
2240,
18,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the best way to include html through an ajax echo command?
===
I am currently building a small website where the content of the main div is being filled through an Ajax call. I basically have a php script that returns the content like this:
(simplified php script...)
<pre><code>
if(isset($_POST["id_tuto"])){
PrintHtml($_POST["id_tuto"]);
}
function PrintHtml($id)
{
switch($id)
{
case [...]:
echo "THIS IS MY HTML CONTENT";
break;
[...]
}
}
</code></pre>
The web page then gets the text from that echo command and replaces the inner html of the content div.
My question is this : What is the best way to echo that html content? there is a lot of content each time since it's a step by step tutorial. Each string will be about 50-80 lines of HTML code. Is there a way to put that html content in a separate html file and echo that file or...?
Thanks a lot!! | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
468,
13,
15895,
120,
40,
20624,
8117,
1202,
60,
800,
3726,
3726,
31,
589,
871,
353,
21,
284,
2271,
113,
14,
2331,
16,
14,
407,
13,
12916,
25,
142,
1943,
120,
40,
20624,
645,
9,
31,
11374,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Practicing BDD with python
===
Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great. | 0 | [
2,
13640,
334,
8096,
29,
20059,
800,
3726,
3726,
56,
50,
14,
127,
2255,
6596,
18,
17,
4672,
80,
50,
904,
26,
20059,
26,
13640,
3257,
5355,
522,
60,
1118,
3007,
835,
4672,
28,
13,
1224,
12610,
17,
1873,
1651,
26,
10811,
83,
44,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Using JavaScript with JSF and Facelets
===
I would like to use JavaScript to manipulate hidden input fields in a JSF/Facelets page. When the page loads, I need to set a hidden field to the color depth of the client.
From my Facelet:
<body onload="setColorDepth(document.getElementById(?????);">
<h:form>
<h:inputHidden value="#{login.colorDepth}" id="colorDepth" />
</h:form>
When JSF processes the page, it is of course changing the IDs of the elements. What's the best way to reference these elements from my JavaScript code? | 0 | [
2,
568,
8247,
8741,
29,
487,
18,
410,
17,
276,
11045,
800,
3726,
3726,
31,
83,
101,
20,
275,
8247,
8741,
20,
18468,
3689,
6367,
2861,
19,
21,
487,
18,
410,
118,
6413,
11045,
2478,
9,
76,
14,
2478,
19069,
15,
31,
376,
20,
309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 this prime generator inefficient C++?
===
Is this seen as an in efficient prime number generator. It seems to me that this is pretty efficient. Is it the use of the stream that makes the program run slower?
I am trying to submit this to SPOJ and it tells me that my time limit exceeded...
#include <iostream>
#include <sstream>
using namespace std;
int main() {
int testCases, first, second, counter = 0;
bool isPrime = true;
stringstream out;
cin >> testCases;
for (int i = 0; i < testCases; i++) {
// get the next two numbers
cin >> first >> second;
if (first%2 == 0)
first++;
// find the prime numbers between the two given numbers
for (int j = first; j <= second; j+=2) {
// go through and check if j is prime
for (int k = 2; k < j; k++) {
if (j%k == 0) {
isPrime = false;
break;
}
}
if (isPrime) {
out << j << "\n";
}
isPrime = true;
}
out << "\n";
}
cout << out.str();
return 0;
}
EDIT: The program is supposed to generate prime numbers between the numbers specified in the input. (See here for more details: [Prime Generator Problem][1] )
-Tomek
[1]: http://www.spoj.pl/problems/PRIME1/ | 0 | [
2,
25,
48,
1621,
15286,
19,
23702,
272,
20512,
60,
800,
3726,
3726,
25,
48,
541,
28,
40,
19,
8243,
1621,
234,
15286,
9,
32,
2206,
20,
55,
30,
48,
25,
1772,
8243,
9,
25,
32,
14,
275,
16,
14,
3766,
30,
1364,
14,
625,
485,
1408... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a rails plugin from a Git repository
===
I've been trying to install [Shoulda][1]
script/plugin install git://github.com/thoughtbot/shoulda.git
but all I get is:
removing: C:/Documents and Settings/Danny/My Documents/Projects/Ruby On Rails/_ProjectName_/vendor/plugins/shoulda/.git
>
And the `vender/plugins` directory is empty. I have Rails 2.1.1 installed as a gem and have verified that 2.1.1 is loaded (using a puts inserted into config/boot.rb). Any ideas about what's going on?
(this is on a windows box)
[1]: http://thoughtbot.com/projects/shoulda
| 0 | [
2,
25429,
21,
2240,
18,
10922,
108,
37,
21,
13,
10404,
24869,
800,
3726,
3726,
31,
22,
195,
74,
749,
20,
16146,
636,
14941,
58,
500,
2558,
165,
500,
3884,
118,
18527,
5831,
16146,
13,
10404,
6903,
10404,
20926,
9,
960,
118,
20131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 advantage of webservices over web-pages for providing ajax content?
===
Should my ajax calls talk to webservices or to simple webpages? It seems to be so much easier to simply Response.Write() the content. Are webservices more reliable or secure? | 0 | [
2,
25,
80,
186,
3314,
16,
2741,
11449,
18,
84,
2741,
8,
6486,
18,
26,
2674,
20624,
2331,
60,
800,
3726,
3726,
378,
51,
20624,
3029,
930,
20,
2741,
11449,
18,
54,
20,
1935,
2741,
6486,
18,
60,
32,
2206,
20,
44,
86,
212,
4950,
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... |
Missing debugger types in VS2005
===
I have one computer that is missing the list of manual debugger types. See the screenshot below.
It has VS2005 SP1. What could cause this?
![Blank Debugger][1]
[1]: http://img505.imageshack.us/img505/5240/blankdebuggerki3.png | 0 | [
2,
2863,
121,
2345,
11356,
2551,
19,
4611,
2835,
800,
3726,
3726,
31,
57,
53,
1428,
30,
25,
2863,
14,
968,
16,
5132,
121,
2345,
11356,
2551,
9,
196,
14,
2324,
7868,
1021,
9,
32,
63,
4611,
2835,
3782,
165,
9,
98,
110,
1679,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GWT paging widget
===
I'm looking for a GWT common purpose paging widget.
So far I have found [GWT widget library][1] and the
[Google Incubator widgets][2].
Is there any other free (possibly open source) widget library implementing a paging behavior.
[1]: http://gwt-widget.sourceforge.net/
[2]: http://code.google.com/p/google-web-toolkit-incubator/w/list | 0 | [
2,
14094,
38,
19006,
68,
4807,
43,
3060,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
14094,
38,
757,
2131,
19006,
68,
4807,
43,
3060,
9,
86,
463,
31,
57,
216,
636,
263,
499,
38,
4807,
43,
3060,
1248,
500,
2558,
165,
500,
17,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Real-Time MySQL binary log parsing
===
we are dealing with a legacy application built on MySQL 5.0 (MyISAM). I need to know in <b>real-time</b> when an update, delete, or insert happens to a particular table. The 'gotcha' is that I can't change the db (i.e. write triggers) in any way. I have to use the bin log, replication or something else which is somewhat non-invasive.
We've looked at using the 'mysqlbinlog' command to parse the binary log. However, this is not real-time and we'd rather do something more event driven.
Any ideas?
| 0 | [
2,
683,
8,
891,
51,
18,
22402,
14171,
6738,
2017,
18,
68,
800,
3726,
3726,
95,
50,
5746,
29,
21,
7780,
3010,
392,
27,
51,
18,
22402,
331,
9,
387,
13,
5,
915,
49,
6101,
6,
9,
31,
376,
20,
143,
19,
13,
1,
220,
1,
7467,
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... |
Cuckoo hashing in C
===
Does anybody have an implementation of Cuckoo hasing in C? If there was an Open Source, non GPL version it would be perfect! | 0 | [
2,
27235,
19170,
68,
19,
272,
800,
3726,
3726,
630,
11181,
57,
40,
6123,
16,
27235,
63,
68,
19,
272,
60,
100,
80,
23,
40,
368,
1267,
15,
538,
489,
5727,
615,
32,
83,
44,
2107,
187,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Automated acronym creation
===
Is there any easy way to create an acronym from a string?
First_name Middle_name Last_name => FML
first_name middle_name last_name => FML
First_name-Middle_nameLast_name => F-ML
first_name-middle_name last_name => F-ML
| 0 | [
2,
14904,
22488,
2502,
800,
3726,
3726,
25,
80,
186,
2010,
161,
20,
1600,
40,
22488,
37,
21,
3724,
60,
64,
1,
7259,
772,
1,
7259,
236,
1,
7259,
800,
1,
4585,
255,
64,
1,
7259,
772,
1,
7259,
236,
1,
7259,
800,
1,
4585,
255,
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... |
VC6 setting additional include path using env vars?
===
I can't believe I am asking this...
It has been a while since I used VC6. I set up what I thought was the correct way to include additional directories for include files (I removed another developer's hard coded paths) and put in something like:
%MY_DIR%\include
but this does not work. Am I missing something? Did VC6 not allow this? It seems like a pretty basic thing to have and now that I think about it it I can't recall ever having done it before...
(I did stop and re-start VC6 after I set the variables)
Google search and a quick search here did not reveal anything.
| 0 | [
2,
13,
8990,
379,
2697,
1351,
468,
2013,
568,
1957,
710,
4033,
18,
60,
800,
3726,
3726,
31,
92,
22,
38,
985,
31,
589,
3379,
48,
9,
9,
9,
32,
63,
74,
21,
133,
179,
31,
147,
13,
8990,
379,
9,
31,
309,
71,
98,
31,
289,
23,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I find where my .Net app is leaking Windows handles?
===
I've got a WinForms .Net app that runs over a lot of XPS documents (thousands) and during this run the number of handles (according sysinternals process monitor and task manager) increases by between 3-10 for each document. I heavily suspect that these are handles that are opened and not closed by the MS .Net XPS framework libraries but I can't track it down.
Despite stepping through the code the handle count increases at different points during the same run. For example, one pass through the loop and the handle count will jump by 1 on one line and next time it might not, or it might jump by 2. So I suspect the XPS com components have a handle leak.
Memory use is fine though, but if I keep exhausting handles like this then I'll crash the app and maybe the desktop.
So far I have tried sysinternals process explorer to look at the handles but they are all marked as <unknown> with no more detail. Also used handle.exe from sysinternals and this does not show any significant different between a before, during and after snapshot.
Any clues on how to track down where the handles are going? I think I'm going to have to simplify to a single threaded console app to test.
Regards
Ryan | 0 | [
2,
184,
107,
31,
477,
113,
51,
13,
9,
2328,
4865,
25,
26334,
1936,
3053,
18,
60,
800,
3726,
3726,
31,
22,
195,
330,
21,
628,
4190,
18,
13,
9,
2328,
4865,
30,
1461,
84,
21,
865,
16,
23045,
18,
4374,
13,
5,
27904,
18,
6,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how-to initialize 'const std::vector<T>' like a c array
===
Is there an elegant way to create and initialize a `const std::vector<const T>` like `const T a[] = { ... }` to a fixed (and small) number of values?
I need to call a function frequently which expects a `vector<T>`, but these values will never change in my case.
In principle I thought of something like
namespace {
const std::vector<const T> v(??);
}
since v won't be used outside of this compilation unit. | 0 | [
2,
184,
8,
262,
2104,
2952,
13,
22,
12124,
38,
354,
43,
45,
45,
28033,
1,
38,
1,
22,
101,
21,
272,
7718,
800,
3726,
3726,
25,
80,
40,
11614,
161,
20,
1600,
17,
2104,
2952,
21,
13,
1,
12124,
38,
354,
43,
45,
45,
28033,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RedCloth's odd support of the <del> tag
===
I am using RedCloth with Rails 2.1.1. The Textile `<del>` tag markup format (i.e. -delete-) was not translating at all. Tried a few choice options.
> x=RedCloth.new('foobar -blah-')
=> "foobar -blah-"
> x.to_html
=> "<p>foobar <del>blah</del></p>" # WORKED!
> x=RedCloth.new('foobar * -blah-')
=> "foobar * -blah-"
> x.to_html
=> "<p>foobar * <del>blah</del></p>" # WORKED!
> x=RedCloth.new("foobar\n* -blah-")
=> "foobar\n* -blah-"
> x.to_html
=> "<p>foobar</p>\n<ul>\n\t<li>-blah-</li>\n</ul>" # DID NOT WORK!
It appears to me that newlines are the culprit in throwing RedCloth up-in-arms. Any solutions to getting RedCloth to properly recognize '-delete-'? I have tried RedCloth 4.0.1, 4.0.3, and 4.0.4.
| 0 | [
2,
402,
15549,
22,
18,
4210,
555,
16,
14,
13,
1,
3436,
1,
3383,
800,
3726,
3726,
31,
589,
568,
402,
15549,
29,
2240,
18,
172,
9,
165,
9,
165,
9,
14,
9770,
13,
1,
3436,
1,
3383,
943,
576,
2595,
13,
5,
49,
9,
62,
9,
13,
8,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multipart text field in pdf form, using OpenOffice Writer
===
So, this might be a crazy idea, so bear with me.
[warning: hackish]
Using OpenOffice.org Writer, one can easily make simple pdf forms (since Writer does XForms, and can export to PDF, and embed the form using FDF). I'd like to make a text entry field with this property:
- if the field overflows, put the overflow on an additional page, or in some special area on the page, labeled "Additional comments" or something
- Basically, what I imagine:
- textbox1 = fixed size
- textbox2 = fixed size (perhaps on another page) to contain the overflow from textbox1
I'm new to Writer, FDF, and the like, so if this is impossible, I'd be glad to hear that as well. Thanks in advance!
| 0 | [
2,
1889,
3091,
1854,
575,
19,
13,
11124,
505,
15,
568,
368,
17047,
1462,
800,
3726,
3726,
86,
15,
48,
530,
44,
21,
3328,
882,
15,
86,
2746,
29,
55,
9,
636,
1885,
2981,
45,
11835,
1595,
500,
568,
368,
17047,
9,
5583,
1462,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Raising C# events with an extension method - is it bad?
===
We're all familiar with the horror that is C# event declaration. To ensure thread-safety, [the standard is to write something like this][1]:
public event EventHandler SomethingHappened;
protected virtual void OnSomethingHappened(EventArgs e)
{
var handler = SomethingHappened;
if (handler != null)
handler(this, e);
}
Recently in some other question on this board (which I can't find now), someone pointed out that extension methods could be used nicely in this scenario. Here's one way to do it:
static public class EventExtensions
{
static public void RaiseEvent(this EventHandler @event, object sender, EventArgs e)
{
var handler = @event;
if (handler != null)
handler(sender, e);
}
static public void RaiseEvent<T>(this EventHandler<T> @event, object sender, T e)
where T : EventArgs
{
var handler = @event;
if (handler != null)
handler(sender, e);
}
}
With these extension methods in place, all you need to declare and raise an event is something like this:
public event EventHandler SomethingHappened;
void SomeMethod()
{
this.SomethingHappened.RaiseEvent(this, EventArgs.Empty);
}
My question: Is this a good idea? Are we missing anything by not having the standard On method? (One thing I notice is that it doesn't work with events that have explicit add/remove code.)
[1]: http://blogs.msdn.com/brada/archive/2005/01/14/353132.aspx | 0 | [
2,
5698,
272,
5910,
963,
29,
40,
3896,
2109,
13,
8,
25,
32,
896,
60,
800,
3726,
3726,
95,
22,
99,
65,
3694,
29,
14,
3930,
30,
25,
272,
5910,
807,
7098,
9,
20,
4062,
9322,
8,
18166,
1084,
15,
636,
124,
1236,
25,
20,
2757,
301... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Automatic Index Creation?
===
Why don't databases automatically index tables based on query frequency? Do any tools exist to analyze a database and the queries it is receiving, and automatically create, or at least suggest which indexes to create?
I'm specifically interested in MySQL, but I'd be curious for other databases as well. | 0 | [
2,
6715,
4348,
2502,
60,
800,
3726,
3726,
483,
221,
22,
38,
6018,
18,
7499,
4348,
7484,
432,
27,
25597,
5328,
60,
107,
186,
4672,
3182,
20,
16051,
21,
6018,
17,
14,
9386,
2829,
32,
25,
3396,
15,
17,
7499,
1600,
15,
54,
35,
639,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Comments field in SharePoint Issue Tracking list
===
I've created a list using the SharePoint (MOSS 2007) Issue Tracking List. A "Comments" field is automatically created in this list. The Comments column has extra functionality that provides a sort of history/log whenever an edit is made to a list item. Unfortunately, a comment entry is created even when an insignificant edit is made. For example, I could edit the title of the list item and leave the comment field blank. This results in a blank entry being saved for the Comments field (except the date/time of the edit and the person making it). If there are several edits made (with the Comments field left empty), then several blank entries appear to be stored in the data (for the Comment field). Is there a way to not save a comment entry if it's blank?
Also, is there a way to have a Comments field in a Custom List? This column seems to only be available in the Issues Tracking List. | 0 | [
2,
7534,
575,
19,
1891,
3132,
1513,
10353,
968,
800,
3726,
3726,
31,
22,
195,
679,
21,
968,
568,
14,
1891,
3132,
13,
5,
7076,
18,
624,
6,
1513,
10353,
968,
9,
21,
13,
7,
960,
6601,
7,
575,
25,
7499,
679,
19,
48,
968,
9,
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... |
SxS installations and WiX
===
I'm trying to figure out how to deal with installation and deployment of our project which is a framework. Typically developers would install the framework and then have their .Net applications reference our dlls.
The framework has 2 levels:
1. A number of native C++ dlls
2. Some C++\CLI and C# assemblies (all are dlls) that reference the native dlls
I want to provide an installer that puts the .Net assemblies in the GAC and installs the native assemblies in the WinSxS folder. So far I haven't been able to find much info about installing SxS assemblies. I know it can be done using MSI, and I was wondering if anyone knows how to do it with WiX or with some other installer tool.
I believe this cannot be done using the Visual Studio setup projects.
Thanks for the help
Dan
| 0 | [
2,
13,
18,
396,
18,
16885,
17,
4807,
396,
800,
3726,
3726,
31,
22,
79,
749,
20,
1465,
70,
184,
20,
1183,
29,
7758,
17,
10475,
16,
318,
669,
56,
25,
21,
6596,
9,
2442,
10168,
83,
16146,
14,
6596,
17,
94,
57,
66,
13,
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... |
Getting renders to recognize custom routing paths
===
So I have a snazzy custom route for login
# routes.rb
map.login '/login', :controller => 'sessions', :action => 'new'
Visit www.asite.com/login and you're there. As is custom with failed login, however, we'll do the following in our action. Note what happens on failed login.
# sessions_controller.rb
def create
self.current_user = User.authenticate(params[:email], params[:password])
if logged_in?
# some work and redirect the user
else
flash.now[:warning] = "The email and/or password you entered is invalid."
render :action => 'new'
end
end
This is very typical. Simply render the new action and prompt for login again. Unfortunately you also get with it an ugly URL: www.asite.com/session. Ick! Is it possible to get rendering to respect the original URL? | 0 | [
2,
1017,
16535,
18,
20,
5844,
5816,
19880,
12074,
800,
3726,
3726,
86,
31,
57,
21,
13,
18,
325,
5092,
93,
5816,
858,
26,
6738,
108,
6926,
5050,
9,
7549,
2942,
9,
5567,
108,
13,
22,
118,
5567,
108,
22,
15,
13,
45,
12898,
1252,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 low-level /embedded systems programming hard for software developers?
===
Given my background as a generalist, I can cover much of the area from analog electronics to writing simple applications that interface to a RDBMS backend.
I currently work in a company that develops hardware to solve industry-specific problems. We have an experienced programmer that have written business apps, video games, and a whole bunch of other stuff for PC's. But when I talk to him about doing low-level programming, he simultaneously express interest and also doubt/uncertainty about joining the project.
Even when talking about PC's, he seems to be more comfortable operating at the language level than the lower-level stuff (instruction sets, ISR's). Still, he's a smart guy, and I think he'd enjoy the work once he is over the initial learning hump. But maybe that's my own enthusiasm for low-level stuff talking... If he was truly interested, maybe he would already have started learning stuff in that direction?
Do you have experience in making that software-to-hardware (or low-level software) transition? Or, better yet, of taking a software only guy, and transitioning him to the low-level stuff?
| 0 | [
2,
25,
708,
8,
3906,
13,
118,
1503,
4283,
7424,
1242,
3143,
552,
26,
2306,
10168,
60,
800,
3726,
3726,
504,
51,
2395,
28,
21,
297,
702,
15,
31,
92,
1227,
212,
16,
14,
217,
37,
11523,
7956,
20,
1174,
1935,
3767,
30,
6573,
20,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tracing which process that has opened a particular file
===
From kernel mode in Windows I'm able to intercept and monitor virtually all actions performed on a particular disk. When a file is opened for any purpose I get an event.
Now I want to trace which application that opened it. I think this should be possible but don't know how.
I'm using the standard file management functions in Windows Win32 API.
Thanks in advance.
/Robert | 0 | [
2,
20005,
56,
953,
30,
63,
520,
21,
1498,
3893,
800,
3726,
3726,
37,
17007,
3740,
19,
1936,
31,
22,
79,
777,
20,
18324,
17,
7626,
9149,
65,
3078,
986,
27,
21,
1498,
8582,
9,
76,
21,
3893,
25,
520,
26,
186,
2131,
31,
164,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Has anyone used or written an Ant task to compile (Rhino) JavaScript to Java bytecode?
===
I'd like to use the [Rhino JavaScript][1] compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips on how to write one?
[1]: https://developer.mozilla.org/en/Rhino_JavaScript_Compiler | 0 | [
2,
63,
1276,
147,
54,
642,
40,
40,
38,
3005,
20,
26561,
13,
5,
21882,
111,
6,
8247,
8741,
20,
8247,
34,
591,
9375,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
275,
14,
636,
21882,
111,
8247,
8741,
500,
2558,
165,
500,
21486,
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... |
What are best practices for designing XML schemas?
===
As an amateur software developer (I'm still in academia) I've written a few schemas for XML documents. I routinely run into design flubs that cause ugly-looking XML documents because I'm not entirely certain what the semantics of XML exactly are.
My assumptions:
<property> value </property>
property = value
<property attribute="attval"> value </property>
A property with a special descriptor, the attribute.
<parent>
<child> value </child>
</parent>
The parent has a characteristic "child" which has the value "value."
<tag />
"Tag" is a flag or it directly translates to text. I'm not sure on this one.
<parent>
<child />
</parent>
"child" describes "parent." "child" is a flag or boolean. I'm not sure on this one, either.
Ambiguity arises if you want to do something like representing cartesian coordinates:
<coordinate x="0" y="1 />
<coordinate> 0,1 </coordinate>
<coordinate> <x> 0 </x> <y> 1 </y> </coordinate>
Which one of those is most correct? I would lean towards the third based upon my current conception of XML schema design, but I really don't know.
What are some resources that succinctly describe how to effectively design xml schemas?
| 0 | [
2,
98,
50,
246,
5242,
26,
15026,
23504,
23874,
18,
60,
800,
3726,
3726,
28,
40,
3852,
2306,
10058,
13,
5,
49,
22,
79,
174,
19,
19450,
6,
31,
22,
195,
642,
21,
310,
23874,
18,
26,
23504,
4374,
9,
31,
22388,
485,
77,
704,
6777,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 FTP Server with XCRC and SSL (Other than CuteFTP SS)
===
I am currently using CuteFTP Secure Sever 3.3 but it has problems. It seems to muck up connection management, drop connections occasionally and die on large files.
I am looking for a replacement that supports XCRC because I use the *Synchronize Folders* function in the CuteFTP client. I would prefer to detect file similarity by XCRC rather than a simple size/name/modification date if possible.
Are there any other servers that support XCRC and SSL?
| 0 | [
2,
1936,
1187,
306,
8128,
29,
13,
21550,
5453,
17,
13,
18,
18,
255,
13,
5,
9539,
119,
10901,
3072,
306,
13,
18,
18,
6,
800,
3726,
3726,
31,
589,
871,
568,
10901,
3072,
306,
4315,
15114,
203,
9,
240,
47,
32,
63,
1716,
9,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Knowing the plaintext, how to discover the encryption scheme used?
===
I have some char() fields in a DBF table that were left encrypted by a past developer in the project.
However, I know the plaintext result of the decryption of several records. How can I determine the function/algorithm/scheme to decrypt the original data? | 2 | [
2,
2506,
14,
3748,
11969,
15,
184,
20,
6297,
14,
24420,
4276,
147,
60,
800,
3726,
3726,
31,
57,
109,
4892,
5,
6,
2861,
19,
21,
13,
43,
12425,
859,
30,
46,
225,
29403,
34,
21,
640,
10058,
19,
14,
669,
9,
207,
15,
31,
143,
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... |
Constructing a Domain Object from multiple DTOs
===
Suppose you have the canonical Customer domain object. You have three different screens on which Customer is displayed: External Admin, Internal Admin, and Update Account.
Suppose further that each screen displays only a subset of all of the data contained in the Customer object.
The problem is: when the UI passes data back from each screen (e.g. through a DTO), it contains only that subset of a full Customer domain object. So when you send that DTO to the Customer Factory to re-create the Customer object, you have only part of the Customer.
Then you send this Customer to your Customer Repository to save it, and a bunch of data will get wiped out because it isn't there. Tragedy ensues.
So the question is: how would you deal with this problem?
Some of my ideas:
- include an argument to the
Repository indicating which part of
the Customer to update, and ignore
others
- when you load the Customer, keep it in static memory, or in the session, or wherever, and then when you receive one of the DTOs from the UI, update only the parts relevant to the DTO
IMO, both of these are kludges. Are there any other better ideas? | 0 | [
2,
18660,
21,
4603,
3095,
37,
1886,
13,
43,
262,
18,
800,
3726,
3726,
5787,
42,
57,
14,
5742,
4272,
7705,
4603,
3095,
9,
42,
57,
132,
421,
14236,
27,
56,
7705,
25,
6115,
45,
4886,
21,
43,
2160,
15,
3117,
21,
43,
2160,
15,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't this regular expression work in PHP?
===
I need to match (case insensitive) "abcd" and an optional trademark symbol
Regex: "/abcd(™)?/gi"
See example:
<?php
preg_match("/abcd(™)?/gi","AbCd™ U9+",$matches);
print_r($matches);?>
When I run this $matches isn't populated with anything... not even created as an empty array. Any ideas?
Thanks. | 0 | [
2,
483,
1437,
22,
38,
48,
1290,
1803,
170,
19,
13,
26120,
60,
800,
3726,
3726,
31,
376,
20,
730,
13,
5,
10325,
19,
19435,
6,
13,
7,
21880,
43,
7,
17,
40,
12832,
11005,
4678,
7953,
1706,
45,
13,
7,
118,
21880,
43,
5,
38,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Troubleshooting Visual Studio 2008 crash when loading a solution
===
I've downloaded the source for SubSonic via SVN. When I try to open the project in Visual Studio 2008, it converts the solution, loads all the projects then disappears without an error message. Subsequent loads of the solution do the same. If I run devenv /safemode and then open the project it works fine, but I can't use any add-ins.
Any ideas for tracking down the crash? | 0 | [
2,
2572,
12511,
68,
3458,
1120,
570,
4597,
76,
12797,
21,
4295,
800,
3726,
3726,
31,
22,
195,
23887,
14,
1267,
26,
972,
17766,
1197,
13,
18,
16578,
9,
76,
31,
1131,
20,
368,
14,
669,
19,
3458,
1120,
570,
15,
32,
8406,
18,
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... |
Drawing an iso line of a 2D implicit scalar field
===
I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation.
I would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0' iso-line can have multiple continuous instances and it is not guaranteed that all of them are connected.
Calculating the value for each pixel is not an option because that would take too much time - in the order of a few seconds and this needs to be as real time as possible.
What I'm currently using is a recursive division of space which can be thought of as a kind of quad-tree. I take an initial, very coarse sampling of the space and if I find a square which contains a transition from positive to negative values, I recursively divide it to 4 smaller squares and checks again, stopping at the pixel level. The positive-negative transition is detected by sampling a sqaure in its 4 corners.
This work fairly well, except when it doesn't. The iso-lines which are drawn sometimes get cut because the transition detection fails for transitions which happen in a small area of an edge and that don't cross a corner of a square.
Is there a better way to do iso-line drawing in this settings? | 0 | [
2,
3533,
40,
11899,
293,
16,
21,
172,
43,
20290,
28960,
575,
800,
3726,
3726,
31,
57,
40,
20290,
28960,
575,
2811,
19,
172,
43,
15,
26,
352,
454,
19,
172,
43,
31,
92,
233,
32,
23909,
40,
5340,
28960,
1923,
47,
82,
21,
4131,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I set the socket timeout in Ruby?
===
How do you set the timeout for blocking operations on a Ruby socket? | 0 | [
2,
184,
107,
31,
309,
14,
18482,
85,
1320,
19,
10811,
60,
800,
3726,
3726,
184,
107,
42,
309,
14,
85,
1320,
26,
11828,
1311,
27,
21,
10811,
18482,
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... | [
1,
1,
1,
1,
1,
1,
1,
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... |
Lisp introspection? when a function is called and when it exits
===
With common lisp and I am assuming the introspection properties. How can I add code to common lisp code that will tell me when a function is called and when has finished executing. I want to take any lisp code and this particular modification to the code. I figure with lisp's AST analysis, this should be possible. | 0 | [
2,
2093,
3401,
17386,
7350,
872,
60,
76,
21,
1990,
25,
227,
17,
76,
32,
4350,
18,
800,
3726,
3726,
29,
757,
2093,
3401,
17,
31,
589,
11704,
14,
17386,
7350,
872,
3704,
9,
184,
92,
31,
3547,
1797,
20,
757,
2093,
3401,
1797,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL group by freight tracking
===
I am creating a procedure that allows my user to enter their Freight Bill number. I want to display the freight information on which flight it was flown on.
I can enter the freight bill number and it will display all 10 lines of this freight movement. I have 3 flights in this case. I am trying to make it group the information by the flights and combine up the pc counts and weight so I only show the 3 rows of information combined instead of the 10 rows for each content line item.
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `get_airbill_info2`(airbill char(8))
BEGIN
SELECT shipments.mawb,
shipments.`date`,
shipments.`time`,
shipments.shipname,
shipments.consname,
shipments.ttlpieces,
shipments.thirdname,
shipments.ttlweight,
shipments.origin,
shipments.destination,
shipments.customers_custid,
contents.contentid,
contents.lineno,
contents.linepcs,
contents.lineweight,
contents.shipments_shipid,
contents2flights.contents_lineno,
contents2flights.contents_shipments_shipid,
contents2flights.segments_flights_flightid,
contents2flights.segments_segmentid,
segments.flights_flightid,
segments.segmentid,
flights.flightid,
flights.flightno,
flights.flightdate,
flights.origin
FROM ( ( ( c283326_tracking.contents2flights contents2flights
JOIN
c283326_tracking.segments segments
ON (contents2flights.segments_segmentid =
segments.segmentid)
AND (contents2flights.segments_flights_flightid =
segments.flights_flightid))
JOIN
c283326_tracking.contents contents
ON (contents2flights.contents_shipments_shipid =
contents.shipments_shipid)
AND (contents2flights.contents_lineno = contents.lineno))
JOIN
c283326_tracking.shipments shipments
ON (contents.shipments_shipid = shipments.shipid))
JOIN
c283326_tracking.flights flights
ON (segments.flights_flightid = flights.flightid)
where mawb = airbill
GROUP BY contents.contentid;
END
| 0 | [
2,
51,
18,
22402,
214,
34,
7728,
10353,
800,
3726,
3726,
31,
589,
2936,
21,
7004,
30,
2965,
51,
4155,
20,
2830,
66,
7728,
1071,
234,
9,
31,
259,
20,
3042,
14,
7728,
676,
27,
56,
1690,
32,
23,
11261,
27,
9,
31,
92,
2830,
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... |
Failover search handling in Solr 3.4
===
Where is the code in Solr 3.4 or 3.5 that handles distributed Solr search for failover?
I dont seem to find the place where Search Handler component splits the shards param values on the pipe : "|".
&shards=host1:port1/solr|host2:port2/solr,host3:port3/solr
Isnt this supported yet in 3.4? | 0 | [
2,
7476,
2549,
2122,
7988,
19,
7176,
139,
203,
9,
300,
800,
3726,
3726,
113,
25,
14,
1797,
19,
7176,
139,
203,
9,
300,
54,
203,
9,
264,
30,
3053,
18,
4387,
7176,
139,
2122,
26,
7476,
2549,
60,
31,
1049,
2260,
20,
477,
14,
209,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 utf8 on the command line (using Perl or Python)?
===
How can I handle utf8 using Perl (or Python) on the command line?
I am trying to split the characters in each word, for example. This is very easy for non-utf8 text, for example:
$ echo "abc def" | perl -ne 'my @letters = m/(.)/g; print "@letters\n"' | less
a b c d e f
But with utf8 it doesn't work, of course:
$ echo "одобрение за" | perl -ne 'my @letters = m/(.)/g; print "@letters\n"' | less
<D0> <BE> <D0> <B4> <D0> <BE> <D0> <B1> <D1> <80> <D0> <B5> <D0> <BD> <D0> <B8> <D0> <B5> <D0> <B7> <D0> <B0>
because it doesn't know about the 2-byte characters.
It would also be good to know how this (i.e., command-line processing of utf8) is done in Python.
| 0 | [
2,
184,
20,
3053,
287,
11720,
457,
27,
14,
1202,
293,
13,
5,
12655,
416,
255,
54,
20059,
6,
60,
800,
3726,
3726,
184,
92,
31,
3053,
287,
11720,
457,
568,
416,
255,
13,
5,
248,
20059,
6,
27,
14,
1202,
293,
60,
31,
589,
749,
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... |
uploading file to django from iphone form.is_valid() failed
===
I am trying to upload image to django from iphone with ASIFormDataRequest.
in my django views.py
class UploadFileForm(forms.Form):
jid = forms.CharField(max_length=255)
file = forms.FileField()
@csrf_exempt
def upload_image(request):
if request.method == 'POST':
form = UploadFileForm(request.POST, request.FILES)
if form.is_valid(): ##this is always fail
newimage = Image(imgfile = request.FILES['image'])
newimage.save()
return HttpResponse('succeeded')
else:
return HttpResponse('failed')
in models.py
class Image(models.Model):
imgfile = models.FileField(upload_to='images/')
i got this in settings.py
MEDIA_ROOT = '/srv/www/media'
with the above code, i can't get the form validated, but if i remove form.is_valid(), then the image is successfully uploaded to /srv/www/media/images/
and the following is the iOS code:
formRequest = [ASIFormDataRequest requestWithURL:url];
[formRequest setPostFormat:ASIMultipartFormDataPostFormat];
formRequest.delegate = self;
[formRequest setData:UIImageJPEGRepresentation(image, 1.0f) withFileName:fileName andContentType:@"image/jpeg" forKey:@"image"];
[formRequest setPostValue:userName forKey:@"name"];
[formRequest setRequestMethod:@"POST"];
[formRequest setPostFormat:ASIMultipartFormDataPostFormat];
[formRequest startAsynchronous];
please, any suggestion is welcome and appreciated. | 0 | [
2,
71,
16866,
3893,
20,
3857,
14541,
37,
21024,
505,
9,
403,
1,
18506,
43,
5,
6,
1702,
800,
3726,
3726,
31,
589,
749,
20,
71,
8294,
1961,
20,
3857,
14541,
37,
21024,
29,
28,
13537,
18768,
99,
10351,
9,
19,
51,
3857,
14541,
4146,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did not receive a notification”!
===
So basically, I have an Activity that implements an interface and has several inherited functions. each of these function would be invoked and pass the data that will be used to update my List adapter. this is the snippet:
@Override
public void onEntriesAdded(List<String> addresses) throws RemoteException {
Log.v(TAG, "Entries Added notify!");
listEntriesAdd.clear();
listEntriesAdd = addresses;
rosterHandler.sendEmptyMessage(1);
}
@Override
public void onEntriesUpdated(List<String> addresses) throws RemoteException {
Log.v(TAG, "Entries Updated notify!");
listEntriesUpdate.clear();
listEntriesUpdate = addresses;
rosterHandler.sendEmptyMessage(2);
}
@Override
public void onEntriesDeleted(List<String> addresses) throws RemoteException {
Log.v(TAG, "onEntries deleted " + addresses);
listEntriesDel.clear();
listEntriesDel = addresses;
rosterHandler.sendEmptyMessage(3);
}
because I've seen any solutions before, I pass the the work for each function into a Handler:
private Handler rosterHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case 0:
// adding or any List<String> elements operations
break;
case 1:
// adding or any List<String> elements operations
break;
case 2:
// adding or any List<String> elements operations
break;
case 3:
// adding or any List<String> elements operations
break;
case 4:
// adding or any List<String> elements operations
break;
}
mAdapterContact.notifyDataSetChanged();
}
};
and then, there's a ServiceConnection class that would be called when I execute bindService:
@Override
protected void onResume() {
super.onResume();
if (!mBinded) {
Log.d(TAG, "Request BIND Service");
mBinded = bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
}
}
and the Service class:
private class MyServiceConnection implements ServiceConnection {
public MyServiceConnection() {
}
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
globalBinder = service;
mXmppFacade = IXmppFacade.Stub.asInterface(service);
try {
mRoster = mXmppFacade.getRoster();
if (mRoster != null) {
Log.i(TAG, "REBUILD ROSTER!!!");
rosterHandler.sendEmptyMessage(0);// send it to handler
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
try {
mRoster.removeRosterListener(ContactList.this);
} catch (RemoteException e) {
e.printStackTrace();
}
mXmppFacade = null;
mChatManager = null;
mRoster = null;
mListContact.clear();
mListGroup.clear();
mContactOnGroup.clear();
mBinded = false;
}
}
So as you can see, I currently updating my List actually, an expandable listview like this...
but everytime I get this error: **Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did not receive a notification”!**
I really confused, I don't know where to place these procedures properly to avoid this error and still can update my list :(
Please HELP! | 0 | [
2,
13005,
15,
968,
4725,
5143,
3859,
10066,
872,
45,
13,
1,
124,
2331,
16,
14,
9924,
106,
63,
1015,
47,
968,
4725,
144,
52,
2588,
21,
52,
4634,
1,
187,
800,
3726,
3726,
86,
11374,
15,
31,
57,
40,
2358,
30,
8713,
18,
40,
6573,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Loop through <select> and build array in the format: "value1","value2","value3"...
===
I wonder if anyone could suggest the best way of looping through all the `<option>` s in a `<select>` element with jQuery, and building an array.
Eg.
Instead of the following, whereby a string ins passed to the autoCompleteArray(),
$("#CityLocal").autocompleteArray(
[
"Aberdeen", "Ada", "Adamsville", "Zoar" //and a million other cities...
],
{
delay:10,
minChars:1,
matchSubset:1,
onItemSelect:selectItem,
onFindValue:findValue,
autoFill:true,
maxItemsToShow:10
}
);
...I need to loop through all the `<options>` in a `<select>` and push them into an array, and just pass that array variable to the function instead of a long string.
Eg,
$("#CityLocal").autocompleteArray(
[
MyBigArrayOfOptions
],
{
delay:10,
minChars:1,
matchSubset:1,
onItemSelect:selectItem,
onFindValue:findValue,
autoFill:true,
maxItemsToShow:10
}
);
I'd be grateful if you could suggest how to push stuff into an array in the correct format. I've pretty much sussed the looping part from another post on this site.
Thanks.
| 0 | [
2,
5293,
120,
13,
1,
18,
16964,
1,
17,
1895,
7718,
19,
14,
2595,
45,
13,
7,
15165,
165,
7,
15,
7,
15165,
135,
7,
15,
7,
15165,
240,
7,
9,
9,
9,
800,
3726,
3726,
31,
2666,
100,
1276,
110,
5601,
14,
246,
161,
16,
5293,
68,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best way to pretty print XML response in grails.
===
given this in a grails action:
def xml = {
rss(version: '2.0') {
...
}
}
render(contentType: 'application/rss+xml', xml)
i see this:
<rss><channel><title></title><description></description><link></link><item></item></channel></rss>
is there an easy way to pretty print the xml? something built into the render method, perhaps?
| 0 | [
2,
246,
161,
20,
1772,
4793,
23504,
1627,
19,
489,
7301,
18,
9,
800,
3726,
3726,
504,
48,
19,
21,
489,
7301,
18,
1028,
45,
6312,
23504,
800,
13,
1,
13,
1224,
18,
5,
10898,
45,
13,
22,
135,
9,
387,
22,
6,
13,
1,
13,
9,
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... |
Get size of SVG graphics by javascript
===
To add a svg graphics in html page, it is common to use object tag to wrap it like this:
<object id="svgid" data="mysvg.svg" type="image/svg+xml"
wmode="transparent" width="100" height="100">
this browser is not able to show SVG: <a linkindex="3"
href="http://getfirefox.com">http://getfirefox.com</a>
is free and does it!
If you use Internet Explorer, you can also get a plugin:
<a linkindex="4" href="http://www.adobe.com/svg/viewer/install/main.html">
http://www.adobe.com/svg/viewer/install/main.html</a>
</object>
If you do not use width and height attributes in the object tag, the svg will be displayed in full size. Normally I get svg files from Open Graphics Library for testing. Is there any way to get svg's size by using JavaScript? Or maybe I should just look at the svg xml file to find out the size from the top svg tag? | 0 | [
2,
164,
1072,
16,
13,
18,
22955,
8351,
34,
8247,
8741,
800,
3726,
3726,
20,
3547,
21,
13,
18,
22955,
8351,
19,
13,
15895,
2478,
15,
32,
25,
757,
20,
275,
3095,
3383,
20,
8118,
32,
101,
48,
45,
13,
1,
23793,
4924,
3726,
7,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sharepoint: Web Part vs. ASP.NET User Control
===
When creating web parts for Sharepoint, is it better to create an actual web part, or is using and ASP.NET User Control (.ascx) just as good?
I already know how to create the user controls that I need, so it seems like the extra effort of creating a web part is just unnecessary leg work.
What are the advantages of using a web part over just creating and ASP.NET user control? | 0 | [
2,
1891,
3132,
45,
2741,
141,
4611,
9,
28,
306,
9,
2328,
4155,
569,
800,
3726,
3726,
76,
2936,
2741,
1341,
26,
1891,
3132,
15,
25,
32,
574,
20,
1600,
40,
3463,
2741,
141,
15,
54,
25,
568,
17,
28,
306,
9,
2328,
4155,
569,
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... |
POST Login with ActionScript 2.0
===
I have created a pretty basic Flash website for a client (<a href="http://sainteclaire.ten90demos.com/">http://sainteclaire.ten90demos.com/</a>) and am having an issue programming a Client Login feature that he would like. If you navigate to the site and click Client Login, it takes you to a login page. The way I need this to work is -- within the Flash, using ActionScript 2.0 -- have the user enter their UserID and Password and click to login, which submits POST vars to the form action of the Client Login website.
Is this possible/legal to do from a different domain? How would I go about doing this, assuming it's possible? | 0 | [
2,
678,
6738,
108,
29,
1028,
8741,
172,
9,
387,
800,
3726,
3726,
31,
57,
679,
21,
1772,
2125,
4433,
2271,
26,
21,
6819,
13,
5,
1,
58,
746,
14057,
3726,
7,
21127,
6903,
12591,
62,
11172,
62,
9,
1316,
3165,
19274,
18,
9,
960,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fixed-size array database field
===
I need to store several date values in a database field. These values will be tied to a "User" such that each user will have their own unique set of these several date values.
I could use a one-to-many relationship here but each user will have exactly 4 date values tied to them so I feel that a one-to-many table would be overkill (in many ways e.g. speed) but if I needed to query against them I would need those 4 values to be in different fields e.g. MyDate1 MyDate2 ... etc. but then the SQL command to fetch it out would have to check for 4 values each time.
So the one-to-many relationship would probably be the best solution, but is there a better/cleaner/faster/whatever another way around? Am I designing it correctly?
The platform is MS SQL 2005 but solution on any platform will do, I'm mostly looking for proper db designing techniques. | 0 | [
2,
3535,
8,
10454,
7718,
6018,
575,
800,
3726,
3726,
31,
376,
20,
1718,
238,
1231,
4070,
19,
21,
6018,
575,
9,
158,
4070,
129,
44,
3802,
20,
21,
13,
7,
16704,
7,
145,
30,
206,
4155,
129,
57,
66,
258,
2619,
309,
16,
158,
238,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Myspace Music Layout Question
===
How do I push my content to the top of the page to not cover up the ad, but to cover the menu and myspace links. I want to do something similar to: [http://www.myspace.com/sensesfail][1] and [http://www.myspace.com/attackx2][2]. Thanks.
[1]: http://www.myspace.com/sensesfail
[2]: http://www.myspace.com/attackattack | 0 | [
2,
51,
5582,
232,
9106,
1301,
800,
3726,
3726,
184,
107,
31,
3250,
51,
2331,
20,
14,
371,
16,
14,
2478,
20,
52,
1227,
71,
14,
21,
43,
15,
47,
20,
1227,
14,
11379,
17,
51,
5582,
6271,
9,
31,
259,
20,
107,
301,
835,
20,
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... |
Strategies for handling memory consumption in PHP5 ?
===
We have a large management software that is producing big reports of all kinds, based on numerous loops, with database retrievals, objects creations (many), and so on.
On PHP4 it could run happily with a memory limit of 64 MB - now we have moved it on a new server and with the same database - same code, the same reports won't come up without a gig of memory limit...
I know that PHP5 has changed under the hood quite a lot of things, but is there a way to make it behave ?
The question at the end is, what strategies do you apply when you need to have your scripts on a diet ? | 0 | [
2,
10272,
26,
7988,
1912,
8330,
19,
13,
26120,
264,
13,
60,
800,
3726,
3726,
95,
57,
21,
370,
1097,
2306,
30,
25,
4081,
580,
2813,
16,
65,
8623,
15,
432,
27,
1548,
19661,
15,
29,
6018,
28419,
18,
15,
3916,
2502,
18,
13,
5,
148... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.