unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
C#: File-size format provider
===
Is there any easy way to create a class that uses **IFormatProvider** that writes out a user-friendly file-size?
public static string GetFileSizeString(string filePath)
{
FileInfo info = new FileInfo(@"c:\windows\notepad.exe");
long size = info.Length;
string sizeString = size.ToString(FileSizeFormatProvider); // This is where the class does its magic...
}
It should result in strings formatted something like "*2,5 MB*", "*3,9 GB*", "*670 bytes*" and so on. | 0 | [
2,
272,
5910,
45,
3893,
8,
10454,
2595,
11747,
800,
3726,
3726,
25,
80,
186,
2010,
161,
20,
1600,
21,
718,
30,
2027,
13,
1409,
49,
23588,
26735,
139,
1409,
30,
6215,
70,
21,
4155,
8,
15950,
3893,
8,
10454,
60,
317,
12038,
3724,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 all table constraints in Oracle
===
How can I disable all table constrains in Oracle with a single command?
This can be either for a single table, a list of tables, or for all tables. | 0 | [
2,
1460,
579,
65,
859,
16747,
19,
15759,
800,
3726,
3726,
184,
92,
31,
1460,
579,
65,
859,
11608,
11809,
18,
19,
15759,
29,
21,
345,
1202,
60,
48,
92,
44,
694,
26,
21,
345,
859,
15,
21,
968,
16,
7484,
15,
54,
26,
65,
7484,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to use system environment variables in VS 2008 Post-Build events?
===
How do I use system environment variables in my project post-build events without having to write and execute an external batch file? I thought that it would be as easy as creating a new environment variable named `LHDLLDEPLOY` and writing the following in my post-build event textbox:
copy $(TargetPath) %LHDLLDEPLOY%\$(TargetFileName) /Y
copy $(TargetName).pdb %LHDLLDEPLOY%\$(TargetName).pdb /Y
...but alas, no. The build output shows that it wrote the files to the "`%LHDLLDEPLOY%`" folder (as "`1 file(s) copied`" twice), but the files are not in the equated path and there is not a new folder called "`LHDLLDEPLOY`"
Where did they actually go, and how do I do this correctly?
| 0 | [
2,
184,
20,
275,
329,
2307,
12157,
19,
4611,
570,
678,
8,
29361,
963,
60,
800,
3726,
3726,
184,
107,
31,
275,
329,
2307,
12157,
19,
51,
669,
678,
8,
29361,
963,
366,
452,
20,
2757,
17,
15644,
40,
4886,
13064,
3893,
60,
31,
289,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.Net Data structures: ArrayList, List, HashTable, Dictionary, SortedList, SortedDictionary, etc.
===
.Net has a lot of complex data structures. Unfortunately, some of them are quite similar and I'm not always sure when to use one and when to use another. Most of my C# and VB books talk about them to a certain extent, but never really go into any real detail.
What's the difference between Array, ArrayList, List, Hashtable, Dictionary, SortedList, and SortedDictionary?
Which ones are enumerable (IList -- can do 'foreach' loops)? Which ones use key/value pairs (IDict)?
What about memory footprint? Insertion speed? Retrieval speed?
Are there any other data structures worth mentioning? | 0 | [
2,
13,
9,
2328,
1054,
3815,
45,
7718,
5739,
15,
968,
15,
19170,
5924,
15,
9186,
15,
22554,
5739,
15,
22554,
22595,
1857,
15,
2722,
9,
800,
3726,
3726,
13,
9,
2328,
63,
21,
865,
16,
1502,
1054,
3815,
9,
6200,
15,
109,
16,
105,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Menu control CSS breaks when inside UpdatePanel
===
I have a menu control inside of an updatepanel. When I hover over a selected item, and then move back off of it, the css class gets set to staticSubMenuItem instead of staticSubMenuItemSelected. Is there a fix for this?
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Menu ID="SubMenu" runat="server" SkinID="subMenu" OnMenuItemClick="SubMenu_Click"
CssClass="floatRight" StaticMenuItemStyle-CssClass="staticSubMenuItem" StaticSelectedStyle-CssClass="staticSubMenuItemSelected"
StaticHoverStyle-CssClass="staticSubMenuItemSelected">
<Items>
<asp:MenuItem Text="Item 1" Value="0" Selected="true" />
<asp:MenuItem Text="Item 2" Value="1" />
</Items>
</asp:Menu>
</ContentTemplate>
</asp:UpdatePanel> | 0 | [
2,
11379,
569,
272,
18,
18,
7947,
76,
572,
11100,
3206,
532,
800,
3726,
3726,
31,
57,
21,
11379,
569,
572,
16,
40,
11100,
3206,
532,
9,
76,
31,
21350,
84,
21,
1704,
9101,
15,
17,
94,
780,
97,
168,
16,
32,
15,
14,
272,
18,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the most efficient way to save a byte array as a file on disk in C#?
===
Pretty simple scenario. I have a web service that receives a byte array that is to be saved as a particular file type on disk. What is the most efficient way to do this in C#? | 0 | [
2,
98,
25,
14,
127,
8243,
161,
20,
2079,
21,
34,
591,
7718,
28,
21,
3893,
27,
8582,
19,
272,
5910,
60,
800,
3726,
3726,
1772,
1935,
12705,
9,
31,
57,
21,
2741,
365,
30,
8359,
21,
34,
591,
7718,
30,
25,
20,
44,
4377,
28,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to setup non-admin development in Visual Studio 2005 and 2003
===
We have been given the directive to make sure that when we develop we are running out of the administrator and poweruser groups to prevent security holes. What are the steps to take to make this possible, but still be able to debug, code, and install when needed?
We develop ASP.NET as well as VB.NET applications.
Thanks!
Brooke Jackson | 0 | [
2,
184,
20,
18161,
538,
8,
1283,
2160,
522,
19,
3458,
1120,
812,
17,
973,
800,
3726,
3726,
95,
57,
74,
504,
14,
15626,
20,
233,
562,
30,
76,
95,
2803,
95,
50,
946,
70,
16,
14,
8890,
17,
414,
16704,
1170,
20,
2501,
1221,
8486,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Doing CRUD in Turbogears
===
Are there any good packages or methods for doing extensive CRUD (create-retrieve-update-delete) interfaces in the Turbogears framework. The FastDataGrid widget is too much of a black box to be useful and CRUDTemplate looks like more trouble than rolling my own. Ideas? Suggestions? | 0 | [
2,
845,
11498,
43,
19,
12036,
834,
5446,
800,
3726,
3726,
50,
80,
186,
254,
16875,
54,
3195,
26,
845,
3386,
11498,
43,
13,
5,
6037,
1373,
8,
6239,
3272,
195,
8,
576,
8209,
8,
24249,
591,
6,
6573,
18,
19,
14,
12036,
834,
5446,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 java open source toolkit to visualize a GML fragment
===
I'm looking for a way to visualize a piece of GML I'm receiving. What is the best freely available java library to use for this task? | 0 | [
2,
246,
8247,
368,
1267,
5607,
13703,
20,
3458,
2952,
21,
12600,
255,
14847,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
161,
20,
3458,
2952,
21,
1855,
16,
12600,
255,
31,
22,
79,
3396,
9,
98,
25,
14,
246,
11298,
904,
8247,
1248,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Best tool for Software System Diagramming
===
Over the years, I have tried many times to find a good, easy to use, cross platform tool for some basic software system diagramming. The UML tools I have tried seemed to get in my way more than help. So far, the solution I keep returning to is Visio, which is both Windows-only and expensive. Although its far from ideal, it does provide some basic building block and allows things like grid placement and zooming. I wanted to see if there is a great tool out there that I'm just missing that fits at least some of the criteria mentioned. | 4 | [
2,
246,
5607,
26,
2306,
329,
14161,
3863,
800,
3726,
3726,
84,
14,
122,
15,
31,
57,
794,
151,
436,
20,
477,
21,
254,
15,
2010,
20,
275,
15,
919,
2452,
5607,
26,
109,
2125,
2306,
329,
14161,
3863,
9,
14,
13,
723,
255,
4672,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a way to have class variables with setter/getter like virtual variables?
===
I am embedding Ruby into my C project and want to load several files that define a class inherited from my own parent class. Each inherited class needs to set some variables on initialization and I don't want to have two different variables for Ruby and C.
Is there a way to define a class variable that has an own custom setter/getter or is this a stupid way to handle it? Maybe it would be better with a custom datatype? | 0 | [
2,
25,
80,
21,
161,
20,
57,
718,
12157,
29,
309,
815,
118,
3060,
815,
101,
6599,
12157,
60,
800,
3726,
3726,
31,
589,
11911,
69,
3258,
10811,
77,
51,
272,
669,
17,
259,
20,
6305,
238,
6488,
30,
9267,
21,
718,
7179,
37,
51,
258... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Technology Themed Gift Basket
===
For customer service week this year, I have the privileged task of creating a technology themed gift basket. I'm trying to keep the basket under $50 as I have a bluetooth keyboard/mouse combo that I'll be adding to it. Besides canned air and monitor wipes, are there any other recommendations for a PC based basket? I was thinking about a USB thumb drive and/or blank CD/DVD media. Any other ideas? | 0 | [
2,
1099,
14,
4688,
4207,
9136,
800,
3726,
3726,
26,
7705,
365,
877,
48,
159,
15,
31,
57,
14,
25317,
3005,
16,
2936,
21,
1099,
14,
4688,
4207,
9136,
9,
31,
22,
79,
749,
20,
643,
14,
9136,
131,
21946,
28,
31,
57,
21,
705,
15808,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Web Services framework versus a custom XML over HTTP protocol?
===
I am looking for **specific guidelines** for when to use Web Services frameworks versus a well-documented custom protocol that communicates using XML over HTTP.
I am less concerned about performance than I am about maintainability and ease-of-development both for client-side and server-side code. For example, I can develop a custom protocol that talks XML without writing tons of descriptor files that Web Services frameworks seem to require. | 0 | [
2,
2741,
687,
6596,
5706,
21,
5816,
23504,
84,
7775,
8494,
60,
800,
3726,
3726,
31,
589,
699,
26,
13,
1409,
9219,
12629,
1409,
26,
76,
20,
275,
2741,
687,
6596,
18,
5706,
21,
134,
8,
28132,
69,
5816,
8494,
30,
8709,
18,
568,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pretty URLs for search pages
===
I really enjoy having "pretty" URLs (e.g. /Products/Edit/1 instead of /products.aspx?productID=1) but I'm at a loss on how to do this for pages that let you search by a large number of variables.
For instance, let's say you have a page that lets a user search for all products of a particular type with a certain name and near a specific address. Would you do this with really long "pretty" URLs (e.g. /Products/Search/Type/{producttype}/Name/{name}/Address/{address}") or just resort to using url params (e.g. /Products/Search?productType={producttype}&name={name}&address={address})? | 0 | [
2,
1772,
13,
911,
7532,
26,
2122,
4434,
800,
3726,
3726,
31,
510,
4696,
452,
13,
7,
21542,
7,
13,
911,
7532,
13,
5,
62,
9,
263,
9,
13,
118,
14086,
18,
118,
69,
242,
11698,
700,
16,
13,
118,
14086,
18,
9,
472,
306,
396,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Does Django support multi-value cookies?
===
I'd like to set a cookie via Django with that has several different values to it, similar to .NET's [HttpCookie.Values][1] property. Looking at the [documentation][2], I can't tell if this is possible. It looks like it just takes a string, so is there another way?
I've tried passing it an array (`[10, 20, 30]`) and dictionary (`{'name': 'Scott', 'id': 1}`) but they just get converted to their string format. My current solution is to just use an arbitrary separator and then parse it when reading it in, which feels icky. If multi-values aren't possible, is there a better way? I'd rather not use lots of cookies, because that would get annoying.
[1]: http://msdn.microsoft.com/en-us/library/system.web.httpcookie_members(VS.80).aspx
[2]: http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpResponse.set_cookie | 0 | [
2,
630,
3857,
14541,
555,
1889,
8,
15165,
19396,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
309,
21,
19980,
1197,
3857,
14541,
29,
30,
63,
238,
421,
4070,
20,
32,
15,
835,
20,
13,
9,
2328,
22,
18,
636,
21127,
716,
17391,
9,
151... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JavaScript intellisense in Visual Studio 2008
===
Have you guys and gals got any tips or hacks for making the most out of the JavaScript intellisense options in Visual Studio 2008?
Consider the following:
var Persons = {};
Persons.Females = {};
Persons.Females.Julie = function (_mood)
{
/// <param name="_mood">Mood of Julie</param>
/// <summary>Constructor function: Julie, a 22 year old female</summary>
/// <returns>New instance of Julie</returns>
var breasts, thighs, stomach; // Private variables
this.mood = _mood; // Public variable
function accessBodypart(_bodypart) // Private function
{
/// <param name="_bodypart">Bodypart to access</param>
}
this.access = function (_bodypart, _accessee) // Privileged function
{
/// <param name="_bodypart">Access a bodypart on Julie</param>
/// <param name="_accessee">Person accessing Julie</param>
/// <summary>If you have sufficient rights, you may use this
/// function</summary>
/// <returns>Julie's reaction</returns>
if (_accessee.status === "boyfriend")
{
accessBodypart(_bodypart);
return "Giggles";
}
return "Slap in the face";
};
};
var happyJulie = Persons.Females.Julie("happy");
Visual Studio shows me the "namespaces" and uses the documentation features (`<param>` and `<summary>`). I have not been able to get the `<return>` documentation feature to work though.
Now, that's all well and good. But when I do:
happyJulie.access("breasts");
Visual Studio does not know about the `access` function and I get no documentation on it.
Is there any way I can expose public variables and privileged functions to Visual Studios intellisense functionality, while still creating objects with private members?
Yes, using the whole `car->wheels->tires` gets old at some point :) | 0 | [
2,
8247,
8741,
14635,
3159,
6498,
19,
3458,
1120,
570,
800,
3726,
3726,
57,
42,
2776,
17,
5027,
18,
330,
186,
11034,
54,
11835,
18,
26,
544,
14,
127,
70,
16,
14,
8247,
8741,
14635,
3159,
6498,
6368,
19,
3458,
1120,
570,
60,
3563,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 is try..finally good; try..catch bad?
===
I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything:
StreamReader reader=new StreamReader("myfile.txt");
try
{
int i = 5 / 0;
}
catch // No args, so it will catch any exception
{}
reader.Close();
However, this is considered good form:
StreamReader reader=new StreamReader("myfile.txt");
try
{
int i = 5 / 0;
}
finally // Will execute despite any exception
{
reader.Close();
}
As far as I can tell, the only difference between putting cleanup code in a finally block and putting cleanup code after the try..catch blocks is if you have return statements in your try block (in that case, the cleanup code in finally will run, but code after the try..catch will not).
Otherwise, what's so special about finally? | 0 | [
2,
483,
25,
1131,
9,
9,
4932,
102,
254,
73,
1131,
9,
9,
18208,
896,
60,
800,
3726,
3726,
31,
57,
541,
148,
395,
30,
32,
25,
896,
505,
20,
275,
2949,
29,
90,
10553,
15,
1118,
100,
30,
2949,
1437,
22,
38,
107,
602,
45,
3766,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL sp_help_operator
===
Anyone know what group I need to belong to show up in the sp_help_operator list? | 0 | [
2,
4444,
255,
3782,
1,
14593,
1,
9477,
3457,
800,
3726,
3726,
1276,
143,
98,
214,
31,
376,
20,
6219,
20,
298,
71,
19,
14,
3782,
1,
14593,
1,
9477,
3457,
968,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Best Method to Spawn Process from SQL Server Trigger
===
How would I go about spawning a separate process using a SQL Server 05/08 trigger? Ideally, I would like to spawn the process and have SQL Server not wait on the process to finish execution. I need to pass a couple parameters from the insert that is triggering the process, but the executable would take care of the rest. | 0 | [
2,
246,
2109,
20,
13,
22860,
953,
37,
4444,
255,
8128,
7286,
800,
3726,
3726,
184,
83,
31,
162,
88,
27487,
21,
1725,
953,
568,
21,
4444,
255,
8128,
13,
4071,
118,
3099,
7286,
60,
5628,
102,
15,
31,
83,
101,
20,
13,
22860,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I run a command in a loop until I seem some string in stdout?
===
I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough.
The particular environment in question at the moment is RedHat Linux but need same thing on Mac sometimes too. So something, generic and *nixy would be best. Don't care about Windows - presumably a *nixy thing would work under cygwin. | 0 | [
2,
184,
107,
31,
485,
21,
1202,
19,
21,
5293,
163,
31,
2260,
109,
3724,
19,
354,
43,
1320,
60,
800,
3726,
3726,
31,
22,
79,
562,
80,
22,
18,
109,
13,
19712,
53,
8,
14813,
29,
416,
255,
15,
10811,
15,
13158,
2099,
30,
83,
408... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a proper way to get a WebProfile?
===
I have a user reporting that when they use the back button to return to a web page that they come back as a different person. It seems like they may be accessing a different users profile.
Here are the important parts of the code:
<code>
//here's the code on the web page
public static WebProfile p = null;
protected void Page_Load(object sender, EventArgs e)
{
p = ProfileController.GetWebProfile();
if (!this.IsPostBack)
{
PopulateForm();
}
}
//here's the code in the "ProfileController" (probably misnamed)
public static WebProfile GetWebProfile()
{
//get shopperID from cookie
string mscsShopperID = GetShopperID();
string userName = new tpw.Shopper(Shopper.Columns.ShopperId, mscsShopperID).Email;
p = WebProfile.GetProfile(userName);
return p;
}
</code>
I'm using static methods and a static WebProfile because I need to use the profile object in a static WebMethod (ajax pageMethod). Could this lead to the profile object being "shared" by different users? Am I not using static methods and objects correctly?
Thanks in advance.
| 0 | [
2,
25,
48,
21,
4119,
161,
20,
164,
21,
2741,
14503,
60,
800,
3726,
3726,
31,
57,
21,
4155,
6670,
30,
76,
59,
275,
14,
97,
5167,
20,
788,
20,
21,
2741,
2478,
30,
59,
340,
97,
28,
21,
421,
840,
9,
32,
2206,
101,
59,
123,
44,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Who uses a digital notepad for saving UML and other diagrams?
===
I often find that for an initial design document, I just want to lob in a couple of rough UML / other diagrams.
Most diagramming tools, even Visio, slow me down considerably. I admit that this is probably [PEBCAK](http://en.wikipedia.org/wiki/PEBKAC).
I usually end up drawing a sketch, and then running it through a scanner.
I was wondering who uses a digital notepad, and would they recommend it? | 0 | [
2,
72,
2027,
21,
1888,
1945,
8240,
26,
7599,
13,
723,
255,
17,
89,
14161,
18,
60,
800,
3726,
3726,
31,
478,
477,
30,
26,
40,
2104,
704,
4492,
15,
31,
114,
259,
20,
13,
10904,
19,
21,
1335,
16,
4182,
13,
723,
255,
13,
118,
89... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to compute the hashCode() from the object's address?
===
In Java, I have a subclass <code>Vertex</code> of the Java3D class <code>Point3f</code>. Now <code>Point3f</code> computes <code>equals()</code> based on the values of its coordinates, but for my <code>Vertex</code> class I want to be stricter: two vertices are only equal if they are the same object. So far, so good:
class Vertex extends Point3f {
// ...
public boolean equals(Object other) {
return this == other;
}
}
I know this violates the contract of <code>equals()</code>, but since I'll only compare vertices to other vertices this is not a problem.
Now, to be able to put vertices into a <code>HashMap</code>, the <code>hashCode()</code> method must return results consistent with <code>equals()</code>. It currently does that, but probably bases its return value on the fields of the <code>Point3f</code>, and therefore will give hash collisions for different <code>Vertex</code> objects with the same coordinates.
Therefore I would like to base the <code>hashCode()</code> on the object's address, instead of computing it from the <code>Vertex</code>'s fields. I know that the <code>Object</code> class does this, but I cannot call its <code>hashCode()</code> method because <code>Point3f</code> overrides it.
So, actually my question is twofold:
* Should I even want such a shallow <code>equals()</code>?
* If yes, then, how do I get the object's address to compute the hash code from?
Edit: I just thought of something... I could generate a random <code>int</code> value on object creation, and use that for the hash code. Is that a good idea? Why (not)? | 0 | [
2,
184,
20,
23909,
14,
19170,
9375,
5,
6,
37,
14,
3095,
22,
18,
3218,
60,
800,
3726,
3726,
19,
8247,
15,
31,
57,
21,
972,
1898,
13,
1,
9375,
1,
8122,
1706,
1,
118,
9375,
1,
16,
14,
8247,
240,
43,
718,
13,
1,
9375,
1,
3132,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
setPrimitiveValue:forKey: and to-many relationships
===
Apple's [documentation on `-setPrimitiveValue:forKey:`](http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html#//apple_ref/occ/instm/NSManagedObject/setPrimitiveValue:forKey:) is vague in two ways when using it to manage to-many relationships.
First they state:
>If you try to set a to-many relationship to a new NSMutableSet object, it will (eventually) fail.
***Eventually?!*** What does that even mean? Will it fail later during `-[NSManagedObjectContext save:]`? When an managed object is turned into a fault and then paged back in? When? Can I write a test case to consistently recreate the failure on-demand?
Second, providing sample code to correctly handle this case, they write:
>first get the existing set using `primitiveValueForKey:` (ensure the method does not return `nil`)
What should I do if/when the method *does* return nil? `assert()` it and fail immediately because that means the entire object graph is corrupted and saving will lead to data loss? `NSAssert()` on it as a warning to the caller but press on (silently doing nothing)?
Right now I'm simply directly assigning my desired `NS[Mutable]Set` in that case, like so:
- (void)setChildren:(NSSet*)value_ {
NSMutableSet *mutableRelationshipSet = [[[self primitiveValueForKey:@"children"] mutableCopy] autorelease];
if (mutableRelationshipSet) {
[mutableRelationshipSet setSet:value_];
[self setPrimitiveValue:mutableRelationshipSet forKey:@"children"];
} else {
[self setPrimitiveValue:value_ forKey:@"children"];
}
}
Is that wrong? | 0 | [
2,
309,
6944,
5130,
1284,
15165,
45,
1106,
4237,
45,
17,
20,
8,
14842,
5833,
800,
3726,
3726,
4037,
22,
18,
636,
28132,
857,
27,
13,
1,
8,
3554,
6944,
5130,
1284,
15165,
45,
1106,
4237,
45,
1,
500,
5,
21127,
6903,
26051,
106,
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... |
Do you use a query handler? If so, what tasks does it perform for you?
===
Several months ago my work deployed an in-house function that wraps the standard, php, mysql_query() function with additional options and abilities. A sample feature would be some handy debugging tools we can turn on/off.
I was wondering how popular query handlers are and what features people like to build into them. | 0 | [
2,
107,
42,
275,
21,
25597,
24641,
60,
100,
86,
15,
98,
8674,
630,
32,
2985,
26,
42,
60,
800,
3726,
3726,
238,
818,
1464,
51,
170,
6698,
40,
19,
8,
1682,
1990,
30,
8118,
18,
14,
1236,
15,
13,
26120,
15,
51,
18,
22402,
1,
819... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extreme Sharding: One SQLite Database Per User
===
I'm working on a web app that is somewhere between an email service and a social network. I feel it has the potential to grow really big in the future, so I'm concerned about scalability.
Instead of using one centralized MySQL/InnoDB database and then partitioning it when that time comes, I've decided to create a separate SQLite database for each active user: one active user per 'shard'.
That way backing up the database would be as easy as copying each user's *small* database file to a remote location once a day.
Scaling up will be as easy as adding extra hard disks to store the new files.
When the app grows beyond a single server I can link the servers together at the filesystem level using GlusterFS and run the app unchanged, or rig up a simple SQLite proxy system that will allow each server to manipulate sqlite files in adjacent servers.
Concurrency issues will be minimal because each HTTP request will only touch one or two database files at a time, out of thousands, and SQLite only blocks on reads anyway.
I'm betting that this approach will allow my app to scale gracefully and support lots of cool and *unique* features. Am I betting wrong? Am I missing anything? | 0 | [
2,
4750,
18723,
68,
45,
53,
4444,
10601,
6018,
416,
4155,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
2741,
4865,
30,
25,
3493,
128,
40,
8517,
365,
17,
21,
668,
982,
9,
31,
583,
32,
63,
14,
2222,
20,
3213,
510,
580,
19,
14,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTML: What's the effect of adding 'return false' to an onclick event ?
===
Many times I've seen links like these in HTML pages:
<a href='#' onclick='someFunc(3.1415926); return false;'>Click here !</a>
What's the effect of the **return false** in there ?
Also, I don't usually see that in buttons.
Edit: Is this specified anywhere ? In some spec in w3.org ? | 0 | [
2,
13,
15895,
45,
98,
22,
18,
14,
1590,
16,
4721,
13,
22,
24632,
4997,
22,
20,
40,
27,
150,
10129,
807,
13,
60,
800,
3726,
3726,
151,
436,
31,
22,
195,
541,
6271,
101,
158,
19,
13,
15895,
4434,
45,
13,
1,
58,
746,
14057,
372... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# Day from Week picker component
===
This question is for C# 2.0 Winform.
For the moment I use checkboxes to select like this : Monday[x], Thuesday[x]¸... etc.
It works fine but **is there a better way to get the day of the week?** (Can have more than one day picked)
| 0 | [
2,
272,
5910,
208,
37,
877,
2036,
106,
5912,
800,
3726,
3726,
48,
1301,
25,
26,
272,
5910,
172,
9,
387,
628,
4190,
9,
26,
14,
688,
31,
275,
2631,
5309,
160,
20,
5407,
101,
48,
13,
45,
5745,
2558,
396,
500,
15,
14808,
160,
1185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Perl or Python script to remove user from group
===
I am putting together a Samba-based server as a Primary Domain Controller, and ran into a cute little problem that should have been solved many times over. But a number of searches did not yield a result. I need to be able to remove an existing user from an existing group with a command line script. It appears that the usermod easily allows me to add a user to a supplementary group with this command:
usermod -a -G supgroup1,supgroup2 username
Without the "-a" option, if the user is currently a member of a group which is not listed, the user will be removed from the group. Does anyone have a perl (or Python) script that allows the specification of a user and group for removal? Am I missing an obvious existing command, or well-known solution forthis? Thanks in advance! | 0 | [
2,
416,
255,
54,
20059,
3884,
20,
4681,
4155,
37,
214,
800,
3726,
3726,
31,
589,
3873,
429,
21,
13,
18,
7483,
8,
1281,
8128,
28,
21,
1256,
4603,
9919,
15,
17,
717,
77,
21,
10901,
265,
1448,
30,
378,
57,
74,
15091,
151,
436,
84... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cap invoke and sudo
===
I want to install a gem on all my application servers, but gem install requires sudo access - how can I enable sudo only for running this command? In other words, I don't wish to use sudo for all my deployment recipes, just for this specific invocation. | 0 | [
2,
2605,
28371,
17,
13,
18,
18601,
800,
3726,
3726,
31,
259,
20,
16146,
21,
8551,
27,
65,
51,
3010,
17595,
15,
47,
8551,
16146,
4781,
13,
18,
18601,
1381,
13,
8,
184,
92,
31,
9240,
13,
18,
18601,
104,
26,
946,
48,
1202,
60,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What good template language is supported in Javascript?
===
Templates are a pretty healthy business in established programming languages, but are there any good ones that can be processed in Javascript?
By "template" I mean a document that accepts a data object as input, inserts the data into some kind of serialized markup language, and outputs the markup. Well-known examples are JSP, the original PHP, XSLT.
By "good" I mean that it's declarative and easy for an HTML author to write, that it's robust, and that it's supported in other languages too. Something better than the options I know about. Some examples of "not good":
----------
String math:
element.innerHTML = "<p>Name: " + data.name
+ "</p><p>Email: " + data.email + "</p>";
clearly too unwieldy, HTML structure not apparent.
----------
XSLT:
<p><xsl:text>Name: </xsl:text><xsl:value-of select="//data/name"></p>
<p><xsl:text>Email: </xsl:text><xsl:value-of select="//data/email"></p>
// structurally this works well, but let's face it, XSLT confuses HTML developers.
----------
Trimpath:
<p>Name: ${data.name}</p><p>Email: ${data.email}</p>
// This is nice, but the processor is only supported in Javascript, and the language is sort of primitive (http://code.google.com/p/trimpath/wiki/JavaScriptTemplateSyntax)
----------
I'd love to see a subset of JSP or ASP or PHP ported to the browser, but I haven't found that.
What are people using these days in Javascript for their templating?
| 0 | [
2,
98,
254,
22894,
816,
25,
1827,
19,
8247,
8741,
60,
800,
3726,
3726,
22894,
18,
50,
21,
1772,
7714,
508,
19,
613,
3143,
2556,
15,
47,
50,
80,
186,
254,
53,
18,
30,
92,
44,
16697,
19,
8247,
8741,
60,
34,
13,
7,
9577,
6554,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Accessing created DOM elements
===
I have code to create another "row" (div with inputs) on a button click. I am creating new input elements and everything works fine, however, I can't find a way to access these new elements.
Example: I have element `<input type='text' id='name_1' name="name_1" />`<br/>
I then create element `<input type='text' id='name_2' name="name_2" />` by using the javascript's createElement function.
Again, I create the element fine, but I want to be able to access the value of name_2 after it has been created and modified by the user. Example: `document.getElementById('name_2');`
This doesn't work. How do I make the DOM recognize the new element? Is it possible? | 0 | [
2,
1381,
68,
679,
11859,
2065,
800,
3726,
3726,
31,
57,
1797,
20,
1600,
226,
13,
7,
5417,
7,
13,
5,
12916,
29,
6367,
18,
6,
27,
21,
5167,
10840,
9,
31,
589,
2936,
78,
6367,
2065,
17,
796,
693,
1123,
15,
207,
15,
31,
92,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL, mySQL - Is there something wrong about joins without the JOIN keyword
===
When I started writing database queries I didn't know the JOIN keyword yet and naturally I just extended what I already knew and wrote queries like this:
SELECT a.someRow, b.someRow
FROM tableA AS a, tableB AS b
WHERE a.ID=b.ID AND b.ID= $someVar
Now that I know that this is the same as an INNER JOIN I find all these queries in my code and ask myself if I should rewrite them. Is there something smelly about them or are they just fine? | 0 | [
2,
4444,
255,
15,
51,
18,
22402,
13,
8,
25,
80,
301,
1389,
88,
10612,
366,
14,
1865,
1246,
9587,
800,
3726,
3726,
76,
31,
373,
1174,
6018,
9386,
2829,
31,
223,
22,
38,
143,
14,
1865,
1246,
9587,
768,
17,
8000,
31,
114,
1984,
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... |
Absolute URL from base + relative URL in C#
===
I have a base URL :
http://my.server.com/folder/directory/sample
And a relative one :
../../other/path
How to get the absolute URL from this ? It's pretty straighforward using string manipulation, but I would like to do this in a secure way, using the `Uri` class or something similar.
It's for a standard a C# app, not an ASP.NET one. | 0 | [
2,
7070,
287,
6362,
37,
1000,
2754,
4543,
287,
6362,
19,
272,
5910,
800,
3726,
3726,
31,
57,
21,
1000,
287,
6362,
13,
45,
7775,
6903,
915,
9,
10321,
106,
9,
960,
118,
8814,
106,
118,
10197,
93,
118,
6101,
5106,
17,
21,
4543,
53,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Generated image using PHP and GD is being cut off
===
This is only happening on the live server. On multiply development servers the image is being created as expected.
LIVE:
Red Hat
GD Support => enabled
GD Version => bundled (2.0.34 compatible)
DEV:
Ubuntu 8
GD Support => enabled
GD Version => 2.0 or higher
In a perfect world I would like the live server and the dev server to be running the same distro, but the live server must be Red Hat.
My question is does anyone know the specific differences that would cause the right most part of an image to be cut off using the bundled version of GD? | 0 | [
2,
6756,
1961,
568,
13,
26120,
17,
489,
43,
25,
142,
1077,
168,
800,
3726,
3726,
48,
25,
104,
4942,
27,
14,
515,
8128,
9,
27,
26314,
522,
17595,
14,
1961,
25,
142,
679,
28,
1727,
9,
515,
45,
402,
2970,
489,
43,
555,
800,
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... |
What plugin would you really like to have for Visual Studio 2005/2008
===
In a brilliant world what would you love to have a plugin to do in VS2005/2008?
One answer per post please, and use voting to agree/disagree with ideas.
| 0 | [
2,
98,
10922,
108,
83,
42,
510,
101,
20,
57,
26,
3458,
1120,
812,
118,
2753,
800,
3726,
3726,
19,
21,
7472,
126,
98,
83,
42,
339,
20,
57,
21,
10922,
108,
20,
107,
19,
4611,
2835,
118,
2753,
60,
53,
1623,
416,
678,
2247,
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,
0,
0,
0,
0,
0... |
Does System.Windows.Forms have a non-static messagebox?
===
I would like something that I can use as follows
var msg = new NonStaticMessageBox();
if(msg.Show("MyMessage", "MyCaption", MessageBoxButtons.OkCancel) == DialogResult.Ok)
{....}
But specifically non-static (I need to pass a reference to it around) does anyone know if/where such an object exists?
| 0 | [
2,
630,
329,
9,
27508,
18,
9,
4190,
18,
57,
21,
538,
8,
18077,
2802,
5309,
60,
800,
3726,
3726,
31,
83,
101,
301,
30,
31,
92,
275,
28,
2415,
4033,
4235,
263,
800,
78,
538,
18077,
3845,
18,
1303,
5309,
5,
6,
73,
100,
5,
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... |
.NET Integer vs Int16?
===
I have a questionable coding practice.
When I need to iterate through a small list of items whose count limit is under 32000, I use Int16 for my *i* variable type instead of Integer. I do this because I assume using the int16 is more efficient than a full blown Integer.
Am I wrong? Is there no effective performance difference (however minute) between using an Int16 vs an Integer? Should I stop using Int16 and just stick with Integer for all my counting/iteration needs? (VB OR C#)
Thanks in advance for any guidance! | 0 | [
2,
13,
9,
2328,
13820,
4611,
19,
38,
1091,
60,
800,
3726,
3726,
31,
57,
21,
23436,
13,
15458,
1345,
9,
76,
31,
376,
20,
32,
106,
1373,
120,
21,
284,
968,
16,
3755,
1196,
2468,
4496,
25,
131,
203,
3050,
15,
31,
275,
19,
38,
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... |
Best place in spec/ for integration responses?
===
I have some integration points where I want to test various responses - where do you think should I store these artifacts in my spec/ directory of my rails application? | 0 | [
2,
246,
209,
19,
12737,
118,
26,
8078,
13231,
60,
800,
3726,
3726,
31,
57,
109,
8078,
819,
113,
31,
259,
20,
1289,
617,
13231,
13,
8,
113,
107,
42,
277,
378,
31,
1718,
158,
10996,
19,
51,
12737,
118,
16755,
16,
51,
2240,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
looking for Java GUI components / ideas for syntax highlighting
===
I'm not committed to any particular GUI tookit or anything - just needs to be Java based. I want to do simple syntax highlighting ( XML and XQuery ) inside editable text areas.
My only candidate so far is Swing's JTextPane, as it supports seems to support the styling of text, but I have no idea how to implement it in this context.
If a particular toolkit has something like this out of the box, that would be awesome, but I'm open to doing this by hand if need be.
| 0 | [
2,
699,
26,
8247,
9457,
5090,
13,
118,
3478,
26,
22649,
23102,
800,
3726,
3726,
31,
22,
79,
52,
4164,
20,
186,
1498,
9457,
199,
242,
54,
602,
13,
8,
114,
2274,
20,
44,
8247,
432,
9,
31,
259,
20,
107,
1935,
22649,
23102,
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... |
Unit testing code with a file system dependency
===
I am writing a component that, given a ZIP file, needs to:
1. Unzip the file.
2. Find a specific dll among the unzipped files.
3. Load that dll through reflection and invoke a method on it.
I'd like to unit test this component.
I'm tempted to write code that deals directly with the file system:
void DoIt()
{
Zip.Unzip(theZipFile, "C:\\foo\\Unzipped");
System.IO.File myDll = File.Open("C:\\foo\\Unzipped\\SuperSecret.bar");
myDll.InvokeSomeSpecialMethod();
}
But folks often say, "Don't write unit tests that rely on the file system, database, network, etc."
If I were to write this in a unit-test friendly way, I suppose it would look like this:
void DoIt(IZipper zipper, IFileSystem fileSystem, IDllRunner runner)
{
string path = zipper.Unzip(theZipFile);
IFakeFile file = fileSystem.Open(path);
runner.Run(file);
}
Yay! Now it's testable; I can feed in test doubles (mocks) to the DoIt method. But at what cost? I've now had to define 3 new interfaces just to make this testable. And what, exactly, am I testing? I'm testing that my DoIt function properly interacts with its dependencies. It doesn't test that the zip file was unzipped properly, etc.
It doesn't feel like I'm testing functionality anymore. It feels like I'm just testing class interactions.
**My question is this**: what's the proper way to unit test something that is dependent on the file system? | 0 | [
2,
1237,
4431,
1797,
29,
21,
3893,
329,
26835,
800,
3726,
3726,
31,
589,
1174,
21,
5912,
30,
15,
504,
21,
12133,
3893,
15,
2274,
20,
45,
137,
9,
367,
2553,
306,
14,
3893,
9,
172,
9,
477,
21,
1903,
13,
43,
211,
497,
14,
367,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 specify redirects and pipes in variables?
===
I have a bash script that creates a Subversion patch file for the current directory. I want to modify it to zip the produced file, if <code>-z</code> is given as an argument to the script.
Here's the relevant part:
zipped=''
zipcommand='>'
if [ "$1" = "-z" ]
then
zipped='zipped '
filename="${filename}.zip"
zipcommand='| zip -@'
fi
echo "Creating ${zipped}patch file $filename..."
svn diff $zipcommand $filename
This doesn't work because it passes the <code>|</code> or <code>></code> contained in <code>$zipcommand</code> as an argument to <code>svn</code>.
I can easily work around this, but the question is whether it's ever possible to use these kinds of operators when they're contained in variables.
Thanks! | 0 | [
2,
92,
31,
19077,
302,
14706,
18,
17,
14104,
19,
12157,
60,
800,
3726,
3726,
31,
57,
21,
13158,
3884,
30,
9695,
21,
972,
10898,
7331,
3893,
26,
14,
866,
16755,
9,
31,
259,
20,
17579,
32,
20,
12133,
14,
671,
3893,
15,
100,
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... |
Disable and later enable all table indexes in Oracle
===
How would I disable and later enable all indexes in a given schema/database in Oracle?
Note: This is to make sqlldr run faster. | 0 | [
2,
1460,
579,
17,
138,
9240,
65,
859,
4348,
160,
19,
15759,
800,
3726,
3726,
184,
83,
31,
1460,
579,
17,
138,
9240,
65,
4348,
160,
19,
21,
504,
23874,
118,
18768,
8436,
19,
15759,
60,
1945,
45,
48,
25,
20,
233,
4444,
211,
3807,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Find Processor Type from compact .net 1.0
===
My application is targeted for Compact .Net 1.0 framework. The application has to check and download any updates available from a web-site. I am thinking of providing the updates as CAB files. Since the CAB files are processor type specific, I want to download the CAB file based on the Processor Type. What is the API for getting the Processor type (ARM/SH/MIPS/etc)?
Thanks,
Kishore A | 0 | [
2,
477,
14762,
1001,
37,
8285,
13,
9,
2328,
137,
9,
387,
800,
3726,
3726,
51,
3010,
25,
9536,
26,
8285,
13,
9,
2328,
137,
9,
387,
6596,
9,
14,
3010,
63,
20,
2631,
17,
7121,
186,
16779,
904,
37,
21,
2741,
8,
9097,
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... |
How does Google's javascript API get around the cross-domain security in AJAX
===
How does Google's API make cross-domain requests back to Google, when it's on your website? | 0 | [
2,
184,
630,
8144,
22,
18,
8247,
8741,
21,
2159,
164,
140,
14,
919,
8,
537,
6232,
1221,
19,
20624,
800,
3726,
3726,
184,
630,
8144,
22,
18,
21,
2159,
233,
919,
8,
537,
6232,
12279,
97,
20,
8144,
15,
76,
32,
22,
18,
27,
154,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
A reliable HTTP library for .Net
===
.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that `HttpWebResponse.GetResponse()` with ReadTimeout **and** Timeout set to 5000 blocks for about 20 seconds before failing.
I need a library with better protocol conformance and timeout control. Know any? | 4 | [
2,
21,
11398,
7775,
1248,
26,
13,
9,
2328,
800,
3726,
3726,
13,
9,
2328,
22,
18,
6123,
16,
7775,
25,
13,
9,
9,
9,
21070,
9,
1701,
109,
1549,
19,
14969,
29,
7775,
11698,
9,
387,
15,
98,
22,
18,
6256,
2762,
55,
193,
130,
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... |
Is it possible to compile a Rails app to a Java VM JAR file?
===
Essentially the only thing I can deploy to my deployment machine is a JAR file. I can't install JRuby, nor can I install Glassfish or Tomcat.
Is it possible to package up a Rails application (including Rails, vendored, of course) to a JAR file such that I can do
c:\my_server> java rails_app.jar
and have it run WEBRick or Mongrel within the JVM? | 0 | [
2,
25,
32,
938,
20,
26561,
21,
2240,
18,
4865,
20,
21,
8247,
13,
20147,
5112,
3893,
60,
800,
3726,
3726,
7398,
14,
104,
584,
31,
92,
17617,
20,
51,
10475,
1940,
25,
21,
5112,
3893,
9,
31,
92,
22,
38,
16146,
2000,
291,
779,
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 is the best pattern/solution to implement 'workflow (a process) for product development'?
===
Present:
The product development is done in Visual Studio at the moment using .Net technologies, so it's important to stay in the same set of tools. Roles apart from developers are using spreadsheets, docs and diagramming tools, photoshop to do their work.
Future:
We want to build a workflow (a sequential process with roles, queues for action items, passing on info from one role to the other, approval etc) for a product development. The software product will be in enhancement stage forever, more the reason to establish this flow.
Typical users are designers, business analysts, content creators, developers, code reviewers, testers.
Let's say a new webpage needs to be developed. It will be,
1. thought about by the analyst in the
tool, will enter the information in
some format
2. a designer will use drag and drop to
build the page look, pass it over to
the
3. content creator, who will add
content(help text, hyperlinks, pure
text etc) to the page
4. a developer will check his queue to start
building logic around this page and
make it functional.
I am thinking about Visual Studio Isolated shell to be used as a tool framework mainly due to it's IDE capabilities et al, to build this. Has anyone worked on a similar set of requirements? Any patterns/solutions/ideas around how to go about this in the VS Shell paradigm?
| 0 | [
2,
98,
25,
14,
246,
3732,
118,
18,
18687,
3309,
20,
8713,
13,
22,
3783,
9990,
13,
5,
58,
953,
6,
26,
2374,
522,
22,
60,
800,
3726,
3726,
734,
45,
14,
2374,
522,
25,
677,
19,
3458,
1120,
35,
14,
688,
568,
13,
9,
2328,
5740,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL NOT IN constraint and NULL values
===
This issue came up when I got different records counts for what I thought were identical queries one using a not in where constraint and the other a left join. The table in the not in constraint had one null value (bad data) which caused that query to return a count of 0 records. I sort of understand why but I could use some help fully grasping the concept.
To state it simply, why does query A return a result but B doesn't?
A: select 'true' where 3 in (1, 2, 3, null)
B: select 'true' where 3 not in (1, 2, null)
This was on SQL Server 2005. I also found that calling set ansi_nulls off causes B to return a result.
| 0 | [
2,
4444,
255,
52,
19,
28804,
17,
16203,
4070,
800,
3726,
3726,
48,
1513,
281,
71,
76,
31,
330,
421,
742,
9927,
26,
98,
31,
289,
46,
6323,
9386,
2829,
53,
568,
21,
52,
19,
113,
28804,
17,
14,
89,
21,
225,
1865,
9,
14,
859,
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... |
Sql Server 2000 - How can I find out what stored procedures are running currently?
===
I'd like to know what stored procedures are currently running to diagnose some performance problems. How can I find that out? | 0 | [
2,
4444,
255,
8128,
824,
13,
8,
184,
92,
31,
477,
70,
98,
8214,
8876,
50,
946,
871,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
143,
98,
8214,
8876,
50,
871,
946,
20,
28438,
109,
956,
1716,
9,
184,
92,
31,
477,
30,
70,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
What is the meaning of Powershell's Copy-Item's -container argument?
===
I am writing a script for MS PowerShell. This script uses the Copy-Item command. One of the optional arguments to this command is "-container". The documentation for the argument states that specifying this argument "Preserves container objects during the copy operation."
This is all well and good, for I would be the last person to want unpreserved container objects during a copy operation. But in all seriousness, what does this argument do? Particularly in the case where I am copying a disk directory tree from one place to another, what difference does this make to the behavior of the Copy-Item command? | 0 | [
2,
98,
25,
14,
1813,
16,
414,
15984,
22,
18,
4344,
8,
2119,
79,
22,
18,
13,
8,
1126,
5851,
106,
5476,
60,
800,
3726,
3726,
31,
589,
1174,
21,
3884,
26,
4235,
414,
15984,
9,
48,
3884,
2027,
14,
4344,
8,
2119,
79,
1202,
9,
53,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find OS type from .Net CF 1.0
===
What is the API for getting the OS type? Windows CE or Windows mobile?
Environment.OSVersion
just gives the CE version. It does provide information if 'Windows Mobile' is installed on the device.
Thanks,
Kishore A | 0 | [
2,
477,
13,
759,
1001,
37,
13,
9,
2328,
10084,
137,
9,
387,
800,
3726,
3726,
98,
25,
14,
21,
2159,
26,
1017,
14,
13,
759,
1001,
60,
1936,
4000,
54,
1936,
3241,
60,
2307,
9,
759,
10898,
114,
2352,
14,
4000,
615,
9,
32,
630,
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... |
Passenger Standalone Nginx Core can't find libcrypto
===
I have passenger configured to serve rails 3.1 apps on a server, but am now trying to deploy a 2.3.2 app via passenger on the same server. I'm trying to follow the advice in [this](http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/) post (which details how to serve an app using passenger standalone and connect it to Apache via a reverse proxy) but am unable to proceed because passenger standalone uses an nginx core that cannot find libcrypto.so.0.9.7.
The exact error is:
# passenger start -a 127.0.0.1 -p 53447 -d
*** ERROR ***
Could not start Passenger Nginx core:
/var/lib/passenger-standalone/3.0.11-x86_64-ruby1.8.7-linux-gcc4.3.2-1002/nginx-
1.0.10/sbin/nginx: error while loading shared libraries: libcrypto.so.0.9.7:
cannot open shared object file: No such file or directory
Stopping web server... done
Running ldd -r /var/.../sbin/nginx yields:
linux-vdso.so.1 => (0x00007fffc1bff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00000037cc200000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000037db800000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000037d1a00000)
libm.so.6 => /lib64/libm.so.6 (0x00000037cba00000)
**libcrypto.so.0.9.7 => not found**
libz.so.1 => /lib64/libz.so.1 (0x00000037cc600000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00000037d1200000)
libc.so.6 => /lib64/libc.so.6 (0x00000037cb600000)
/lib64/ld-linux-x86-64.so.2 (0x00000037ca200000)
And running whereis licrypto.so.0.9.7 yields:
libcrypto.so.0.9: /lib/libcrypto.so.0.9.7 /lib/libcrypto.so.0.9.8g /usr/lib/libcrypto.so.0.9.7 /lib64/libcrypto.so.0.9.8g
So I know passenger's nginx core can't find libcrypto and I know where it is, I'm just not sure how to get the passenger nginx core to recognize where it is. Can anyone point me in the right direction? | 0 | [
2,
3093,
26986,
13,
2723,
108,
396,
2884,
92,
22,
38,
477,
13,
8326,
11435,
111,
800,
3726,
3726,
31,
57,
3093,
28895,
20,
1884,
2240,
18,
203,
9,
165,
4865,
18,
27,
21,
8128,
15,
47,
589,
130,
749,
20,
17617,
21,
172,
9,
240,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Binding a wx.html2.WebView.New Widget?
===
I would like to bind the wx.html2.WebView.New widget with wx.EVT_LEFT_UP however it doesnt work (it doesnt get noticed, nothing happens).
Is there anything i am missing? | 0 | [
2,
8728,
21,
619,
396,
9,
15895,
135,
9,
14113,
4725,
9,
2681,
4807,
43,
3060,
60,
800,
3726,
3726,
31,
83,
101,
20,
10193,
14,
619,
396,
9,
15895,
135,
9,
14113,
4725,
9,
2681,
4807,
43,
3060,
29,
619,
396,
9,
2443,
38,
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... |
Converting variable name to string in SAS/IML
===
I have a variable called "var" in SAS/IML. I want to know how I can create a new string variable:
var2 = "var";
In other words how do I take the name of any variable and convert it to a string. | 0 | [
2,
19583,
7612,
204,
20,
3724,
19,
9233,
118,
49,
8184,
800,
3726,
3726,
31,
57,
21,
7612,
227,
13,
7,
3311,
7,
19,
9233,
118,
49,
8184,
9,
31,
259,
20,
143,
184,
31,
92,
1600,
21,
78,
3724,
7612,
45,
4033,
135,
800,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento: how to use Mage::getConfig()->setNode($path, $value) to change config variables during the session
===
I need to get a config variable and change it for the session only
I think i have to use this Mage::getConfig()->setNode($path, $value);
but i don't understand how it works.
I mean what should the path be?
Thanks in advance | 0 | [
2,
4723,
17050,
45,
184,
20,
275,
12507,
45,
45,
3060,
14093,
2816,
5,
6,
8,
1,
3554,
251,
546,
5,
4403,
8353,
15,
5579,
15165,
6,
20,
753,
13,
14093,
2816,
12157,
112,
14,
3723,
800,
3726,
3726,
31,
376,
20,
164,
21,
13,
1409... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Progressive Mp4 Streaming using ASP.NET
===
I am facing problem while streaming mp4 video from any part or section using asp.net script. Script is working well when you stream mp4 video from start but failed to stream if you want to choose any starting point.
Sample script i am using
if (filename.EndsWith(".mp4") && filename.Length > 2)
{
FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read);
// Sample logic to calculate approx length based on starting time.
if (context.Request.Params["starttime"] != null && context.Request.Params["d"] != null)
{
double total_duration = Convert.ToDouble(context.Request.Params["d"]);
double startduration = Convert.ToDouble(context.Request.Params["starttime"]);
double length_sec = (double)fs.Length / total_duration; // total length per second
seekpos = (long)(length_sec * startduration);
}
if (seekpos==0)
{
position = 0;
length = Convert.ToInt32(fs.Length);
}
else
{
position = Convert.ToInt32(seekpos);
length = Convert.ToInt32(fs.Length - position);
}
// Add HTTP header stuff: cache, content type and length
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetLastModified(DateTime.Now);
context.Response.AppendHeader("Content-Type", "video/mp4");
context.Response.AppendHeader("Content-Length", length.ToString());
if (position > 0)
{
fs.Position = position;
}
// Read buffer and write stream to the response stream
const int buffersize = 16384;
byte[] buffer = new byte[buffersize];
int count = fs.Read(buffer, 0, buffersize);
while (count > 0)
{
if (context.Response.IsClientConnected)
{
context.Response.OutputStream.Write(buffer,0, count);
context.Response.Flush();
count = fs.Read(buffer, 0, buffersize);
}
else
{
count = -1;
}
}
fs.Close();
}
I think problem is in the following line, if i remove it, video still can be played but from start
if (position > 0)
{
fs.Position = position;
}
There may be starting mp4 header like used in flv streaming to track seek position due to which stream can't be recognized, if seek position > 0
Can any one help me in this.
Regards. | 0 | [
2,
5546,
4628,
300,
11920,
568,
28,
306,
9,
2328,
800,
3726,
3726,
31,
589,
4325,
1448,
133,
11920,
4628,
300,
763,
37,
186,
141,
54,
1050,
568,
28,
306,
9,
2328,
3884,
9,
3884,
25,
638,
134,
76,
42,
3766,
4628,
300,
763,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RegEx expression needed for BBCode Tag
===
I'm converting my forum to phpBB and they use similar BBCode tag but one is different. To quote in the old forum, it was formatted like:
old: [quote=prattw]My text here.[/quote]
new: [quote="prattw"]My text here.[/quote]
I need a regex that will add the quotes around the username in the BBCode block. Many thanks!
| 0 | [
2,
7953,
1706,
1803,
851,
26,
2313,
8355,
3383,
800,
3726,
3726,
31,
22,
79,
19583,
51,
5691,
20,
13,
26120,
3490,
17,
59,
275,
835,
2313,
8355,
3383,
47,
53,
25,
421,
9,
20,
16371,
19,
14,
315,
5691,
15,
32,
23,
13,
29850,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript: Show Trobber during long-running javascript function
===
When the user clicks a button on my webpage, I call a long-running javascript function (e.g. the pausecomp function found here: http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm)
The browser freezes while waiting for the function call to finish. How can I make the function run asynchronously? How can I show a trobber while it's running and hide the throbber when it's finished?
All examples I've found all assume you are using AJAX. Is there a more generic way to do this for any function call? | 0 | [
2,
8247,
8741,
45,
298,
6408,
17031,
112,
175,
8,
11325,
8247,
8741,
1990,
800,
3726,
3726,
76,
14,
4155,
10840,
18,
21,
5167,
27,
51,
2741,
6486,
15,
31,
645,
21,
175,
8,
11325,
8247,
8741,
1990,
13,
5,
62,
9,
263,
9,
14,
691... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 using ROUND HALF UP. Rounding mode that most of us were taught in grade school
===
how to round using ROUND HALF UP in javascript?
I am using Prototype JavaScript framework version 1.5.1_rc3, so I prefer to use it if available. If not, I appreciate also if you share it.
Any guidance is appreciated. | 0 | [
2,
184,
20,
560,
568,
560,
519,
71,
9,
560,
68,
3740,
30,
127,
16,
182,
46,
2359,
19,
2044,
116,
800,
3726,
3726,
184,
20,
560,
568,
560,
519,
71,
19,
8247,
8741,
60,
31,
589,
568,
7063,
8247,
8741,
6596,
615,
137,
9,
264,
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... |
trecdocparser in lucene
===
I am trying to parse a TREC file that contains a few <DOC>....<HTML>...</HTML></DOC>
After numerous search, i found lucene has a trecdocparser class, however, i still dont understand how to use it after reading javadoc:
http://lucene.apache.org/core/old_versioned_docs/versions/3_4_0/api/all/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.html#extract(java.lang.StringBuilder, java.lang.String, java.lang.String, int, java.lang.String[])
Also, I could not find any example of using this class on the internet, could expert explain a little to me? or any example would be great!
thanks | 0 | [
2,
4607,
150,
13799,
3574,
4104,
19,
18515,
556,
800,
3726,
3726,
31,
589,
749,
20,
2017,
870,
21,
4607,
150,
3893,
30,
1588,
21,
310,
13,
1,
13799,
1,
9,
9,
9,
9,
1,
15895,
1,
9,
9,
9,
1,
118,
15895,
1,
118,
13799,
1,
75,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot call the JSON result in Jquery
===
I have an action of the controller that return the result as the JSON result.(I test it ready, It works well with this action).
public JsonResult GetProductsByDepList(int id)
{
JsonResult jr = new JsonResult();
var _product = from a in DataContext.GetProductsByDep(id)
select new { ID = a.ID, ProName = a.Name};
jr.Data = _product.ToList();
jr.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
return jr;
}
And this is what I loop it in my view :
$(document).ready(function () {
var urlProduct = '<%: Url.Content("~/") %>' + "Products/GetProductsByDepList";
$.getJSON(urlProduct, function (dataPro) {
alert(123);
});
});
I just test it with alert, but it doesn't alert anything when I load my page.
Could anyone tell me how to use Action of controller in jquery??
Thanks and welcome all your answers.
| 0 | [
2,
1967,
645,
14,
487,
528,
829,
19,
487,
8190,
93,
800,
3726,
3726,
31,
57,
40,
1028,
16,
14,
9919,
30,
788,
14,
829,
28,
14,
487,
528,
829,
9,
5,
49,
1289,
32,
1451,
15,
32,
693,
134,
29,
48,
1028,
6,
9,
317,
487,
528,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
python paramiko shell commands
===
I'm using paramiko to compile a program on a server. As you may know it compiling takes a lot of time and a lot of data is being sent out from this process. Since I cannot get from a shell command the exit status of the command to be executed I'm forced to wait for the data to be sent out to me and, when it stops sending, I can move on to the next command in line.
This practice is not reliable because of some issues:
- the program may still execute without sending output
- I have to use sleep commands if `recv_ready` returns false in order to keep my memory low
- using sleep commands is time consuming given the fact that I don't know how much to "sleep" it before considering the process as done so I can move on to the next one
Here's my actual code so far:
for command in commands:
shell.send( "%s\n" % command )
waited = 0
while True:
if shell.recv_ready():
x = shell.recv( 1024 )
if len( x ):
print x
shell.settimeout( 1 )
waited = 0
else:
time.sleep( 1 )
waited += 1
if waited > 10:
break
This is working fine for most cases but if the running task lasts longer than 10 seconds my program moves to the next command because he thinks it's done. If I increase the timeout threshold to say 20 seconds I lose 20 seconds between each command being executed which is a lot of time wasted considering the fact that most commands take less than 1-2 seconds to execute.
How do you guys suggest i should do this? | 0 | [
2,
20059,
2258,
79,
7427,
3593,
14294,
800,
3726,
3726,
31,
22,
79,
568,
2258,
79,
7427,
20,
26561,
21,
625,
27,
21,
8128,
9,
28,
42,
123,
143,
32,
24378,
1384,
21,
865,
16,
85,
17,
21,
865,
16,
1054,
25,
142,
795,
70,
37,
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... |
When should I use Debug.Assert()?
===
I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.
Our production code contains no asserts whatsoever and my question is this...
Should I begin using Asserts in our production code? And if so, When is its use most appropriate? Would it make more sense to do
Debug.Assert(val != null);
or
if ( val == null )
throw new exception();
| 0 | [
2,
76,
378,
31,
275,
121,
16254,
9,
22220,
38,
5,
6,
60,
800,
3726,
3726,
31,
22,
195,
74,
21,
736,
2306,
2335,
26,
88,
21,
159,
130,
15,
452,
2158,
29,
21,
272,
18,
1168,
9,
31,
22,
195,
167,
88,
20878,
18,
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... |
How do I view the SQL that is generated by nHibernate?
===
How do I view the SQL that is generated by nHibernate? version 1.2 | 0 | [
2,
184,
107,
31,
1418,
14,
4444,
255,
30,
25,
6756,
34,
12109,
15191,
8820,
60,
800,
3726,
3726,
184,
107,
31,
1418,
14,
4444,
255,
30,
25,
6756,
34,
12109,
15191,
8820,
60,
615,
137,
9,
135,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Generic Exception Handling in Python the "Right Way"
===
Sometimes I find myself in the situation where I want to execute several sequential commands like such:
try:
foo(a, b)
except Exception, e:
baz(e)
try:
bar(c, d)
except Exception, e:
baz(e)
...
This same pattern occurs when exceptions simply need to be ignored.
This feels redundant and the excessive syntax causes it to be surprisingly difficult to follow when reading code.
In C, I would have solved this type of problem easily with a macro, but unfortunately, this cannot be done in straight python.
Question: How can I best reduce the code footprint and increase code readability when coming across this pattern? | 0 | [
2,
12733,
5391,
7988,
19,
20059,
14,
13,
7,
4183,
161,
7,
800,
3726,
3726,
1030,
31,
477,
992,
19,
14,
1858,
113,
31,
259,
20,
15644,
238,
1353,
5495,
10107,
14294,
101,
145,
45,
1131,
45,
4310,
111,
5,
58,
15,
334,
6,
1613,
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... |
jQuery JSONP problem in IE6
===
I've encountered a problem when retrieving a JSONP response from a server in a different domain using IE6.
When I make the same AJAX call using JSONP to a server in the same domain as the web page, all goes well in all browsers (including IE6). However, when I make calls between domains (XSS) using JSONP, Internet Explorer 6 locks up. Specifically, the CPU spikes to 100% and the 'success' callback is never reached. The only time I have had success going between domains is when the response is very short (less than 150 bytes typically). The length of the response seems important.
I'm using jQuery 1.2.6. I've tried the $.getJSON() method and the $.ajax(dataType: "jsonp") method without success. This works beautifully in FF3 and IE7. I haven't been able to find anyone else with a similar problem. I thought this type of functionality was fully supported by jQuery in IE6.
Any help is very appreciated,
Andrew
Here is my AJAX call:
function test(count)
{
var dataSourceUrl = "http://somesite";
$.ajax({
type: "GET",
url: dataSourceUrl,
data: "test=true&c=" + count,
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function(results)
{
alert("here");
}
});
} | 0 | [
2,
487,
8190,
93,
487,
528,
306,
1448,
19,
13,
660,
379,
800,
3726,
3726,
31,
22,
195,
8208,
21,
1448,
76,
13,
6239,
3272,
8397,
21,
487,
528,
306,
1627,
37,
21,
8128,
19,
21,
421,
4603,
568,
13,
660,
379,
9,
76,
31,
233,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to avoid storing passwords in the clear for tomcat's server.xml Resource definition of a DataSource?
===
The resource definition in tomcat's server.xml looks something like this...
<Resource
name="jdbc/tox"
scope="Shareable"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@yourDBserver.yourCompany.com:1521:yourDBsid"
driverClassName="oracle.jdbc.pool.OracleDataSource"
username="tox"
password="toxbaby"
maxIdle="3"
maxActive="10"
removeAbandoned="true"
removeAbandonedTimeout="60"
testOnBorrow="true"
validationQuery="select * from dual"
logAbandoned="true"
debug="99"/>
The password is in the clear. How to avoid this? | 0 | [
2,
184,
20,
2658,
25615,
20884,
18,
19,
14,
1207,
26,
2067,
5782,
22,
18,
8128,
9,
396,
8184,
6577,
5465,
16,
21,
1054,
12097,
60,
800,
3726,
3726,
14,
6577,
5465,
19,
2067,
5782,
22,
18,
8128,
9,
396,
8184,
1879,
301,
101,
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... |
Read data in FileStream into a generic Stream
===
What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following:
1. read line by line and write the data to the stream
2. read chunks of bytes and write to the stream
3. etc
I'm just trying to find the most efficient way.
Thanks | 0 | [
2,
1302,
1054,
19,
3893,
11260,
77,
21,
12733,
3766,
800,
3726,
3726,
98,
22,
18,
14,
127,
8243,
161,
20,
1302,
21,
3766,
77,
226,
3766,
60,
19,
48,
610,
15,
31,
22,
79,
749,
20,
1302,
1054,
19,
21,
3893,
11260,
77,
21,
12733,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Difference between int[] array and int array[]
===
I have recently been thinking of the difference between the two ways of defining an array:
1. int[] array
2. int array[]
Is there a difference? I havent found anything in my Java book explaining me the difference and googling the question isnt bringing me any closer... I just dont know what to google after.
Thanks | 0 | [
2,
2841,
128,
19,
38,
2558,
500,
7718,
17,
19,
38,
7718,
2558,
500,
800,
3726,
3726,
31,
57,
1989,
74,
1440,
16,
14,
2841,
128,
14,
81,
2847,
16,
14684,
40,
7718,
45,
137,
9,
19,
38,
2558,
500,
7718,
172,
9,
19,
38,
7718,
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... |
Getting Spring Application Context
===
Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application?
Assuming the main class starts up and initializes the application context, does it need to pass that down throw the call stack to any classes that need it, or is there a way for a class to ask for the previously created context? (Which I assume has to be a singleton?)
Thanks! | 0 | [
2,
1017,
1573,
3010,
4141,
800,
3726,
3726,
25,
80,
21,
161,
20,
12038,
1326,
118,
26763,
102,
3772,
21,
4344,
16,
14,
3010,
1126,
11969,
19,
21,
1573,
3010,
60,
11704,
14,
407,
718,
3244,
71,
17,
2104,
13569,
14,
3010,
4141,
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... |
Best practice: Self-referential scripts on a web site
===
On the advice of a more experienced developer, I have always coded my web pages that require user input (form processing, database administration, etc.) as self-referential pages. For PHP pages, I set the action of the form to the `'PHP_SELF'` element of the `$_SERVER` predefined variable, and depending on the arguments that I pass the page logic determines which code block(s) to execute.
I like that all of the code is contained in one file, and not spread around to various result pages. The one issue I've found is that my stats parsing programs can't differentiate between the first view of the page, and subsequent views (e.g. when the form has been submitted). A long time ago, when I used CGI or CF to create the pages, I directed the user to a different result page, which showed very neatly how many times the form was actually used.
What is the best practice for these types of pages in web development? Are there other, more compelling reasons for using (or not using) self-referential pages?
| 0 | [
2,
246,
1345,
45,
1119,
8,
99,
2407,
10107,
17505,
27,
21,
2741,
689,
800,
3726,
3726,
27,
14,
4978,
16,
21,
91,
3882,
10058,
15,
31,
57,
550,
13,
22254,
51,
2741,
4434,
30,
4077,
4155,
6367,
13,
5,
4190,
5511,
15,
6018,
1603,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Will a task using kill to send a signal be preempted?
===
We have the following code in VxWorks:
<pre><code>
sig_hdr () { ... }
task_low_priority() {
...
// Install signal handler for SIGUSR1
signal(SIGUSR1, sig_hdr);
...
}
task_high_priority() {
...
kill(pid, SIGUSR1); //pid is the ID of task_low_priority
...
}
</code></pre>
The high priority task sends a signal (via kill) to the low priority task.
Will the high priority task be pre-empted and the low priority task execute right away, or will the signal be deferred until the low priority task gets to run? | 0 | [
2,
129,
21,
3005,
568,
1177,
20,
2660,
21,
2800,
44,
782,
14228,
69,
60,
800,
3726,
3726,
95,
57,
14,
249,
1797,
19,
566,
396,
7684,
45,
13,
1,
3515,
1,
9375,
1,
8858,
1,
252,
3807,
13,
5,
6,
13,
1,
13,
9,
9,
9,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Network auto-disovery using SNMP and .NET
===
Are there any libraries, (third party is fine) that can help do network auto-disovery using SNMP and .NET?
If not, have you ever rolled your own? | 0 | [
2,
982,
3108,
8,
2906,
2549,
93,
568,
8912,
2554,
17,
13,
9,
2328,
800,
3726,
3726,
50,
80,
186,
8649,
15,
13,
5,
8932,
346,
25,
1123,
6,
30,
92,
448,
107,
982,
3108,
8,
2906,
2549,
93,
568,
8912,
2554,
17,
13,
9,
2328,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... |
What are the current state of affairs on threading, concurrency and forked processes, in Ruby on Rails?
===
Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't.
The notion of only one request-response active at the same time can be a hassle when creating web applications which fork off a shell-command that takes long to finish.
What I'd like are some of your views on these kinds of setups? Is Rails maybe not a good fit for some applications?
Also, what are the current state of affairs in regard to concurrency in Ruby on Rails? What are the best practises. Are there workarounds to the shortcomings?
| 0 | [
2,
98,
50,
14,
866,
146,
16,
2118,
27,
9322,
68,
15,
25547,
17,
26,
4616,
5102,
15,
19,
10811,
27,
2240,
18,
60,
800,
3726,
3726,
10811,
27,
2240,
18,
630,
52,
107,
1889,
96,
10647,
69,
3772,
8,
99,
18,
8782,
7202,
253,
134,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Many to many table queries
===
I have a many to many index table, and I want to do an include/exclude type query on it.
fid is really a integer index, but here as letters for easier understanding. Here's a sample table :
table t
eid | fid
----+----
1 | A
1 | B
1 | C
2 | B
2 | C
3 | A
3 | C
4 | A
4 | B
5 | B
Here are some sample queries I want.
1. What eids have fid B, and NOT A? (Answer eid 2 and 5)
2. What eids have fid C, and NOT A? (Answer eid 2)
I can't seem to figure out a query that will do this.
I've tried a self join like this:
select * from t as t1 join t as t2 where t1.eid=t2.eid and t1.fid!=t2.fid and t1.fid=B and t2.fid!=A
That won't work, because it will still return rows where eid=1 and fid=C.
Am I clear on what I want? | 0 | [
2,
151,
20,
151,
859,
9386,
2829,
800,
3726,
3726,
31,
57,
21,
151,
20,
151,
4348,
859,
15,
17,
31,
259,
20,
107,
40,
468,
118,
1706,
150,
17405,
1001,
25597,
27,
32,
9,
13,
15817,
25,
510,
21,
13820,
4348,
15,
47,
235,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I make a framework for quickly building similar, but different, sites?
===
I have the the need to build lots of sites that are very similar, but not exactly the same, using ASP.NET 2.0.
I'm trying to find the best way to make the generation of these sites quick and easy.
The sites will be used to collect information about a user, and there will be multiple steps for each site.
The sites will all collect similar information, but some sites may require less or more information than others. Additionally, certain form fields will need to be populated from different database tables, based on the site.
I would like to use a Microsoft patterns & practices solution, but I'm not sure that there is one that fits this scenario.
My current thinking is that I will put as much business logic as possible into an external assembly and then write a custom Web user control for each step for each site. I will include these user controls in a master page's Panel control.
I don't like this solution because each site will be nearly duplicating the code for the other sites.
How can I improve upon this design?
The main obstacle is that the sites are similar, but sufficiently different.
Thanks!
Alex | 0 | [
2,
184,
92,
31,
233,
21,
6596,
26,
976,
353,
835,
15,
47,
421,
15,
3259,
60,
800,
3726,
3726,
31,
57,
14,
14,
376,
20,
1895,
7503,
16,
3259,
30,
50,
253,
835,
15,
47,
52,
1890,
14,
205,
15,
568,
28,
306,
9,
2328,
172,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CASCADE DELETE just once
===
I have a Postgresql database on which I want to do a few cascading deletes. However, the tables aren't set up with the ON DELETE CASCADE rule. Is there any way I can perform a delete and tell Postgresql to cascade it just this once? Something equivalent to
DELETE FROM some_table CASCADE;
The answers to [this older question][1] make it seem like so such solution exists, but I figured I'd ask this question explicitly just to be sure.
[1]: http://stackoverflow.com/questions/45611/cascading-deletes-in-postgresql | 0 | [
2,
13542,
27448,
114,
382,
800,
3726,
3726,
31,
57,
21,
678,
6879,
18,
22402,
6018,
27,
56,
31,
259,
20,
107,
21,
310,
7167,
13489,
68,
27448,
18,
9,
207,
15,
14,
7484,
4847,
22,
38,
309,
71,
29,
14,
27,
27448,
13542,
1828,
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... |
Why no static methods in Interfaces, but static fields and inner classes OK?
===
There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, but not static methods?
Static inner types perhaps aren't a fair comparison, since that's just syntactic sugar that generates a new class, but why fields but not methods?
An argument against static methods within interfaces is that it breaks the virtual table resolution strategy used by the JVM, but shouldn't that apply equally to static fields, i.e. the compiler can just inline it?
COnsistency is what I desire, and Java should have either supported no statics of any form within an interface, or it should be consistent and allow them. | 0 | [
2,
483,
90,
12038,
3195,
19,
6573,
18,
15,
47,
12038,
2861,
17,
3754,
2684,
5854,
60,
800,
3726,
3726,
80,
57,
74,
21,
310,
2346,
411,
235,
88,
483,
42,
92,
22,
38,
9267,
12038,
3195,
363,
6573,
18,
15,
47,
2369,
16,
105,
3218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Good Intro to COM Programming
===
Is there a good book or website with a basic introduction to COM programming? | 0 | [
2,
254,
17386,
20,
13,
960,
3143,
800,
3726,
3726,
25,
80,
21,
254,
360,
54,
2271,
29,
21,
2125,
3445,
20,
13,
960,
3143,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How do you determine whether or not a give Type (System.Type) inherits from a specific base class (in .Net)?
===
This is likely going to be an easy answer and I'm just missing something, but here goes...If I have a Type, (that is, an actual System.Type...not an instance) how do I tell if it inherits from another specific base type? | 0 | [
2,
184,
107,
42,
3746,
1472,
54,
52,
21,
590,
1001,
13,
5,
10724,
9,
4474,
6,
17569,
18,
37,
21,
1903,
1000,
718,
13,
5,
108,
13,
9,
2328,
6,
60,
800,
3726,
3726,
48,
25,
1720,
228,
20,
44,
40,
2010,
1623,
17,
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... |
MVC model design / inheritance
===
Forgive the vague title, I wasn't sure how to describe it.
If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'?
For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From there they get different forms based on the archive type.
Or would it be better to split them into different models - Video, Book, Audio?
Or can models inherit (like Video extends Archive). I guess this is basic OOP / classes, but have no idea how to apply that here.
Examples from any MVC framework are welcome!
| 0 | [
2,
307,
8990,
1061,
704,
13,
118,
13852,
800,
3726,
3726,
8591,
14,
14800,
581,
15,
31,
526,
22,
38,
562,
184,
20,
4996,
32,
9,
100,
42,
57,
21,
12733,
1061,
13,
7,
23941,
7,
15,
184,
107,
42,
298,
421,
4146,
118,
4190,
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... |
Can attributes be added dynamically in C#?
===
Is it possible to add attributes at runtime or to change the value of an attribute at runtime? | 0 | [
2,
92,
13422,
44,
905,
7782,
1326,
19,
272,
5910,
60,
800,
3726,
3726,
25,
32,
938,
20,
3547,
13422,
35,
485,
891,
54,
20,
753,
14,
1923,
16,
40,
35,
14755,
35,
485,
891,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Automatically resizing X11 display when connecting an external monitor
===
I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run "xrandr --auto" in order for the laptop to resize the display to match the external monitor. It would be nice if this could be done automatically, either triggered when the monitor is connected, but it would be enough to actually run "xrandr --auto" when the laptop wakes up from suspend/hibernate.
I created a script "/etc/pm/sleep.d/00xrandr.sh" containing the line
xrandr --auto
but this fails since the script does not have access to the X display.
Any ideas? | 0 | [
2,
7499,
10719,
3335,
993,
1306,
3042,
76,
6440,
40,
4886,
7626,
800,
3726,
3726,
31,
57,
21,
12294,
946,
287,
12968,
2473,
20,
56,
31,
6379,
40,
4886,
7626,
76,
31,
22,
79,
35,
14,
488,
9,
951,
48,
4781,
55,
20,
485,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RDLC SubReports Exporting to Excel
===
I have a RDLC report which has a table, calling a subreport N times. This works perfectly in the control viewer and when I export to PDF. Yet when I export to Excel, I get the following error:
> Subreports within table/matrix cells
> are ignored.
Does anyone know why this occurs only within the Excel export? And is there a workaround? | 0 | [
2,
13,
897,
6109,
972,
17437,
18,
7487,
68,
20,
20700,
800,
3726,
3726,
31,
57,
21,
13,
897,
6109,
1330,
56,
63,
21,
859,
15,
2555,
21,
972,
17437,
13,
103,
436,
9,
48,
693,
5759,
19,
14,
569,
16812,
17,
76,
31,
7487,
20,
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 write the content of one stream into another stream in .net?
===
I often run into the problem that I have one stream full of data and want to write everything of it into another stream.
All code-examples out there use a buffer in form of a byte-array.
Is there a more elegant way to this?
If not, what's the ideal size of the buffer. Which factors make up this value? | 0 | [
2,
184,
20,
2757,
14,
2331,
16,
53,
3766,
77,
226,
3766,
19,
13,
9,
2328,
60,
800,
3726,
3726,
31,
478,
485,
77,
14,
1448,
30,
31,
57,
53,
3766,
503,
16,
1054,
17,
259,
20,
2757,
796,
16,
32,
77,
226,
3766,
9,
65,
1797,
8,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What browser features/plugins for opera, IE, firefox, chrome, safari, etc. do you use for browser compatibility testing?
===
I use the [Nightly Tester Tools][1] for Firefox and [Fiddler][2] for IE. What do you use?
[1]: https://addons.mozilla.org/en-US/firefox/addon/6543
[2]: http://fiddlertool.com/fiddler/ | 0 | [
2,
98,
16495,
967,
118,
18527,
17040,
26,
1877,
15,
13,
660,
15,
535,
18219,
15,
13,
12985,
15,
25055,
15,
2722,
9,
107,
42,
275,
26,
16495,
13,
21618,
4431,
60,
800,
3726,
3726,
31,
275,
14,
636,
4893,
102,
1289,
106,
4672,
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... |
Windows (Vista): Set process-priority on a program shortcut
===
Is there any way to launch a program with a shortcut, that sets the process-priority of that program?
iTunes is dragging my system to it's knees, but when I set the process-priority to "low", somehow, like magic, Windows gets back to it's normal responsive self :) | 0 | [
2,
1936,
13,
5,
22034,
6,
45,
309,
953,
8,
6944,
248,
856,
27,
21,
625,
502,
4118,
800,
3726,
3726,
25,
80,
186,
161,
20,
3394,
21,
625,
29,
21,
502,
4118,
15,
30,
3415,
14,
953,
8,
6944,
248,
856,
16,
30,
625,
60,
12952,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you do attachments on your website?
===
Due to a lack of response to my original [question][1], probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better! :)
We create custom business software for our customers, and quite often they want attachments to be added to certain business entities. For example, they want to attach a Word document to a customer, or an image to a job. I'm curious as to how other are handling the following:
- How the user attaches documents? Single attachment? Batch attachment?
- How you display the attached
documents? Simple list? Detailed list?
- And the killer question, how the
user then edits attached documents? Is this even possible in a web environment? Granted the user can just view the attachment.
- Is there a good control library to help manage this process?
Our current development environment is ASP.NET and C#, but I don't think this is a pretty agnostic question when it comes to development tools, save for the fact I need to work in a web environment.
It seems we always run into problems with the customer and working with attachments in a web environment so I am looking for some **successes** that other programmers have had with their user base on how best to interact with attachments.
[1]: http://stackoverflow.com/questions/124258/how-would-you-allow-users-to-edit-attachments-in-a-web-application | 0 | [
2,
184,
107,
42,
107,
14575,
18,
27,
154,
2271,
60,
800,
3726,
3726,
397,
20,
21,
1792,
16,
1627,
20,
51,
501,
636,
24652,
500,
2558,
165,
500,
15,
910,
397,
20,
1696,
833,
68,
27,
51,
141,
9,
179,
94,
15,
31,
57,
289,
88,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Optimistic vs. Pessimistic locking
===
I understand the differences between optimistic and pessimistic locking*. Now could someone explain to me when I would use either one in general?
And does the answer to this question change whether or not I'm using a stored procedure to perform the query?
*But just to check, optimistic means "don't lock the table while reading" and pessimistic means "lock the table while reading." | 0 | [
2,
24408,
4611,
9,
10457,
8672,
3771,
17538,
800,
3726,
3726,
31,
1369,
14,
4921,
128,
24408,
17,
10457,
8672,
3771,
17538,
2483,
9,
130,
110,
737,
3271,
20,
55,
76,
31,
83,
275,
694,
53,
19,
297,
60,
17,
630,
14,
1623,
20,
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... |
How do I make a custom Flex component for a gap-fill exercise?
===
The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the missing words - hence this kind of test/exercise is called gap-fill.There could be several sentences in the exercise with multiple gaps - something that looks like this:
***London is the ________ and largest urban area in the _____________. An important settlement for two millennia, London's history goes back to its founding by the ___________.***
The component must be able to display text with 'floating' gaps within the text. These gaps would have similar behaviour to TextInput control. Once the student submits the answer the component will return the words that were typed in and these are then compared against the expected answers.
The component should be able to display the text and the gaps dynamically derive all required parameters from the text. The position of the gaps could be marked by a special token - such as #10# - which would mark the position of the gap within the text and the size of the gap (number of characters).
Therefore the above text could look like this before being loaded into the component:
London is the #10# and largest urban area in the #15#. An important settlement for two millennia, London's history goes back to its founding by the #8#.
| 0 | [
2,
184,
107,
31,
233,
21,
5816,
14409,
5912,
26,
21,
4127,
8,
19971,
5935,
60,
800,
3726,
3726,
14,
2131,
16,
48,
5912,
25,
20,
1289,
1918,
16,
21,
1209,
27,
21,
504,
1550,
13,
8,
19,
14,
823,
1021,
32,
83,
44,
11320,
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... |
How do you RedirectToAction using POST intead of GET?
===
When you call RedirectToAction within a Controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST?
I have an Action that accepts both GET and POST requests, and I want to be able to RedirectToAction using a POST and send it some values.
Like this:
this.RedirectToAction("actionname", new RouteValueDictionary(new { someValue = 2, anotherValue = "text" }));
I want the someValue and anotherValue values to be sent using an HTTP POST instead of a GET. Does anyone know how to do this? | 0 | [
2,
184,
107,
42,
302,
14706,
262,
8645,
568,
678,
19,
12265,
43,
16,
164,
60,
800,
3726,
3726,
76,
42,
645,
302,
14706,
262,
8645,
363,
21,
9919,
15,
32,
7499,
302,
14706,
18,
568,
40,
7775,
164,
9,
184,
107,
31,
13108,
494,
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... |
How to pass arguments to a constructor in an IOC-framework
===
How can I pass arguments to a constructor in an IOC-framework?
I want to do something like: (Trying to be IOC-framework agnostic ;) )
object objectToLogFor = xxx;
container.Resolve<ILogging>(objectToLogFor);
public class MyLogging : ILogging
{
public MyLogging(object objectToLogFor){}
}
It seems that this is not possible in StructureMap. But I would love to see someone prove me wrong.
Are other frameworks more feature-rich? Or am I using the IOC-framework in the wrong way? | 0 | [
2,
184,
20,
1477,
10553,
20,
21,
6960,
248,
19,
40,
31,
2499,
8,
8361,
3783,
800,
3726,
3726,
184,
92,
31,
1477,
10553,
20,
21,
6960,
248,
19,
40,
31,
2499,
8,
8361,
3783,
60,
31,
259,
20,
107,
301,
101,
45,
13,
5,
5840,
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... |
Passing in parameter from html element with jQuery.
===
I'm working with jQuery for the first time and need some help. I have html that looks like the following:
<div id='comment-8' class='comment'>
<p>Blah blah</p>
<div class='tools'></div>
</div>
<div id='comment-9' class='comment'>
<p>Blah blah something else</p>
<div class='tools'></div>
</div>
I'm trying to use jQuery to add spans to the .tools divs that call variouis functions when clicked. The functions needs to receive the id (either the entire 'comment-8' or just the '8' part) of the parent comment so I can then show a form or other information about the comment.
What I have thus far is:
<script type='text/javascript'>
$(function() {
var actionSpan = $('<span>[Do Something]</span>');
actionSpan.bind('click', doSomething);
$('.tools').append(actionSpan);
});
function doSomething(commentId) { alert(commentId); }
</script>
I'm stuck on how to populate the commentId parameter for doSomething. Perhaps instead of the id, I should be passing in a reference to the span that was clicked. That would probably be fine as well, but I'm unsure of how to accomplish that.
Thanks,
Brian | 0 | [
2,
2848,
19,
18906,
37,
13,
15895,
4520,
29,
487,
8190,
93,
9,
800,
3726,
3726,
31,
22,
79,
638,
29,
487,
8190,
93,
26,
14,
64,
85,
17,
376,
109,
448,
9,
31,
57,
13,
15895,
30,
1879,
101,
14,
249,
45,
13,
1,
12916,
4924,
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... |
Restoring SplitterDistance inside TabControl is inconsistent
===
I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, then the restore works and the splitter distance is as I left it. If some other tab is selected, then the splitter distance is wrong. | 0 | [
2,
19144,
2132,
815,
13357,
572,
6523,
12898,
25,
22380,
800,
3726,
3726,
31,
22,
79,
1174,
21,
628,
4190,
18,
3010,
17,
53,
16,
14,
6523,
18,
19,
51,
6523,
12898,
63,
21,
2132,
1126,
5851,
106,
9,
31,
22,
79,
7599,
14,
2132,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Anybody know where I can get docs or tutorials on VSS 2005 Integration via .net.
===
I know that I can add the SourceSafeTypeLib to a project and can explore it in object browser and find obvious things (GetLatest, etc), but I am looking for some more thorough documentation or specific tutorials on things like "undo another user's checkout" or"determine who has a file checked out.
If anyone knows where to find this material, how to do advanced or non-obvious tasks with VSS, or knows how to disassemble a COM api (so I can engineer my own api) it would be much appreciated. | 0 | [
2,
11181,
143,
113,
31,
92,
164,
9765,
18,
54,
29724,
18,
27,
4611,
18,
812,
8078,
1197,
13,
9,
2328,
9,
800,
3726,
3726,
31,
143,
30,
31,
92,
3547,
14,
1267,
18166,
4474,
8326,
20,
21,
669,
17,
92,
8594,
32,
19,
3095,
16495,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GetElementsByTagName functionality from .net code-behind page?
===
I am writing a webpage in C# .NET. In javascript there is a function called GetElementsByTagName... this is nice for javascript invoked from the .aspx page. My question is, is there any way I can have this kind of functionality from my C# code-behind?
--
The scenario for those curious: I used an asp:repeater to generate a lot of buttons, and now I'm essentially trying to make a button that clicks them all. I tried storing all the buttons in a list as I created them, but the list is getting cleared during every postback, so I thought I could try the above method. | 0 | [
2,
164,
27567,
18,
779,
8628,
7259,
18548,
37,
13,
9,
2328,
1797,
8,
24878,
2478,
60,
800,
3726,
3726,
31,
589,
1174,
21,
2741,
6486,
19,
272,
5910,
13,
9,
2328,
9,
19,
8247,
8741,
80,
25,
21,
1990,
227,
164,
27567,
18,
779,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you do a deep copy an object in .Net (C# specifically)?
===
I want a true deep copy. In Java, this was easy, but how do you do it in C#? | 0 | [
2,
184,
107,
42,
107,
21,
855,
4344,
40,
3095,
19,
13,
9,
2328,
13,
5,
150,
5910,
3524,
6,
60,
800,
3726,
3726,
31,
259,
21,
1151,
855,
4344,
9,
19,
8247,
15,
48,
23,
2010,
15,
47,
184,
107,
42,
107,
32,
19,
272,
5910,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How do I add Active Directory support to Windows PE?
===
I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend? | 0 | [
2,
184,
107,
31,
3547,
1348,
16755,
555,
20,
1936,
3560,
60,
800,
3726,
3726,
31,
259,
20,
25597,
1348,
16755,
37,
1936,
3560,
172,
9,
387,
15,
56,
25,
52,
1827,
13,
7,
1320,
16,
14,
1649,
9,
7,
7099,
2206,
20,
5601,
30,
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,
0... |
Can I use DoxyGen to document ActionScript code?
===
How do I Configuring DoxyGen to document ActionScript files?
I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there. | 0 | [
2,
92,
31,
275,
107,
15161,
1863,
20,
4492,
1028,
8741,
1797,
60,
800,
3726,
3726,
184,
107,
31,
1065,
13549,
68,
107,
15161,
1863,
20,
4492,
1028,
8741,
6488,
60,
31,
22,
195,
506,
14,
1637,
9,
472,
17,
1637,
9,
8198,
6488,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.