unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Is there a Windows Forms native way to flash a form's title bar?
===
Is there a correct way in Windows Forms to flash a titlebar without having to drop to P/Invoking FlashWindow?
I'm using .NET 2.0 for compatibility and size reasons, so maybe I just missed the method because it's in newer versions of the .NET framework. | 0 | [
2,
25,
80,
21,
1936,
1997,
1275,
161,
20,
4433,
21,
505,
22,
18,
581,
748,
60,
800,
3726,
3726,
25,
80,
21,
4456,
161,
19,
1936,
1997,
20,
4433,
21,
581,
1850,
366,
452,
20,
2804,
20,
351,
118,
108,
2625,
1581,
4433,
27508,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I choose a multicast address for my application's use?
===
How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications.
* Packets will be entirely contained within an administrative domain, probably a LAN
* If several independent instances of my application are in use on the same network, they could each use their own multicast address - but if they don't, they will be able to coexist anyway, they'll just have a small amount of overhead ignoring each others' packets.
* My packets already contain a "magic number" to avoid problems
* I will be checking the originator address (which I know can be spoofed of course), TTL and other things to try to prevent unexpected packets mucking things up.
Ideas please :)
Currently I've just allocated an arbitrary one from the "local use" space, 239.255.42.99 | 0 | [
2,
184,
107,
31,
3538,
21,
1889,
6146,
3218,
26,
51,
3010,
22,
18,
275,
60,
800,
3726,
3726,
184,
378,
31,
3538,
40,
31,
10166,
300,
1889,
6146,
3218,
26,
51,
3010,
22,
18,
275,
60,
31,
123,
376,
91,
119,
53,
13,
5,
58,
979,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: Select concrete classes using config file
===
*(This question specifically in C#, but applies generally to .NET)*
I have a largish application that has a fairly good design, and is broken into major sections over interfaces (this was done to assist parallel development).
We now have a primary set of concrete classes that implement the required interfaces, but we also have additional sets of concrete classes for alternative situations and testing.
At the moment we pull all these classes together at the top level in code:
IMyInterface xComponent = new ConcreteXComponent1();
If I want to swap out components then I only have to change that line and recompile:
// IMyInterface xComponent = new ConcreteXComponent1();
IMyInterface xComponent = new ConcreteXComponentAlternative();
That works great, but obviously requires a recompile -- I'd rather the concrete class was chosen using a value from a config file.
What's the standard pattern for changing concrete classes using a configuration file? Is there standard library I can use that solves this problem for me?
Thanks! | 0 | [
2,
13,
9,
2328,
45,
5407,
4105,
2684,
568,
13,
14093,
2816,
3893,
800,
3726,
3726,
1637,
5,
1565,
1301,
3524,
19,
272,
5910,
15,
47,
13169,
1469,
20,
13,
9,
2328,
6,
2483,
31,
57,
21,
7841,
263,
1595,
3010,
30,
63,
21,
6647,
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... |
Can I do SQL Server 2005 merge replication through an SSH tunnel?
===
Our usage case is a database responsible for accounts, sessions, licenses, etc. — it needs to be polled upon client startup, so high reliability is crucial. As such, we'd like to replicate across different servers in physically separate networks, just in case an entire datacenter happens to go down. I have successfully set up a push subscription to another server in the same network, so this generally works. It's the connection to servers *outside* the network that I need to get working now.
Replication doesn't work directly across networks. Microsoft [suggests either a VPN or web replication][1]. The latter strikes me as inefficient (and they do say "Note: Web synchronization is designed for synchronizing data with portable computers, handheld devices, and other clients. Web synchronization is not intended for high-volume server-to-server applications.")
The former, a VPN, would work, but I still consider it a needlessly complex solution (not to mention the added potential for security issues) to continuously run a VPN connection. **I'd much rather just run an SSH tunnel.** Yet, I can't find any article that explains how to do this and isn't about MySQL.
I've got an SSH server set up on the subscriber, and have used PuTTY to establish a tunnel from `<publisher>:1434` to `<subscriber>:1433`. I cannot, however, get SQL Server Management Studio to connect this way (I'm not sure it supports the `:` port syntax). I've also set up an alias on `<publisher>`'s SQL Server Configuration Manager, with `@@servername` of `<subscriber>`, pointing to `localhost:1434`. Connecting to that doesn't appear to work either.
I used the push subscription option, so I figure the publisher needs to connect to the subscriber, not the other way 'round.
Both servers use the default instance, and run SQL Server 2005 SP 2 on Windows Server 2003 SP 2. The SSH server on the subscriber is freeSSHd 1.2.1.
Is this possible at all? Is there another way I can leverage SSH to pretend the machine exists within the same network? Or do I have to go with a VPN?
[1]: http://msdn.microsoft.com/en-us/library/ms151319(SQL.90).aspx | 0 | [
2,
92,
31,
107,
4444,
255,
8128,
812,
12666,
23841,
120,
40,
13,
18,
1635,
3485,
60,
800,
3726,
3726,
318,
7514,
610,
25,
21,
6018,
1864,
26,
5310,
15,
5763,
15,
3962,
18,
15,
2722,
9,
13,
1,
32,
2274,
20,
44,
4994,
69,
685,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET MVC - Including JS file
===
I am playing around with MVC and have started setting up an existing site we have built in standard .Net Forms.
I am only including a JS file and as all the requests are being routed via .Net it is trying to compile it.
It is the standard compilation error you would see with invalid c#:
CS1012: Too many characters in character literal
How do you prevent client assets being compiled?
Many thanks | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
13,
8,
215,
487,
18,
3893,
800,
3726,
3726,
31,
589,
791,
140,
29,
307,
8990,
17,
57,
373,
2697,
71,
40,
3149,
689,
95,
57,
392,
19,
1236,
13,
9,
2328,
1997,
9,
31,
589,
104,
215,
21,
487,
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... |
Simple .NET webcam library
===
Is there a simple library for .NET that has a simply API that let's you do something like;
// pseudo-code
List<Webcam> cams = Webcam.GetAll();
Image i = cams[0].GrabImage();
I've looked at DirectShow and WIA, both seem to be much more complicated than this. I've also looked at [this CodeProject project][1], but it really is much more complicated than what I need.
The library should support image grabbing and video grabbing, and preferably live streaming of video.
[1]: http://www.codeproject.com/KB/directx/directshownet.aspx | 0 | [
2,
1935,
13,
9,
2328,
2741,
8760,
1248,
800,
3726,
3726,
25,
80,
21,
1935,
1248,
26,
13,
9,
2328,
30,
63,
21,
1659,
21,
2159,
30,
408,
22,
18,
42,
107,
301,
101,
73,
12894,
8452,
8,
9375,
968,
1,
14113,
8760,
1,
5373,
18,
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... |
Manual vs. Automatic Memory Management
===
Do you prefer `malloc` and `free` / `new`, `delete`, etc... or do you prefer your language to have garbage collection? Why and why not? Do you have any proof besides your own reasoning about why your method is better?
| 0 | [
2,
5132,
4611,
9,
6715,
1912,
1097,
800,
3726,
3726,
107,
42,
6369,
13,
1,
3482,
10799,
1,
17,
13,
1,
4639,
1,
13,
118,
13,
1,
2681,
1,
15,
13,
1,
24249,
591,
1,
15,
2722,
9,
9,
9,
54,
107,
42,
6369,
154,
816,
20,
57,
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... |
Convert PHP Function to JavaScript
===
<?php
function toconv(string)
{
$gogo = array(
"a" => "b","cd" => "e");
$string = str_replace( array_keys( $gogo ),
array_values( $gogo ),
$string);
return $string;
}
?>
How can I implement that in JavaScript? | 0 | [
2,
8406,
13,
26120,
1990,
20,
8247,
8741,
800,
3726,
3726,
13,
1,
60,
26120,
1990,
20,
1126,
710,
5,
11130,
6,
13,
1,
5579,
839,
839,
800,
7718,
5,
13,
7,
58,
7,
800,
1,
13,
7,
220,
7,
15,
7,
6324,
7,
800,
1,
13,
7,
62,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 garbage collection coexist with explicit memory management?
===
For example, say one was to include a 'delete' keyword in C# 4. Would it be possible to guarantee that you'd never have wild pointers, but still be able to rely on the garbage collecter, due to the reference-based system?
The only way I could see it possibly happening is if instead of references to memory locations, a reference would be an index to a table of pointers to actual objects. However, I'm sure that there'd be some condition where that would break, and it'd be possible to break type safety/have dangling pointers. | 0 | [
2,
92,
15024,
1206,
326,
1706,
702,
29,
14990,
1912,
1097,
60,
800,
3726,
3726,
26,
823,
15,
395,
53,
23,
20,
468,
21,
13,
22,
24249,
591,
22,
1246,
9587,
19,
272,
5910,
268,
9,
83,
32,
44,
938,
20,
9120,
30,
42,
22,
43,
243... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the most questionable bug report you ever received from QA?
===
Once in a while you get a bug report, usually from someone new in QA who may not fully understand the product yet, that makes you raise an eyebrow.
I'll start off with one which my team (both dev & QA) still laugh about years after it happened.
The product I was working on had a toolbar with a set of buttons which toggled certain aspects of the app's state. I got a bug report which stated that "when you push button [x], it gets stuck. you have to push it again to get it unstuck." | 0 | [
2,
98,
25,
14,
127,
23436,
6256,
1330,
42,
462,
420,
37,
7234,
60,
800,
3726,
3726,
382,
19,
21,
133,
42,
164,
21,
6256,
1330,
15,
951,
37,
737,
78,
19,
7234,
72,
123,
52,
2337,
1369,
14,
2374,
768,
15,
30,
1364,
42,
3972,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which is the best way to compare the integer part of two non-integer numbers?
===
I need to compare the integer part of two doubles for inequality and I'm currently doing this:
int iA = (int)dA;
int iB = (int)dB;
if( iA != iB )
{
...
}
but I wonder if there's a better approach than this.
Thanks. | 0 | [
2,
56,
25,
14,
246,
161,
20,
11590,
14,
13820,
141,
16,
81,
538,
8,
6391,
13699,
2116,
60,
800,
3726,
3726,
31,
376,
20,
11590,
14,
13820,
141,
16,
81,
7784,
26,
18340,
17,
31,
22,
79,
871,
845,
48,
45,
19,
38,
13,
549,
800,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Am I Retarded or Does C++ Suck At Maths? (Factorial Question)
===
So, simple procedure, calculate a factorial number. Code is as follows.
int calcFactorial(int num)
{
int total = 1;
if (num == 0)
{
return 0;
}
for (num; num > 0; num--)
{
total *= num;
}
return total;
}
Now, this works fine and dandy (There are certainly quicker and more elegant solutions, but this works for me) for most numbers. However when inputting larger numbers such as 250 it, to put it bluntly, craps out. Now, the first couple factorial "bits" for 250 are { 250, 62250, 15126750, 15438000, 3813186000 } for reference.
My code spits out { 250, 62250, 15126750, 15438000, **-481781296** } which is obviously, uh, off. My first suspicion was perhaps that I had breached the limit of a 32 bit integer, but given that 2^32 is 4294967296 I don't think so. The only thing I can think of is perhaps that it breaches a **signed** 23-bit limit, but shouldn't it be able to think about this sort of thing? If being signed is the problem I can solve this by making the integer unsigned but this would only be a temporary solution, as the next iteration yields 938043756000 which is far above the 4294967296 limit.
So, is my problem the signed limit? If so, what can I do to calculate large numbers (Though I've a "LargeInteger" class I made a while ago that may be suited!) without coming across this problem again? | 0 | [
2,
589,
31,
302,
15299,
69,
54,
630,
272,
20512,
8466,
35,
5057,
18,
60,
13,
5,
17455,
2815,
1301,
6,
800,
3726,
3726,
86,
15,
1935,
7004,
15,
18469,
21,
3932,
2815,
234,
9,
1797,
25,
28,
2415,
9,
19,
38,
13,
16304,
17455,
281... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 library or asp.net application for Amazon S3
===
I want to have a web based admin to upload, delete files and folders in Amazon S3 on ASP.NET website. <br/>
I am pretty sure something like this already exist, has anyone seen it? | 0 | [
2,
13,
9,
2328,
1248,
54,
28,
306,
9,
2328,
3010,
26,
8059,
13,
18,
240,
800,
3726,
3726,
31,
259,
20,
57,
21,
2741,
432,
21,
43,
2160,
20,
71,
8294,
15,
27448,
6488,
17,
19294,
18,
19,
8059,
13,
18,
240,
27,
28,
306,
9,
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... |
Documentation - writing style
===
I am currently documenting our development process, and more importantly the reasons *why* we do it a particular way. I am planning to write in the style that I used during my (physics) degree, and which is common in many mathematics and physics textbooks, which is along the following lines:
"Therefore, we now see that X is Y, because of Z"
"We can state that F(x)..."
This style is very natural to me, but it has raised some discussion and I would like to know whether there is theoretical basis to the way I plan to write. The name of the style, if it has one, and/or a link to a Wikipedia page should be enough to silence the doubters!
Thanks in advance. | 0 | [
2,
13945,
13,
8,
1174,
1034,
800,
3726,
3726,
31,
589,
871,
4492,
68,
318,
522,
953,
15,
17,
91,
16922,
14,
2932,
1637,
2256,
2483,
95,
107,
32,
21,
1498,
161,
9,
31,
589,
2334,
20,
2757,
19,
14,
1034,
30,
31,
147,
112,
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... |
ASP.Net MVC - handling bad URL parameters
===
What's the best way to handle a visitor constructing their own URL and replacing what we expect to be an ID with anything they like?
For example:
[http://stackoverflow.com/questions/236349][1]
But the user could just as easily replace the URL with:
[http://stackoverflow.com/questions/foo][2]
I've thought of making every Controller Function parameter a `String`, and using `Integer.TryParse()` on them - if that passes then I have an ID and can continue, otherwise I can redirect the user to an Unknown / not-found or index View.
Stack Overflow handles it nicely, and I'd like to too - how do you do it, or what would you suggest?
[1]: http://stackoverflow.com/questions/236349
[2]: http://stackoverflow.com/questions/foo | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
13,
8,
7988,
896,
287,
6362,
12905,
800,
3726,
3726,
98,
22,
18,
14,
246,
161,
20,
3053,
21,
10875,
18660,
66,
258,
287,
6362,
17,
5496,
98,
95,
4186,
20,
44,
40,
4924,
29,
602,
59,
101,
60,
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... |
Developing applications for Nokia 5310
===
If developing an application for use with a Nokia 5310 - what is the best approach to capturing text input in the native SMS composer? Is this at all possible? Are there work-arounds? Is it possible to override native functions?
Thanks, | 0 | [
2,
3561,
3767,
26,
24294,
6207,
1036,
800,
3726,
3726,
100,
3561,
40,
3010,
26,
275,
29,
21,
24294,
6207,
1036,
13,
8,
98,
25,
14,
246,
2141,
20,
12859,
1854,
6367,
19,
14,
1275,
7613,
18,
3039,
60,
25,
48,
35,
65,
938,
60,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is your convention to distinguish between object methods to be called by the outside, and object methods to be called by a subclass ?
===
I know most of the ins and outs of Python's approach to private variables/members/functions/...
However, I can't make my mind up on how to distinguish between methods for external use or subclassing use.
Consider the following example:
class EventMixin(object):
def subscribe(self, **kwargs):
'''kwargs should be a dict of event -> callable, to be specialized in the subclass'''
def event(self, name, *args, **kwargs):
...
def _somePrivateMethod(self):
...
In this example, I want to make it clear that subscribe is a method to be used by external users of the class/object, while event is a method that should not be called from the outside, but rather by subclass implementations.
Right now, I consider both part of the public API, hence don't use any underscores. However, for this particular situation, it would feel cleaner to, for example, use no underscores for the external API, one underscore for the subclassable API, and two underscores for the private/internal API. However, that would become unwieldy because then the internal API would need to be invoked as
self._EventMixin__somePrivateMethod()
So, what are your conventions, coding-wise, documentationwise, or otherwise ?
| 0 | [
2,
98,
25,
154,
3087,
20,
9705,
128,
3095,
3195,
20,
44,
227,
34,
14,
719,
15,
17,
3095,
3195,
20,
44,
227,
34,
21,
972,
1898,
13,
60,
800,
3726,
3726,
31,
143,
127,
16,
14,
19,
18,
17,
70,
18,
16,
20059,
22,
18,
2141,
20,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to provide a Session/Host object for use in both a windows and web application?
===
I have a web application that makes heavy use of the Session state to store information about the current user, their personal settings, record their session history and so on.
I have found myself retrieving this session information in my business layer, like so:
((UserSession)HttpContext.Current.Session["UserSession"]).User.Info
This poses a problem - at some point in the future my application will have a Windows client which obviously cannot reference the web Session state. So I need a host or customized session class that I can reference in my business layer that is agnostic of whether the application is running on the web or desktop. Something like:
IHost.User.Info
Behind the scenes, the web implementation will obviously utilize the Session state to store information, but I need to hide this away from my business layer. Has anyone solved this problem or got any practival advice on how best to approach this?
Help appreciated. | 0 | [
2,
184,
20,
1181,
21,
3723,
118,
11694,
3095,
26,
275,
19,
156,
21,
1936,
17,
2741,
3010,
60,
800,
3726,
3726,
31,
57,
21,
2741,
3010,
30,
1364,
1278,
275,
16,
14,
3723,
146,
20,
1718,
676,
88,
14,
866,
4155,
15,
66,
1319,
124... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 override the Icon for iphone apps?
===
I remember reading somewhere that you can provide your own icons without having them pass them through the automatic gloss effect when compiling an iphone app, but I can't remember how to do it, and not sure where it was in the docs. Anyone here remembers?
thanks! | 0 | [
2,
184,
107,
42,
84,
11891,
14,
9801,
26,
21024,
4865,
18,
60,
800,
3726,
3726,
31,
1518,
1876,
3493,
30,
42,
92,
1181,
154,
258,
9801,
18,
366,
452,
105,
1477,
105,
120,
14,
6715,
13,
12456,
1590,
76,
24378,
40,
21024,
4865,
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... |
Integrating POP3 client functionality into a C# application?
===
I have a web application that requires a server based component to periodically access POP3 email boxes and retrieve emails. The service then needs to process the emails which will invlove:
- Validating the email against some business rules (does it contain a valid reference in the subject line, which user sent the mail etc)
- Analysing and saving any attachments to disk
- Take the email body and attachment details and create a new work item in the database
- Or update an existing work item where the reference matches the incoming email subject line
What is the best way to approach this? I really dont want to have to write a POP3 client from scratch, but I need to be able to customize the processing of emails. Ideally I would be able to plug in some component that does the access and retrieval for me, returning arrays of attachments, body text, subject line etc ready for my processing...
Advice much appreciated.
| 0 | [
2,
24529,
1675,
240,
6819,
18548,
77,
21,
272,
5910,
3010,
60,
800,
3726,
3726,
31,
57,
21,
2741,
3010,
30,
4781,
21,
8128,
432,
5912,
20,
19886,
1381,
1675,
240,
8517,
8120,
17,
11917,
8517,
18,
9,
14,
365,
94,
2274,
20,
953,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the best way to have stringTokenizer split up a line of text into predefined variables
===
I'm not sure if the title is very clear, but basically what I have to do is read a line of text from a file and split it up into 8 different string variables. Each line will have the same 8 chunks in the same order (title, author, price, etc). So for each line of text, I want to end up with 8 strings.
The first problem is that the last two fields in the line may or may not be present, so I need to do something with stringTokenizer.hasMoreTokens, otherwise it will die messily when fields 7 and 8 are not present.
I would ideally like to do it in one while of for loop, but I'm not sure how to tell that loop what the order of the fields is going to be so it can fill all 8 (or 6) strings correctly. Please tell me there's a better way that using 8 nested if statements! | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
57,
3724,
262,
2853,
11907,
2132,
71,
21,
293,
16,
1854,
77,
782,
13439,
12157,
800,
3726,
3726,
31,
22,
79,
52,
562,
100,
14,
581,
25,
253,
1207,
15,
47,
11374,
98,
31,
57,
20,
107,
25,
1302... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 advantages does C++ have over other languages for Qt development?
===
As well-known, C++ has steeper learning curve than most of the mainstream languages, which results in better performance . But, does using C++ over other languages[like Java,Ruby,Python] for Qt development have still (major) advantages,let's say about Qtopia? If any, what are they? | 0 | [
2,
98,
14683,
630,
272,
20512,
57,
84,
89,
2556,
26,
2593,
38,
522,
60,
800,
3726,
3726,
28,
134,
8,
2929,
15,
272,
20512,
63,
7358,
106,
2477,
7101,
119,
127,
16,
14,
7469,
2556,
15,
56,
1736,
19,
574,
956,
13,
9,
47,
15,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Any Smalltalk on .NET?
===
Are there any usable implementations of Smalltalk for the .NET runtime? | 0 | [
2,
186,
284,
9718,
27,
13,
9,
2328,
60,
800,
3726,
3726,
50,
80,
186,
182,
579,
6123,
18,
16,
284,
9718,
26,
14,
13,
9,
2328,
485,
891,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
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... |
Python for large scale developmen
===
I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
- When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?
- When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?
- How do you handle/prevent typing errors (typos)?
- Are UnitTest's used as a substitute for static type checking?
As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed.
| 0 | [
2,
20059,
26,
370,
3464,
2803,
755,
800,
3726,
3726,
31,
83,
44,
3158,
20,
2484,
88,
370,
3464,
522,
19,
20059,
17,
1118,
19,
184,
107,
42,
4027,
21,
370,
1797,
1000,
60,
13,
8,
76,
42,
233,
19,
21618,
1693,
20,
14,
7810,
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... |
Connection string hell in .NET / LINQ-SQL / ASP.NET
===
I have a web application that comprises the following:
- A web project (with a web.config file containing a connection string - but no data access code in the web project)
- A data access project that uses LINQ-SQL classes to provide entities to the web project UI (this project has a settings file and an app.config - both of which have connection strings)
When I build and deploy, there is no settings file or app.config in the Bin directory with the data access .dll, but changing the connection string in the web.config file doesn't change the database accordingly - so the connection string must be compiled into the data access dll.
What I need is one config file for my entire deployment - website, data access dlls, everything - that has one connection string which gets used. At the moment there appear to be multiple connection strings getting used or hardcoded all over the place.
How do I best resolve this mess?
Thanks for any help. | 0 | [
2,
2760,
3724,
1094,
19,
13,
9,
2328,
13,
118,
6294,
1251,
8,
18,
22402,
13,
118,
28,
306,
9,
2328,
800,
3726,
3726,
31,
57,
21,
2741,
3010,
30,
8595,
14,
249,
45,
13,
8,
21,
2741,
669,
13,
5,
1410,
21,
2741,
9,
14093,
2816,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 compression algorithm that allows random reads/writes in a file?
===
What is the best compression algorithm that allows random reads/writes in a file?
I know that any adaptive compression algorithms would be out of the question.
And I know huffman encoding would be one solution. But does anyone have a better compression algorithm that would allow random reads/writes?
I think you could use any compression algorithm if you write it in blocks, but ideally I would not like to have to decompress a whole block at a time. But if you have suggestions on an easy way to do this and how to know the block boundaries, please let me know. If this is part of your solution, please also let me know what you do when the data you want to read is across a block boundary?
In the context of your answers please assume the file in question is 100GB, and sometimes I'll want to read the first 10 bytes, and sometimes I'll want to read the last 19 bytes, and sometimes I'll want to read 17 bytes in the middle. . | 0 | [
2,
98,
25,
14,
246,
14864,
9083,
30,
2965,
5477,
11137,
118,
23716,
18,
19,
21,
3893,
60,
800,
3726,
3726,
98,
25,
14,
246,
14864,
9083,
30,
2965,
5477,
11137,
118,
23716,
18,
19,
21,
3893,
60,
31,
143,
30,
186,
22142,
14864,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's a good way to train employees on how to use the software you've just created?
===
I'm working in a small company and weeks away from deploying a web-app that will be used a lot. Everyone at one location will have to learn to use it, and although I think it's pretty easy and intuitive I may be biased.
I've written a help guide with plenty of screenshots that's available on every page, but I'll still need to train everyone. What's the best way? How do you take a step back and explain code you've been working on for weeks? | 0 | [
2,
98,
22,
18,
21,
254,
161,
20,
1528,
3716,
27,
184,
20,
275,
14,
2306,
42,
22,
195,
114,
679,
60,
800,
3726,
3726,
31,
22,
79,
638,
19,
21,
284,
237,
17,
1342,
229,
37,
17617,
68,
21,
2741,
8,
7753,
30,
129,
44,
147,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it correct to compare two truncated floating point numbers using the == operator?
===
¿Or is there a chance that the operation will fail?
Thanks. | 0 | [
2,
25,
32,
4456,
20,
11590,
81,
22328,
69,
8319,
454,
2116,
568,
14,
800,
3726,
6022,
60,
800,
3726,
3726,
13,
1,
248,
25,
80,
21,
1504,
30,
14,
1453,
129,
7476,
60,
3669,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
What is the current state of text-only compression?
===
In honor of the [Hutter Prize][1],
what are the top algorithms (and a quick description of each) for text compression?
[1]: http://prize.hutter1.net/ | 0 | [
2,
98,
25,
14,
866,
146,
16,
1854,
8,
4965,
14864,
60,
800,
3726,
3726,
19,
1853,
16,
14,
636,
252,
13274,
1507,
500,
2558,
165,
500,
15,
98,
50,
14,
371,
15935,
13,
5,
290,
21,
2231,
5318,
16,
206,
6,
26,
1854,
14864,
60,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
rhino-mocks - good sample apps
===
I know that there has been a couple questions about tutorials on rhino-mocks. But I am wondering if there are any sample apps out there that use rhino-mocks in the context of an n-tier business application using ado.net.
I find the tutes good, but they don't seem to bring everything all together into the big picture. Thus, I am looking for a sample app that brings the full picture together.
Also, I think there is a little bit of a lack of examples which specifically deal with mocking and testing the logic in the data access layer.
Cheers
Anthony | 0 | [
2,
18642,
8,
79,
5668,
18,
13,
8,
254,
5717,
4865,
18,
800,
3726,
3726,
31,
143,
30,
80,
63,
74,
21,
1335,
2346,
88,
29724,
18,
27,
18642,
8,
79,
5668,
18,
9,
47,
31,
589,
5712,
100,
80,
50,
186,
5717,
4865,
18,
70,
80,
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... |
In PHP, how do I send a control character down a socket?
===
In a PHP script I am writing, I need to send a control+z character down a network socket I have previously created. I understand the ctrl+z character to be chr(26), so at the end of the string I am sending I have added a new line (\r\n) and then the chr(26) as follows:
$socket=fsockopen($host['host'],$host['port']);
fputs($socket, "I am a message\r\n" . chr(26));
fclose($socket);
Sadly, this isn't sending a Ctrl+Z, as I'd hoped it would.
Regards,
Jon | 0 | [
2,
19,
13,
26120,
15,
184,
107,
31,
2660,
21,
569,
925,
125,
21,
18482,
60,
800,
3726,
3726,
19,
21,
13,
26120,
3884,
31,
589,
1174,
15,
31,
376,
20,
2660,
21,
569,
2430,
380,
925,
125,
21,
982,
18482,
31,
57,
1343,
679,
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 handle a reentrant validation event when showing dialog
===
I'm wondering how people handle a situation like this, when you have a validation event, and you need to show the user a dialog box asking him whether to continue or cancel.
The problem is that when showing that dialog box, it causes another validation event because it's considered losing focus on the control again, and you end up with an infinite loop of dialog popups.
I can't show the message box before or after the validation event either, because either the user hasn't finished editing the control, or the value has been already committed and rolling back would cause problems of its own.
What I'm doing right now is setting a flag before showing the dialog and clearing it afterward, and then in the validation event function, check if the flag is set and if it is, skip the function. It works but is cumbersome and prone to programmer errors.
Is there some easier way to handle something like that ? | 0 | [
2,
184,
20,
3053,
21,
302,
2291,
7874,
27999,
807,
76,
3187,
28223,
800,
3726,
3726,
31,
22,
79,
5712,
184,
148,
3053,
21,
1858,
101,
48,
15,
76,
42,
57,
21,
27999,
807,
15,
17,
42,
376,
20,
298,
14,
4155,
21,
28223,
1649,
337... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where I can download sample database which can be used as data warehouse?
===
Where I can download sample database which can be used for data warehouse creation? It should't be sample from Microsoft (Northwind etc.).
Thanks in advance | 0 | [
2,
113,
31,
92,
7121,
5717,
6018,
56,
92,
44,
147,
28,
1054,
8308,
60,
800,
3726,
3726,
113,
31,
92,
7121,
5717,
6018,
56,
92,
44,
147,
26,
1054,
8308,
2502,
60,
32,
378,
22,
38,
44,
5717,
37,
7099,
13,
5,
7946,
7809,
2722,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Why do software engineers hate writing documentation?
===
I ask because I quite enjoy it! I'm talking about design documentation and implentation notes, which are non-existent in most of the codebases I've been handed. I can understand why a developer wouldn't want to write requirements (that's the analyst's job) or the user documentation (that's a technical writer's job) but I don't get why developers hate writing design docs.
I don't think I would feel as if I'd finished the job if I only wrote the code and walked away -- mainly because when I've been introduced to code-only situations I've seen how hard it is to figure out what's been done and what the software does. I would hate for people to suffer the same situation when inheriting my code.
What makes you loath writing supporting documentation for your code? | 4 | [
2,
483,
107,
2306,
5379,
3223,
1174,
13945,
60,
800,
3726,
3726,
31,
1349,
185,
31,
1450,
4696,
32,
187,
31,
22,
79,
1582,
88,
704,
13945,
17,
5420,
13465,
857,
2434,
15,
56,
50,
538,
8,
20788,
19,
127,
16,
14,
1797,
8436,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are the arguments IN FAVOR of PHP closing tags for PHP only files?
===
The Zend Framework coding standard mentions the following:
<blockquote>
For files that contain only PHP code, the closing tag ("?>") is never permitted. It is not required by PHP, and omitting it prevents the accidental injection of trailing whitespace into the response.
</blockquote>
- <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html">Zend Framework coding standard: file formatting</a>
However I do remember hearing about an issue (with tooling or including maybe?) where files needed to have closing tag.
Does anyone know of any issues (other than the developer issue of wanting symmetry) where you would need to have closing tags or are they generally a bad idea? | 0 | [
2,
98,
50,
14,
10553,
19,
3654,
16,
13,
26120,
4239,
3383,
18,
26,
13,
26120,
104,
6488,
60,
800,
3726,
3726,
14,
10526,
43,
6596,
13,
15458,
1236,
10292,
14,
249,
45,
13,
1,
12048,
8970,
591,
1,
26,
6488,
30,
3717,
104,
13,
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... |
Compression XML metrics . .
===
I have a client server application that sends XML over TCP/IP from client to server and then broadcast out to other clients. How do i know at what the minimun size of the XML that would warrant a performance improvement by compression the XML rather than sending over the regular stream.
Are there any good metrics on this or examples? | 0 | [
2,
14864,
23504,
11544,
18,
13,
9,
13,
9,
800,
3726,
3726,
31,
57,
21,
6819,
8128,
3010,
30,
11350,
23504,
84,
13,
38,
7439,
118,
4307,
37,
6819,
20,
8128,
17,
94,
1992,
70,
20,
89,
7421,
9,
184,
107,
31,
143,
35,
98,
14,
42... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I make Visual Studio wrap lines at 80 characters?
===
Is there any way to make Visual Studio word-wrap at 80 characters? I'm using VS2008.
[This post is loosely related.][1]
[1]: http://stackoverflow.com/questions/84209/vertical-line-after-a-certain-amount-characters-in-visual-studio | 0 | [
2,
184,
92,
31,
233,
3458,
1120,
8118,
1560,
35,
2972,
1766,
60,
800,
3726,
3726,
25,
80,
186,
161,
20,
233,
3458,
1120,
833,
8,
499,
10817,
35,
2972,
1766,
60,
31,
22,
79,
568,
4611,
2753,
9,
636,
1565,
678,
25,
13166,
1597,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 the typical get set properties in C#... with parameters
===
I'd like to do the same in C#. Is there anyway of using properties in C# with parameters in the same way I've done with the parameter 'Key' in this VB.NET example?
> Private Shared m_Dictionary As IDictionary(Of String, Object) = New Dictionary(Of String, Object)
Public Shared Property DictionaryElement(ByVal Key As String) As Object
Get
If m_Dictionary.ContainsKey(Key) Then
Return m_Dictionary(Key)
Else
Return [String].Empty
End If
End Get
Set(ByVal value As Object)
If m_Dictionary.ContainsKey(Key) Then
m_Dictionary(Key) = value
Else
m_Dictionary.Add(Key, value)
End If
End Set
End Property
Thanks
| 0 | [
2,
568,
14,
3874,
164,
309,
3704,
19,
272,
5910,
9,
9,
9,
29,
12905,
800,
3726,
3726,
31,
22,
43,
101,
20,
107,
14,
205,
19,
272,
5910,
9,
25,
80,
2774,
16,
568,
3704,
19,
272,
5910,
29,
12905,
19,
14,
205,
161,
31,
22,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you automate copying file with path too deep issues in Windows?
===
I want to be able to copy selectively copy a list of files and preserve their directory structure. The problem is that there are quite a few files that their path exceeds 256 character. How is this problem usually handled? | 0 | [
2,
184,
107,
42,
3108,
5281,
4344,
68,
3893,
29,
2013,
266,
855,
1549,
19,
1936,
60,
800,
3726,
3726,
31,
259,
20,
44,
777,
20,
4344,
14092,
102,
4344,
21,
968,
16,
6488,
17,
6224,
66,
16755,
1411,
9,
14,
1448,
25,
30,
80,
50,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rake and current directory
===
How do I get the directory where the rakefile.rb is located?
I want to use this as my root directory to locate everything off.
Cheers
| 0 | [
2,
21009,
17,
866,
16755,
800,
3726,
3726,
184,
107,
31,
164,
14,
16755,
113,
14,
21009,
16877,
9,
7549,
25,
335,
60,
31,
259,
20,
275,
48,
28,
51,
5900,
16755,
20,
12717,
796,
168,
9,
10497,
18,
3,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Any tool to manage checklists?
===
As a developer, we do various activities everyday each requiring a set of things to take care of or to complete before we can say that the activity is complete. It is impossible to keep all these 'things' in memory and hence we have checklists. There are checklists for things to do before you commit code, things that a code reviewer needs to check, things to do/verify before a shared database is updated, things to check before we send out a build to customer.
Anyone using any software, tool or mechanism (anything formal and not ad-hoc) to maintain ,manage and record all the various checklists that can exist in the day of a developer? | 0 | [
2,
186,
5607,
20,
4705,
2631,
5739,
18,
60,
800,
3726,
3726,
28,
21,
10058,
15,
95,
107,
617,
1648,
10789,
206,
9052,
21,
309,
16,
564,
20,
247,
781,
16,
54,
20,
1279,
115,
95,
92,
395,
30,
14,
2358,
25,
1279,
9,
32,
25,
399... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Compare datatables
===
I built an application which displays the records from database in the window and checks the the database for new records every couple of seconds. The problem is that the window blinks each time I check for new records and I want to fix it. I have tried to compare the old datatable with the new one and refresh only if they are different.
Does anyone know what is the best practice for such cases? I tried to do it the following way but it doesn't work:
private bool GetBelongingMessages()
{
bool result = false;
DataTable dtTemp = OleDbWorks.GetBelongingMessages(currentCallID);
if(dtTemp != dtMessages)
{
dtMessages = dtTemp;
result = true;
}
else
{
result = false;
}
return result;
} | 0 | [
2,
11590,
1054,
5924,
18,
800,
3726,
3726,
31,
392,
40,
3010,
56,
9412,
14,
742,
37,
6018,
19,
14,
1463,
17,
16602,
14,
14,
6018,
26,
78,
742,
352,
1335,
16,
2582,
9,
14,
1448,
25,
30,
14,
1463,
11718,
18,
206,
85,
31,
2631,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linq to Sql - Hierarchical Query to Find Ancestors
===
Given an EmployeeId, how can I construct a Linq to Sql query to find all of the ancestors of the employee? Each EmployeeId has an associated SupervisorId (see below).
**Entity Definition:**
![alt text][1]
**Sample Table Data:**
![alt text][2]
[1]: http://www.planet-gizmo.com/images/temp/stackoverflow/entity.gif
[2]: http://www.planet-gizmo.com/images/temp/stackoverflow/table_data.gif
For example, a query of the ancestors for EmployeeId 6 (Frank Black) should return Jane Doe, Bob Smith, Joe Bloggs, and Head Honcho.
If necessary, I can cache the list of all employees to improve performance.
Thanks.
| 0 | [
2,
6294,
1251,
20,
4444,
255,
13,
8,
21376,
4272,
25597,
20,
477,
11575,
800,
3726,
3726,
504,
40,
7362,
1340,
15,
184,
92,
31,
6960,
21,
6294,
1251,
20,
4444,
255,
25597,
20,
477,
65,
16,
14,
11575,
16,
14,
7362,
60,
206,
7362,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Good rails generatot tutorial?
===
As title, good I mean with detail coverage of m.template, m.class_collisions etc. A paid book or free online resources would be acceptable too. | 0 | [
2,
254,
2240,
18,
11011,
262,
38,
29724,
60,
800,
3726,
3726,
28,
581,
15,
254,
31,
884,
29,
6110,
5245,
16,
307,
9,
9577,
6554,
15,
307,
9,
1898,
1,
20410,
403,
5757,
2722,
9,
21,
2192,
360,
54,
551,
2087,
2566,
83,
44,
12513... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
SVN Update of multiple files
===
How to do svn update of multiple files located across different directories ?
For committing multiple files from different directories, we can put them all up in a text file and give that file as an argument to svn commit and it will happily commit all those files. But <b>update</b> ? | 0 | [
2,
13,
18,
16578,
11100,
16,
1886,
6488,
800,
3726,
3726,
184,
20,
107,
13,
18,
16578,
11100,
16,
1886,
6488,
335,
464,
421,
559,
1596,
13,
60,
26,
19524,
1886,
6488,
37,
421,
559,
1596,
15,
95,
92,
442,
105,
65,
71,
19,
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... |
How to unit test if my object is really serializablable?
===
I am using C# 2.0 with Nunit Test. I have some object that need to be serialized. These object are quite complexe (inheritance at difference level and contain a lot of object, event and delegate).
How can I create Unit Test to be sure that my object is serializable safe? | 0 | [
2,
184,
20,
1237,
1289,
100,
51,
3095,
25,
510,
5956,
10967,
6287,
579,
60,
800,
3726,
3726,
31,
589,
568,
272,
5910,
172,
9,
387,
29,
10210,
242,
1289,
9,
31,
57,
109,
3095,
30,
376,
20,
44,
27877,
9,
158,
3095,
50,
1450,
150... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Are there some statistics on the most frequently used Java API functions?
===
Given a large API (an in particular, the Java or J2EE standard libraries), is there a tool or search engine or other resource that can tells me which methods, classes, or even packages people in general tend to use the most?
I am annotating (see below) APIs and would like to focus my attention on popular areas.
The only thing I can think of is using google code with different method names but that is of course tedious.
Some background (if anyone is interested): As part of my PhD research I've developed a [tool][1] that allows users to highlight important "directives" in method documentation (their own or in existing APIs) and then pushes these annotations to users to increase chances that they become aware of it. Our lab studies show that this has potential, but to get people to use it in the field I have to provide "corpuses" of annotated APIs and I'm trying to prioritize which libraries to annotate.
[1]: http://emoose.cs.cmu.edu | 0 | [
2,
50,
80,
109,
5818,
27,
14,
127,
3086,
147,
8247,
21,
2159,
3719,
60,
800,
3726,
3726,
504,
21,
370,
21,
2159,
13,
5,
210,
19,
1498,
15,
14,
8247,
54,
487,
135,
2851,
1236,
8649,
6,
15,
25,
80,
21,
5607,
54,
2122,
1406,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
[Javascript] How to access HTML element without ID?
===
For instance in the snippet below - how do I access the h1 element knowing the ID of parent element (header-inner div)?
<div id='header-inner'>
<div class='titlewrapper'>
<h1 class='title'>
Some text I want to change
</h1>
</div>
Thanks! | 0 | [
2,
636,
1004,
1385,
8741,
500,
184,
20,
1381,
13,
15895,
4520,
366,
4924,
60,
800,
3726,
3726,
26,
4851,
19,
14,
13,
29061,
1021,
13,
8,
184,
107,
31,
1381,
14,
746,
165,
4520,
2506,
14,
4924,
16,
4766,
4520,
13,
5,
1743,
106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Vector graphics clipboard format for Qt.
===
I want my Qt application to be able to save simple vector graphics to clipboard in a compatible way. On windows I want to be able to paste the graphics into Microsoft Word or Powerpoint. On Linux I want to be compatible with the Open Office.
Which format would you recommend? Can Qt generate EMF in an easy way? Is SVG an option? | 0 | [
2,
7497,
8351,
12229,
2806,
2595,
26,
2593,
38,
9,
800,
3726,
3726,
31,
259,
51,
2593,
38,
3010,
20,
44,
777,
20,
2079,
1935,
7497,
8351,
20,
12229,
2806,
19,
21,
14961,
161,
9,
27,
1936,
31,
259,
20,
44,
777,
20,
640,
62,
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... |
What other languages have features and/or libraries similar to Perl formats?
===
I may be in the minority here, but I very much enjoy [Perl's formats][1]. I especially like being able to wrap a long piece of text within a column ("~~ ^<<<<<<<<<<<<<<<<" type stuff). Are there any other programming languages that have similar features, or libraries that implement similar features? I am especially interested in any libraries that implement something similar for Ruby, but I'm also curious about any other options.
[1]: http://www.perl.com/doc/manual/html/pod/perlform.html | 0 | [
2,
98,
89,
2556,
57,
967,
17,
118,
248,
8649,
835,
20,
416,
255,
13767,
60,
800,
3726,
3726,
31,
123,
44,
19,
14,
6480,
235,
15,
47,
31,
253,
212,
4696,
636,
1432,
255,
22,
18,
13767,
500,
2558,
165,
500,
9,
31,
1118,
101,
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... |
Printing Scrolled Divs
===
I have a web page that displays a long line graph inside a div with overflow-x: scroll.
This works well as a web page allowing the use to scroll back and forward through the graph.
However, when printing the page the scroll position is reset to zero.
Is there a way to overcome this? | 0 | [
2,
7312,
12159,
69,
13,
12916,
18,
800,
3726,
3726,
31,
57,
21,
2741,
2478,
30,
9412,
21,
175,
293,
7210,
572,
21,
13,
12916,
29,
20285,
8,
396,
45,
12159,
9,
48,
693,
134,
28,
21,
2741,
2478,
2719,
14,
275,
20,
12159,
97,
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... |
Most succinct LINQ To SQL for taking COUNT(*) of either side of many-to-many?
===
Please help me with a sanity check. Assuming a many-to-many relationship:
![Post, PostTagAssoc, Tag][1]
[1]: http://www.codingthewheel.com/pics/many_to_many.gif
What's the most succinct way (using LINQ to SQL) to get a result set showing, for **each** tag (or post), the aggregate number of posts (or tags) assigned to it?
Thanks!
| 0 | [
2,
127,
13,
29437,
4812,
6294,
1251,
20,
4444,
255,
26,
741,
2468,
5,
2483,
6,
16,
694,
270,
16,
151,
8,
262,
8,
14842,
60,
800,
3726,
3726,
2247,
448,
55,
29,
21,
22869,
2631,
9,
11704,
21,
151,
8,
262,
8,
14842,
1429,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Connection Strings modification after the deployment
===
I created the setup project for the application and I can see that the later modifications of the configuration file (Application.exe.config) don't affect the application execution.
I am developing an application with the database file included and I want to enable users to move the database file and modify connection strings.
Does anyone know what's the best practice for the deployment of the application with the database file? | 0 | [
2,
2760,
7887,
16135,
75,
14,
10475,
800,
3726,
3726,
31,
679,
14,
18161,
669,
26,
14,
3010,
17,
31,
92,
196,
30,
14,
138,
13922,
16,
14,
8091,
3893,
13,
5,
2552,
20669,
9,
1706,
62,
9,
14093,
2816,
6,
221,
22,
38,
6245,
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... |
timerfd_create with debian linux testing on amd64
===
I am trying to use timerfd\_create and timerfd\_settime under Debian Linux lenny. The manpage says to include `<sys/timerfd.h>`. This file cannot be located on my System. According to the Debian Package Search the only packages with a timerfd.h are the linux-headers-* packets.
I have installed the packets linux-headers-2.6.26-1-amd64 and linux-headers-2.6.26-1-common. I tried including the /lib/modules/2.6.26-1-amd64/build/include/linux/timerfd.h file (and not including `<sys/timerfd.h>`). But then I get the following linker error:
slave.c:(.text+0x166): undefined reference to `timerfd_ceate`
slave.c:(.text+0x1e5): undefined reference to `timerfd_settime`
My build command was gcc -o slave slave.c -L../libs -lcan -lutils -lrt
The can and utils libraries are my own. Non of them use or define one of the timerfd\_\* functions. I tried -lrt because timer\_create and timer\_settimer need it, even if its not in the manpage. A test programm with timer\_create and timer\_settimer works without problems and as expected.
What packets do I need to install, what library do I need to link to, and what include files do I need to use timerfd\_create and timerfd\_settimer.
Thanks
Edger | 0 | [
2,
85,
8291,
43,
1,
6037,
1373,
29,
121,
10035,
13024,
4431,
27,
589,
43,
3470,
800,
3726,
3726,
31,
589,
749,
20,
275,
85,
8291,
43,
1,
6037,
1373,
17,
85,
8291,
43,
1,
3554,
891,
131,
121,
10035,
13024,
23364,
9,
14,
169,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Good sophisticated linq to sql sample?
===
I am looking for a more sophisticated way of using Linq to SQL. I am leaning L2Q but I am only seeing simple examples of business objects and simple CRUD operations in them.
Any sample application that includes these:
1- Business objects which get their data from more than 1 table and from many to many tables.
2- Keeping track of data changes and automatically be able to make changes to more than one table in a simple operation. An intelligent SubmitChanges? (don't know if this possible - right now I write my own stored procs to do all the work plus I am desiging my database in a way so my use of Linq to SQL is easier!)
3- Good use of relationships between tables. It should be more than just dragging tables into the designer.
4- Transactions
5- disconnected data. Use in ASP.NET.
6- N-Tier architecture
7- Basically, more sophisticated use of LINQ to SQL and learning good design patterns
8- Skip Linq to SQL and move to Linq to Entities?
I feel I am not taking good advantage of Linq and it's just giving me nice intellisense and easier queries and I feel it has a lot more to offer but not sure what and how.
I am looking for real life sophisticated samples which can be a good source for learning above from what books and tutorials provide.
Anything on CodePlex? Google code... etc? | 0 | [
2,
254,
13388,
6294,
1251,
20,
4444,
255,
5717,
60,
800,
3726,
3726,
31,
589,
699,
26,
21,
91,
13388,
161,
16,
568,
6294,
1251,
20,
4444,
255,
9,
31,
589,
5939,
644,
135,
1251,
47,
31,
589,
104,
2078,
1935,
3770,
16,
508,
3916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Foreign keys in mysql?
===
I have been slowly learning SQL the last few weeks. I've picked up all of the relational algebra and the basics of how relational databases work. What I'm trying to do now is learn how it's implemented.
A stumbling block I've come across in this, is foreign keys in MySQL. I can't seem to find much about the other than that they exist in the InnoDB storage schema that MySQL has.
Could anyone provide me a simple example of foreign keys implemented in MySQL?
Here's part of a schema I wrote that doesn't seem to be working if you would rather point out my flaw than show me a working example.
CREATE TABLE `posts` (
`pID` bigint(20) NOT NULL auto_increment,
`content` text NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`uID` bigint(20) NOT NULL,
`wikiptr` bigint(20) default NULL,
`cID` bigint(20) NOT NULL,
PRIMARY KEY (`pID`),
Foreign Key(`cID`) references categories,
Foreign Key(`uID`) references users
) ENGINE=InnoDB; | 0 | [
2,
1228,
5534,
19,
51,
18,
22402,
60,
800,
3726,
3726,
31,
57,
74,
1447,
2477,
4444,
255,
14,
236,
310,
1342,
9,
31,
22,
195,
2114,
71,
65,
16,
14,
5827,
192,
10999,
17,
14,
2125,
18,
16,
184,
5827,
192,
6018,
18,
170,
9,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's an easy way to obtain the current svn revision in a c++ visual studio application
===
Is there any easy way to access the SVN repository revision number and store it in a c++ string in a c++ visual studio application?
Thanks for your help in advance! | 0 | [
2,
98,
22,
18,
40,
2010,
161,
20,
5545,
14,
866,
13,
18,
16578,
11323,
19,
21,
272,
20512,
3458,
1120,
3010,
800,
3726,
3726,
25,
80,
186,
2010,
161,
20,
1381,
14,
13,
18,
16578,
24869,
11323,
234,
17,
1718,
32,
19,
21,
272,
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,
0... |
eliminate the enter key after pressing it in the keyup event of a textbox.
===
How to cancel a keypress event in a textbox after pressing the return key. | 0 | [
2,
10628,
14,
2830,
1246,
75,
7196,
32,
19,
14,
1246,
576,
807,
16,
21,
1854,
5309,
9,
800,
3726,
3726,
184,
20,
14815,
21,
1246,
5890,
807,
19,
21,
1854,
5309,
75,
7196,
14,
788,
1246,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Can this be refactored into nicey nice LINQ?
===
I have an IList of type Breadcrumb which is just a lightweight class that has NavigationTitle, NavigationUrl and IsCurrent properties. It is cached on the webserver. I have a method that builds out the current breadcrumb trail up until the first Breadcrumb that has IsCurrent set to true... using the code below. Its very ugly and definitely a quick dirtbag willie solution, but I was curious, can this be easily refactored into LINQ?
IList<Breadcrumb> crumbs = new List<Breadcrumb>();
bool foundCurrent = false;
for (int a = 0; a < cachedCrumbs.Count; a++)
{
crumbs.Add(crumbs[a]);
if (foundCurrent)
{
break;
}
foundCurrent = (crumbs[a + 1] != null && ((Breadcrumb)crumbs[a + 1]).IsCurrent);
} | 0 | [
2,
92,
48,
44,
302,
17455,
69,
77,
2210,
93,
2210,
6294,
1251,
60,
800,
3726,
3726,
31,
57,
40,
31,
5739,
16,
1001,
5988,
25241,
220,
56,
25,
114,
21,
13613,
718,
30,
63,
8368,
22235,
15,
8368,
911,
255,
17,
25,
17657,
3704,
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 do I convert any image to a 4-color paletted image using the Python Imaging Library ?
===
I have a device that supports 4-color graphics (much like CGA in the old days).
I wanted to use [PIL][1] to read the image and convert it using my 4-color palette (of red, green, yellow, black), but I can't figure out if it's even possible at all. I found some mailing list archive posts that seem to suggest other people have tried to do so and failed.
A simple python example would be much appreciated!
[1]: http://www.pythonware.com/products/pil/ | 0 | [
2,
184,
107,
31,
8406,
186,
1961,
20,
21,
268,
8,
11282,
27349,
43,
1961,
568,
14,
20059,
13090,
1248,
13,
60,
800,
3726,
3726,
31,
57,
21,
3646,
30,
6747,
268,
8,
11282,
8351,
13,
5,
18422,
101,
272,
1136,
19,
14,
315,
509,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What Open Source Licence to choose?
===
I was checking codeplex.com and when it's time to start a project, it requires to choose a License. They give us this [link][1] to choose the license.
What do you suggest? I have read few description and they look very similar.
[1]: http://en.wikipedia.org/wiki/Open_source_licenses | 0 | [
2,
98,
368,
1267,
10899,
20,
3538,
60,
800,
3726,
3726,
31,
23,
9886,
1797,
11326,
9,
960,
17,
76,
32,
22,
18,
85,
20,
799,
21,
669,
15,
32,
4781,
20,
3538,
21,
3962,
9,
59,
590,
182,
48,
636,
6258,
500,
2558,
165,
500,
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... |
Unable to cat Ruby blocks to files
===
Please help, I am stuck here ---
irb> a = "line of text\n line two\n line three"
irb> system("cat > test_file << #{a}")
cat: of: No such file or directory
cat: text: No such file or directory
=> false
| 0 | [
2,
2343,
20,
2008,
10811,
5198,
20,
6488,
800,
3726,
3726,
2247,
448,
15,
31,
589,
4549,
235,
13,
8,
8,
8,
31,
7549,
1,
21,
800,
13,
7,
1143,
16,
1854,
1,
103,
293,
81,
1,
103,
293,
132,
7,
31,
7549,
1,
329,
5,
7,
5782,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Filtering input field in Ruby on Rails
===
I am using Ruby on Rails.
I want to create a filter field on a page such that whenever the input field's value changes I filter a list shown below via ajax. (Exaclty like the Users search works in Stackoverflow)
Dor now, I made it run with a form_remote_tag containing a text_field_tag and a submit_tag, and it filters my list when I push the submit button. I would like to remove the submit button and execute the filtering every time the value of the text input changes. How can I trigger a form submit every time the text in an input field changes?
I tried inside my form
`<%= text_field_tag (:filter), "" , :onchage => "alert ('This is a Javascript Alert')" %>`
just to get the onchange event, but somehow not even this alert appears... | 0 | [
2,
25272,
6367,
575,
19,
10811,
27,
2240,
18,
800,
3726,
3726,
31,
589,
568,
10811,
27,
2240,
18,
9,
31,
259,
20,
1600,
21,
11945,
575,
27,
21,
2478,
145,
30,
6634,
14,
6367,
575,
22,
18,
1923,
1693,
31,
11945,
21,
968,
1721,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 you create a linked server from SQL Server (any version) to a SQL Server CE (3.5) database?
===
We've purchased a tool from Redgate called SQL Data Compare. I use it mainly for testing purposes to prove that my application is making the modifications to the database that I think it is, and not making any other changes.
My current application has both "online" and "offline" editing. In online mode you are working directly with a SQL Server, and in offline mode you are working with a subset of the tables in a SQL CE (3.5) file.
Anyway, the SQL Data Compare tool doesn't support SQLCE, so I was hoping I could create a linked server to the SQLCE database and create a SQL Server database that mirrors the CE database through views, and that would let me do my testing.
So, I can't figure out how to create a linked server to a SQLCE database. Does anyone know how to do that? | 0 | [
2,
92,
42,
1600,
21,
4727,
8128,
37,
4444,
255,
8128,
13,
5,
6001,
615,
6,
20,
21,
4444,
255,
8128,
4000,
13,
5,
240,
9,
264,
6,
6018,
60,
800,
3726,
3726,
95,
22,
195,
2432,
21,
5607,
37,
402,
3322,
227,
4444,
255,
1054,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make a system call that returns the stdout output as a string (ie, open a pipe from a command) in various languages.
===
Perl does this with backticks. For example, this
$output = `ls`;
returns a directory listing. (That's just an example; there are of course much better ways to get the list of files in a directory.)
The similar function, `system("foo")`, returns the operating system return code for the command `foo`. I'm talking about the similar function that returns whatever `foo` prints to stdout.
How do other languages do this? Whichever languages does this most concisely/cleanly wins! (I'll add the perl backtick answer.)
PS: I'm mainly asking because I'm looking for the canonical name for such a function.
| 0 | [
2,
184,
20,
233,
21,
329,
645,
30,
4815,
14,
354,
43,
1320,
5196,
28,
21,
3724,
13,
5,
660,
15,
368,
21,
7642,
37,
21,
1202,
6,
19,
617,
2556,
9,
800,
3726,
3726,
416,
255,
630,
48,
29,
97,
1786,
4020,
9,
26,
823,
15,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Agile in small bites: most bang for the buck
===
What single aspect of agile development should we implement first to improve our development process, and why?
I'm in a situation that's requiring me to "tweak" my process, rather than re-engineer it, and "agile" seems to be the mantra of the day. If we can make only one change that will improve something--quality, time to market, documentation, transparency, *etc*., what will have the most visible, positive impact?
If we choose correctly, we'll be able to make a second choice. :-)
| 0 | [
2,
27475,
19,
284,
18551,
45,
127,
6582,
26,
14,
5400,
800,
3726,
3726,
98,
345,
7289,
16,
27475,
522,
378,
95,
8713,
64,
20,
3545,
318,
522,
953,
15,
17,
483,
60,
31,
22,
79,
19,
21,
1858,
30,
22,
18,
9052,
55,
20,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to concatenate web pages in ASP.NET
===
I have a bunch of web pages that are product documentation. I want to create some sort of combination page that will pull all of the other page content in and concatenate them into one long page.
IFrames won't work because I don't know the size of each page. I could have the combination page do a ton of #includes, and that would work, but I don't want to have to keep the master update to date (we have a database of page names that can change over time).
Ultimately I'm after something that can get a list of pages, and for each one do the equivalent of a #include for that page into the current page.
I hope that makes sense. Any thoughts?
| 0 | [
2,
184,
20,
1065,
9530,
8820,
2741,
4434,
19,
28,
306,
9,
2328,
800,
3726,
3726,
31,
57,
21,
7653,
16,
2741,
4434,
30,
50,
2374,
13945,
9,
31,
259,
20,
1600,
109,
2058,
16,
3733,
2478,
30,
129,
2201,
65,
16,
14,
89,
2478,
2331... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Help write a query: Confusion over order of operations of GROUP BY and ORDER BY
===
I have a table named Info of this schema:
int objectId;
int time;
int x, y;
There is a lot of redundant data in the system - that is, `objectId` is not UNIQUE. For each `objectId` there can be multiple entries of `time, x, y`.
I want to retrieve a list of the latest position of each object. I started out with this query:
SELECT * FROM Info GROUP BY objectId
That got me just the kind of list I was looking for. However I want also to get just the latest times for each Object, so I tried:
SELECT * FROM Info GROUP BY objectId ORDER BY time DESC
This gave me a `time` descended list of Infos. However, **I don't think it did what I want - that is return me the latest `time, x, y` for each object**.
Can anyone imagine a query to do what I want?
| 0 | [
2,
448,
2757,
21,
25597,
45,
5677,
84,
389,
16,
1311,
16,
214,
34,
17,
389,
34,
800,
3726,
3726,
31,
57,
21,
859,
377,
15404,
16,
48,
23874,
45,
19,
38,
3095,
1340,
73,
19,
38,
85,
73,
19,
38,
993,
15,
13,
93,
73,
80,
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... |
designing business msgs parser / rewriting from scratch
===
I take care of critical app in my project. It does stuff related to parsing business msgs (legacy standard), processing them and then storing some results in a DB (another apps picks that up). After more then a year of my work (I've other apps to look after as well) the app is finally stable. I've introduced strict TDD policy and I have 20% unit test coverage (thank you Michael Feathers for your book!), most of it in critical parts. I have some white-box Fitness tests as well (whole business scenarios are covered there). I feel that I cannot further refactor this app and I'm safe to play hard with it. It's designed so badly, I want to rewrite it. App itself is around 20k of challenging legacy C/C++ code. There were other dependencies but I manged to decouple most of them.
----------
All I have is Sun C++ compiler, cppunitlite, STLPort and Boost. Please do not suggest other technologies (no XML, Java etc) as this is not the option in my organization.
I'd like to do it with modern C++ (perhaps play with metaprograming...), TDD from start to the end.
There are about 30 types of msgs I need to parse. Each of them is composed of 3-10 lines, most of them are pretty similar.
This is root of all evil -> lots of code duplication.
Each msgs has a class describing how it should be parsed. Take a look at the main inheritance tree:
MSG_A MSG_B
/ \ / \
MSG_A_NEW MSG_A_CNL MSG_B_NEW MSG_B_CNL
Both trees goes much deeper. There are very small differences between MSG_A_NEW and MSG_B_NEW. It should be handled by single class that could be injected with some small customization.
My initial plan it to have one generic msg class that will be customized. Some entity (builder... ?) will take a look at the msgs and initialize proper object that will be able to parse the msg. Another entity will be able to discover what line is it and this info will be used by builder. I'm planning to write several parsers that are responsible for parsing just one specific line. This will allow me to reuse it in parsing different msgs.
There are several challenges that I struggle to solve in an elegant and extensible way.
Each type of msg:
has min and max number if lines
- has some must-have lines
- has some optional lines
- certain lines must be at certain places (i.e. date cannot be before msg type), order matters
I need to be able to validate format of the msgs.
----------
I'm not sure if I explained the design challenge here good enough. My design experience is very limited. I've been bug-fixing for a while now and finally I will have a change to do some fun codding :)
What high-level advice do you have for that? Which design patterns can you identify in this description? Main design constraint is maintainability and extensibility with performance at the bottom (we have other bottlenecks anyway...).
| 0 | [
2,
15026,
508,
4235,
5447,
2017,
4104,
13,
118,
302,
12646,
37,
12395,
800,
3726,
3726,
31,
247,
781,
16,
2507,
4865,
19,
51,
669,
9,
32,
630,
3217,
1597,
20,
2017,
18,
68,
508,
4235,
5447,
13,
5,
6727,
12852,
1236,
6,
15,
5511,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 batch gwt-rpc calls ?
===
With DWR it is possible to group together several service calls inb one HTTP request :<br>
[dwr batch feature][1]<br><br>
This feature is very usezful to reduce the latency of an ajx application.
Is there a way to do something similar with GWT / GWT-RPC ?<br>
Thanks for your help
[1]: http://directwebremoting.org/dwr/browser/engine/batch | 0 | [
2,
184,
20,
13064,
14094,
38,
8,
139,
5779,
3029,
13,
60,
800,
3726,
3726,
29,
13,
43,
7127,
32,
25,
938,
20,
214,
429,
238,
365,
3029,
19,
220,
53,
7775,
3772,
13,
45,
1,
5145,
1,
636,
43,
7127,
13064,
1580,
500,
2558,
165,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP destructor and freeing memory
===
I have a PHP class that creates a PNG image on the fly and sends it to browser. PHP manual says that I need to make sure that *imagedestroy* function is called at end to release the memory. Now, if I weren't using a class, I would have some code like this:
function shutdown_func()
{
global $img;
if ($img)
imagedestroy($img);
}
register_shutdown_function("shutdown_func");
However, I believe that appropriate place for my class would be to place a call to *imagedestroy* in class' destructor.
I failed to find out if destructors get called the same way shutdown functions does? For example, if execution stops when user presses the STOP button in browser.
Note: whatever you write in your answer, please point to some article or manual page (URL) that supports it. | 0 | [
2,
13,
26120,
13,
20137,
248,
17,
551,
68,
1912,
800,
3726,
3726,
31,
57,
21,
13,
26120,
718,
30,
9695,
21,
351,
2723,
1961,
27,
14,
2855,
17,
11350,
32,
20,
16495,
9,
13,
26120,
5132,
898,
30,
31,
376,
20,
233,
562,
30,
1637,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 operator<< be implemented as a friend or as a member function?
===
That's basically the question, is there a "right" way to implemente operator<< ?
Reading [this](http://bytes.com/forum/thread170304.html) I can see that something like:
friend bool operator<<(obj const& lhs, obj const& rhs);
Is prefered to something like
bool operator<<(obj const& rhs);
But I can't quite see why should I use one or the other.
My personal case is:
friend ostream & operator<<(ostream &os, const Paragraph& p) {
return os << p.to_str();
}
But I could probably do:
ostream & operator<<(ostream &os) {
return os << paragraph;
}
What rationale should I base this decision on?
*Note*:
Paragraph::to_str = (return paragraph)
where paragraph's a string.
| 0 | [
2,
378,
6022,
1,
44,
6807,
28,
21,
860,
54,
28,
21,
322,
1990,
60,
800,
3726,
3726,
30,
22,
18,
11374,
14,
1301,
15,
25,
80,
21,
13,
7,
4183,
7,
161,
20,
8713,
62,
6022,
1,
13,
60,
1876,
636,
1565,
500,
5,
21127,
6903,
232... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get a zipped file's content using the rubyzip library?
===
I'm trying to extract an uploaded zip file and store its contents in the database, one entry per file. The rubyzip library has nearly no useful documentation.
There is an assets table that has key :string (file name) and data :binary (file contents).
I'm using the rubyzip library, and have made it as far as this:
Zip::ZipFile.open(@file_data.local_path) do |zipfile|
zipfile.each do |entry|
next if entry.name =~ /__MACOSX/ or entry.name =~ /\.DS_Store/ or !entry.file?
asset = self.assets.build
asset.key = entry.name
asset.data = ?? # what goes here?
end
end
How can I set the data from a ZipEntry? Do I have to use a temp file?
| 0 | [
2,
184,
107,
31,
164,
21,
28693,
3893,
22,
18,
2331,
568,
14,
10811,
2553,
306,
1248,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
10962,
40,
23782,
12133,
3893,
17,
1718,
82,
8478,
19,
14,
6018,
15,
53,
2792,
416,
3893,
9,
14,
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 .NET 3.5 (lambdas, Linq) evolved
===
I remember reading a post about a year or so ago by Scott Hanselman (maybe by scott guthrie) about how Linq evolved. It remember it showing that anyonymous types led to lambda expressions which then led to Linq in some way. I can't seem to find it on google. Does anyone else remember this post? If so, can you please post it? | 0 | [
2,
184,
13,
9,
2328,
203,
9,
264,
13,
5,
24187,
18,
15,
6294,
1251,
6,
7339,
800,
3726,
3726,
31,
1518,
1876,
21,
678,
88,
21,
159,
54,
86,
1464,
34,
1824,
4800,
19965,
13,
5,
5138,
34,
1824,
22472,
6,
88,
184,
6294,
1251,
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... |
What to do with a stupid client request?
===
I won the bid on a project and now the client (who is itself from IT Department) wants me to architect/implement the solution in a very particular way. I am sure the application will fail that way for performance problems. And it will not be easily scalable.
This particular client/user does not know ANYTHING about the platform and language I will be using (ASP.NET / SQL Server). Hi’s only knowledge is in Cobol and trying to make him to understand my POV is just making him angry.
He contacted me. He was the person who selected me as a winner on the bid. He is who will be approving my checks. He is my only contact with this company.
I do not feel comfortable with providing a solution I know will fail and I do not want to be known as the stupid programmer who make it fail. I do know their real needs and usage patterns for this application because I have done projects for them in the past.
On the other hand, doing this in his way will just extend my contract more time (so, more financial gains) in order to solve the problems by modifying the code.
Should I resign from the project knowing that probably I will be losing this client forever?
Or…
Should I take the pill and take financial advantage from an extended project and just assume the bad fame as a cost?
| 0 | [
2,
98,
20,
107,
29,
21,
3553,
6819,
3772,
60,
800,
3726,
3726,
31,
230,
14,
4458,
27,
21,
669,
17,
130,
14,
6819,
13,
5,
1924,
25,
1145,
37,
32,
604,
6,
2846,
55,
20,
3338,
118,
8983,
413,
1130,
14,
4295,
19,
21,
253,
1498,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unix/Linux books
===
Are there any good books for a relatively new but not totally new *nix user to get a bit more in depth knowledge (so no "Linux for dummies")? For the most part, I'm not looking for something to read through from start to finish. Rather, I'd rather have something that I can pick up and read in chunks when I need to know how to do something or whenever I have one of those "how do I do that again?" moments. Some areas that I'd like to see are:
- command line administration
- bash scripting
- programming (although I'd like something that isn't just relevant for C programmers)
I'd like this to be as platform-independent as possible (meaning it has info that's relevant for any linux distro as well as BSD, Solaris, OS X, etc), but the unix systems that I use the most are OS X and Debian/Ubuntu. So if I would benefit the most from having a more platform-dependent book, those are the platforms to target.
If I can get all this in one book, great, but I'd rather have a bit more in-depth material than coverage of **everything**. So if there are any books that cover just one of these areas, post it. Hell, post it even if it's not relevant to any of those areas and you think it's something that a person in my position should know about. | 0 | [
2,
22540,
118,
1226,
7147,
964,
800,
3726,
3726,
50,
80,
186,
254,
964,
26,
21,
3109,
78,
47,
52,
5139,
78,
1637,
14064,
4155,
20,
164,
21,
1142,
91,
19,
5204,
1918,
13,
5,
656,
90,
13,
7,
1226,
7147,
26,
13,
12617,
18978,
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... |
Error Tracking in live/production DB
===
I currently work at a company that has a lot of custom applications that are made internally. There are not currently standards for a lot of things. I would like to implement a way to record/track errors that happen in this programs (most are asp.net).
I am currently thinking of handling this in the Global.asax in the Application Error method. First trying to save the information to an Error Log/Tracking database, and if that fails, try sending an e-mail.
What type of information is the most useful to get from the error message and other application variables (page, username etc).
I am currently thinking of using two tables, one to get the general error and application information, and a second that holds the exception information. This will be a one to many relationship to hand the inner Exceptions that can come from one Application level exception.
I am sure that I am missing a lot of details and would like to hear your strategy for handling this issue.
| 0 | [
2,
7019,
10353,
19,
515,
118,
11386,
13,
9007,
800,
3726,
3726,
31,
871,
170,
35,
21,
237,
30,
63,
21,
865,
16,
5816,
3767,
30,
50,
117,
17739,
9,
80,
50,
52,
871,
3364,
26,
21,
865,
16,
564,
9,
31,
83,
101,
20,
8713,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Any python libs for parsing Bind config files?
===
Any python libs for parsing Bind config files?
Basically something that will aid in adding/removing zones and records.
This needs to work even if someone modifies the config by hand so overwriting the configs every time is not a solution. | 0 | [
2,
186,
20059,
13,
8326,
18,
26,
2017,
18,
68,
10193,
13,
14093,
2816,
6488,
60,
800,
3726,
3726,
186,
20059,
13,
8326,
18,
26,
2017,
18,
68,
10193,
13,
14093,
2816,
6488,
60,
11374,
301,
30,
129,
3096,
19,
4721,
118,
99,
17847,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 determine the ideal buffer size when using FileInputStream?
===
I have a method that creates a MessageDigest (a hash) from a file, and I need to do this to a lot of files (>= 100,000). How big should I make the buffer used to read from the files to maximize performance?
Most everyone is familiar with the basic code (which I'll repeat here just in case):
MessageDigest md = MessageDigest.getInstance( "SHA" );
FileInputStream ios = new FileInputStream( "myfile.bmp" );
byte[] buffer = new byte[4 * 1024]; // what should this value be?
int read = 0;
while( ( read = ios.read( buffer ) ) > 0 )
md.update( buffer, 0, read );
ios.close();
md.digest();
What is the ideal size of the buffer to maximize throughput? I know this is system dependent, and I'm pretty sure its OS, FileSystem, *and* HDD dependent, and there maybe other hardware/software in the mix.
(I should point out that I'm somewhat new to Java, so this may just be some Java API call I don't know about.) | 0 | [
2,
184,
107,
42,
3746,
14,
5628,
17497,
1072,
76,
568,
3893,
108,
4881,
11260,
60,
800,
3726,
3726,
31,
57,
21,
2109,
30,
9695,
21,
2802,
1115,
14288,
13,
5,
58,
19170,
6,
37,
21,
3893,
15,
17,
31,
376,
20,
107,
48,
20,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are some best practices for large-scale development in Python?
===
I don't like the "Is too! Is not!" nature of a lot of the responses that [this question][1] provoked. But I'm really interested in some of the answers, and I'd like to hear more about them. So I'm asking the question from a different perspective.
It's pretty clear to me, after having built a number of medium-size Python projects by myself, that large-scale development in Python presents problems that I haven't seen before.
For instance: I'm good about implementing unit tests, and so I'm confident that my classes and methods do what they're designed to do. What I'm not confident about is how those methods would work if four or five other developers were using them. I worry that my methods aren't designed properly. I worry that I'm not documenting my APIs properly. I look at the panoply of arguments that `zip()` takes, and think, man, *none* of my methods do that.
I also get nervous about the visibility of variables inside class definitions, and wonder if I should be using name mangling more. I get nervous about name mangling. I love that functions are first-class objects, but I worry that injudicious application of that particular feature can result in code graphs that are impervious to analysis.
At the same time, I know that there *are* teams that are being successful with large-scale development in Python. There are clearly ways to work around the things I'm worried about.
So: what are they? Those of you who have done large-scale development in Python: what have you learned? What do you do to keep your code manageable? What kinds of tools and techniques have been helpful?
(Oh, and in case this isn't obvious, the question isn't "How do you build large-scale systems in Python?" I'm interested in system scalability too, but this question's focusing on scaling development.)
[1]: http://stackoverflow.com/questions/236407/python-for-large-scale-development | 0 | [
2,
98,
50,
109,
246,
5242,
26,
370,
8,
5093,
522,
19,
20059,
60,
800,
3726,
3726,
31,
221,
22,
38,
101,
14,
13,
7,
403,
266,
187,
25,
52,
187,
7,
1444,
16,
21,
865,
16,
14,
13231,
30,
636,
1565,
1301,
500,
2558,
165,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Friendship relations tracking algorithm
===
I'm thinking of an application that would try to prove the "[Six degrees of separation][1]" theory with a set of users that are part of a social network.
I would have those elements:
1. A couple of users for which I'd like to prove the six degrees theory
2. For each user, I know the list of friends in the social network
Which is the best algorithm to see if the two users are connected, with which degree and show the eventual steps in the connection?
[1]: http://en.wikipedia.org/wiki/Six_degrees_of_separation | 0 | [
2,
5683,
2649,
10353,
9083,
800,
3726,
3726,
31,
22,
79,
1440,
16,
40,
3010,
30,
83,
1131,
20,
4220,
14,
13,
7,
2558,
6742,
4442,
16,
8312,
500,
2558,
165,
500,
7,
1639,
29,
21,
309,
16,
3878,
30,
50,
141,
16,
21,
668,
982,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a print version of the Java 1.5 API exist?
===
Does a print version of the Java >= 1.5 API exist? Where can I buy it online? Preferably in Canada, but just a title is great. | 0 | [
2,
630,
21,
4793,
615,
16,
14,
8247,
137,
9,
264,
21,
2159,
3182,
60,
800,
3726,
3726,
630,
21,
4793,
615,
16,
14,
8247,
13,
1,
3726,
137,
9,
264,
21,
2159,
3182,
60,
113,
92,
31,
3034,
32,
2087,
60,
6369,
4801,
19,
836,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
php: open_basedir and /dev/urandom
===
Calling the Pear Mail class in some instances automatically attempts to read /dev/urandom, however access is restricted due to an open_basedir setting. Is it safe to add /dev to open_basedir? Or is there a better way around this? | 0 | [
2,
13,
26120,
45,
368,
1,
1281,
1523,
17,
13,
118,
14438,
118,
17692,
5555,
800,
3726,
3726,
2555,
14,
16619,
4216,
718,
19,
109,
13946,
7499,
3265,
20,
1302,
13,
118,
14438,
118,
17692,
5555,
15,
207,
1381,
25,
7079,
397,
20,
40,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get exception when using injection with a simple HelloEJB project
===
I am now learning EJB and got a problem when testing the Injection functionality. Here is my code (I create an EJB project in Eclipse).
I run the EJB with embedded Glassfish, and run the test(main) independently, but always get this exception:
java.lang.NullPointerException
at com.example.MainUsingInjection.runTest(MainUsingInjection.java:11)
at com.example.MainUsingInjection.main(MainUsingInjection.java:20)
I hope anyone can help me with this. Thank you very much.
**HelloSessionBean.java**
package com.example;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless
@LocalBean
public class HelloSessionBean implements HelloSessionBeanRemote {
public HelloSessionBean() { }
public void helloMethod() {
System.out.println("Hello World!\n");
}
}
**HelloSessionBeanRemote.java**
package com.example;
import javax.ejb.Remote;
@Remote
public interface HelloSessionBeanRemote {
public void helloMethod();
}
**MainUsingJnjection.java**
package com.example;
import javax.ejb.EJB;
public class MainUsingInjection {
@EJB(name="HelloSessionBean")
public static HelloSessionBeanRemote bean;
public void runTest() throws Exception {
bean.helloMethod();
}
public static void main(String[] args) {
MainUsingInjection cli = new MainUsingInjection();
try {
cli.runTest();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 0 | [
2,
164,
5391,
76,
568,
13646,
29,
21,
1935,
10975,
10022,
220,
669,
800,
3726,
3726,
31,
589,
130,
2477,
13,
10022,
220,
17,
330,
21,
1448,
76,
4431,
14,
13646,
18548,
9,
235,
25,
51,
1797,
13,
5,
49,
1600,
40,
13,
10022,
220,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fragment addToBackStack crashes app
===
I have a FragmentActivity that loads one custom ListFragment at startup, and replaces it with a new fragment after an item is clicked.
In the fragment activity subclass:
public void onCreate(Bundle savedInstanceState) {
...
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.list_activity, listFragment, "venueListFragment");
ft.commit();
...
}
In the list item handler within the ListFragment subclass:
public void onListItemClick(ListView l, View v, int position, long id) {
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
VenueListFragment newFragment = VenueListFragment.newInstance(nextListType, nextRowID);
ft.replace(R.id.list_activity, newFragment, "venueListFragment");
ft.addToBackStack(null);
ft.commit();
}
This works fine after the first fragment, but when I try to click on an item in the 2nd fragment, I get this error from within the internal FragmentManager class:
04-03 01:04:24.999: E/AndroidRuntime(15016): FATAL EXCEPTION: main
04-03 01:04:24.999: E/AndroidRuntime(15016): java.lang.NullPointerException
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.support.v4.app.LoaderManagerImpl.hasRunningLoaders(LoaderManager.java:824)
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:420)
04-03 01:04:24.999: E/AndroidRuntime(15016): at android.os.Handler.handleCallback(Handler.java:587)
I noticed if I comment out addToBackStack, the next fragment is loaded fine, but of course I can no navigate backwards. Also, if I simply wait 5-7 seconds before clicking the next list item, the app doesn't crash, but the cursor loader within the fragment finishes loading way earlier than that since the entire list is already viewable. In onDestroyView, I explicitly call CursorLoader's cancelLoad() method anyway.
Any thoughts on how to fix this? Is this a bug in the Android Compatibility Library?
I'm using the latest version of ACL (rev 7) and have the min SDK set to API level 7 (2.1). | 0 | [
2,
14847,
3547,
262,
1958,
25325,
21563,
4865,
800,
3726,
3726,
31,
57,
21,
14847,
19348,
30,
19069,
53,
5816,
968,
22133,
1130,
35,
20205,
15,
17,
3934,
18,
32,
29,
21,
78,
14847,
75,
40,
9101,
25,
15802,
9,
19,
14,
14847,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET MVC 3 dynamic form generation
===
I am trying to generate a form at run-time. I have ended up with this approach
@using (Html.BeginForm()) {
@foreach (var propertyInfo in typeof(MvcApplication1.Models.LogOnModel).GetProperties()) {
if (propertyInfo.PropertyType == typeof(Boolean)) {
Html.CheckBoxFor(m => new PropertyWrapper<Boolean>(propertyInfo, Model).Property);
}
else if (propertyInfo.PropertyType == typeof(String)) {
Html.TextBoxFor(m => new PropertyWrapper<String>(propertyInfo, Model).Property);
}
...
}
}
With this class to allow the `[ElementType]For()` methods to work (they need a reference to a property which can't be retrieved using reflection).
public class PropertyWrapper<T> {
private PropertyInfo _propertyInfo;
private Object _instance;
public PropertyWrapper(PropertyInfo propertyInfo, Object instance) {
_propertyInfo = propertyInfo;
_instance = instance;
}
public T Property {
get { return (T)_propertyInfo.GetValue(_instance, null); }
set { _propertyInfo.SetValue(_instance, value, null); }
}
}
I get the following error
System.Reflection.TargetException: Non-static method requires a target.
because `instance` parameter of `PropertyWrapper` constructor is null. Am I missing something? Is this even possible? | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
203,
7782,
505,
2782,
800,
3726,
3726,
31,
589,
749,
20,
7920,
21,
505,
35,
485,
8,
891,
9,
31,
57,
1272,
71,
29,
48,
2141,
13,
1,
12655,
13,
5,
15895,
9,
17143,
108,
4190,
5,
6,
6,
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... |
ConcurrentQueue holds object's reference or value? "out of memory" exception
===
Is objects enqueued to a ConcurrentQueue are copied to the queue or just their references?
I don't understand any scenario.
Explanation:
I defined a ConcurrentQueue like this:
// BufferElement is a class I created
private ConcurrentQueue<BufferElement> _bufferQueue;
I have a function which is called a lot of times and it's purpsoe is to enqueue an element to the queue:
private void EnqueueElementToBuffer(string data, int moreData)
{
// the bufferElement constructor is setting data and moreData to it's fields.
BufferElement bufferElement = new BufferElement(data, moreData);
bufferQueue.Enqueue(bufferElement);
}
When I run this I get Out of Memory exception after a while. I thought it might be because the garbage collector does not collect the `bufferElement` because it is still has referenced in the `bufferQueue`, so I changed the function to this:
private void EnqueueElementToBuffer(string data, int moreData)
{
// _bufferElement is now a filed of the class
_bufferElement.Data = data;
_bufferElement.MoreData = moreData;
bufferQueue.Enqueue(_bufferElement);
}
And I didn't get the exception, and wasn't about to get one judging by the memory in the windows task manager.
Now I thought that the problam was solved because when I enqueued objects to the queue only the reference to the objects is cpoied to the queue, but I was afraid that all the elements in the queue are referencing to the same object, so I checked another function I have in another thread which what it does is:
// while bufferQueue is not empty do the following
BufferElement bufferElement = null;
bufferQueue.TryDequeue(out bufferElement);
And I checked the content of couple of elements and saw that their content was different! so if objects enqueued to the queue are copied by value why I got the Out of Memory exception at first?
| 0 | [
2,
19513,
2005,
4185,
2763,
3095,
22,
18,
2801,
54,
1923,
60,
13,
7,
1320,
16,
1912,
7,
5391,
800,
3726,
3726,
25,
3916,
1957,
2005,
291,
69,
20,
21,
19513,
2005,
4185,
50,
18225,
20,
14,
22521,
54,
114,
66,
7231,
60,
31,
221,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Floating bullets to the right but keeping the "left to right order" intact
===
I have a list that I floated to the right:
http://jsfiddle.net/ghDdm/6/
The problem with this is that my list is now "out-of-order", that is it should read:
link 1 | link 2 | link 3...
instead of
link 6 | link 5 | link 4
I tried using text-align: right on the .box class but this doesn't seem to work... | 0 | [
2,
8319,
11366,
20,
14,
193,
47,
2882,
14,
13,
7,
9742,
20,
193,
389,
7,
10572,
800,
3726,
3726,
31,
57,
21,
968,
30,
31,
15400,
20,
14,
193,
45,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
4780,
8096,
79,
118,
12626,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can you store an xhtml page in xml CDATA?
===
I need to grab the xhtml source from a site and store it in an xml file, however the xhtml contains CDATA and since nested CDATA is not allowed I'm not sure what to do. Is there any simple solution to this or is there some easy way to covert the xhtml to html? Thanks for any help. | 0 | [
2,
184,
92,
42,
1718,
40,
993,
15895,
2478,
19,
23504,
1745,
4375,
60,
800,
3726,
3726,
31,
376,
20,
4931,
14,
993,
15895,
1267,
37,
21,
689,
17,
1718,
32,
19,
40,
23504,
3893,
15,
207,
14,
993,
15895,
1588,
1745,
4375,
17,
179,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create a custom DVD player for XBox?
===
I would like to create an application that runs on XBox 360 (downloaded using XBox Live) that will play the DVD movie in the tray. I know the XBox already has this ability, but I want my custom DVD player to allow users to save bookmarks for parts of the movie they really like and then browse their bookmarks later when they put the DVD back in. It might sound silly, but it is for a business venture I am undertaking.
My questions are:<br/>
1. Is this possible?<br/>
2. What platform can I use to make this? (XNA?)<br/>
3. Where should I go to learn how to do it?
I am a very experienced .NET developer but I am not an expert in media or game programming (yet). Thank you! | 0 | [
2,
184,
107,
31,
1600,
21,
5816,
3527,
517,
26,
13800,
60,
800,
3726,
3726,
31,
83,
101,
20,
1600,
40,
3010,
30,
1461,
27,
13800,
11760,
13,
5,
2968,
22546,
568,
13800,
515,
6,
30,
129,
418,
14,
3527,
1308,
19,
14,
10121,
9,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 programatically interface an Excel spreadsheet?
===
I have a request for some contract work from an organization that uses [Excel as a database][1] and wants to do some work on the Excel data via a real database. (Yeah, I know, never mind...)
The client has an Excel sheet that they use internally to keep track of some government programmes. The data from this Excel sheet used to be manually imported into a SQL database via CSV as intermediate format and made available via a tiny web app. Changes in either the spreadsheet or the db were done manually (by different people) and had to be kept in sync manually.
The spec for new functionality includes:
- upload the Excel file into the web app
- make minor changes via the web app (this bit is, of course, a no-brainer)
- occasionally export the data back into Excel
The spreadsheet (actually, it's a couple of them in a workbook) implements some guidelines necessary to interact with other institutions and therefore has to remain the same structurally before and after import. It contains a lot of formatting, hidden columns and sort buttons as well as a lot of data links between the cells in the different sheets.
I don't want to have to reproduce the spreadsheet from scratch to deliver the export, nor do I want to manually extract the proper columns into CSV before making the import. I'm rather looking for a way to load the Excel, "query" certain fields, write them to the DB and later load the data back from the DB and manipulate only the contents of the proper cells.
Is there a way to programatically interface with an existing spreadsheet and only read or change the bits that you need?
[1]: http://www.neopoleon.com/home/blogs/neo/archive/2003/09/29/5458.aspx
| 0 | [
2,
184,
107,
31,
625,
721,
8438,
6573,
40,
20700,
1789,
17627,
60,
800,
3726,
3726,
31,
57,
21,
3772,
26,
109,
1305,
170,
37,
40,
1165,
30,
2027,
636,
1706,
11040,
28,
21,
6018,
500,
2558,
165,
500,
17,
2846,
20,
107,
109,
170,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP's sleep function and client connections
===
How does PHP handle client connection while doing sleeps?
Or put another way ... what happens if the client closes the connection to the server while a page is being processed?
Does it just kill the process, or does it continue to process the page until the end?
Since I'm not sure of the answers to the above how would I implement the following pseudocode in PHP.
Record user entered
while (user is still connected) {
fetch changes in state since last awake
send changes to user
sleep(5);
}
Record user exit
Any thoughts would be appreciated.
Thanks. | 0 | [
2,
13,
26120,
22,
18,
1742,
1990,
17,
6819,
6760,
800,
3726,
3726,
184,
630,
13,
26120,
3053,
6819,
2760,
133,
845,
1742,
18,
60,
54,
442,
226,
161,
13,
9,
9,
9,
98,
5531,
100,
14,
6819,
543,
18,
14,
2760,
20,
14,
8128,
133,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using VirtualPathProvider to load ASP.NET MVC views from DLLs
===
Based on this question [here][1] and using code found [here][2] I'm trying to load views that are embedded resources in a separate DLL project, and the original question's author says he has had success doing this - but I can't get it to work as it seems the MVC view engine is intercepting the request and still looking at the file system for the view. Exception:
Server Error in '/' Application.
The view 'Index' or its master could not be found. The following locations were searched:
~/Views/admin/Index.aspx
~/Views/admin/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/App/Views/admin/Index.aspx
~/App/Views/admin/Index.ascx
~/App/Views/Shared/Index.aspx
~/App/Views/Shared/Index.ascx
I am using a CustomViewEngine, like Rob Connery's /App structure one as follows:
public class CustomViewEngine : WebFormViewEngine
{
public CustomViewEngine()
{
MasterLocationFormats = new[] {
"~/App/Views/{1}/{0}.master",
"~/App/Views/Shared/{0}.master"
};
ViewLocationFormats = new[] {
"~/App/Views/{1}/{0}.aspx",
"~/App/Views/{1}/{0}.ascx",
"~/App/Views/Shared/{0}.aspx",
"~/App/Views/Shared/{0}.ascx"
};
PartialViewLocationFormats = ViewLocationFormats;
}
}
In my AssemblyResourceProvider I'm checking to see if the path starts "~/plugin/" and then using the dll filename convention plugin.{controller}.dll
Any suggestions?
[1]: http://stackoverflow.com/questions/19746/views-in-seperate-assemblies-in-aspnet-mvc
[2]: http://www.codeproject.com/KB/aspnet/ASP2UserControlLibrary.aspx | 0 | [
2,
568,
6599,
8353,
26735,
139,
20,
6305,
28,
306,
9,
2328,
307,
8990,
4146,
37,
13,
43,
211,
18,
800,
3726,
3726,
432,
27,
48,
1301,
636,
6836,
500,
2558,
165,
500,
17,
568,
1797,
216,
636,
6836,
500,
2558,
135,
500,
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... |
Parsing CSS by regex
===
I'm creating a CSS editor and am trying to create a regular expression that can get data from a CSS document. This regex works if I have one property but I can't get it to work for all properties. I'm using preg/perl syntax in PHP.
### Regex
(?<selector>[A-Za-z]+[\s]*)[\s]*{[\s]*((?<properties>[A-Za-z0-9-_]+)[\s]*:[\s]*(?<values>[A-Za-z0-9#, ]+);[\s]*)*[\s]*}
### Test case
body { background: #f00; font: 12px Arial; }
### Expected Outcome
Array(
[0] => Array(
[0] => body { background: #f00; font: 12px Arial; }
[selector] => Array(
[0] => body
)
[1] => Array(
[0] => body
)
[2] => font: 12px Arial;
[properties] => Array(
[0] => font
)
[3] => Array(
[0] => font
)
[values] => Array(
[0] => 12px Arial
[1] => background: #f00
)
[4] => Array(
[0] => 12px Arial
[1] => background: #f00
)
)
)
### Real Outcome
Array(
[0] => Array
(
[0] => body { background: #f00; font: 12px Arial; }
[selector] => body
[1] => body
[2] => font: 12px Arial;
[properties] => font
[3] => font
[values] => 12px Arial
[4] => 12px Arial
)
)
Thanks in advance for any help - this has been confusing me all afternoon! | 0 | [
2,
2017,
18,
68,
272,
18,
18,
34,
7953,
1706,
800,
3726,
3726,
31,
22,
79,
2936,
21,
272,
18,
18,
1835,
17,
589,
749,
20,
1600,
21,
1290,
1803,
30,
92,
164,
1054,
37,
21,
272,
18,
18,
4492,
9,
48,
7953,
1706,
693,
100,
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... |
Embedding Opera in Cocoa
===
So, I'm writing a Cocoa application that needs to be able to display web content using Opera's rendering engine. This is for a feature, not because I'm an Opera fanboi (I'm not). All I've been able to find on the subject is this [press release about Adobe's use of the Opera engine](http://www.opera.com/pressreleases/en/2003/09/30/).
Has anyone done this? What's the API like? Are they going to want royalties, payments, an NDA, etc? | 0 | [
2,
11911,
69,
3258,
1877,
19,
24507,
800,
3726,
3726,
86,
15,
31,
22,
79,
1174,
21,
24507,
3010,
30,
2274,
20,
44,
777,
20,
3042,
2741,
2331,
568,
1877,
22,
18,
15307,
1406,
9,
48,
25,
26,
21,
1580,
15,
52,
185,
31,
22,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there hard evidence of the ROI of unit testing?
===
I work for a small company that has no clue about software design. So, I am unfamiliar with many of the concepts that are considered obvious, standard practices by so many SO contributors.
Unit testing sounds great to me, but I'm not sure I should spend any time really learning it unless I can convince others that is has significant value. I have to convice the other programmers and, more importantly, the bean-counters in management, that all the extra time spent learning the testing framework, writing tests, keeping them updated, etc.. will pay for itself, and then some.
What proof is there? Has anyone actually developed the same software with two separate teams, one using unit testing and the other not, and compared the results? I doubt it. Am I just supposed to justify it with, "Look it up on the internet, everybody's talking about it, so it must be the right thing to do"?
Where is the hard evidence that will convince the laymen that unit testing is worth the effort? | 0 | [
2,
25,
80,
552,
1445,
16,
14,
13,
661,
49,
16,
1237,
4431,
60,
800,
3726,
3726,
31,
170,
26,
21,
284,
237,
30,
63,
90,
8906,
88,
2306,
704,
9,
86,
15,
31,
589,
17819,
29,
151,
16,
14,
8700,
30,
50,
724,
4674,
15,
1236,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a central repsoitory for timezone information
===
I know that systems are using their own timezone databases at different levels.
Is there a central place where all timezeone and DST information lives, that makes it easy for programmers to write updates to their timezone data sources?
For example, do people make provisions for a timezone for each possible combination? For example, islands in Mexican territory don't follow DST, so they would each have to be different from the three mainland timezones (that should be described w/ DST date ranges). | 0 | [
2,
25,
80,
21,
521,
9411,
656,
49,
14599,
26,
85,
11661,
676,
800,
3726,
3726,
31,
143,
30,
1242,
50,
568,
66,
258,
85,
11661,
6018,
18,
35,
421,
2216,
9,
25,
80,
21,
521,
209,
113,
65,
85,
1734,
849,
17,
13,
43,
384,
676,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Problem with inheritance in C++
===
Here's my problem: I have a virtual method defined in a .h file that I want to call in a class that inherits from the base class. Sadly though, the method in the derived class doesn't get called. Is there a better way to implement what I'm trying to do?
#ifndef ofxBASE_SND_OBJ
#define ofxBASE_SND_OBJ
#include "ofConstants.h"
class ofxBaseSndObj {
public:
virtual string getType(){}
string key;
};
#endif
Here's my buzz class
#ifndef OFXSO_BUZZ
#define OFXSO_BUZZ
#include "ofxBaseSndObj.h"
class ofxSOBuzz : public ofxBaseSndObj
{
public:
string getType();
};
#endif
ofxSOBuzz.cpp
string ofxSOBuzz::getType()
{
string s = string("ofxSOBuzz");
printf(" ********* returning string type %s", s.c_str()); // doesn't get called!
return s;
}
Then in another class I try to call it this way:
string ofxSndObj::createFilter(ofxBaseSndObj obj)
{
string str = obj.getType();
if(str.compare("ofxSOBuzz") == 0)
{
printf(" all is well ");
}
}
In the method above I need to be able to pass in one of many kinds of objects that all extend the ofxBaseSndObj object. Any suggestsions or pointers would be greatly appreciated. Thanks! | 0 | [
2,
1448,
29,
13852,
19,
272,
20512,
800,
3726,
3726,
235,
22,
18,
51,
1448,
45,
31,
57,
21,
6599,
2109,
2811,
19,
21,
13,
9,
252,
3893,
30,
31,
259,
20,
645,
19,
21,
718,
30,
17569,
18,
37,
14,
1000,
718,
9,
16382,
362,
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... |
Confirmed features of .NET 4.0?
===
Does anyone know what will be in .NET 4.0?
I found [tuples on codeplex](https://mef.svn.codeplex.com/svn/src/ComponentModel/System/Tuple.cs):
....
// NOTE : this is a TEMPORARY and a very minimalistic implementation of Tuple'2,
// as defined in http://devdiv/sites/docs/NetFX4/CLR/Specs/Base Class Libraries/Tuple Spec.docx
// We will remove this after we move to v4 and Tuple is actually in there
public struct Tuple<TFirst, TSecond>
....
| 3 | [
2,
2842,
967,
16,
13,
9,
2328,
268,
9,
387,
60,
800,
3726,
3726,
630,
1276,
143,
98,
129,
44,
19,
13,
9,
2328,
268,
9,
387,
60,
31,
216,
636,
2473,
18534,
27,
1797,
11326,
500,
5,
21127,
18,
6903,
790,
410,
9,
18,
16578,
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 does Silverlight determine an assembly is "Silverlight"?
===
I'm trying to compile code from F# to use in Silverlight. I compile with:
--noframework --cliroot "C:\program Files\Microsoft Silverlight\2.0.31005.0" --standalone
This generates a standalone assembly that references the SL framework. But when I try to add a reference to the generated assembly, I get this error:
> You can only add project references to
> other Silverlight projects in the
> solution.
What is the VS plugin doing to determine that this isn't a Silverlight assembly? Here's the manifest:
// Metadata version: v2.0.50727
.assembly extern mscorlib
{
.publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
.ver 2:0:5:0
}
.assembly FSSLLibrary1
{
// --- The following custom attribute is added automatically, do not uncomment -------
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module 'F#-Module-FSSLLibrary1'
// MVID: {49038883-5D18-7281-A745-038383880349}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x04120000
I don't understand what it's finding that it doesn't like; it's pure verifiable IL. I compared to a SL "class library" assembly, and it looks the same. The only difference was some attributes, but I deleted those and VS still let me reference the DLL. I even added unverifiable IL to the "SL library" DLL and it still loaded.
Any suggestions? | 0 | [
2,
184,
630,
1172,
3130,
3746,
40,
1475,
25,
13,
7,
16782,
3130,
7,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
26561,
1797,
37,
398,
5910,
20,
275,
19,
1172,
3130,
9,
31,
26561,
29,
45,
13,
8,
8,
251,
8361,
3783,
13,
8,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.