unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Reflector not inside VS
===
I downloaded [Reflector.Net][1] and it's an .Exe outside VS. I remember (last year) when I downloaded it, it was an Addin to VS. How can I make it back to an Addin?
[1]: http://www.red-gate.com/products/reflector/ | 0 | [
2,
6907,
248,
52,
572,
4611,
800,
3726,
3726,
31,
23887,
636,
27977,
248,
9,
2328,
500,
2558,
165,
500,
17,
32,
22,
18,
40,
13,
9,
1706,
62,
719,
4611,
9,
31,
1518,
13,
5,
8558,
159,
6,
76,
31,
23887,
32,
15,
32,
23,
40,
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... |
efficient ways to anonymous personalization using ASP.NET + Cookie
===
I am trying to achieve anonymous personalization in a ASP.net environment. I know that ASP.NET 2.0 provide [Profile][1]. However, I want to avoid traffic to the database as much as possible since the site I am working on is a relatively high traffic site.
The other obvious solution is cookie, but given the [limitation of cookie][2], I was wondering if anyone have any efficient method to store information into cookie. Does anyone know how amazon or yahoo deals anon. personalization?
Thanks in advance!
[1]: http://www.odetocode.com/articles/440.aspx
[2]: http://www.ietf.org/rfc/rfc2109.txt | 0 | [
2,
8243,
2847,
20,
10364,
1319,
1829,
568,
28,
306,
9,
2328,
2754,
19980,
800,
3726,
3726,
31,
589,
749,
20,
4689,
10364,
1319,
1829,
19,
21,
28,
306,
9,
2328,
2307,
9,
31,
143,
30,
28,
306,
9,
2328,
172,
9,
387,
1181,
636,
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... |
Nice bit of code to format an xml string
===
Anyone got a ready made function that will take an XML string and return a correctly indented string?
eg
<XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML>
and will return nicely formatted String in return after inserting linebreaks and tabs or spaces?
Yes I know the code is easy to write but I'm sure someone else has already written it.
| 0 | [
2,
2210,
1142,
16,
1797,
20,
2595,
40,
23504,
3724,
800,
3726,
3726,
1276,
330,
21,
1451,
117,
1990,
30,
129,
247,
40,
23504,
3724,
17,
788,
21,
12044,
19,
817,
1427,
3724,
60,
12369,
13,
1,
396,
8184,
1,
8628,
165,
1,
58,
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... |
Will I leak memory if I don't close a MemoryStream?
===
OK, so if I've got
MemoryStream foo(){
MemoryStream ms = new MemoryStream();
// write stuff to ms
return ms;
}
void bar(){
MemoryStream ms2 = foo();
// do stuff with ms2
return;
}
is there any chance that the MemoryStream that I've allocated will somehow fail to be disposed of later? I've got a peer review insisting that I manually close this, and I can't find the information to tell if he has a valid point or not. | 0 | [
2,
129,
31,
11724,
1912,
100,
31,
221,
22,
38,
543,
21,
1912,
11260,
60,
800,
3726,
3726,
5854,
15,
86,
100,
31,
22,
195,
330,
1912,
11260,
4310,
111,
5,
6,
1,
1912,
11260,
4235,
800,
78,
1912,
11260,
5,
6,
73,
12894,
2757,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.Net DataBinding a new object with value type properties
===
Using data binding, how do you bind a new object that uses value types?
Simple example:
public class Person() {
private string _firstName;
private DateTime _birthdate;
private int _favoriteNumber;
//Properties
}
If I create a new Person() and bind it to a form with text boxes. Birth Date displays as 01/01/0001 and Favorite Number as 0. These fields are required, but I would like these boxes to be empty and have the user fill them in.
The solution also needs to be able to default fields. In our example, I may want the Favorite Number to default to 42.
I'm specifically asking about Silverlight, but I assume WPF and WinForms probably have the same issue.
| 0 | [
2,
13,
9,
2328,
1054,
22260,
21,
78,
3095,
29,
1923,
1001,
3704,
800,
3726,
3726,
568,
1054,
8728,
15,
184,
107,
42,
10193,
21,
78,
3095,
30,
2027,
1923,
2551,
60,
1935,
823,
45,
317,
718,
840,
5,
6,
13,
1,
932,
3724,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to "bind" services to specific channels (tcp, http, ipc) in a .NET Remoting server?
===
I have a complex .NET Remoting server app that provides a couple of services. Clients can currently use tcp and http channels to connect to the server.
Now I need to implement some new administration services, but I want to restrict their availability to the local machine, i.e. I want to create an administration tool that can use these new services, but I do not want sensitive data to physically leave the server, so I need to restrict running the admin tool on the same server computer.
I thought about adding the new services and also registering the ipc channel with the server for use by the admin tool. Now comes the problem: how can I prevent remote clients connecting to these new admin services using the tcp or http channel? Can I say something like "register service x, implemented by class C in assembly A, usable only via ipc", "register service y, implemented by class D in assembly A, usable via tcp/http" in app.config (or using remoting infrastructure classes)?
It's the "usable only via ipc" part that baffles me. (And no, porting to WCF is not an option right now.) | 0 | [
2,
184,
20,
13,
7,
4772,
43,
7,
687,
20,
1903,
6328,
13,
5,
38,
7439,
15,
7775,
15,
31,
5779,
6,
19,
21,
13,
9,
2328,
302,
7662,
68,
8128,
60,
800,
3726,
3726,
31,
57,
21,
1502,
13,
9,
2328,
302,
7662,
68,
8128,
4865,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I make the IsEnabled property of a button dependent on the presence of data in other controls? (WPF)
===
I have a "Login" button that I want to be disabled until 3 text boxes on the same WPF form are populated with text (user, password, server).
I have a backing object with a boolean property called IsLoginEnabled which returns True if and only if all 3 controls have data. However, when should I be checking this property? Should it be on the LostFocus event of each of the 3 dependent controls?
Thanks!
vg1890 | 0 | [
2,
184,
107,
31,
233,
14,
25,
219,
579,
43,
1354,
16,
21,
5167,
9063,
27,
14,
1970,
16,
1054,
19,
89,
8671,
60,
13,
5,
499,
7721,
6,
800,
3726,
3726,
31,
57,
21,
13,
7,
5567,
108,
7,
5167,
30,
31,
259,
20,
44,
10154,
163,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to detect duplicate text?
===
Some thing ago, I write [small script][1] using [Text::DeDupe][2] to remove duplicates of blog posts before I have to lay my eyes on them.
After reading [Syntactic Clustering of the Web][3] paper on which implementation is based, I would love to have ability to find overlapping documents (e.g. snippets of blogs as opposed to full text, maybe also quotes).
Do you know of any other implementation in C, C++ or perl which I can try out before writing my own?
[1]: http://svn.rot13.org/index.cgi/refeed/view/trunk/deduper/reblog-dupe.pl
[2]: http://search.cpan.org/dist/Text-DeDuper/
[3]: http://www.ra.ethz.ch/CDstore/www6/Technical/Paper205/Paper205.html | 0 | [
2,
184,
20,
9092,
19429,
1854,
60,
800,
3726,
3726,
109,
584,
1464,
15,
31,
2757,
636,
15988,
3884,
500,
2558,
165,
500,
568,
636,
11969,
45,
45,
7424,
576,
62,
500,
2558,
135,
500,
20,
4681,
19429,
18,
16,
8146,
9868,
115,
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... |
Infragistics Windows Grid
===
I'm using the Infragistics WinForms UltaGrid control and I'm setting the RegexPattern property. How do I get the grid cell I'm setting the RegEx for to actually use that pattern to restrict entry? Or am I misunderstanding how the RegexPattern property works.
Jeff
| 0 | [
2,
19,
22133,
3771,
18,
1936,
7354,
800,
3726,
3726,
31,
22,
79,
568,
14,
19,
22133,
3771,
18,
628,
4190,
18,
13,
10368,
58,
16375,
569,
17,
31,
22,
79,
2697,
14,
7953,
6899,
721,
8766,
1354,
9,
184,
107,
31,
164,
14,
7354,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pass parameter to servlet
===
How do I pass a parameter from a page's useBean in JSP to a servlet in Java? I have some data in a form that gets passed no problem with a submit button, but no way to send anything else. Please help? Here is my code:
<input name = "deleteGameButton" type = "submit" value = "Delete"
onclick = "submitToServlet('DeleteGameServlet');">
Here is the corresponding javascript:
function submitToServlet(newAction)
{
document.userGameForm.action = newAction;
}
I'd like the servlet to have access to userBean
<jsp:useBean id = "userBean" scope = "session" class = "org.project.User" /> | 0 | [
2,
184,
20,
1477,
18906,
20,
13,
10321,
1336,
800,
3726,
3726,
184,
107,
31,
1477,
21,
18906,
37,
21,
2478,
22,
18,
275,
863,
210,
19,
487,
3401,
20,
21,
13,
10321,
1336,
19,
8247,
60,
31,
57,
109,
1054,
19,
21,
505,
30,
3049,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 architect DAL for WebService exposure?
===
We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB.
The base classes for the DAL
I have a generated DAL (which sits on some custom base classes) with various 'Rec' classes (Table1Rec, Table2Rec) each of which represents the record structure of a given table.
Here is a sample Pseudo-class...
Public Class SomeTableRec
Private mField1 As String
Private mField1isNull As Boolean
Private mField2 As Integer
Private mField2isNull As Boolean
Public Sub New()
mField1isNull = True
mField2isNull = True
End Sub
Public Property Field1() As String
Get
Return mField1
End Get
Set(ByVal value As String)
mField1 = value
mField1isNull = False
End Set
End Property
Public ReadOnly Property Field1isNull() As Boolean
Get
Return mField1isNull
End Get
End Property
Public Property Field2() As Integer
Get
Return mField2
End Get
Set(ByVal value As Integer)
mField2 = value
mField2isNull = False
End Set
End Property
Public ReadOnly Property Field2isNull() As Boolean
Get
Return mField2isNull
End Get
End Property
End Class
Each class has properties for each of the fields...
Thus I can write...
Dim Rec as New Table1Rec
Table1Rec.Field1 = "SomeString"
Table2Rec.Field2 = 500
Where a field can accept a NULL value, there is an additional property which indicates if the value is currently null.
Thus....
Dim Rec as New Table1Rec
Table1Rec.Field1 = "SomeString"
If Table1Rec.Field1Null then
' This clearly is not true
End If
If Table1Rec.Field2Null then
' This will be true
End If
This works because the constructor of the class sets all NULLproperties to True and the setting of any FieldProperty will cause the equivalent NullProperty to be set to false.
I have recently had the need to expose my DAL over the web through a web service (which I of course intend to secure) and have discovered that while the structure of the 'Rec' class remains intact over the web... All logic is lost..
If someone were to run the previous piece of code remotely they would notice that neither condition would prove true as there is no client side code which sets null to true.
**I get the feeling I have architected this all wrong, but cannot see how I should improve it.**
**What is the correct way to architect this?** | 0 | [
2,
184,
20,
3338,
6868,
26,
2741,
11449,
6587,
60,
800,
3726,
3726,
95,
57,
21,
2157,
7119,
6868,
56,
7550,
84,
318,
13,
9007,
9,
318,
4865,
18,
376,
20,
275,
48,
6868,
20,
12044,
4055,
149,
48,
13,
9007,
9,
14,
1000,
2684,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why CLR integration assemblies have a random version number
===
For some reason, new projects set the version number of the assembly to 1.0.*, which then assigns what appears to be a random number once compiled.
Why is this not set to 1.0.0.0 like all other projects.
Thanks. | 0 | [
2,
483,
10842,
139,
8078,
21066,
57,
21,
5477,
615,
234,
800,
3726,
3726,
26,
109,
1215,
15,
78,
2314,
309,
14,
615,
234,
16,
14,
1475,
20,
137,
9,
387,
9,
2483,
15,
56,
94,
13952,
18,
98,
1780,
20,
44,
21,
5477,
234,
382,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to know, efficiently, if a postgres table has rows
===
I did this tests and the results seems the count function scale linearly. I have another function relying strongly in the efficiency to know if there are any data, so I would like to know how to replace this select count(*) with another more efficient (maybe constant?) query or data structure.
> psql -d testdb -U postgres -f truncate_and_insert_1000_rows.sql > NUL
> psql -d testdb -U postgres -f count_data.sql
--------------------------------------------------------------------------------
----------------------------
Aggregate (cost=36.75..36.76 rows=1 width=0) (actual time=0.762..0.763 rows=1
loops=1)
-> Seq Scan on datos (cost=0.00..31.40 rows=2140 width=0) (actual time=0.02
8..0.468 rows=1000 loops=1)
Total runtime: **0.846 ms**
(3 filas)
> psql -d testdb -U postgres -f truncate_and_insert_10000_rows.sql > NUL
> psql -d testdb -U postgres -f count_data.sql
--------------------------------------------------------------------------------
------------------------------
Aggregate (cost=197.84..197.85 rows=1 width=0) (actual time=6.191..6.191 rows=
1 loops=1)
-> Seq Scan on datos (cost=0.00..173.07 rows=9907 width=0) (actual time=0.0
09..3.407 rows=10000 loops=1)
Total runtime: **6.271 ms**
(3 filas)
> psql -d testdb -U postgres -f truncate_and_insert_100000_rows.sql > NUL
> psql -d testdb -U postgres -f count_data.sql
--------------------------------------------------------------------------------
-----------------------------------
Aggregate (cost=2051.60..2051.61 rows=1 width=0) (actual time=74.075..74.076 r
ows=1 loops=1)
-> Seq Scan on datos (cost=0.00..1788.48 rows=105248 width=0) (actual time=
0.032..46.024 rows=100000 loops=1)
Total runtime: **74.164 ms**
(3 filas)
> psql -d prueba -U postgres -f truncate_and_insert_1000000_rows.sql > NUL
> psql -d testdb -U postgres -f count_data.sql
--------------------------------------------------------------------------------
--------------------------------------
Aggregate (cost=19720.00..19720.01 rows=1 width=0) (actual time=637.486..637.4
87 rows=1 loops=1)
-> Seq Scan on datos (cost=0.00..17246.60 rows=989360 width=0) (actual time
=0.028..358.831 rows=1000000 loops=1)
Total runtime: **637.582 ms**
(3 filas)
the definition of data is
CREATE TABLE data
(
id INTEGER NOT NULL,
text VARCHAR(100),
CONSTRAINT pk3 PRIMARY KEY (id)
); | 0 | [
2,
184,
20,
143,
15,
20519,
15,
100,
21,
678,
6879,
18,
859,
63,
11295,
800,
3726,
3726,
31,
144,
48,
4894,
17,
14,
1736,
2206,
14,
2468,
1990,
3464,
6745,
102,
9,
31,
57,
226,
1990,
21760,
5020,
19,
14,
7836,
20,
143,
100,
80... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Internal properties vrs ivars
===
When I need a private object I currently use properties, like so:
// Private interface in .m file
@interface MyClass()
@property (strong, nonatomic) NSArray* myInternalArray;
@end
@implementation MyClass
@synthesize myInternalArray = _myInternalArray;
...
self.myInternalArray = something;
...
However, I believe with ARC, this this is equivalent to doing:
// Private interface in .m file
@interface MyClass() {
NSArray* _myInternalArray;
}
@end
@implementation MyClass
...
_myInternalArray = something
...
The default for variables is `__strong`. So `NSArray* _myInternalArray;` is the same as `__strong NSArray* _myInternalArray;` therefore the ivar retains the reference just like the property above.
So my quesitons is what is the best way to do internal variables?
* The first method has more control e.g. nonatomic, atomic, readwrite etc.. So does that make it preferable?
* The second method has less boilerplate so dose that win out?
* Is there some other advantages of one method over the other?
| 0 | [
2,
3117,
3704,
13,
6938,
18,
31,
3311,
18,
800,
3726,
3726,
76,
31,
376,
21,
932,
3095,
31,
871,
275,
3704,
15,
101,
86,
45,
12894,
932,
6573,
19,
13,
9,
79,
3893,
13,
1,
6280,
6413,
51,
1898,
5,
6,
13,
1,
10890,
106,
1084,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Could not load file or assembly 'System.Data'
===
I receive this error:
Could not load file or assembly 'System.Data' or one of its dependencies
This is my code in Web.Config.
<add assembly="System.Data" />
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Could you help me out to figure out what I'm doing wrong? Thanks | 0 | [
2,
110,
52,
6305,
3893,
54,
1475,
13,
22,
10724,
9,
18768,
22,
800,
3726,
3726,
31,
2588,
48,
7019,
45,
110,
52,
6305,
3893,
54,
1475,
13,
22,
10724,
9,
18768,
22,
54,
53,
16,
82,
29411,
48,
25,
51,
1797,
19,
2741,
9,
14093,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 issues multiple browsers on Mac os Lion
===
I'm not very familiar with javascript programming, I hope someone can help me here.
I'm running Intel Mac os 10.7.2.
Since I have installed the Apple Java update and Flashback malware removal tool (through software update), I have this problem in Safari, Firefox and Chrome. I know Java and Javascript aren't the same, but it's strange this problem appeared directly after the updates.
Problem: some javascripts aren't working anymore; on multiple sites javascript console returns a lot of 'Uncaught referenceError:xxx is not defined' and 'Unsafe javascript attempts to access frame xxx'.
It looks like the javascript code gets modified somehow. Someone told me it could be a badly written pop-up blocker. Which I haven't installed actually. This is what's happening:
Original code:
>var nw=window.open(u, 'ws_pop', 'height='+h+',width='+w+',left='+l+',top='+t);
My browsers return this (without the space after < ):
>var nw= < !--ow.open(u, 'ws_pop', 'height='+h+',width='+w+',left='+l+',top='+-->
Creating a new user and profile doesn't solve the problem. I have reinstalled all 3 browsers, Javascript plugins are turned on, even Java is turned on, and I have turned on/off the browsers pop-up blockers.
Can someone tell me what's going on here, or how I can fix this?
Any help appreciated.
Thanks in advance!
| 0 | [
2,
8247,
8741,
1549,
1886,
16495,
18,
27,
1572,
13,
759,
6023,
800,
3726,
3726,
31,
22,
79,
52,
253,
3694,
29,
8247,
8741,
3143,
15,
31,
1376,
737,
92,
448,
55,
235,
9,
31,
22,
79,
946,
14635,
1572,
13,
759,
332,
9,
465,
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... |
sync and import/export ics to/from iCal and dhtmlxscheduler
===
I don't know what to do at the moment. I successfully managed to get events I create in a web calendar with dhtmlxscheduler into an ics and iCal can read them through an caldav server I have on my synology.
When I want to create a new event in iCal then it sets up different .ics files. So now my question, can I somehow use the ics import/export tool in my html file and how do I integrate it. In the documentation it seems that the variables have to be integrated in an php file but I tried it and it doesn't work.
Basically, I would like to create an event in the dhtmlxscheduler and in iCal and it should sync with each other. Another idea I had to read the data from a mysql and parse the ics files into the mysql but I don't know how to do it.
Maybe someone can help me with this. It would be very great.
Thanks,
Karolin | 0 | [
2,
6063,
150,
17,
9010,
118,
1706,
1993,
13,
8354,
20,
118,
2665,
13,
4272,
17,
13,
43,
15895,
396,
7526,
11203,
106,
800,
3726,
3726,
31,
221,
22,
38,
143,
98,
20,
107,
35,
14,
688,
9,
31,
3673,
1471,
20,
164,
963,
31,
1600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Save Image in pictures library
===
I am trying to work with sample `save` method and find lots of tutorials which made me so complicated in thinking of different things which made me confused totally but the image is not saving and in return getting a `Null exception`.
My Steps involved in acheiving this:
1.***First created a new project with a image control and 2 buttons one is for loading the image using photochooser task and the other is for saving the modified image.***
2.***This is my XAML part***:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Button Content="Select" Height="72" HorizontalAlignment="Left" Margin="151,63,0,0" Name="Button1" VerticalAlignment="Top" Width="160" />
<Button Content="Save" Height="72" HorizontalAlignment="Left" Margin="151,141,0,0" Name="Button2" VerticalAlignment="Top" Width="160" />
</Grid>
<Image Source="Tulips.jpg" Name="img" />
<TextBlock Text="Your Text Here"/>
***Now my codebhind looks likes this:***
Private Sub Button1_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
Try
photoChooserTask.Show()
Catch ex As System.InvalidOperationException
MessageBox.Show("An error occurred.")
End Try
End Sub
Private Sub photoChooserTask_Completed(sender As Object, e As PhotoResult)
If e.TaskResult = TaskResult.OK Then
'MessageBox.Show(e.ChosenPhoto.Length.ToString())
'Code to display the photo on the page in an image control named myImage.
Dim bmp As System.Windows.Media.Imaging.BitmapImage = New System.Windows.Media.Imaging.BitmapImage()
bmp.SetSource(e.ChosenPhoto)
img.Source = bmp
End If
End Sub
***Saving Image:***
Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
' Create a filename for JPEG file in isolated storage.
Dim tempJPEG As String = img.Source.ToString
' Create virtual store and file stream. Check for duplicate tempJPEG files.
Using myIsolatedStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
If myIsolatedStorage.FileExists(tempJPEG) Then
myIsolatedStorage.DeleteFile(tempJPEG)
End If
Dim fileStream As IsolatedStorageFileStream = myIsolatedStorage.CreateFile(tempJPEG)
Dim sri As StreamResourceInfo = Nothing
Dim uri As New Uri(tempJPEG, UriKind.Relative)
sri = Application.GetResourceStream(uri)
Dim bitmap As New BitmapImage()
bitmap.SetSource(sri.Stream)
Dim wb As New WriteableBitmap(bitmap)
' Encode WriteableBitmap object to a JPEG stream.
Extensions.SaveJpeg(wb, fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85)
'wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85);
fileStream.Close()
End Using
End Sub
Now I am little bit confusing in the writeable bitmap concepts as
I am trying to write a simple text and save it back in the pictures library for that I found a simple way in SO mentioned to take a texblock and place it on the image would be sufficient and a better way to do that.
This is how my screen looks like:
![enter image description here][1]
So I followed it and chosen it as mentioned above:
<Image Source="Tulips.jpg" Name="img" />
<TextBlock Text="Your Text Here"/>
If I do this way and in save button click I have declared
`Dim tempJPEG As String = "Tulips.jpg"` then it works pretty well and saving only the image and not with the text.
Now If I do this way `Dim tempJPEG As String = img.Source.ToString` it gives me Null exception.
So simply I want to select the image from the pictures library write some text on it and save it back to the pictures library in some folder.
So can anyone say me the best way to acheive this
[1]: http://i.stack.imgur.com/7C2Rk.png | 0 | [
2,
2079,
1961,
19,
3104,
1248,
800,
3726,
3726,
31,
589,
749,
20,
170,
29,
5717,
13,
1,
19863,
1,
2109,
17,
477,
7503,
16,
29724,
18,
56,
117,
55,
86,
8343,
19,
1440,
16,
421,
564,
56,
117,
55,
4230,
5139,
47,
14,
1961,
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... |
Parse a Date from a String in Win32
===
I have a string containing a date, and another string containing the date format of the first string. Is there a function that I can call to convert that date into something like a SYSTEMTIME structure? Basically, I'd like the opposite of [GetDateFormat()][1].
[1]: http://msdn.microsoft.com/en-us/library/ms776293(VS.85).aspx | 0 | [
2,
2017,
870,
21,
1231,
37,
21,
3724,
19,
628,
3125,
800,
3726,
3726,
31,
57,
21,
3724,
3503,
21,
1231,
15,
17,
226,
3724,
3503,
14,
1231,
2595,
16,
14,
64,
3724,
9,
25,
80,
21,
1990,
30,
31,
92,
645,
20,
8406,
30,
1231,
77,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NHibernate automatically rename the column name in C#
===
I couldn't figure out why NHibernate is doing this.
Here's part of my table in MS SQL
CREATE TABLE Person (
nameFamily text,
nameGiven text
)
Here's Person.hbm.xml
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Infosci.Dpd.Model.Person,Infosci.Dpd.Model" table="Person" lazy="true">
<property type="string" name="NameGiven" column="nameGiven" />
<property type="string" name="NameFamily" column="nameFamily" />
</class>
</hibernate>
And in my Person.cs I name my property like the following
string NameFamily
{
get ;
set ;
}
string NameGiven
{
get ;
set ;
}
Then I try to create a record using the following code
ISession session = NHibernateHelper.GetCurrentSession();
Person person = new Person();
person.NameFamily = "lee";
session.Save(person);
And what's weird is when I try do execute it, NHibernate actually change the column name by doing the following
NHibernate: INSERT INTO Person (name_family,name_given.......
So here NHibernate chagne my column name from NameFamily to name_family although I did specify the column name.
Is this a NHibernate bug? Or is there any configuration I need to do?
And here's my hibernate config file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Data Source=xxxxxxx;Initial Catalog=xx;Integrated Security=True;Pooling=False;User ID=xxxx;Password=xxxx</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
And this is how I create the sessionFactory
sessionFactory = new `Configuration().Configure("hibernate.cfg.xml").
SetNamingStrategy(ImprovedNamingStrategy.Instance).
AddFile("Person.hbm.xml").
BuildSessionFactory();`
| 0 | [
2,
12109,
15191,
8820,
7499,
302,
7259,
14,
4698,
204,
19,
272,
5910,
800,
3726,
3726,
31,
711,
22,
38,
1465,
70,
483,
12109,
15191,
8820,
25,
845,
48,
9,
235,
22,
18,
141,
16,
51,
859,
19,
4235,
4444,
255,
1600,
859,
840,
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 do I transfer data from one database to another using a DataSet?
===
As usual, some background information first:
Database A (Access database) - Holds a table that has information I need from only two columns. The information from these two columns is needed for an application that will be used by people that cannot access database A.
Database B (Access database) - Holds a table that contains only two columns (mirrors to what we need from table A). Database B is accessible to all users of the application. One issue is that on of the column names is not the same as it is in the table from Database A.
What I need to do is transfer the necessary data via a utility that will run automatically, say once a week (the two databases don't need to be totally in sync, just close). The transfer utility will be run from a user account that has access to both databases (obviously).
Here's the approach I've taken (again if there is a better way, please suggest away):
1. Grab the data from database A. It is only the two columns from the necessary table.
2. Write the data out to [tablename].txt file using a DataReader object and WriterStream object. I've done this so I can use a schema.ini file and force the data columns to have the same name as they will be in Database B.
3. Create a DataSet object, containing a DataTable that mirrors the table from Database B.
4. Suck the information from the .txt file into the DataTable using the Microsoft.Jet.OLEDB.4.0 provider with extended properties of text, hdr=yes and fmt=delimited (to match how I have the schema.ini file setup and the .txt file setup). I'm using a DataAdapter to fill the DataTable.
5. Create another DataSet object, containing a DataTable that mirrors the table from Database B.
6. Suck in the information from Database B so that it contains all the current data found in the table that needs to be updated from Database A. Again I'm using a DataAdapter to fill this DataTable (a different one from Step 5, since they are both using different data sources).
7. Merge the DataTable that holds the data from Database A (or the .txt file, technically).
8. Update Database B's table with the changes.
I've written update, delete and insert commands manually for the DataAdapter that is repsonsible for talking to Database B. However, this logic is never used because the DataSet-From-Database-B.Merge(Dataset-From-TxtFile[tableName]) doesn't flip the HasChanges flag. This means the DataSet-From-Database-B.Update doesn't fire any of the commands.
So is there any way I can get the data from DataSet-From-TxtFile to merge and apply to Database B using the method I'm using? Am I missing a crucial step here?
I know I could always delete all the records from Database B's table and then just insert all the records from the text file (even if I had to loop through each record in the DataSet and apply row.SetAdded to ensure it triggers the HasChanges flag), but I'd rather have it apply ONLY the changes each time.
I'm using c# and the 2.0 Framework (which I realize means I can use DataTables and TableAdapters instead of DataSets and DataAdapters since I'm only dealing with a single table, but anyway).
TIA | 0 | [
2,
184,
107,
31,
2617,
1054,
37,
53,
6018,
20,
226,
568,
21,
1054,
3554,
60,
800,
3726,
3726,
28,
3820,
15,
109,
2395,
676,
64,
45,
6018,
21,
13,
5,
20604,
6018,
6,
13,
8,
2763,
21,
859,
30,
63,
676,
31,
376,
37,
104,
81,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 i-th value from a SortedList or SortedDictionary
===
I have a sorted collection of objects (it can be either SortedList or SortedDictionary, I will use it mainly for reading so add performance is not that important). How can I get the i-th value?
So e.g. when I have numbers 1, 2, 3, 4, 5 in the collection and I want the median (so 3 in this example), how can I do it? | 0 | [
2,
1017,
31,
8,
96,
1923,
37,
21,
22554,
5739,
54,
22554,
22595,
1857,
800,
3726,
3726,
31,
57,
21,
22554,
1206,
16,
3916,
13,
5,
242,
92,
44,
694,
22554,
5739,
54,
22554,
22595,
1857,
15,
31,
129,
275,
32,
2011,
26,
1876,
86,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can anyone explaing servlet mapping?
===
I'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions.
Mapping everything under my context path to the front controller (let's call it "__app__") means I should take care of static files also, something I'd rather not to (why reinvent yet another weel?), so some combination with tomcat's default servlet (let's call it "__tomcat__") appears to be the way to go.
I got the thing to work doing something like
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tomcat</servlet-name>
<url-pattern>*.ext</url-pattern>
</servlet-mapping>
and repeating the latter for each one of the file extensions of my static content. I'm just wondering why the following setups, which to me are equivalent to the one above, don't work.
<!-- failed attempt #1 -->
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tomcat</servlet-name>
<url-pattern>*.ext</url-pattern>
</servlet-mapping>
<!-- failed attempt #2 -->
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tomcat</servlet-name>
<url-pattern>/some-static-content-folder/*</url-pattern>
</servlet-mapping>
Can anyone shed some light?
| 0 | [
2,
92,
1276,
3271,
263,
13,
10321,
1336,
13305,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
2757,
21,
2741,
3010,
568,
1573,
79,
8990,
9,
4147,
31,
22,
43,
114,
2942,
109,
117,
8,
576,
3893,
3896,
20,
1573,
22,
18,
431,
9919,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XML to WordML using XSLT 1.0 - replace html tags within xml content with wordML formatting tags
===
I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text.
<w:p>
<w:r>
<w:t> html formatted content is in here taken from xml file! </w:t>
</w:r>
</w:p>
This is how my templates are sort of set up. I have a recursive call-template function that does text replacement against the source xml content. When it comes across a "`<b>`" tag, I output a string in CDATA containing "`</w:t></w:r><w:r><w:rPr><w:b/></w:rPr><w:t>`" to close the current run and start up a new run with bold formatting enabled. when it gets to a "`</b>`" tag, it replaces it with the following CDATA string "`</w:t></w:r><w:r><w:t>`".
What I'd like to do is use XSL to close the run tag and start a new run without using CDATA string inserts. Is this possible?
| 0 | [
2,
23504,
20,
833,
8184,
568,
993,
18,
255,
38,
137,
9,
387,
13,
8,
3934,
13,
15895,
3383,
18,
363,
23504,
2331,
29,
833,
8184,
2595,
1203,
3383,
18,
800,
3726,
3726,
31,
589,
2936,
21,
833,
8184,
4492,
37,
40,
23504,
3893,
1196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 translate a user-entered mathematical equation into C# code at runtime?
===
I would like to allow the user to enter any equation, like the following, into a text box:
x = x / 2 * 0.07914
x = x^2 / 5
And have that equation applied to telemetry data that is coming from a device connected via a serial port. The incoming data points are represented by **x** and each data point is processed by the user-specified equation. I did this years ago, but I didn't like the solution because it required parsing the text of the equation for every calculation:
float ApplyEquation (string equation, float dataPoint)
{
// parse the equation string and figure out how to do the math
// lots of messy code here...
}
When you're processing boatloads of data points, this introduces quite a bit of overhead. I would like to be able to translate the equation into a function, on the fly, so that it only has to be parsed once. It would look something like this:
FunctionPointer foo = ConvertEquationToCode(equation);
....
x = foo(x); // I could then apply the equation to my incoming data like this
Function ConvertEquationToCode would parse the equation and return a pointer to a function that applies the appropriate math.
The app would basically be writing new code at runtime. Is this possible with .NET? | 0 | [
2,
25,
32,
938,
20628,
21,
4155,
8,
23753,
7046,
8020,
77,
272,
5910,
1797,
35,
485,
891,
60,
800,
3726,
3726,
31,
83,
101,
20,
1655,
14,
4155,
20,
2830,
186,
8020,
15,
101,
14,
249,
15,
77,
21,
1854,
1649,
45,
993,
800,
993,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 create an application shortcut (.lnk file) in C# or .Net
===
The title says it all. If anyone has a routine or code snip-it handy that will save me the google trolling that would be great. Otherwise I'll post whatever I come up with.
Thanks | 0 | [
2,
184,
107,
42,
1600,
40,
3010,
502,
4118,
13,
5,
9,
255,
5719,
3893,
6,
19,
272,
5910,
54,
13,
9,
2328,
800,
3726,
3726,
14,
581,
898,
32,
65,
9,
100,
1276,
63,
21,
8275,
54,
1797,
8912,
4307,
8,
242,
20277,
30,
129,
2079,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 rake throwing this Rails migration error?
===
I have two machines... a development machine and a production machine. When I first brought my rails app onto the production server, I had no problem. I simply imported schema.rb by running rake db:schema:load RAILS_ENV=production. All was well.
So, then on my development machine, I made some more changes and another migration, and then copy the new application over to the production machine. I then tried to update the database by running rake db:migrate RAILS_ENV=production. I get the following error:
"There is already an object named 'schema_migrations' in the database."
I'm thinking to myself, ya no kidding Rake... you created it! I ran trace on rake and it seems as if rake thinks it's the first time it's ever ran. However, by analyzing my 'schema_migrations' table on my development machine and my production machine you can see that there is a difference of one migration, namely the one that I want to migrate.
I have also tried to explicitly define the version number, but that doesn't work either.
Any ideas on how I can bring my production server up to date?
Thanks! | 0 | [
2,
483,
25,
21009,
6033,
48,
2240,
18,
8443,
7019,
60,
800,
3726,
3726,
31,
57,
81,
6035,
9,
9,
9,
21,
522,
1940,
17,
21,
637,
1940,
9,
76,
31,
64,
809,
51,
2240,
18,
4865,
1204,
14,
637,
8128,
15,
31,
41,
90,
1448,
9,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Are pipes considered dangerous to use in Windows, from a security standpoint?
===
Are pipes considered dangerous to use in Windows, from a security standpoint? | 0 | [
2,
50,
14104,
724,
3342,
20,
275,
19,
1936,
15,
37,
21,
1221,
1261,
3132,
60,
800,
3726,
3726,
50,
14104,
724,
3342,
20,
275,
19,
1936,
15,
37,
21,
1221,
1261,
3132,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Changing text color in a DTPicker control
===
In VB6, I have a DTPicker control on a form. (This control is the calendar date/time selector in the Microsoft Windows CommonControls-2 6.0 component.)
While there are many properties to affect the colors of the calendar when it's dropped down, there is no property that allows changing the color of the date that's displayed in the textbox. I'm looking for something like the standard TextBox's ForeColor property.
Does anyone have a little API magic to allow me to simulate that property? | 0 | [
2,
4226,
1854,
1665,
19,
21,
13,
43,
38,
16855,
106,
569,
800,
3726,
3726,
19,
13,
20468,
379,
15,
31,
57,
21,
13,
43,
38,
16855,
106,
569,
27,
21,
505,
9,
13,
5,
1565,
569,
25,
14,
7036,
1231,
118,
891,
23946,
19,
14,
7099,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Limitations of C# Action lamda code blocks
===
C# .NET 3.5. I'm trying to understand the intrinsic limitation of the C# Action object. Within the lamda (are those, in fact, lamdas?), we can perform assignments, call functions, even execute a ternary operation, but we can't execute a multi-statement operation.
Is this because the single-statement execution is just syntactic sugar for wrapping it in a delegate? Why does the first example below not work?
public class MyClass
{
private int m_Count = 0;
public void Test()
{
int value = 0;
// Does not work, throws compile error
Action action = () => { if(m_Count < 10) m_Count++; value = m_Count; }
// Works
Action action2 = () => value = delegate(){
if(m_Count < 10)
m_Count++;
return m_Count;
};
// Works
Action action3 = () => value = m_Count;
// Works
Action action4 = () => value = m_Count < 10 ? m_Count++ : 0;
// Works
Action action5 = () => value = Increment();
}
public int Increment()
{
if (m_Count < 10)
m_Count++;
return m_Count;
}
} | 0 | [
2,
14070,
16,
272,
5910,
1028,
11108,
593,
1797,
5198,
800,
3726,
3726,
272,
5910,
13,
9,
2328,
203,
9,
264,
9,
31,
22,
79,
749,
20,
1369,
14,
22892,
24943,
16,
14,
272,
5910,
1028,
3095,
9,
363,
14,
11108,
593,
13,
5,
1509,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java file extension regex
===
I'm trying to come up with a Java regex that will match a filename only if it has a valid extension. For example it should match "foo.bar" and "foo.b", but neither "foo." nor "foo".
I've written the following test program
public static void main(String[] args) {
Pattern fileExtensionPattern = Pattern.compile("\\.\\w+\\z");
boolean one = fileExtensionPattern.matcher("foo.bar").matches();
boolean two = fileExtensionPattern.matcher("foo.b").matches();
boolean three = fileExtensionPattern.matcher("foo.").matches();
boolean four = fileExtensionPattern.matcher("foo").matches();
System.out.println(one + " " + two + " " + three + " " + four);
}
I expect this to print "true true false false", but instead it prints false for all 4 cases. Where am I going wrong?
Cheers,
Don
| 0 | [
2,
8247,
3893,
3896,
7953,
1706,
800,
3726,
3726,
31,
22,
79,
749,
20,
340,
71,
29,
21,
8247,
7953,
1706,
30,
129,
730,
21,
3893,
7259,
104,
100,
32,
63,
21,
7394,
3896,
9,
26,
823,
32,
378,
730,
13,
7,
4120,
111,
9,
1850,
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... |
How do I record the time every time I log on and log off of Windows XP?
===
I notice that Windows XP Event Viewer show a list of typical actions under System logs every time I start or shutdown Windows, and I can tell when my day starts and ends.
Is there anyways I can record the time every time I lock my screen and every time I re-login? There maybe a way to fool System Event Logger into submission, but a free third party tool would be good too if not. | 0 | [
2,
184,
107,
31,
571,
14,
85,
352,
85,
31,
6738,
27,
17,
6738,
168,
16,
1936,
23045,
60,
800,
3726,
3726,
31,
3551,
30,
1936,
23045,
807,
16812,
298,
21,
968,
16,
3874,
3078,
131,
329,
18893,
352,
85,
31,
799,
54,
28450,
1936,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CAS: Running exe from intranet
===
Before I get flamed and down-voted without mercy, my company will not allow the install of .NET3.5 on non-dev machines yet (others are currently on 3.0).
I have a managed exe on network share that needs to be able to run from there. This is a common problem with pre-.NET3.5SP1, but I cannot figure out how to solve it. I have read [this question][1], as well as, [this article][2], in addition to the MSDN CAS articles (which is like trying to read and understand a EULA). I cannot seem to solve this problem.
I've tried signing it; along with other suggestions found in the articles. The only way I've found to get it to run from the network is to make it a click-once application and publish it; which is unacceptable because it creates a bunch of different files in the published directory (which confuses our less-than-technical users) and creates entries in the Add/Remove Programs in the Control Panel.
I'm just a dev, so I don't have rights to set/alter machine policies and such. Can anyone give me step-by-step instructions (or point me to a easy-to-read site) on what needs to be done to enable this thing to run from the network? Is it even possible without setting machine/domain security/software policies (which I don't have access to)?
[1]: http://stackoverflow.com/questions/197835/how-to-get-rid-of-security-exception
[2]: http://blogs.msdn.com/vancem/archive/2008/08/13/net-framework-3-5-sp1-allows-managed-code-to-be-launched-from-a-network-share.aspx | 0 | [
2,
7167,
45,
946,
1396,
62,
37,
14369,
2328,
800,
3726,
3726,
115,
31,
164,
7025,
43,
17,
125,
8,
28195,
43,
366,
8450,
15,
51,
237,
129,
52,
1655,
14,
16146,
16,
13,
9,
2328,
240,
9,
264,
27,
538,
8,
14438,
6035,
768,
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... |
The intersection point between a spline and a line
===
I'm trying to find a way to calculate the intersection between a b-spline and a straight line. So far Google hasn't been much help. | 0 | [
2,
14,
5351,
454,
128,
21,
3782,
1143,
17,
21,
293,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
21,
161,
20,
18469,
14,
5351,
128,
21,
334,
8,
3401,
1143,
17,
21,
1599,
293,
9,
86,
463,
8144,
9979,
22,
38,
74,
212,
448,
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... |
Unknown property 'MozOpacity' - meaning?
===
I'm using Chris Pederick's Firefox addon ["Web Developer 1.1.6"][1]. I get this warning when hitting a certain web page on my site:
> Unknown property 'MozOpacity'. Declaration dropped.
What does this mean and how can I fix this on my site?
[1]: http://chrispederick.com/work/web-developer/ | 0 | [
2,
2562,
1354,
13,
22,
18057,
11490,
5788,
22,
13,
8,
1813,
60,
800,
3726,
3726,
31,
22,
79,
568,
1948,
12855,
62,
4869,
22,
18,
535,
18219,
3547,
218,
636,
7,
14113,
10058,
137,
9,
165,
9,
379,
7,
500,
2558,
165,
500,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Custom MembershipProvider Initialize method
===
When overriding the MembershipProvider and calling it directly, is there a way to fill the NameValueCollection config parameter of the Initialize method without manually looking through the config file for the settings?
Obviously this Initialize is being called by asp.net and the config is being filled somewhere. I have implemented my own MembershipProvider and it works fine through the build in controls.
I would like to create a new instance of my provider and make a call to it directly, but I don't really want to parse the .config for the MembershipProvider, it's connection string name and then the connection string if it's already being done somewhere.
| 0 | [
2,
5816,
4363,
26735,
139,
2104,
2952,
2109,
800,
3726,
3726,
76,
84,
5175,
68,
14,
4363,
26735,
139,
17,
2555,
32,
1703,
15,
25,
80,
21,
161,
20,
3509,
14,
204,
15165,
15015,
872,
13,
14093,
2816,
18906,
16,
14,
2104,
2952,
2109,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Open source examples of well designed applications
===
Do you know of well designed open source applications that are instructive to analyse?
Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality. | 0 | [
2,
368,
1267,
3770,
16,
134,
1006,
3767,
800,
3726,
3726,
107,
42,
143,
16,
134,
1006,
368,
1267,
3767,
30,
50,
19,
10346,
1284,
20,
13,
21702,
60,
3524,
15,
31,
22,
79,
3158,
19,
5713,
3767,
3095,
8,
99,
10832,
192,
13305,
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... |
Can't find windows share despite having connected VPN
===
I'm a programmer dammit, I should be allowed to ask these kinds of IT questions! :)
Anyway the problem is as follows. I'm writing an automatic build script to deploy code to a live windows 2003 server. To get access to the server I enabled the VPN role, and I can connect to it remotely from my dev machine using a username and password I set up on the server from the network connections screen.
I set up a share on that machine and gave full share+security permissions to the account I am using to connect. Once connected, I would have thought I would be able to see the share. In fact I can't even see the computer even though the VPN is connected (if i type '\\IPADDRESS\' into the run box nothing comes up).
Am I missing an essential step here?
| 0 | [
2,
92,
22,
38,
477,
1936,
1891,
869,
452,
2587,
13,
10924,
103,
800,
3726,
3726,
31,
22,
79,
21,
17968,
13,
20725,
15,
31,
378,
44,
1159,
20,
1349,
158,
8623,
16,
32,
2346,
187,
13,
45,
6,
2774,
14,
1448,
25,
28,
2415,
9,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ListView with DataPager not working
===
From everything I've read, it seemed that adding paging to a ListView control should be dead simple, but it's not working for me. After adding the ListView and DataPager controls to the form and wiring them together, I'm getting very odd behavior. The DataPager correctly limits the ListView's page size, but clicking the paging buttons doesn't affect the ListView at all. The paging buttons seem to think they are doing they're job, as the last button is disabled when you go to the last page, etc., but the ListView never changes. Also, it takes two clicks on the DataPager to get it to do anything, i.e., clicking on Last once does nothing, but clicking it a second time causes the DataPager to react as if the last page is now selected.
The only thing I can think of is that I'm binding the DataSource at runtime (to a LINQ object), not using a LinqDataSource control or anything. Has anyone seen this behavior? Am I doing something wrong? Here's the code I'm using:
<asp:DataPager ID="HistoryDataPager" runat="server" PagedControlID="HistoryListView" PageSize="10">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="true" ShowLastPageButton="true" />
</Fields>
</asp:DataPager>
<asp:ListView ID="HistoryListView" runat="server">
...
</asp:ListView>
In the code-behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
HistoryListView.DataSource = From x in myContext.myTables ...
DataBind()
End If
End Sub
| 0 | [
2,
968,
4725,
29,
1054,
6486,
139,
52,
638,
800,
3726,
3726,
37,
796,
31,
22,
195,
1302,
15,
32,
890,
30,
4721,
19006,
68,
20,
21,
968,
4725,
569,
378,
44,
828,
1935,
15,
47,
32,
22,
18,
52,
638,
26,
55,
9,
75,
4721,
14,
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... |
[Windows Form] My FORM_Load event doesn´t work
===
I Don´t know why, but my form isn´t calling Form_Load event when its load.
How it can be?? | 0 | [
2,
636,
27508,
18,
505,
500,
51,
505,
1,
8294,
807,
1437,
13,
38,
170,
800,
3726,
3726,
31,
221,
13,
38,
143,
483,
15,
47,
51,
505,
2532,
13,
38,
2555,
505,
1,
8294,
807,
76,
82,
6305,
9,
184,
32,
92,
44,
60,
60,
3,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
ColdFusion vs PHP
===
Can anyone share with me (without fervent evangelism, please) any comparative experiences you might have with regard to ColdFusion and PHP in developing internal enterprise browser-based applications?
Specifically (but not limited to):
1: Do the rapid-development characteristics of ColdFusion compensate for any performance issues resulting from the additional overhead?
2: Is either particularly suited to individual or team development?
3: Is rapidly developing an application in ColdFusion and then porting it to PHP to improve performance a proposition that only a madman or venture capitalist would consider? | 4 | [
2,
1191,
9818,
4611,
13,
26120,
800,
3726,
3726,
92,
1276,
1891,
29,
55,
13,
5,
14506,
28817,
17645,
756,
15,
2247,
6,
186,
14102,
5513,
42,
530,
57,
29,
6731,
20,
1191,
9818,
17,
13,
26120,
19,
3561,
3117,
6002,
16495,
8,
1281,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Telnet server communicate to the client?
===
I want to write a C# application where it connects to a telnet server and communicates to the server. I was wondering how a telnet server sends information to the client. I have looked (skimmed) over the [Telnet RFC][1] and looked at the incoming packets coming in from the server and still a bit confused. Can somebody give me an example how the server moves the cursor around in the telnet client and how it can change colors of characters? (An example would be most appreciated)
[1]: http://www.faqs.org/rfcs/rfc854.html | 0 | [
2,
184,
630,
6757,
2328,
8128,
8709,
20,
14,
6819,
60,
800,
3726,
3726,
31,
259,
20,
2757,
21,
272,
5910,
3010,
113,
32,
8534,
20,
21,
6757,
2328,
8128,
17,
8709,
18,
20,
14,
8128,
9,
31,
23,
5712,
184,
21,
6757,
2328,
8128,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to add a web part page to a site definition?
===
I have to create a site definition for a client that must contain pre-defined web part pages. I can create the web part pages but am at a loss when it comes to attaching them to the site on creation.
I know web part pages created through SharePoint are stored in a Document Library. Do I need to pre-populate a "Web Part Pages" document library and add the needed navigation to these files? If so, how do I go about adding the needed aspx files?
Finally, are there any caveats that I should be aware of for configuring the custom web part page in onet? | 0 | [
2,
184,
20,
3547,
21,
2741,
141,
2478,
20,
21,
689,
5465,
60,
800,
3726,
3726,
31,
57,
20,
1600,
21,
689,
5465,
26,
21,
6819,
30,
491,
3717,
782,
8,
13439,
2741,
141,
4434,
9,
31,
92,
1600,
14,
2741,
141,
4434,
47,
589,
35,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What have you done to customize your IDE?
===
What tweaks / addins / themes do you have rigged up to make your IDE awesome? For example, in Visual Studio I [color themes][1], [CodeRush][2] draws lines between braces, I always install and use the [Consolas][3] font and I have it setup to [sync my settings across computers][4] for when I change hotkeys and whatnot with the help of [FolderShare][5].
[1]: http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx
[2]: http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/
[3]: http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en
[4]: http://blogs.msdn.com/saraford/archive/2008/06/30/did-you-know-you-can-use-team-settings-to-keep-visual-studio-settings-on-different-machines-in-sync-248.aspx
[5]: https://www.foldershare.com/welcome.aspx | 0 | [
2,
98,
57,
42,
677,
20,
5816,
2952,
154,
13,
3448,
60,
800,
3726,
3726,
98,
28769,
18,
13,
118,
3547,
108,
18,
13,
118,
6876,
107,
42,
57,
13,
26774,
71,
20,
233,
154,
13,
3448,
13706,
60,
26,
823,
15,
19,
3458,
1120,
31,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Open source examples of well designed Python applications
===
Do you know of well designed open source applications that are instructive to analyse?
Of course this question is strictly related to [this other post][1], but I am specifically interested in applications written in Python.
[1]: http://stackoverflow.com/questions/234276/open-source-examples-of-well-designed-applications | 0 | [
2,
368,
1267,
3770,
16,
134,
1006,
20059,
3767,
800,
3726,
3726,
107,
42,
143,
16,
134,
1006,
368,
1267,
3767,
30,
50,
19,
10346,
1284,
20,
13,
21702,
60,
16,
674,
48,
1301,
25,
10369,
1597,
20,
636,
1565,
89,
678,
500,
2558,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BindingFlags for Type.GetMethods excluding property accesors
===
Suppose I've got the following program:
namespace ReflectionTest
{
public class Example
{
private string field;
public void MethodOne() { }
public void MethodTwo() { }
public string Property
{
get { return field; }
set { this.field = value; }
}
}
class Program
{
static void Main(string[] args)
{
iterate(typeof(Example));
Console.ReadLine();
}
public static void iterate(Type type)
{
MethodInfo[] methods = type.GetMethods(
BindingFlags.DeclaredOnly |
BindingFlags.Instance |
BindingFlags.Public);
foreach (MethodInfo mi in methods)
{
Console.WriteLine(mi.Name);
}
}
}
}
When I run the program I'm getting the following output:
<pre>MethodOne
MethodTwo
get_Property
set_Property</pre>
I want to skip the property accesor methods. I've tried with different [`BindingFlags`][1], for instance, `~BindingFlags.SetProperty`, but with no luck. At the moment the only way I've found to skip those methods is rewriting the iterate function to:
public static void iterate(Type type)
{
MethodInfo[] methods = type.GetMethods(
BindingFlags.DeclaredOnly |
BindingFlags.Instance |
BindingFlags.Public);
foreach (MethodInfo mi in methods)
{
if (mi.IsSpecialName) continue;
Console.WriteLine(mi.Name);
}
}
Do you know what `BindingFlags` should I use?
Thank you very much.
[1]: http://msdn.microsoft.com/en-us/library/system.reflection.bindingflags.aspx | 0 | [
2,
8728,
22868,
18,
26,
1001,
9,
3060,
5909,
1807,
43,
18,
13,
14938,
1354,
7602,
160,
248,
18,
800,
3726,
3726,
5787,
31,
22,
195,
330,
14,
249,
625,
45,
204,
5582,
9138,
10543,
13,
1,
317,
718,
823,
13,
1,
932,
3724,
575,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Color mapping a texture in opengl
===
I am displaying a texture that I want to manipulate without out affecting the image data. I want to be able to clamp the texel values so that anything below the lower value becomes 0, anything above the upper value becomes 0, and anything between is linearly mapped from 0 to 1.
Originally, to display my image I was using glDrawPixels. And to solve the problem above I would create a color map using glPixelMap. This worked beautifully. However, for performance reasons I have begun using textures to display my image. The glPixelMap approach no longer seems to work. Well that approach may work but I was unable to get it working.
I then tried using glPixelTransfer to set scales and bias'. This seemed to have some sort of effect (not necessarily the desired) on first pass, but when the upper and lower constraints were changed no effect was visible.
I was then told that fragment shaders would work. But after a call to glGetString(GL_EXTENSIONS), I found that GL_ARB_fragment_shader was not supported. Plus, a call to glCreateShaderObjectARB cause a nullreferenceexception.
So now I am at a loss? Please Help. | 0 | [
2,
1665,
13305,
21,
12714,
19,
368,
8430,
800,
3726,
3726,
31,
589,
17418,
21,
12714,
30,
31,
259,
20,
18468,
366,
70,
13808,
14,
1961,
1054,
9,
31,
259,
20,
44,
777,
20,
20759,
14,
14012,
532,
4070,
86,
30,
602,
1021,
14,
987,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
AJAX, Rails, and dynamic loading of forms.
===
I have a rails app that has picked up a bit of traction, but I have a serious headache to deal with. It's a basic sort of asset manager application - users upload their photos, .pdfs, videos, etc., and the system allows them to manage how that asset is presented.
I started with a fairly standard rails view - just what gets generated by rails - for index.html.erb. I have a partial that renders a thumbnail for each of the assets and something like this:
<div id="preview"> </div>
What I want is for the thumbnail to be clickable (easy enough) but when the user hits that button, the contents of the div will be filled with, well, essentially the edit.html.erb, but I'm guessing it needs to be done as a partial. I've already managed this with straight javascript.
I do have access to the pre-publication version of the new 'Agile Development on Rails' book, which anyone can get through the publisher, but the chapter on AJAX is very minimal and assumes more experience with these things than I have, this being my first foray into javascript and rails.
Thanks...
| 0 | [
2,
20624,
15,
2240,
18,
15,
17,
7782,
12797,
16,
1997,
9,
800,
3726,
3726,
31,
57,
21,
2240,
18,
4865,
30,
63,
2114,
71,
21,
1142,
16,
19468,
15,
47,
31,
57,
21,
2055,
14276,
20,
1183,
29,
9,
32,
22,
18,
21,
2125,
2058,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Should I always make my java-code thread-save, or for performance-reasons do it only when needed?
===
If I create classes, that are used at the moment only in a single thread, should I make them thread-safe, even if I don't need that at the moment? It could be happen, that I later use this class in multiple threads, and at that time I could get race conditions and may have a hard time to find them if I didn't made the class thread-safe in the first place. Or should I make the class not thread-safe, for better performance? But premature optimization is evil.
Differently asked: Should I make my classes thread-safe if needed (if used in multiple threads, otherwise not) or should I optimize this issue then needed (if I see that the synchronization eats up an important part of processing time)?
If I choose one of the both ways, are there methods to reduce the disadvantages? Or exists a third possibility, that I should use? | 0 | [
2,
378,
31,
550,
233,
51,
8247,
8,
9375,
9322,
8,
19863,
15,
54,
26,
956,
8,
24793,
18,
107,
32,
104,
76,
851,
60,
800,
3726,
3726,
100,
31,
1600,
2684,
15,
30,
50,
147,
35,
14,
688,
104,
19,
21,
345,
9322,
15,
378,
31,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
is TCHAR still relevant?
===
I'm new to Windows programming and after reading the Petzold book I wonder whether it's still good practice to use the TCHAR type and the _T() function to declare strings or if I should just use the wchar_t and L"" strings in new code.
I will target only Windows 2000 and up and my code will be i18n from the start up. | 0 | [
2,
25,
13,
38,
5433,
174,
7480,
60,
800,
3726,
3726,
31,
22,
79,
78,
20,
1936,
3143,
17,
75,
1876,
14,
3170,
380,
1218,
360,
31,
2666,
1472,
32,
22,
18,
174,
254,
1345,
20,
275,
14,
13,
38,
5433,
1001,
17,
14,
13,
1,
38,
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... |
How can I take numerous shapefiles and have them line up in GIS?
===
I am trying to take a shapefile of subdivisions within a county that I have created and line it up with another shapefile that was given to me by the County Appraisal District (parcel data). When I try to get them to line up then my streets shapefiles is not aligned with everything else. They are all on the same coordinate system and I do not want to have to recreate the shapefile for the subdivisions. Any thoughts? | 0 | [
2,
184,
92,
31,
247,
1548,
2539,
16877,
18,
17,
57,
105,
293,
71,
19,
16004,
60,
800,
3726,
3726,
31,
589,
749,
20,
247,
21,
2539,
16877,
16,
10050,
18,
363,
21,
271,
30,
31,
57,
679,
17,
293,
32,
71,
29,
226,
2539,
16877,
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... |
XmlReader - Read Current Node as string
===
In the following snippet, using XmlReader, when I encounter an element. I would like to read it as-is, including all attributes and namespace decoration in the element. Using the oXml.Name property, I am only able to get the tag name. Is there a function to get the tag itself?
oXml = XmlReader.Create(path, oXmlSettings)
While oXml.Read()
Select Case oXml.NodeType
Case XmlNodeType.Element
'Read Element as-is
End Select
End While
I have tried oXml.ReadOuterXml() but it returns the element and its subcontent. That could be acceptable, but how to I fast forward my XmlReader to ignore subsequent XmlNodeType.Text and XmlNodeType.EndElement that will happen when the element I just got from ReadOuterXml has been parsed?
| 0 | [
2,
23504,
10647,
106,
13,
8,
1302,
866,
15421,
28,
3724,
800,
3726,
3726,
19,
14,
249,
13,
29061,
15,
568,
23504,
10647,
106,
15,
76,
31,
7007,
40,
4520,
9,
31,
83,
101,
20,
1302,
32,
28,
8,
403,
15,
215,
65,
13422,
17,
204,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RegSvr32 registering yet nothing actually registered
===
A rather odd experience. Using the latest PDK (v7.3) from ActiveState, I used perlctrl to build a COM DLL. Perlctrl ran without a hitch. OLEView read the typelib okay. RegSvr32 registered it okay. However ... there's no sign of it in registry, and anything that tries to use it fails. I hunted for the various UIDs using RegEdit and they're just not there.
The code is below. It's a wrapping of Lingua::ZH::WordSegmenter, but with the encoding changed to utf8 rather than gbk.
It's probably something obvious ...
package ZHWordSeg;
use strict;
use warnings;
use utf8;
use ws;
use Encode;
use constant STX => chr( 2 ); #[
use constant ETX => chr( 3 ); #]
use constant FS => chr( 28 ); #^
use constant RS => chr( 30 ); #~
use constant TAB_SEPARATOR => 0;
use constant CARET_SEPARATOR => 1;
use constant FS_SEPARATOR => 2;
use constant SPACE_SEPARATOR => 3;
use constant AS_ARRAY => 4;
use feature 'switch';
our $segmenter;
sub ZHWordSeg_Setup {
my $dic = shift;
my $dic_encoding = shift;
my $separator = shift;
my $verbose = shift;
$dic_encoding = 'utf8' unless defined( $dic_encoding );
$separator = " " unless defined( $separator );
$verbose = 0 unless defined( $verbose );
if ( defined( $dic ) ) {
$segmenter = ws->new( dic => $dic, dic_encoding => $dic_encoding, seperator => $separator, verbose => $verbose );
} else {
$segmenter = ws->new( dic_encoding => $dic_encoding, seperator => $separator, verbose => $verbose );
}
}
sub ZHWordSeg {
my $source = shift;
print STDERR $source;
my $sepcode = shift;
$source = encode("utf8",$source);
my $stringres = $segmenter->seg($source);
my @arrayres;
given ($sepcode) {
when (TAB_SEPARATOR) {
$stringres =~ tr/ /\t/;
return $stringres;
}
when (CARET_SEPARATOR) {
$stringres =~ tr/ /^/;
$stringres .= "^";
return $stringres;
}
when (FS_SEPARATOR) {
$stringres =~ s/ /FS/eg;
$stringres .= FS;
return $stringres;
}
when (SPACE_SEPARATOR) {
return $stringres;
}
default {
@arrayres = split( / /, $stringres );
return \@arrayres;
}
}
}
sub SetDictionary {
my ($source) = shift;
my $res = set_dic($source);
return $res;
}
1;
=pod
=begin PerlCtrl
%TypeLib = (
PackageName => 'ZHWordSeg',
DocString => 'Chinese word segmentation',
HelpContext => 1,
TypeLibGUID => '{F6C9BD66-7CA1-4610-B77F-E219A7122C18}', # do NOT edit this line
ControlGUID => '{45D47C6A-2B9A-4D62-9CFD-F18C95DC00C5}', # do NOT edit this line either
DispInterfaceIID=> '{007E4E7A-3B75-4DC3-864C-7746860941B3}', # or this one
ControlName => 'BOCWS',
ControlVer => 2, # increment if new object with same ProgID
# create new GUIDs as well
ProgID => 'ZHWordSeg.BOCWS',
LCID => 0,
DefaultMethod => 'ChineseWordSegmenter',
Methods => {
'ChineseWordSegmenter' => {
RetType => VT_VARIANT,
TotalParams => 2,
NumOptionalParams => 1,
ParamList =>
[ 'source' => VT_BSTR,
'sepcode' => VT_I4
]
},
'ChineseWordSegmenter_Setup' => {
RetType => VT_VARIANT,
TotalParams => 4,
NumOptionalParams => 4,
ParamList =>
[ 'dic' => VT_BSTR,
'dic_encoding' => VT_BSTR,
'separator' => VT_BSTR,
'verbose' => VT_BSTR
]
}
}, # end of 'Methods'
Properties => {
TAB_SEPARATOR => {
DocString => "Separate items with TAB (0x0)",
Type => VT_I4,
DispID => 3,
ReadOnly => 1,
},
CARET_SEPARATOR => {
DocString => "Separate items with ^ (0x1)",
Type => VT_I4,
DispID => 4,
ReadOnly => 1,
},
FS_SEPARATOR => {
DocString => "Separate items with ascii 28 (0x2)",
Type => VT_I4,
DispID => 5,
ReadOnly => 1,
},
SPACE_SEPARATOR => {
DocString => "Separate items with space (0x3)",
Type => VT_I4,
DispID => 6,
ReadOnly => 1,
},
AS_ARRAY => {
DocString => "Separate items as array (0x4)",
Type => VT_I4,
DispID => 7,
ReadOnly => 1,
}
}, # end of 'Properties'
); # end of %TypeLib
=end PerlCtrl
=cut
This is the .perlctrl file, in case it matters:
#!C:\Program Files\ActiveState Perl Dev Kit 7.3 Deployment\bin\lib\pai.exe
PAP-Version: 1.0
Packer: C:\Program Files\ActiveState Perl Dev Kit 7.3 Deployment\bin\perlctrl.exe
Script: ZHWordSeg.ctrl
Cwd: P:\BOCWS
Byref: 0
Clean: 0
Date: 2008-10-24 18:05:42
Debug: 127.0.0.1:2000
Dependent: 0
Dyndll: 0
Exe: BOCWS.dll
Force: 1
Gui: 0
Hostname: xi
No-Compress: 0
No-Gui: 0
No-Logo: 0
Runlib:
Shared: none
Singleton: 0
Tmpdir:
Verbose: 0
Version-Comments:
Version-CompanyName:
Version-FileDescription: Wrapper of Lingua::ZH::WordSegmenter.pm
Version-FileVersion: 1.0
Version-InternalName: ZHWordSeg
Version-LegalCopyright:
Version-LegalTrademarks:
Version-OriginalFilename: ZHWordSeg.ctrl
Version-ProductName: BOChineseWordSegmenter
Version-ProductVersion: 1.0
Warnings: 0
Xclude: 1
| 0 | [
2,
7953,
18,
6938,
3125,
2243,
68,
768,
626,
1121,
3801,
800,
3726,
3726,
21,
864,
4210,
1496,
9,
568,
14,
5736,
13,
9251,
197,
13,
5,
710,
465,
9,
240,
6,
37,
1348,
3859,
15,
31,
147,
416,
6109,
38,
6362,
20,
1895,
21,
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... |
Regex matching multiple occurrences per file and per line
===
First post, so here goes. I'm writing a script that does intelligent search and replace on a file tree. Essentially, the script gets each file's contents into a buffer string and performs a match with a pre-defined pattern, in this case the pattern is `/^[^\r\n]*(vendor)[^\r\n]*$/im`. The pattern should find any case-insensitive forms of "vendor" and give me the entire line that was matched. I need to see the whole line in order to determine whether or not to replace the occurrence. This pattern performs well for any number of separate line occurences in a given file.
However, if there are multiple occurrences on a given line, the pattern will only match one of those occurrences, and skip the others. I'm trying to determine if I need to have a second pattern to do additional searching on the matched line, or if I can accomplish this purpose with a single pattern that does all of the above.
Just a sample of what I'm hoping to produce. An example of a single line, multi-occurrence match:
> Enthusiastically revolutionize
> web-enabled VENDOR potentialities
> vendors installed base e-tailers.
I would like to output something similar to this (again, the ouput isn't the issue here, it's whether or not I can match it all with one pattern):
> Multiple occurrences in line: ||
> Enthusiastically revolutionize
> web-enabled VENDOR potentialities
> vendors installed base e-tailers. ||
> Replace? (y,n,q) || ...abled VENDOR poten... ||
> Replace? (y,n,q) || ...ties vendors insta... ||
Please let me know if I am unclear on my objective. Thanks for any help and response to this! | 0 | [
2,
7953,
1706,
10120,
1886,
12933,
18,
416,
3893,
17,
416,
293,
800,
3726,
3726,
64,
678,
15,
86,
235,
1852,
9,
31,
22,
79,
1174,
21,
3884,
30,
630,
9214,
2122,
17,
3934,
27,
21,
3893,
1541,
9,
7398,
15,
14,
3884,
3049,
206,
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... |
Generating a Deck of Cards
===
I'm trying to make a simple blackjack program. Sadly, I'm having problems right of the bat with generating a deck of cards.
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<char> deck;
char suit[] = {'h','d','c','s'};
char card[] = {'2','3','4','5','6','7','8','9','10','J','Q','K','A'};
for (int j=0; j<13; j++) {
for (int i=0; i<4; i++) {
deck.push_back(card[j] suit[i]);
}
}
return 0;
}
I know my problem begins with me trying to assign the value '10' to a char. Obviously I couldn't get this to compile but I'm sure when I try to assign the card values to the vector deck I'll also get an error since I used variable type 'char'. Knowing what kind of variable type to use seems to be killing me. Also, would 'deck.push_back(card[j] suit[i]);' be the correct code to combine the card and suit, or do you have to put something between card[j] and suit[i]? I'd appreciate it if any of you could lead me in the right direction. Also as a little side note, this is part of a homework assignment so please don't just give me entire blocks of code. Thanks for you help. | 0 | [
2,
13500,
21,
4061,
16,
4092,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
1935,
319,
6994,
625,
9,
16382,
15,
31,
22,
79,
452,
1716,
193,
16,
14,
3570,
29,
13500,
21,
4061,
16,
4092,
9,
6926,
22640,
13,
1,
1963,
11260,
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... |
SCM inside or outside the IDE?
===
I've personally always used some type of external application for my SCM work; these days, that means [tortoiseSVN][1] on windows and [versions.app][2] on the mac. However, I keep running up against developers (namely eclipse users) who argue that SCM is better done within the IDE itself. I've yet to hear any really compelling arguments in favor of this workflow, and I personally like a degree of "separation" between the IDE and SCM operations. This has been burned into me from using unstable SVN plugins in Visual Studio, and the sub-standard SVN support in Xcode in years past when working offline.
Which way promotes the better workflow in your opinion?
[1]: http://tortoisesvn.tigris.org
[2]: http://versionsapp.com | 0 | [
2,
4729,
79,
572,
54,
719,
14,
13,
3448,
60,
800,
3726,
3726,
31,
22,
195,
7200,
550,
147,
109,
1001,
16,
4886,
3010,
26,
51,
4729,
79,
170,
73,
158,
509,
15,
30,
1108,
636,
2153,
38,
16238,
18,
16578,
500,
2558,
165,
500,
27,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Limiting assembly execution number of cpu cycles
===
I have a project that dynamically loads in unknown assemblies implementing a specified interface. I don't know the contents or purposes of the assembly, other than it implementing my interface.
I need to somehow restrict the amount of processing power available to these assemblies. Processor priority is not what I'm looking for. I can't use a stopwatch and assign a certain amount of time for the assembly to run as the server might be arbitrarily busy.
Optimally I'd like to specify some completely load independent measure of CPU usage. I can run the assemblies in their own process if necessary.
Is there any way to somehow measure the total over-time CPU usage of a given thread (or process, though thread would be the optimal)?
Might I use the process performance counters, or are they, as I suspect, too unreliable? While I don't need to-the-cycle accuracy, I would need rather high accuracy to limit the computing power allocated to each assembly execution. | 0 | [
2,
17567,
1475,
5769,
234,
16,
17578,
14763,
800,
3726,
3726,
31,
57,
21,
669,
30,
7782,
1326,
19069,
19,
2562,
21066,
17333,
21,
9931,
6573,
9,
31,
221,
22,
38,
143,
14,
8478,
54,
4612,
16,
14,
1475,
15,
89,
119,
32,
17333,
51,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In Silverlight, how to populate a sorted DataGrid from a dynamically changing connection
===
I have a data set whose elements are displayed as rows in a DataGrid. The sort order for the rows changes in response to external events.
My initial thought was to store the rows as an ObservableCollection and resort the collection after updates. However I ran into two problems:
1) the ObservableCollection does not have a Sort() method
2) if I try to sort the elements myself, I get an exception whenever I try to assign an element to a new position, for example in a swap function like
class MyCollection : ObservableCollection<T>
{
void swap( int i, int j )
{
T tmp = this[i];
this[i] = this[j]; // THROWS A NOT SUPPORTED EXCEPTION
this[j] = tmp;
}
}
So the question is ... how to populate a DataGrid whose row order needs to update dynamically?
I did finally get one answer working, I'll describe it below.
| 0 | [
2,
19,
1172,
3130,
15,
184,
20,
1675,
12383,
21,
22554,
1054,
16375,
37,
21,
7782,
1326,
4226,
2760,
800,
3726,
3726,
31,
57,
21,
1054,
309,
1196,
2065,
50,
6115,
28,
11295,
19,
21,
1054,
16375,
9,
14,
2058,
389,
26,
14,
11295,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SharePoint Development / Production Environments
===
One of the biggest challenges that I've encountered with SharePoint is that it doesn't lend itself nicely to the typical project environment, which, at minimum, contain development and production environments. The issues I've run into the most are that content and lists are so tightly coupled that it makes it difficult to perform design changes without performing a content freeze on the production environment. For example, if I have a list with calculated columns and wanted to add some new functionality, I would have to do a content freeze on the production server, create a list template (including content) from the production server, restore that list to the development environment, make my changes, then reverse the list template process. The same holds true for pages and just about anything else in SharePoint. It seems as though once the site is deployed, it's best to work directly on the production box, but that breaks a ton of best practices, for obvious reasons.
How are some of you other SharePoint developers handling this limitation? | 0 | [
2,
1891,
3132,
522,
13,
118,
637,
11246,
800,
3726,
3726,
53,
16,
14,
3835,
7595,
30,
31,
22,
195,
8208,
29,
1891,
3132,
25,
30,
32,
1437,
22,
38,
13866,
1145,
24050,
20,
14,
3874,
669,
2307,
15,
56,
15,
35,
5187,
15,
3717,
52... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Dynamic where clause in LINQ - with column names available at runtime
===
Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way.
Consider the following situation :
var query =
from c in db.Customers
where (c.ContactFirstName.Contains("BlackListed") ||
c.ContactLastName.Contains("BlackListed") ||
c.Address.Contains("BlackListed"))
select c;
The columns/attributes that need to be checked against the blacklisted term are only available to me at runtime. How do I generate this dynamic where clause?
An additional complication is that the Queryable collection (db.Customers above) is typed to a Queryable of the base class of 'Customer' (say 'Person'), and therefore writing c.Address as above is not an option. | 0 | [
2,
7782,
113,
9040,
19,
6294,
1251,
13,
8,
29,
4698,
1817,
904,
35,
485,
891,
800,
3726,
3726,
1460,
22661,
106,
45,
31,
22,
195,
15091,
14,
1448,
568,
13832,
37,
329,
9,
1226,
1251,
9,
28993,
18,
15,
47,
31,
22,
79,
174,
699,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding a new project to an existing solution in TFS
===
I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in. | 0 | [
2,
4721,
21,
78,
669,
20,
40,
3149,
4295,
19,
13,
11720,
18,
800,
3726,
3726,
31,
905,
21,
669,
20,
40,
3149,
4295,
30,
25,
871,
131,
1267,
569,
568,
13,
11720,
18,
15,
47,
26,
109,
1215,
31,
1967,
2631,
19,
14,
78,
669,
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... |
iPhone how to create the UI component
===
I'm exploring the iPhone SDK and want to create and use a UI Component like the figure below. A rounded table with cells in which each cell can have some label text, maybe an input text field and an action button that would take it to the next screen. The table should not be screen filling.
But... I can't figure out how to do it or find example code. The 'Table View' always seems to result in a screen filling table and although the 'Table View Cell' looks like what I need I can't find any good examples. I'm sure it's all not that hard, but I just can't find it. Any tips, pointers are appreciated.
(This figure is just an example of the sort of UI component I'm looking for, I'm not build something related to flight tracking...)
![Table like component][1]
[1]: http://gerodt.homeip.net/table_ui_component.png
Gero | 0 | [
2,
21024,
184,
20,
1600,
14,
13,
5661,
5912,
800,
3726,
3726,
31,
22,
79,
11748,
14,
21024,
13,
18,
43,
197,
17,
259,
20,
1600,
17,
275,
21,
13,
5661,
5912,
101,
14,
1465,
1021,
9,
21,
8472,
859,
29,
2934,
19,
56,
206,
1667,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 polymorphism or conditionals promote better design?
===
I recently stumbled across [this entry in the google testing blog][1] about guidelines for writing more testable code. I was in agreement with the author until this point:
> Favor polymorphism over conditionals: If you see a switch statement you should think polymorphisms. If you see the same if condition repeated in many places in your class you should again think polymorphism. Polymorphism will break your complex class into several smaller simpler classes which clearly define which pieces of the code are related and execute together. This helps testing since simpler/smaller class is easier to test.
I simply cannot wrap my head around that. I can understand using polymorphism instead of RTTI (or DIY-RTTI, as the case may be), but that seems like such a broad statement that I can't imagine it actually being used effectively in production code. It seems to me, rather, that it would be easier to add additional test cases for methods which have switch statements, rather than breaking down the code into dozens of separate classes.
Also, I was under the impression that polymorphism can lead to all sorts of other subtle bugs and design issues, so I'm curious to know if the tradeoff here would be worth it. Can someone explain to me exactly what is meant by this testing guideline?
[1]: http://googletesting.blogspot.com/2008/08/by-miko-hevery-so-you-decided-to.html | 0 | [
2,
630,
3446,
13348,
54,
21206,
18,
3947,
574,
704,
60,
800,
3726,
3726,
31,
1989,
10282,
464,
636,
1565,
2792,
19,
14,
8144,
4431,
8146,
500,
2558,
165,
500,
88,
12629,
26,
1174,
91,
1289,
579,
1797,
9,
31,
23,
19,
2022,
29,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tech Books you have but never read
===
Let's be honest.
Many of us have books that were bought thinking "I might need this some day".
That day has never come.
Or maybe you spent $50+ on the book but only used it a few times.
Or you bought it thinking it was the current technological trend.
Post your list of books that you have but have never read, let alone used for a project.
----------
Only put books related to your work. Tech books! | 0 | [
2,
6145,
964,
42,
57,
47,
243,
1302,
800,
3726,
3726,
408,
22,
18,
44,
6964,
9,
151,
16,
182,
57,
964,
30,
46,
2448,
1440,
13,
7,
49,
530,
376,
48,
109,
208,
7,
9,
30,
208,
63,
243,
340,
9,
54,
913,
42,
1111,
21946,
2430,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Visual Studio (2008) mixed mode project depencies. C-sharp project depends on C++ dll, but C++ dll is not getting re-built
===
I have a Visual Studio 2008 solution with two projects in it. A C++ DLL and a Csharp application.
The Csharp application uses [DllImport] to access the functions in the DLL, and has a dependency set on the DLL.
For some reason, setting the dependency isn't sufficient to cause VS to copy the DLL to the build path of the app. So the app project has a post-build event which causes the DLL to get copied. (If anyone knows of a cleaner way of doing this, please let me know!)
The problem I have is that when I make a change to the DLL code, then attempt to run the Csharp application in the debugger, VS2008 fails to realise that the DLL must be rebuilt (and re-copied).
I have to force a re-build of the Csharp application (ie by explicitly choosing build, or by "touching" a .CS file).
Does anyone know how to tell Visual Studio to do the right thing?
Thanks,
Rob | 0 | [
2,
3458,
1120,
13,
5,
2753,
6,
2198,
3740,
669,
13,
17309,
22851,
9,
272,
8,
23646,
669,
9597,
27,
272,
20512,
13,
43,
211,
15,
47,
272,
20512,
13,
43,
211,
25,
52,
1017,
302,
8,
8607,
800,
3726,
3726,
31,
57,
21,
3458,
1120,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
determining the line terminator in emacs
===
I'm writing a config file and I need to define if the process expects a windows format file or a unix format file. I've got a copy of the expected file - is there a way I can check if it uses \n or \r\n without exiting emacs? | 0 | [
2,
13521,
14,
293,
13,
815,
28607,
19,
13,
62,
6893,
18,
800,
3726,
3726,
31,
22,
79,
1174,
21,
13,
14093,
2816,
3893,
17,
31,
376,
20,
9267,
100,
14,
953,
4186,
18,
21,
1936,
2595,
3893,
54,
21,
22540,
2595,
3893,
9,
31,
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... |
using STL to find all elements in a vector
===
I have a collection of elements that I need to operate over, calling member functions on the collection:
std::vector<MyType> v;
... // vector is populated
For calling functions with no arguments it's pretty straight-forward:
std::for_each(v.begin(), v.end(), std::mem_fun(&MyType::myfunc));
A similar thing can be done if there's one argument to the function I wish to call.
My problem is that I want to call a function on elements in the vector if it meets some condition. `std::find_if` returns an iterator to the first element meeting the conditions of the predicate.
std::vector<MyType>::iterator it =
std::find_if(v.begin(), v.end(), MyPred());
I wish to find **all** elements meeting the predicate and operate over them.
I've been looking at the STL algorithms for a "`find_all`" or "`do_if`" equivalent, or a way I can do this with the existing STL (such that I only need to iterate once), rather than rolling my own or simply do a standard iteration using a for loop and comparisons. | 0 | [
2,
568,
354,
255,
20,
477,
65,
2065,
19,
21,
7497,
800,
3726,
3726,
31,
57,
21,
1206,
16,
2065,
30,
31,
376,
20,
4055,
84,
15,
2555,
322,
3719,
27,
14,
1206,
45,
354,
43,
45,
45,
28033,
1,
915,
4474,
1,
566,
73,
13,
9,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I setup iis with an ssl cert?
===
Is there a way to programaticaly install a ssl cert for iis 6 and 7? | 0 | [
2,
184,
92,
31,
18161,
595,
18,
29,
40,
13,
18,
18,
255,
13,
17580,
60,
800,
3726,
3726,
25,
80,
21,
161,
20,
625,
12479,
58,
102,
16146,
21,
13,
18,
18,
255,
13,
17580,
26,
595,
18,
400,
17,
453,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
What are you using to unit test your C++ code?
===
I'm looking into some possible options for unit testing C++ classes.
So, short and to the point, what are you using? | 0 | [
2,
98,
50,
42,
568,
20,
1237,
1289,
154,
272,
20512,
1797,
60,
800,
3726,
3726,
31,
22,
79,
699,
77,
109,
938,
6368,
26,
1237,
4431,
272,
20512,
2684,
9,
86,
15,
502,
17,
20,
14,
454,
15,
98,
50,
42,
568,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
To foo bar, or not to foo bar: that is the question.
===
This was something originally discussed during a presentation given by Charles Brian Quinn of the [Big Nerd Ranch][1] at [acts_as_conference][2]. He was discussing what he had learned from instructing a Ruby on Rails Bootcamp to many people both new to programming and new to Rails.
One particular slide that stood out was along the lines of **never using foo and bar as exampls when trying to teach someone to program**. His reasoning was very simple.
Which is easier to understand?
baz = foo + bar
or
answer = first_number + second_number
It's happened many times myself when explaining something and I immediately jump to the go to foo bar placeholders but then realize my mistake and make the example make a lot more sense by using a real world scenario.
This is especially applicable when trying to teach someone who has had no programming exposure and you end up needing explain foo and bar before explaining what you're actually trying to teach.
However, using foo and bar for experienced programmers seems OK, though I personally think, along with Charles, that it's something that needs to change.
A quick SO search for "foo" returns over 20 pages of results with foo being used in more ways that I can comprehend. And in some cases where I'm reading a question on a particular language and I'm doing so to help understand that language better. If applicable variable names are used instead of foo and bar, it makes it much easier to understand and interpret the problem. So for seasoned developers, the construct seems a bit flawed as well.
Is this a habit that will ever be able to be kicked?
So the question is, do you choose to foo bar or to not foo bar? Why?
[1]: http://www.bignerdranch.com/
[2]: http://www.actsasconference.com | 0 | [
2,
20,
4310,
111,
748,
15,
54,
52,
20,
4310,
111,
748,
45,
30,
25,
14,
1301,
9,
800,
3726,
3726,
48,
23,
301,
912,
6078,
112,
21,
6364,
504,
34,
922,
2730,
8565,
16,
14,
636,
6407,
25758,
6459,
500,
2558,
165,
500,
35,
636,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Splitting strings in python
===
I have a string which is like this:
this is [bracket test] "and quotes test "
I'm trying to write something in Python to split it up by space while ignoring spaces within square braces and quotes. The result I'm looking for is:
['this','is','bracket test','and quotes test '] | 0 | [
2,
17282,
7887,
19,
20059,
800,
3726,
3726,
31,
57,
21,
3724,
56,
25,
101,
48,
45,
48,
25,
636,
2559,
13316,
38,
1289,
500,
13,
7,
290,
18901,
1289,
13,
7,
31,
22,
79,
749,
20,
2757,
301,
19,
20059,
20,
2132,
32,
71,
34,
726... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Failure MDA.
===
I reloaded an old project, and tried to run it only to run into the Binding Failure MDA Assistant:
<pre>
BindingFailure was detected
Message: The assembly with display name 'SoapTest.XmlSerializers' failed to load in the
'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was:
System.IO.FileNotFoundException: Could not load file or assembly
'SoapTest.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. The system cannot find the file specified.
</pre>
After googling this, the only solution I could find was to turn off the MDA. This works, but I would prefer to solve the underlying problem (SoapTest.XmlSerializers.dll not being in the bin\Debug directory). How can I fix this? What creates the SoapTest.XmlSerializers.dll, and why is it not being created on a Rebuild? Yes, I have tried updating the Web Reference (this doesn't help). No I don't want to upgrade to WCF Soap Services. | 0 | [
2,
8728,
2990,
307,
593,
9,
800,
3726,
3726,
31,
27339,
69,
40,
315,
669,
15,
17,
794,
20,
485,
32,
104,
20,
485,
77,
14,
8728,
2990,
307,
593,
1482,
45,
13,
1,
3515,
1,
8728,
24910,
4221,
23,
11968,
2802,
45,
14,
1475,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 - Multiple Values comma separated when using GROUP BY
===
I have data that looks like
> CUSTOMER, CUSTOMER_ID, PRODUCT
> ABC INC 1 XYX
> ABC INC 1 ZZZ
> DEF CO 2 XYX
> DEF CO 2 ZZZ
> DEF CO 2 WWW
> GHI LLC 3 ZYX
I'd like to write a query that'd make the data look like this:
> CUSTOMER, CUSTOMER_ID, PRODUCTS
> ABC INC 1 XYX, ZZZ
> DEF CO 2 XYX, ZZZ, WWW
> GHI LLC 3 ZYX
**Using Oracle 10g if helps. I saw something that would work using MYSQL, need plain SQL or ORACLE equivelant. I've also seen examples of stored procs that could be made, however, I cannot use a stored proc with the product i'm using.**
Here's how'd it work in MySQL if i were using it
> SELECT CUSTOMER, CUSTOMER_ID,
> GROUP_CONCAT( PRODUCT ) FROM
> MAGIC_TABLE GROUP BY CUSTOMER,
> CUSTOMER_ID
Thx. | 0 | [
2,
4444,
255,
13,
8,
1886,
4070,
11951,
58,
4196,
76,
568,
214,
34,
800,
3726,
3726,
31,
57,
1054,
30,
1879,
101,
13,
1,
7705,
15,
7705,
1,
1340,
15,
2374,
13,
1,
5079,
3016,
137,
13,
15161,
396,
13,
1,
5079,
3016,
137,
2052,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 disable ViewState for dynamically created controls?
===
I can't seem to be able to disable ViewState for controls that I add to a page dynamically.
**ASPX**
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page1.aspx.cs" Inherits="Page1" EnableViewState="false" %>
...
<asp:PlaceHolder ID="DropDownPlaceHolder" runat="server" EnableViewState="false" />
<asp:Button ID="Submit" runat="server" OnClick="Submit_OnClick" Text="Click Me!" EnableViewState="false"/>
...
**ASPX.CS**
protected override void OnInit(EventArgs e)
{
DropDownList dropDown = new DropDownList();
TextBox textBox = new TextBox();
textBox.EnableViewState = false;
dropDown.Items.Add("Apple");
dropDown.Items.Add("Dell");
dropDown.Items.Add("HP");
dropDown.AutoPostBack = true;
dropDown.EnableViewState = false;
DropDownPlaceHolder.Controls.Add(dropDown);
DropDownPlaceHolder.Controls.Add(textBox);
base.OnInit(e);
}
If I can't disable ViewState on these controls, then I can never programmatically override what a user has entered/selected.
I've tried placing this code in OnInit and Page_Load, but the effect is the same in either location -- ViewState is enabled.
So, how can I disable ViewState and keep it from populating these controls?
Thanks! | 0 | [
2,
184,
92,
31,
1460,
579,
1418,
3859,
26,
7782,
1326,
679,
8671,
60,
800,
3726,
3726,
31,
92,
22,
38,
2260,
20,
44,
777,
20,
1460,
579,
1418,
3859,
26,
8671,
30,
31,
3547,
20,
21,
2478,
7782,
1326,
9,
13,
1409,
472,
306,
396,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Skip Lists -- ever used them?
===
I'm wwondering whether anyone here has ever used a [skip list][1]. It looks to have roughly the same advantages as a balanced binary tree, but is simpler to implement. If you have, did you write your own, or use a pre-written library (and if so, which one)?
[1]: http://en.wikipedia.org/wiki/Skip_list | 0 | [
2,
12532,
7227,
13,
8,
8,
462,
147,
105,
60,
800,
3726,
3726,
31,
22,
79,
619,
8784,
1157,
68,
1472,
1276,
235,
63,
462,
147,
21,
636,
2413,
306,
968,
500,
2558,
165,
500,
9,
32,
1879,
20,
57,
4457,
14,
205,
14683,
28,
21,
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... |
Tab key == 4 spaces and auto-indent after curly braces in VIM.
===
How do I make Vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like emacs does?
Also, how do I save these settings so I never have to input them again.
I've seen other questions related to this but it always seems to be a little off from what I want. | 0 | [
2,
6523,
1246,
800,
3726,
268,
7644,
17,
3108,
8,
108,
817,
38,
75,
21056,
15646,
18,
19,
1790,
79,
9,
800,
3726,
3726,
184,
107,
31,
233,
1790,
8,
1755,
79,
243,
275,
6523,
18,
13,
5,
1126,
8122,
68,
7644,
20,
6523,
18,
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... |
One DB per developer or not?
===
In a development enviroment, should every developer use its own database instance, or should they use a central database instance during development? What are the advantages and disadvantages of each approach? | 0 | [
2,
53,
13,
9007,
416,
10058,
54,
52,
60,
800,
3726,
3726,
19,
21,
522,
21314,
661,
1130,
15,
378,
352,
10058,
275,
82,
258,
6018,
4851,
15,
54,
378,
59,
275,
21,
521,
6018,
4851,
112,
522,
60,
98,
50,
14,
14683,
17,
13387,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Where can I find a good Scrum Book in Spanish?
===
Has anybody any experience with a Spanish Scrum Book that they can recommend? | 0 | [
2,
113,
92,
31,
477,
21,
254,
26562,
360,
19,
1273,
60,
800,
3726,
3726,
63,
11181,
186,
1496,
29,
21,
1273,
26562,
360,
30,
59,
92,
12360,
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... | [
1,
1,
1,
1,
1,
1,
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... |
Java Swing, textarea as input/output?
===
I want to load up a window using the java swing, something like <a href='http://www.java2s.com/Code/Java/Swing-JFC/ShowlinestartendoffsetsinaJTextArea.htm'>this</a>.
However I want to be able to use it for text input also not just to dump data into it..
any idea how to do it? | 0 | [
2,
8247,
5587,
15,
1854,
17760,
28,
6367,
118,
1320,
4881,
60,
800,
3726,
3726,
31,
259,
20,
6305,
71,
21,
1463,
568,
14,
8247,
5587,
15,
301,
101,
13,
1,
58,
746,
14057,
3726,
22,
21127,
6903,
6483,
9,
1004,
1385,
135,
18,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Restricting access to objects in an application
===
One problem that I come across regularly and yet don't have a solution to is to restrict or permit access to specific entities in a system. Some companies (banks, for example) have very strict policies regarding which employees may access certain information. For example, an employee at a specific branch may access account information for customers of that specific branch but not from other branches. Also, banks that have branches in many countries may be subject to legal restrictions that restricts employees in other countries from accessing information about domestic customers.
Another example I've come across is a public website where users belong to a specific entity (such as a company) and may access information regarding that entity only and not other entities.
If the number of entities is small and fixed, this is not a problem. Simply specify domain groups in the active directory (if you're working in Microsoft environments, which is the case for me), add users to the groups and restrict access using IsInRole() for each entity. So if there is a company called ABC in the system I'd create a domain group called "Admins_ABC" or something like that and when a user tries to administer information about ABC, I'd make sure the user is a member of that group. This is not really the way the AD is intended to be used, but for a small number of entities I've found it reasonable.
The complexity increases when the number of entities change often and when the requirements become more detailed. I've seen security requirements that are similar to security in NTFS - some users (or groups of users) should be able to access some entities (files in NTFS) or groups of entities (the permissions that are set on directories in NTFS are propagated to it's children).
I try to avoid situations like these because they tend to be a nightmare to model and code and they usually become complex to administer, but the customers I work with often need solutions to this problem.
Like I said, I have never actually solved this problem in a *good* way. How would you go about modeling and developing a solution for this problem in a way that can be reused? Do you know of any general, proprietary solutions that can be used? | 0 | [
2,
15436,
68,
1381,
20,
3916,
19,
40,
3010,
800,
3726,
3726,
53,
1448,
30,
31,
340,
464,
4217,
17,
768,
221,
22,
38,
57,
21,
4295,
20,
25,
20,
15436,
54,
8992,
1381,
20,
1903,
12549,
19,
21,
329,
9,
109,
1532,
13,
5,
5366,
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... |
Soving the shared-server security problem for Python
===
So my group is trying to set up a shared-server environment for various and sundry web services. I think we've settled on setting `disable_functions` and `disable_classes` site wide in `php.ini` and `php_admin_value` to force `open_basedir` in each app's `httpd.conf`
for php scripts, and passenger's [user switching](http://www.modrails.com/documentation/Users%20guide.html#user_switching) for ruby scripts.
We still need to find something for python though. Passenger does support python, but not for per-application security for specific sub-directories (it's all or nothing at the domain level). Any suggestions?
(And if any of the previous doesn't make sense - well, I'm the guy who's supposed to set up the python support, not the guy who set up the php or ruby support, so there's still some "and then some magic happens" steps in there from my perspective). | 0 | [
2,
86,
8397,
14,
2592,
8,
10321,
106,
1221,
1448,
26,
20059,
800,
3726,
3726,
86,
51,
214,
25,
749,
20,
309,
71,
21,
2592,
8,
10321,
106,
2307,
26,
617,
17,
939,
12611,
2741,
687,
9,
31,
277,
95,
22,
195,
2200,
27,
2697,
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... |
Upper vs Lower Case
===
When doing case-insensitive comparisons, is it more efficient to convert the string to upper case or lower case? Does it even matter?
It is suggested [in this SO post][1] that C# is more efficient with ToUpper because "Microsoft optimized it that way." But I've also read [this argument][2] that converting ToLower vs. ToUpper depends on what your strings contain more of, and that typically strings contain more lower case characters which makes ToLower more efficient.
In particular, I would like to know:
- Is there a way to optimize ToUpper or ToLower such that one is faster than the other?
- Is it faster to do a case-insensitive comparison between upper or lower case strings, and why?
- Are there any programming environments (eg. C, C#, Python, whatever) where one case is clearly better than the other, and why?
[1]: http://stackoverflow.com/questions/9033/hidden-features-of-c#12137
[2]: http://www.petefreitag.com/item/175.cfm
| 0 | [
2,
1508,
4611,
987,
610,
800,
3726,
3726,
76,
845,
610,
8,
108,
19435,
6050,
18,
15,
25,
32,
91,
8243,
20,
8406,
14,
3724,
20,
1508,
610,
54,
987,
610,
60,
630,
32,
166,
1161,
60,
32,
25,
2347,
636,
108,
48,
86,
678,
500,
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... |
Eclipse: Can you format code on save?
===
In Eclipse, under Windows -> Preference -> Java -> Code Style, you can define code templates for comments and code, and you can setup a code formatter. I'm wondering if it is possible in Eclipse to have these setting take affect every time I save a source file. Basically, instead of me highlighting everything and pressing Ctrl+Shift+F, I want Eclipse to be responsible for making sure my code is formatted properly.
Is this possible and how do you set it up?
| 0 | [
2,
11652,
45,
92,
42,
2595,
1797,
27,
2079,
60,
800,
3726,
3726,
19,
11652,
15,
131,
1936,
13,
8,
1,
9808,
13,
8,
1,
8247,
13,
8,
1,
1797,
1034,
15,
42,
92,
9267,
1797,
22894,
18,
26,
7534,
17,
1797,
15,
17,
42,
92,
18161,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Save a message from exchange 2003 in .msg format using WEBDAV, C#
===
in C# .net 2.0, is there a quick and easy way to retrieve a message (including its possible attachments) from exchange 2003 and save it to disk in .MSG (outlook) format.
Thanks, | 0 | [
2,
2079,
21,
2802,
37,
1950,
973,
19,
13,
9,
79,
18,
263,
2595,
568,
2741,
43,
5214,
15,
272,
5910,
800,
3726,
3726,
19,
272,
5910,
13,
9,
2328,
172,
9,
387,
15,
25,
80,
21,
2231,
17,
2010,
161,
20,
11917,
21,
2802,
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... |
VC++ problem with 64 bit oracle client with OpenforwardOnly flag in database connection.
===
I am porting an existing windows based C++ application to 64 bit environment and this is one of those weird errors.
In the code snippet you can that I am using openforwardonly and it used to work fine with our old setup but in the 64 bit environment it gives the problem of fetching only ONE recordset. Or it could be a problem with the <b>MoveNext(); </b> of ADO.
To circumvent it we started using adOpenStatic and it worked fine for me for a while but only later realized that it has a performance hit and it is taking forever to get/iterative through values.
I request someone to try this code with both the flags and validate the behavior I am seeing.
Information about ado flags:
http://www.w3schools.com/ADO/met_rs_open.asp
Another EE topic
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_DB/Q_11520558.html
I remember seeing a MS support case but I can't get to it now.
I would appreciate any help or suggestions. I know we are using old technology but we want to move to the additional capabilities without changing code much.
// Dbtest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <time.h>
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
int main(int argc, char* argv[])
{
HRESULT hr = S_OK;
try
{
CoInitialize(NULL);
_bstr_t strCnn("Provider=OraOLEDB.Oracle;Data Source =****; User Id=****; password=***");
_ConnectionPtr m_pConn;
hr=m_pConn.CreateInstance(__uuidof(Connection));
if(FAILED(hr))
{
printf("Failed creating record set instance\n");
return 0;
}
m_pConn->Open(strCnn,"","",NULL);
//Open the Record set for getting records from Author table
_RecordsetPtr pRstDoctors = NULL;
time_t start,end1,end2;
pRstDoctors.CreateInstance(__uuidof(Recordset));
time(&start);
pRstDoctors->Open("select logid from log",strCnn, adOpenForwardOnly,
**adLockReadOnly**,adCmdText);
//Declare a variable of type _bstr_t
int valField1;
//int valField2;
pRstDoctors->MoveFirst();
//Loop through the Record set
if (!pRstDoctors->EndOfFile)
{
while(!pRstDoctors->EndOfFile)
{
valField1 = pRstDoctors->Fields->GetItem("logid")->Value.intVal;
// valField2 = pRstDoctors->Fields->GetItem("reportid")->Value.intVal;
// printf("%d - \n",valField1);
pRstDoctors->MoveNext();
}
}
time(&end1);
double dif=difftime(end1,start);
printf("time difference is %.2lf",dif);
}
catch(_com_error e)
{
printf("Error:%s\n",e);
}
CoUninitialize();
return 0;
}
| 0 | [
2,
13,
8990,
20512,
1448,
29,
4384,
1142,
15759,
6819,
29,
368,
21216,
4965,
3157,
19,
6018,
2760,
9,
800,
3726,
3726,
31,
589,
1295,
68,
40,
3149,
1936,
432,
272,
20512,
3010,
20,
4384,
1142,
2307,
17,
48,
25,
53,
16,
273,
5455,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 bring a failing project back on track?
===
You must have heard the archtypical story of a failing/failed project:
1. A team of inexperienced programmers work 24x7
2. Bugs are fixed only to introduce new bugs
3. Customer is screaming that he could not even do the basic stuff (Saving/Querying) etc.
4. Programmers used to having the spec handed down struggle to improvise
5. No automated unit tests aggrevate the situation
6. Architecture document that looked nice on paper was not followed in practice
7. Third party components used become bottlenecks not having been tested for fitness in the first place
8. Milestone after milestone missed
9. The team is not able to come up with a delivery date as nobody agrees as to the quantum of work actually needs to be done
10. No technical leadership / or a Cowboy Coder that can take on the technical issues
Now, If you were to be brought in as #10 what would be your first steps?
| 0 | [
2,
184,
107,
42,
1499,
21,
7250,
669,
97,
27,
792,
60,
800,
3726,
3726,
42,
491,
57,
752,
14,
5071,
22371,
609,
16,
21,
7250,
118,
24910,
69,
669,
45,
137,
9,
21,
173,
16,
27624,
17968,
18,
170,
937,
396,
465,
172,
9,
13925,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 use Explain Plain to optimize queries?
===
I have been tasked to optimize some sql queries at work. Everything I have found points to using Explain Plain to identify problem areas. The problem I can not find out exactly what explain plain is telling me. You get Cost, Cardinality, and bytes.
What do this indicate, and how should I be using this as a guide. Are low numbers better? High better? Any input would be greatly apprciated.
Or if you have a better way to go about optimizing a query, I would be interested.
| 0 | [
2,
184,
20,
275,
3271,
3748,
20,
22864,
9386,
2829,
60,
800,
3726,
3726,
31,
57,
74,
14605,
20,
22864,
109,
4444,
255,
9386,
2829,
35,
170,
9,
796,
31,
57,
216,
819,
20,
568,
3271,
3748,
20,
5808,
1448,
924,
9,
14,
1448,
31,
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... |
Does the TIBCO EMS server manage reconnection? or does the client?
===
The TIBCO EMS .NET reference guide says (pg 134)
> To enable reconnection behavior and fault tolerance, the serverURL parameter must be a comma-separated list of two or more URLs. In a situation with only one server, you may supply two copies of that server’s URL to enable client reconnection (for example, tcp://localhost:7222,tcp://localhost:7222).
The TIBCO EMS user's guide (pg 292) talks about failover scenarios, client notification, and automatic transfer of clients to the backup server, but nothing specifically "reconnect" related.
In a "reconnect" scenario, does the server handle everything? or does the client have to do something with it's TIBCO.EMS.Connection instances? | 0 | [
2,
630,
14,
4174,
220,
716,
3579,
18,
8128,
4705,
29693,
872,
60,
54,
630,
14,
6819,
60,
800,
3726,
3726,
14,
4174,
220,
716,
3579,
18,
13,
9,
2328,
2801,
3378,
898,
13,
5,
9623,
13,
13837,
6,
13,
1,
20,
9240,
29693,
872,
3257... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 java RPG (Role Playing Game) engine for an experienced programmer?
===
I am looking into building a smallish Java rpg. I haven't found any good examples of a RPG engine that would be the most powerful yet most stable for an experienced Java programmer. Thanks in advance everyone. | 0 | [
2,
98,
25,
14,
246,
8247,
22338,
13,
5,
661,
413,
791,
250,
6,
1406,
26,
40,
3882,
17968,
60,
800,
3726,
3726,
31,
589,
699,
77,
353,
21,
284,
1595,
8247,
22338,
9,
31,
2933,
22,
38,
216,
186,
254,
3770,
16,
21,
22338,
1406,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 add EditText on spinner popup in android?
===
I need to add `EditText` on top of the `Spinner` popup for searching purpose. Is this possible? How to do this? give me any idea for this. | 0 | [
2,
184,
20,
3547,
9392,
11969,
27,
3310,
1031,
1675,
576,
19,
13005,
60,
800,
3726,
3726,
31,
376,
20,
3547,
13,
1,
69,
242,
11969,
1,
27,
371,
16,
14,
13,
1,
3401,
18005,
1,
1675,
576,
26,
5792,
2131,
9,
25,
48,
938,
60,
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,
0,
0,
0,
0,
0... |
Connect Azure Data Marketplace to SQL Server 2008 R2
===
Is there a way to connect SQL Server 2008 R2 to the Azure Data Marketplace to enable data import?
Are there any ODBC or JDBC drivers for the Azure Data Marketplace?
Thanks for your assistance,
| 0 | [
2,
6379,
25715,
1054,
19408,
20,
4444,
255,
8128,
570,
761,
135,
800,
3726,
3726,
25,
80,
21,
161,
20,
6379,
4444,
255,
8128,
570,
761,
135,
20,
14,
25715,
1054,
19408,
20,
9240,
1054,
9010,
60,
50,
80,
186,
12340,
7229,
54,
487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is there any option to connect other db in the salesforce platform?
===
I would like to know whether there any option to connect to the external db in the salesforce platform.
Thanks,
Easwar | 1 | [
2,
25,
80,
186,
4255,
20,
6379,
89,
13,
9007,
19,
14,
2598,
8774,
2452,
60,
800,
3726,
3726,
31,
83,
101,
20,
143,
1472,
80,
186,
4255,
20,
6379,
20,
14,
4886,
13,
9007,
19,
14,
2598,
8774,
2452,
9,
3669,
15,
13507,
18,
1885,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Update the table with 2 column values
===
I want to update the table value comparing with two column values.
Query
UPDATE acc SET slloc =
(SELECT Location
FROM Duplication$
WHERE Duplication$.GROUP1 = acc.grpcd AND acc.ccode = Duplication$.div)
The above query showing error as
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
How can i change my query
Need query help | 0 | [
2,
11100,
14,
859,
29,
172,
4698,
4070,
800,
3726,
3726,
31,
259,
20,
11100,
14,
859,
1923,
15047,
29,
81,
4698,
4070,
9,
25597,
11100,
7602,
309,
13718,
10799,
800,
13,
5,
18,
16964,
1474,
37,
1052,
20669,
4403,
113,
1052,
20669,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS- link to an icon visible on hover
===
I have an icon that I display on top, right of a div on hovering over the div. My code is like this:
<div class='edit_hover_class'>
<!-- some code -->
</div>
And the corresponding css file contains:
.edit_hover_class:hover {
background: url("trash.gif") no-repeat scroll right top;
}
I want to attach a link to the edit icon, is it possible with plain css? If so, how? | 0 | [
2,
272,
18,
18,
8,
3508,
20,
40,
9801,
4560,
27,
21350,
800,
3726,
3726,
31,
57,
40,
9801,
30,
31,
3042,
27,
371,
15,
193,
16,
21,
13,
12916,
27,
18503,
84,
14,
13,
12916,
9,
51,
1797,
25,
101,
48,
45,
13,
1,
12916,
718,
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... |
Android Custom Calendar agenda
===
Hi guys i have been looking for an calendar agenda view with day, week,month views in it. I am trying it with the help of custom gridview right now. Do anybody have done it before and if so i would require your guidance. Thanks in Advance. Looking for better response. | 1 | [
2,
13005,
5816,
7036,
11277,
800,
3726,
3726,
4148,
2776,
31,
57,
74,
699,
26,
40,
7036,
11277,
1418,
29,
208,
15,
877,
15,
6444,
4146,
19,
32,
9,
31,
589,
749,
32,
29,
14,
448,
16,
5816,
7354,
4725,
193,
130,
9,
107,
11181,
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... |
Binding ASP.NET GridView to an Oracle SYS_REFCURSOR
===
We have a Procedure in Oracle with a SYS_REFCURSOR output parameter that returns the data we want to bind to an ASP.NET GridView control. I've seen this done before but I can't find the original reference I used to solve the problem.
Here is what the procedure looks like:
create or replace PROCEDURE GETSOMEDATA
(
P_Data OUT SYS_REFCURSOR
)
AS
BEGIN
OPEN P_Data FOR SELECT * FROM SOMETABLE;
END GETSOMEDATA;
And for now the GridView is just bare-bones:
<asp:GridView ID="grdData" runat="server" AutoGenerateColumns="true"></asp:GridView> | 0 | [
2,
8728,
28,
306,
9,
2328,
7354,
4725,
20,
40,
15759,
10315,
18,
1,
14057,
4734,
18,
248,
800,
3726,
3726,
95,
57,
21,
7004,
19,
15759,
29,
21,
10315,
18,
1,
14057,
4734,
18,
248,
5196,
18906,
30,
4815,
14,
1054,
95,
259,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What unicode-friendly text editor would you recommend for Windows?
===
I work on a lot of Asian Language localization projects, and am looking for a powerful text editor with the following features:
1) Unicode support
2) Find in Files
3) Replace in Files
4) Regular expressions
5) Multiline find/replace
6) Built-in diff
I am currently using NotePad++, but it doesn't really support unicode in its find-in-files tool, which is a deal-breaker. EmEditor looks promising, but it doesn't have multi-line find/replace.
Anyone working with Chinese, Japanese, or Korean files have a text editor that they like, free or commercial? | 0 | [
2,
98,
28010,
8,
15950,
1854,
1835,
83,
42,
12360,
26,
1936,
60,
800,
3726,
3726,
31,
170,
27,
21,
865,
16,
2282,
816,
375,
1829,
2314,
15,
17,
589,
699,
26,
21,
2177,
1854,
1835,
29,
14,
249,
967,
45,
137,
6,
28010,
555,
172,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to implement BaseValidator and IValidator in custom control - ASP.Net
===
I have a custom control that implements IValidator, but I also want to have a property for ValidationGroup. From research, it appears I need to inherit from BaseValidator to do so. Can anybody provide a successfull example from a ASP.Net custom control that implements both BaseValidator and IValidator? | 0 | [
2,
184,
20,
8713,
1000,
18506,
43,
3457,
17,
31,
18506,
43,
3457,
19,
5816,
569,
13,
8,
28,
306,
9,
2328,
800,
3726,
3726,
31,
57,
21,
5816,
569,
30,
8713,
18,
31,
18506,
43,
3457,
15,
47,
31,
67,
259,
20,
57,
21,
1354,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript Array.sort implementation?
===
Which algorithm does the JavaScript Array.sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which algorithm the vanilla sort uses. | 0 | [
2,
8247,
8741,
7718,
9,
22843,
6123,
60,
800,
3726,
3726,
56,
9083,
630,
14,
8247,
8741,
7718,
9,
22843,
5,
6,
1990,
275,
60,
31,
1369,
30,
32,
92,
247,
65,
3832,
16,
10553,
17,
3719,
20,
2985,
421,
8623,
16,
14357,
15,
31,
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,
0,
0,
0,
0,
0,
0... |
Default parameters to actions with Django
===
Is there a way to have a default parameter passed to a action in the case where the regex didnt match anything using django?
<pre><code>
urlpatterns = patterns('',(r'^test/(?P<name>.*)?$','myview.displayName'))
#myview.py
def displayName(request,name):
# write name to response or something
</code></pre>
I have tried setting the third parameter in the urlpatterns to a dictionary containing ' and giving the name parameter a default value on the method, none of which worked. the name parameter always seems to be None. I really dont want to code a check for None if i could set a default value.
Any ideas? | 0 | [
2,
12838,
12905,
20,
3078,
29,
3857,
14541,
800,
3726,
3726,
25,
80,
21,
161,
20,
57,
21,
12838,
18906,
1100,
20,
21,
1028,
19,
14,
610,
113,
14,
7953,
1706,
1182,
730,
602,
568,
3857,
14541,
60,
13,
1,
3515,
1,
9375,
1,
287,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.