unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Combine Fluent and XML mapping for NHibnernate
===
I just fell in love with NHibernate and the fluent interface. The latter enables very nice mappings with refactoring support (no more need for xml files).
But nobody is perfect, so I am missing the many-to-any mapping in fluent. Does anybody know if it is already there? If so, a simple line of code would be nice.
But to stick to the header of the question, is there any way to combine fluent and normal NHibernate mapping.
Currently I use the following lines for my test setup WITH fluent, and the second code block for my test WITHOUT fluent (with XML mappings). How can I tell fluent to use fluent IF AVAILABLE and XML otherwise...
var cfg = new Configuration();
cfg.AddProperties(MsSqlConfiguration.MsSql2005.ConnectionString.Is(_testConnectionstring).ToProperties());
cfg.AddMappingsFromAssembly(typeof(CatMap).Assembly);
new SchemaExport(cfg).Create(true, true);
var persistenceModel = new PersistenceModel();
persistenceModel.addMappingsFromAssembly(typeof(CatMap).Assembly);
IDictionary<string, string> properties = MsSqlConfiguration.MsSql2005.UseOuterJoin().ShowSql().ConnectionString.Is(_testConnectionstring).ToProperties();
properties.Add("command_timeout", "340");
session = new SessionSource(properties, persistenceModel).CreateSession();
Without Fluent...
config = new Configuration();
IDictionary props = new Hashtable();
props["connection.provider"] = "NHibernate.Connection.DriverConnectionProvider";
props["dialect"] = "NHibernate.Dialect.MsSql2005Dialect";
props["connection.driver_class"] = "NHibernate.Driver.SqlClientDriver";
props["connection.connection_string"] = "Server=localhost;initial catalog=Debug;Integrated Security=SSPI";
props["show_sql"] = "true";
foreach (DictionaryEntry de in props)
{
config.SetProperty(de.Key.ToString(), de.Value.ToString());
}
config.AddAssembly(typeof(CatMap).Assembly);
SchemaExport se = new SchemaExport(config);
se.Create(true, true);
factory = config.BuildSessionFactory();
session = factory.OpenSession();
That's it...
Chris
PS: I really like this site, the GUI is perfect, and the quality of all articles is incredible. I think it will be huge :-) Have to register...
| 0 | [
2,
12287,
19252,
17,
23504,
13305,
26,
13,
103,
8630,
1031,
8820,
800,
3726,
3726,
31,
114,
1139,
19,
339,
29,
12109,
15191,
8820,
17,
14,
19252,
6573,
9,
14,
1932,
14645,
253,
2210,
13305,
18,
29,
302,
17455,
68,
555,
13,
5,
251,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Whats the fastest way to divide an integer by 3.
===
int x = n / 3; // <-- make this faster | 0 | [
2,
98,
18,
14,
7518,
161,
20,
8918,
40,
13820,
34,
203,
9,
800,
3726,
3726,
19,
38,
993,
800,
13,
103,
13,
118,
203,
73,
12894,
13,
1,
8,
8,
233,
48,
4233,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How do I capture PHP output into a variable?
===
I'm generating a ton of XML that is to be passed to an API as a post variable when a user click on a form button. I also want to be able to show the user the XML before hand.
The code is sorta like the following in structure:
<?php
$lots of = "php";
?>
<xml>
<morexml>
<?php
while(){
?>
<somegeneratedxml>
<?php } ?>
<lastofthexml>
<?php ?>
<html>
<pre>
The XML for the user to preview
</pre>
<form>
<input id="xml" value="theXMLagain" />
</form>
</html>
My XML is being generated with a few while loops and stuff. It then needs to be shown in the two places (the preview and the form value).
My question is. How do I capture the generated XML in a variable or whatever so I only have to generate it once and then just print it out as apposed to generating it inside the preview and then again inside the form value? | 0 | [
2,
184,
107,
31,
3683,
13,
26120,
5196,
77,
21,
7612,
60,
800,
3726,
3726,
31,
22,
79,
13500,
21,
13,
444,
16,
23504,
30,
25,
20,
44,
1100,
20,
40,
21,
2159,
28,
21,
678,
7612,
76,
21,
4155,
10840,
27,
21,
505,
5167,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I increase the key repeat rate beyond the OS's limit?
===
I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and .
This of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I dual boot a MacBook), I hate my key repeat rate turned all the way up. But in Visual Studio, and other apps, the rate is still much slower than I would prefer.
How can I make the key repeat rate faster in Visual Studio and other text editors?
| 0 | [
2,
184,
92,
31,
1839,
14,
1246,
6830,
1684,
1701,
14,
13,
759,
22,
18,
4496,
60,
800,
3726,
3726,
31,
57,
21,
896,
9474,
16,
568,
14,
29588,
5534,
16,
51,
8896,
20,
20782,
1267,
1797,
9,
32,
22,
18,
301,
31,
22,
195,
677,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Accessing internal members via System.Reflection?
===
I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is:
FieldInfo[] _fields =
typeof(ButtonedForm.TitleButton).GetFields(
BindingFlags.NonPublic | BindingFlags.Instance |
BindingFlags.DeclaredOnly);
Console.WriteLine("{0} fields:", _fields.Length);
foreach (FieldInfo fi in _fields)
{
Console.WriteLine(fi.Name);
}
This spits out all the private members nicely, but still doesn't display internals. I know this is possible, because when I was messing around with the autogenerated tests that Visual Studio can produce, it asked about something to do with displaying internals to the Test project. Well, now I'm using NUnit and really liking it, but how can I achieve the same thing with it? | 0 | [
2,
1381,
68,
3117,
443,
1197,
329,
9,
27977,
872,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1237,
1289,
21,
718,
30,
63,
151,
3117,
3719,
9,
158,
4409,
376,
4431,
266,
15,
47,
51,
4894,
669,
25,
10332,
106,
1373,
15,
2011,
185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the best way to validate a terminal command has run successfully in Rails?
===
I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another. | 0 | [
2,
98,
25,
14,
246,
161,
20,
7394,
1373,
21,
3855,
1202,
63,
485,
3673,
19,
2240,
18,
60,
800,
3726,
3726,
31,
22,
79,
1174,
21,
2231,
2240,
18,
4865,
17,
23,
5712,
184,
31,
92,
7394,
1373,
14,
1280,
40,
1396,
3319,
22,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
c# store user settings in database
===
Is there an easy method to store a persons user settings in a sql 2000 database. Ideally all settings in one field so I don't keep having to edit the table every time I add a setting. I am thinking along the lines of serialize a settings class if anyone has an example.
The reason I don't want to use the built in .NET user settings stored in persistent storage is work uses super mandatory profiles so upon a users log off the settings are cleared which is a pain. I posted asking for any solutions to this previously but didn't get much of a response. | 0 | [
2,
272,
5910,
1718,
4155,
12410,
19,
6018,
800,
3726,
3726,
25,
80,
40,
2010,
2109,
20,
1718,
21,
4280,
4155,
12410,
19,
21,
4444,
255,
824,
6018,
9,
5628,
102,
65,
12410,
19,
53,
575,
86,
31,
221,
22,
38,
643,
452,
20,
9392,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Third party data delivery of lots of data...
===
Does anyone know how sites that have a real-time feed of a lot of data work? I am referring to something like a stock site, where they can tell you in real time (well, 20 minute delay mostly, but still real-time - 20 minutes as I understand it).
They have thousands of data pieces delivered to them every second, I would imagine: MSFT 25.00 +.23 VOL 12000 ???? for each stock that had a change during some interval.
So, is there just a constant feed of small pushes going on? Or do you think a site will pull from the place that has the real data and say "give me all changes since 12:23:45 CST to now" type query?
I ask this because at work we might have a situation where we need to have at our application's fingertips real time information like this, and it won't make sense to hit our third party provider over and over and over again every second... | 0 | [
2,
422,
346,
1054,
6010,
16,
7503,
16,
1054,
9,
9,
9,
800,
3726,
3726,
630,
1276,
143,
184,
3259,
30,
57,
21,
683,
8,
891,
4063,
16,
21,
865,
16,
1054,
170,
60,
31,
589,
7378,
20,
301,
101,
21,
2070,
689,
15,
113,
59,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Strategies for pushing updates to an ASP.NET webfarm?
===
How do most people handle updating ASP.NET applications running in a webfarm? I am having the problem that because the app is in use and the request affitnity is not sticky, when we push the update users run into errors as the process requests the request might be handled by the wrong version of the application. How do you do this? Take the entire application offline and let the push complete or do you update live and let the chips fall where they may? Ideally we'd like to minimize down time if at all possible.
any thoughts/suggestions/pointers would be appreciated | 0 | [
2,
10272,
26,
5076,
16779,
20,
40,
28,
306,
9,
2328,
2741,
3700,
79,
60,
800,
3726,
3726,
184,
107,
127,
148,
3053,
71,
43,
1880,
28,
306,
9,
2328,
3767,
946,
19,
21,
2741,
3700,
79,
60,
31,
589,
452,
14,
1448,
30,
185,
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... |
Can I save a record in a Windows Gadget in a file or other storage (database, etc.)?
===
I'm planning to create a simple gadget to create a TO DO list application. **This is just for practice and to explore Windows Gadget**. How can I store the values in the database? As much as possible, I don't want to set up a local http handler file to be a means to store value to file or database.
**Note**: I tag this with html and javascript since I'm aware it uses such. | 0 | [
2,
92,
31,
2079,
21,
571,
19,
21,
1936,
25661,
19,
21,
3893,
54,
89,
4326,
13,
5,
18768,
8436,
15,
2722,
9,
6,
60,
800,
3726,
3726,
31,
22,
79,
2334,
20,
1600,
21,
1935,
25661,
20,
1600,
21,
20,
107,
968,
3010,
9,
13,
1409,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
When to use Fixed Point these days
===
For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up...
I'm wondering if these days when floating point runs faster than ever, is it ever worth considering fixed point? Are there general rules of thumb where we can say it'll matter by more than a few percent? What is the overview from 35,000 feet of numerical performance? (BTW, i'm assuming a general CPU as found in most computers, not DSP or specialized embedded systems.) | 0 | [
2,
76,
20,
275,
3535,
454,
158,
509,
800,
3726,
3726,
26,
5339,
234,
8,
13555,
68,
31,
22,
79,
5154,
568,
3535,
454,
700,
16,
8319,
454,
9,
16,
674,
32,
22,
211,
1161,
184,
151,
34,
3231,
14,
3535,
454,
1001,
25,
19,
1072,
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... |
Which is fastest in PHP- MySQL or MySQLi?
===
I'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true?
And I'm only asking about speed. I know mysqli has features that are not present in the older extension. | 0 | [
2,
56,
25,
7518,
19,
13,
26120,
8,
51,
18,
22402,
54,
51,
18,
1251,
1210,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
143,
100,
1276,
63,
186,
64,
8,
3203,
1496,
29,
48,
926,
2613,
262,
915,
9,
21,
310,
8146,
18,
395,
14,
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... |
Implementing Mozilla's toSource() method in Internet Explorer.
===
Has anyone implemented Mozialla's Object.toSource() method for Internet Explorer and other non-Gecko browsers? I'm looking for a lightweight way to serialize simple objects into strings. | 0 | [
2,
17333,
13,
18057,
3247,
22,
18,
20,
12097,
5,
6,
2109,
19,
2620,
8520,
9,
800,
3726,
3726,
63,
1276,
6807,
1873,
2553,
14210,
22,
18,
3095,
9,
262,
12097,
5,
6,
2109,
26,
2620,
8520,
17,
89,
538,
8,
834,
150,
921,
16495,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I do a find/replace in t-sql?
===
I basically have an xml column, and I need to find and replace one tag value in each record. | 0 | [
2,
92,
31,
107,
21,
477,
118,
99,
5119,
19,
13,
38,
8,
18,
22402,
60,
800,
3726,
3726,
31,
11374,
57,
40,
23504,
4698,
15,
17,
31,
376,
20,
477,
17,
3934,
53,
3383,
1923,
19,
206,
571,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Portability of #warning preprocessor directive
===
I know that the #warning directive is not standard C/C++, but several compilers support it, including gcc/g++. But for those that don't support it, will they silently ignore it or will it result in a compile failure? In other words, can I safely use it in my project without breaking the build for compilers that don't support it? | 0 | [
2,
1295,
4091,
16,
6926,
1885,
2981,
782,
16835,
248,
15626,
800,
3726,
3726,
31,
143,
30,
14,
6926,
1885,
2981,
15626,
25,
52,
1236,
272,
118,
150,
20512,
15,
47,
238,
21486,
18,
555,
32,
15,
215,
489,
3384,
118,
263,
20512,
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... |
Automatically opening a file using Windows shell script
===
I have a Windows shell script that opens an application. I'd like to modify it to make it open a file automatically upon opening the application.
I know it uses VBscript but I'm not familiar with the language; all the tutorials I found just talked about using VBS for web pages, not for Windows scripts. I know the syntax is different because I get error messages.
The best "solution" I found was to simply add the file path at the end of the run statement using the "&" symbol, but Windows pops up an error saying the file couldn't be found. Am I missing something? | 0 | [
2,
7499,
1214,
21,
3893,
568,
1936,
3593,
3884,
800,
3726,
3726,
31,
57,
21,
1936,
3593,
3884,
30,
8965,
40,
3010,
9,
31,
22,
43,
101,
20,
17579,
32,
20,
233,
32,
368,
21,
3893,
7499,
685,
1214,
14,
3010,
9,
31,
143,
32,
2027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
User32 API calls in .NET
===
I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to handle this for me.
However, a lot of this functionality is already available in the .NET framework, specifically in the System.Management namespace for dealing with processes and active windows, etc. Some of it seems to be missing, for example the SetForegroundWindow functions.
Are you aware of anything built into the .NET framework that already provides this functionality, or will I need to take the P/Invoke route? | 0 | [
2,
4155,
3125,
21,
2159,
3029,
19,
13,
9,
2328,
800,
3726,
3726,
31,
22,
79,
871,
2334,
70,
21,
669,
4838,
2936,
21,
3593,
4610,
26,
1936,
13,
5,
1281,
27,
319,
5309,
15,
13,
13784,
210,
3524,
6,
9,
207,
31,
2536,
20,
19414,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
User interface design for small displays - resources?
===
I'm developing an application for a small display (1.8" diagonal, 128x160).
Lots of people must be developing for cell phones, so I'm hoping for pointers to online resources for user interfaces with small displays and limited input.
-Adam | 0 | [
2,
4155,
6573,
704,
26,
284,
9412,
13,
8,
2566,
60,
800,
3726,
3726,
31,
22,
79,
3561,
40,
3010,
26,
21,
284,
3042,
13,
5,
165,
9,
457,
7,
16807,
15,
13218,
396,
11580,
6,
9,
7503,
16,
148,
491,
44,
3561,
26,
1667,
14830,
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 do you use to create flowcharts?
===
I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio or OmniGraffle comes to mind but they both feel soo bloated and they also tend to emphasize the document formatting/printing side and less on helping to organize the actual logic. Is there anything else out there that fellow developers would recommend?
I'm hoping to find something fairly simple that would let me throw together flowcharts on the fly when I'm working through complex logic. I don't care about formatting or fonts or the like, just something that would help me keep my logic organized as I work through it. Even something that would arrange the chart itself and simply allow me to specify where to branch and what to check, etc.
Any OS would be fine, though I personally lean towards OS X apps as this has recently been my primary work environment. | 0 | [
2,
98,
107,
42,
275,
20,
1600,
3312,
5433,
38,
18,
60,
800,
3726,
3726,
31,
22,
79,
7686,
98,
4672,
148,
57,
216,
4811,
26,
353,
3312,
5433,
38,
18,
9,
4409,
4235,
9060,
1963,
54,
14677,
12461,
10812,
1624,
20,
594,
47,
59,
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... |
RegEx: Grabbing values between quotation marks
===
I have a value like this "Foo Bar" "Another Value" something else
What RegEx expression will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value)? | 0 | [
2,
7953,
1706,
45,
9910,
4070,
128,
22786,
4872,
800,
3726,
3726,
31,
57,
21,
1923,
101,
48,
13,
7,
4120,
111,
748,
7,
13,
7,
14945,
1923,
7,
301,
962,
98,
7953,
1706,
1803,
129,
788,
14,
4070,
12188,
19,
14,
22786,
4872,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... |
Explicit Type Conversion in Scala
===
Lets say I have the following code:
abstract class Animal
case class Dog(name:String) extends Animal
var foo:Animal = Dog("rover")
var bar:Dog = foo //ERROR!
How do I fix the last line of this code? Basically, I just want to do what, in a C-like language would be done:
var bar:Dog = (Dog) foo | 0 | [
2,
14990,
1001,
6263,
19,
25975,
800,
3726,
3726,
6884,
395,
31,
57,
14,
249,
1797,
45,
8502,
718,
2383,
610,
718,
1952,
5,
7259,
45,
11130,
6,
9073,
2383,
4033,
4310,
111,
45,
25480,
800,
1952,
5,
7,
139,
2549,
7,
6,
4033,
748,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting 256 colors out of ruby-ncurses
===
I've got 256 colors working great in my terminal ([test scripts here][1]), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output the colors with any of the various ncurses color changing/string output functions I've found. What gives?
[1]: http://www.frexx.de/xterm-256-notes/ | 0 | [
2,
1017,
13,
16910,
5268,
70,
16,
10811,
8,
103,
4734,
7202,
800,
3726,
3726,
31,
22,
195,
330,
13,
16910,
5268,
638,
374,
19,
51,
3855,
13,
5,
2558,
10543,
17505,
235,
500,
2558,
165,
500,
6,
15,
47,
32,
6604,
638,
76,
31,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Make and build utilities on CentOS/RHEL?
===
I've been unsuccessfully searching for a way to install `make` utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing `gcc`, `gcc-c++` didn't help! Package `build-essential` is not made for CentOS/RHEL. I have RPMFORGE repo enabled in YUM. | 0 | [
2,
233,
17,
1895,
19817,
27,
5802,
759,
118,
139,
9180,
60,
800,
3726,
3726,
31,
22,
195,
74,
12194,
5792,
26,
21,
161,
20,
16146,
13,
1,
11115,
1,
10082,
27,
51,
5802,
759,
331,
9,
135,
9,
31,
22,
195,
292,
120,
109,
12936,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 would I implement a Python bit map?
===
I wish to implement a 2d bit map class in Python. The class would have the following requirements:
1. Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like:
bitmap = Bitmap(8,8)
2. provide an API to access the bits in this 2d map as boolean or even integer values, i.e.:
if bitmap[1, 2] or bitmap.get(0, 1)
3. Able to retrieve the data as packed Binary data. Essentially it would be each row of the bit map concatenated and returned as Binary data. It may be padded to the nearest byte or something similar.
bitmap.data()
4. Be able to create new maps from the binary data retrieved:
new_bitmap = Bitmap(8, 8, bitmap.data())
I know Python is able to perform binary operations, but I'd like some suggestions as how best to use them to implement this class. | 0 | [
2,
184,
83,
31,
8713,
21,
20059,
1142,
2942,
60,
800,
3726,
3726,
31,
2536,
20,
8713,
21,
172,
43,
1142,
2942,
718,
19,
20059,
9,
14,
718,
83,
57,
14,
249,
4786,
45,
137,
9,
1655,
14,
2936,
16,
13,
25267,
18966,
13,
6560,
172,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best IDE for Powershell?
===
What are the different IDE's for PowerShell? Which is the best? | 4 | [
2,
246,
13,
3448,
26,
414,
15984,
60,
800,
3726,
3726,
98,
50,
14,
421,
13,
3448,
22,
18,
26,
414,
15984,
60,
56,
25,
14,
246,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Accessing HttpApplicationState during Session_End
===
In my ASP.NET application using InProc sessions, Session_End calls a static method in another object to do session-specific clean up. This clean up uses a shared database connection that I am storing in application state.
The problem is that I cannot see how to access the application state without passing it (or rather the database connection) as a parameter to the clean up method. Since I am not in a request I have no current HttpContext, and I cannot find any other static method to access the state.
Am I missing something? | 0 | [
2,
1381,
68,
7775,
2552,
20669,
3859,
112,
3723,
1,
2451,
800,
3726,
3726,
19,
51,
28,
306,
9,
2328,
3010,
568,
19,
15617,
5763,
15,
3723,
1,
2451,
3029,
21,
12038,
2109,
19,
226,
3095,
20,
107,
3723,
8,
9219,
2745,
71,
9,
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... |
Authenticating in PHP using LDAP through Active Directory
===
I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 ([adLDAP][1] does it on Apache). Anyone had done anything similar, with success?
[1]: http://adldap.sourceforge.net/ | 0 | [
2,
14351,
1880,
19,
13,
26120,
568,
644,
20472,
120,
1348,
16755,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
161,
20,
14351,
1373,
3878,
120,
644,
20472,
29,
13,
26120,
13,
5,
1410,
1348,
16755,
142,
14,
11747,
6,
9,
5628,
102,
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... |
acts_as_tree does not destroy the model's children
===
I have this Task model:
class Task < ActiveRecord::Base
acts_as_tree :order => 'sort_order'
end
And I have this test
class TaskTest < Test::Unit::TestCase
def setup
@root = create_root
end
def test_destroying_a_task_should_destroy_all_of_its_descendants
d1 = create_task(:parent_id => @root.id, :sort_order => 2)
d2 = create_task(:parent_id => d1.id, :sort_order => 3)
d3 = create_task(:parent_id => d2.id, :sort_order => 4)
d4 = create_task(:parent_id => d1.id, :sort_order => 5)
assert_equal 5, Task.count
d1.destroy
assert_equal @root, Task.find(:first)
assert_equal 1, Task.count
end
end
The test is successful: when I destroy d1, it destroys all the descendants of d1. Thus, after the destroy only the root is left.
However, this test is now failing after I have added a before_save callback to the Task. This is the code I added to Task:
before_save :update_descendants_if_necessary
def update_descendants_if_necessary
handle_parent_id_change if self.parent_id_changed?
return true
end
def handled_parent_id_change
self.children do |sub_task|
#the code within the loop is deliberately commented out
end
end
When I added this code, `assert_equal 1, Task.count` fails, with `Task.count == 4`. I think `self.children` under `handled_parent_id_change` is the culprit, because when I comment out the `self.children do |sub_task|` block, the test passes again.
Any ideas?
| 0 | [
2,
3167,
1,
472,
1,
8101,
630,
52,
4407,
14,
1061,
22,
18,
391,
800,
3726,
3726,
31,
57,
48,
3005,
1061,
45,
718,
3005,
13,
1,
1348,
14953,
45,
45,
8436,
3167,
1,
472,
1,
8101,
13,
45,
7861,
800,
1,
13,
22,
22843,
1,
7861,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 obtain a list of the application domains my application has created?
===
I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID.
After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable.
Purely from a sanity checking point of view, is there a way I can query the CLR to see what app domains are still loaded by the creating app domain (i.e. so I can compare the tracking Hashtable against what the CLR actually sees)?
Thanks in advance.
Kev
| 0 | [
2,
184,
107,
31,
5545,
21,
968,
16,
14,
3010,
15544,
51,
3010,
63,
679,
60,
800,
3726,
3726,
31,
57,
21,
365,
4865,
30,
9695,
4865,
537,
6232,
22,
18,
112,
14,
674,
16,
82,
275,
26,
175,
946,
8674,
9,
31,
22,
195,
74,
10353,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Proper IE6 HTML element dimensions
===
I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using <pre>document.body.clientHeight</pre> but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big.
Now, I really don't want to use browser specific logic and substract a pixel or 2 from each dimension just for IE6. Also, I am not using CSS (width: 100% etc.) for this because I need the pixel amounts.
Does anyone know a better way to fill the viewport with an element in IE6+ (obviously all good browsers, too)? | 0 | [
2,
4119,
13,
660,
379,
13,
15895,
4520,
9913,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
14,
9456,
17,
2947,
16,
40,
4520,
29,
8247,
8741,
20,
1227,
14,
1078,
16495,
1418,
1993,
15,
17,
31,
22,
79,
1300,
568,
13,
1,
3515,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best way to document AJAX + PHP code?
===
I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - is split and mixed between server-side and client-side code. Sometimes there's also database-side code (stored procedures, views, etc) that is doing part of the work.
This challenges me to come up with an efficient way to document such code. I usually provide a list of .js files inside .php file as well as list of .php files inside .js file. I also do in-line comments and function descriptions, where I list what function is used by what file and what output is expected. I do similar tasks for database procedures. Maybe there's a better method?
Any ideas or experiences? | 0 | [
2,
246,
161,
20,
4492,
20624,
2754,
13,
26120,
1797,
60,
800,
3726,
3726,
31,
57,
550,
74,
26,
4492,
68,
1797,
15,
47,
76,
32,
1624,
20,
20624,
2754,
13,
26120,
15,
32,
22,
18,
52,
550,
2010,
45,
14,
1797,
25,
510,
1789,
70,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find out which remote branch a local branch is tracking
===
How can I find out which remote branch a local branch is tracking?
Do I need to parse git config output, or is there a command that would do this for me? | 0 | [
2,
477,
70,
56,
5388,
1686,
21,
375,
1686,
25,
10353,
800,
3726,
3726,
184,
92,
31,
477,
70,
56,
5388,
1686,
21,
375,
1686,
25,
10353,
60,
107,
31,
376,
20,
2017,
870,
13,
10404,
13,
14093,
2816,
5196,
15,
54,
25,
80,
21,
1202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
What's in your .zshrc?
===
I always find it interesting what people put in their programming environments. After reading the same basic question for .vimrc and .bashrc, I have to ask for my favorite shell. So what's in yours? | 0 | [
2,
98,
22,
18,
19,
154,
13,
9,
380,
1635,
5453,
60,
800,
3726,
3726,
31,
550,
477,
32,
4883,
98,
148,
442,
19,
66,
3143,
11246,
9,
75,
1876,
14,
205,
2125,
1301,
26,
13,
9,
1755,
79,
5453,
17,
13,
9,
6093,
3112,
150,
15,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript memory profiler for Firefox
===
Is there a tool/plugin/function for Firefox that'll dump out a memory usage of Javascript objects that you create in a page/script? I know about Firebug's profiler but I'd like something more than just times. Something akin to what Yourkit has for Java profiling of memory usage.
Reason is that a co-worker is using id's for "keys" in an array and is creating 1000's of empty slots when he does this. He's of the opinion that this is harmless whereas I differ. I'd like to offer some proof to prove whether I'm right or not.
Thanks in advance.
| 0 | [
2,
8247,
8741,
1912,
5296,
139,
26,
535,
18219,
800,
3726,
3726,
25,
80,
21,
5607,
118,
18527,
5831,
118,
22359,
26,
535,
18219,
30,
22,
211,
11424,
70,
21,
1912,
7514,
16,
8247,
8741,
3916,
30,
42,
1600,
19,
21,
2478,
118,
8741,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best practices for migrating web application from Netscape to IIS?
===
We are in the process of developing a .NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so that the requests are responded by IIS. at the same time we would still need the Netscape server so as to redirect the users from the IIS web app for the regions of the web site which the new application doesn't process (yet).
The old application is frame based, so we plan on using IFrames in the content area (of a master page in web client software factory) and use a URL rewrite engine to render pages from the old system in the iframe.
We also need to point the DNS entry which currently points to the Netscape server to IIS.
Are there and best practices for the above activities? | 0 | [
2,
246,
5242,
26,
28749,
2741,
3010,
37,
4275,
13109,
20,
595,
18,
60,
800,
3726,
3726,
95,
50,
19,
14,
953,
16,
3561,
21,
13,
9,
2328,
432,
595,
18,
2812,
2741,
3010,
28,
141,
16,
21,
302,
8,
27035,
68,
669,
9,
14,
501,
274... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 command to refresh environment variables from the command prompt in Windows?
===
If I modify or add an environment variable I have to restart the command prompt (minor inconvenience). Is there a command I could execute that would do this without restarting CMD? | 0 | [
2,
25,
80,
21,
1202,
20,
24905,
2307,
12157,
37,
14,
1202,
11443,
4417,
19,
1936,
60,
800,
3726,
3726,
100,
31,
17579,
54,
3547,
40,
2307,
7612,
31,
57,
20,
22767,
14,
1202,
11443,
4417,
13,
5,
2160,
248,
19,
1126,
21460,
2940,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to deploy an already built Drupal site?
===
I'm a Drupal newbie. Is it possible to set up everything and deploy Drupal on the server? I mean things like putting in the content, setting up the modules, etc..., then you put it all up to the production server?
Thanks in advance! | 0 | [
2,
25,
32,
938,
20,
17617,
40,
614,
392,
15708,
6720,
689,
60,
800,
3726,
3726,
31,
22,
79,
21,
15708,
6720,
78,
5893,
9,
25,
32,
938,
20,
309,
71,
796,
17,
17617,
15708,
6720,
27,
14,
8128,
60,
31,
884,
564,
101,
3873,
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... |
C++ Strategy Design Pattern, making an interface array
===
After having implemented the strategy pattern, I wanted to make an array of the interface-type, to which I can then add any concrete type.
For those who don't know the strategy pattern:
http://en.wikipedia.org/wiki/Strategy_pattern
In this particular example I would want to make a StrategyInterface array, which I can then fill with concrete type's A, B and C. However, because this is an abstract class, I can't get it done. Is there a way to do this, or is it completely impossible, without removing the abstract method?
| 0 | [
2,
272,
20512,
4427,
704,
3732,
15,
544,
40,
6573,
7718,
800,
3726,
3726,
75,
452,
6807,
14,
4427,
3732,
15,
31,
417,
20,
233,
40,
7718,
16,
14,
6573,
8,
4474,
15,
20,
56,
31,
92,
94,
3547,
186,
4105,
1001,
9,
26,
273,
72,
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... |
Coming up to speed on the programming environment
===
I'm not a full-time software guy. In fact, in the last ten years, 90 % of my work was either on the hardware or doing low-level (embedded) code.
But the other 10% involves writing shell scripts for development tools, making kernel changes to add special features, and writing GUI applications for end-users.
The problem is that I find myself facing significant holes in my knowledge, often because it's been years since I've done "X", and I've either forgotten, or the environment has changed.
Every so often, there are threads on TheDailyWTF.com along the lines of "WTF: the guy spent all day writing tons of code, when he could have called foobar() in library baz". I've been there myself, because I don't remember much beyond the #include <stdio.h> stuff (for example), and my quick search somehow missed the right library.
What methods have you found effective to crash-learn and/or crash-refresh yourself in programming environments that you rarely touch? | 2 | [
2,
880,
71,
20,
1362,
27,
14,
3143,
2307,
800,
3726,
3726,
31,
22,
79,
52,
21,
503,
8,
891,
2306,
1244,
9,
19,
837,
15,
19,
14,
236,
652,
122,
15,
3151,
13,
11881,
16,
51,
170,
23,
694,
27,
14,
7610,
54,
845,
708,
8,
3906,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 functional differences exist between WPF and WinForms WebBrowser control?
===
WPF WebBrowser control looks great but knowledge accumlated over time about WinForms WebBrowser is substantial and it's hard to ignore work like csExWB. It would be nice to know what functional shortcomings or advantages exists in .NET 3.5's WPF WebBrowser control over WinForms WebBrowser control. In particular, is it possible to build csExWB-like functionality on top of WPF WebBrowser? | 0 | [
2,
98,
7652,
4921,
3182,
128,
619,
7721,
17,
628,
4190,
18,
10192,
5417,
4104,
569,
60,
800,
3726,
3726,
619,
7721,
10192,
5417,
4104,
569,
1879,
374,
47,
1918,
7602,
723,
6554,
43,
84,
85,
88,
628,
4190,
18,
10192,
5417,
4104,
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... |
LINQ Benchmarks in multitiered environment
===
I am involved in development of a tiered application that uses LINQ2SQL separated from the web server with a NET.TCP Binding on WCF.
My questions are:
1. What sort of measures should I take
to achieve the best performance?
2. Since the entity objects returned by
the LINQ need to be converted to a
IEnumerable list to be serialized
everytime, is there anyway to remove
this dependency? | 0 | [
2,
6294,
1251,
25324,
18,
19,
1889,
5259,
69,
2307,
800,
3726,
3726,
31,
589,
1013,
19,
522,
16,
21,
7197,
69,
3010,
30,
2027,
6294,
1251,
135,
18,
22402,
4196,
37,
14,
2741,
8128,
29,
21,
4275,
9,
38,
7439,
8728,
27,
11801,
410... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Binding Gtk# NodeView to a IList?
===
I've got a data object with a component in it that is an System.Collections.Generic.IList, and I'd like to reflect changes to that list into a Gtk# NodeView, so that when an item is added to the list, the NodeView will get a new item added to it.
How would I listen for changes to an IList? I have considered wrapping the IList with a class that implements IList, delegates the requisite methods, and broadcasts an event when changing it's contents, but that seems like a lot of work for something that has probably already been solved by someone else. | 0 | [
2,
8728,
9509,
197,
5910,
15421,
4725,
20,
21,
31,
5739,
60,
800,
3726,
3726,
31,
22,
195,
330,
21,
1054,
3095,
29,
21,
5912,
19,
32,
30,
25,
40,
329,
9,
15015,
5757,
9,
17083,
596,
9,
49,
5739,
15,
17,
31,
22,
43,
101,
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... |
Greasemonkey: love it or hate it?
===
As users, we love the power of Greasemonkey. As developers, it can complicate things.
Some [people][1] advocate defensively disabling user scripts; others are willing to die to defend them.
Is there a middle ground? How can we reduce the threat of an evolutionary arms race between users and unscrupulous advertisers?
[1]: http://dean.edwards.name/weblog/2005/03/ungreased/ | 0 | [
2,
21167,
2111,
4237,
45,
339,
32,
54,
3223,
32,
60,
800,
3726,
3726,
28,
3878,
15,
95,
339,
14,
414,
16,
21167,
2111,
4237,
9,
28,
10168,
15,
32,
92,
13,
960,
26811,
564,
9,
109,
636,
10171,
500,
2558,
165,
500,
7645,
4222,
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... |
Change min/max/close buttons theme
===
im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.
I looked into what controls them and the mouse messages do. However they also contol resizing and other functions that i dont want to loose.
Is there an easy way to just change the theme of these buttons?
Windows XP
MFC Forms
Visual studio 2005 | 0 | [
2,
753,
4232,
118,
8304,
118,
14330,
12861,
3184,
800,
3726,
3726,
797,
871,
84,
1340,
68,
14,
19312,
1,
6897,
20578,
15,
19312,
1,
6897,
16304,
10454,
17,
19312,
1,
6897,
19516,
1373,
20,
5107,
51,
258,
1665,
118,
17794,
581,
748,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Accessing crash logs on iPhones used for ad hoc distribution
===
When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs.
How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would likely be the case if you were distributing your app to them via ad hoc distribution for beta testing? | 0 | [
2,
1381,
68,
4597,
18893,
27,
21024,
18,
147,
26,
21,
43,
21061,
2523,
800,
3726,
3726,
76,
568,
53,
22,
18,
258,
21024,
26,
522,
32,
22,
18,
2010,
511,
20,
1381,
186,
4597,
18893,
1197,
993,
9375,
8,
1,
6826,
11907,
8,
1,
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... |
Making locking easier in MTAs
===
In multi-threaded code, when an instance may be read or written by multiple threads, they need to be locked on to perform these operations safely.
To avoid the repetition of creating an object to lock on and writing a bunch of lock statements through code, I've created a generic class to handle the locking.
Am I missing anything, conceptually? This should work, right?
public class Locked<T> where T : new()
{
private readonly object locker = new object();
private T value;
public Locked()
: this(default(T))
{ }
public Locked(T value)
{
this.value = value;
}
public T Get()
{
lock (this.locker)
{
return this.value;
}
}
public void Set(T value)
{
lock (this.locker)
{
this.value = value;
}
}
}
And an example of it being used in a class:
private Locked<bool> stopWorkerThread = new Locked<bool>();
public void WorkerThreadEntryPoint()
{
while (true)
{
if (this.stopWorkerThread.Get())
{
break;
}
Also, how would I test something like this, in an automated way (e.g. create a unit test)? | 0 | [
2,
544,
17538,
4950,
19,
307,
6922,
800,
3726,
3726,
19,
1889,
8,
96,
10647,
69,
1797,
15,
76,
40,
4851,
123,
44,
1302,
54,
642,
34,
1886,
20396,
15,
59,
376,
20,
44,
4011,
27,
20,
2985,
158,
1311,
9817,
9,
20,
2658,
14,
23184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 there be a difference between an empty BSTR and a NULL BSTR?
===
When maintaining a COM interface should an empty BSTR be treated the same way as NULL?
In other words should these two function calls produce the same result?
// Empty BSTR
CComBSTR empty(L""); // Or SysAllocString(L"")
someObj->Foo(empty);
// NULL BSTR
someObj->Foo(NULL);
| 0 | [
2,
378,
80,
44,
21,
2841,
128,
40,
2424,
334,
9729,
17,
21,
16203,
334,
9729,
60,
800,
3726,
3726,
76,
8215,
21,
13,
960,
6573,
378,
40,
2424,
334,
9729,
44,
4789,
14,
205,
161,
28,
16203,
60,
19,
89,
715,
378,
158,
81,
1990,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 was your worst client request/specification?
===
What was the vaguest, most contradictory, physically impossible, or sheer gibberish spec you have ever received from a client?
And more interesting, how did you handle it? | 0 | [
2,
98,
23,
154,
4126,
6819,
3772,
118,
9219,
857,
60,
800,
3726,
3726,
98,
23,
14,
14800,
384,
15,
127,
29160,
15,
7994,
3992,
15,
54,
14694,
18814,
106,
1595,
12737,
42,
57,
462,
420,
37,
21,
6819,
60,
17,
91,
4883,
15,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Examples of Requirement Documents
===
I was wondering if anyone could provide me some information on what they put in a requirements document, how do you structure it? I'm the lead for the first time ever and I want to make sure I provide good documents so the project will succeed.
Any templates/examples would be great. | 0 | [
2,
3770,
16,
8981,
4374,
800,
3726,
3726,
31,
23,
5712,
100,
1276,
110,
1181,
55,
109,
676,
27,
98,
59,
442,
19,
21,
4786,
4492,
15,
184,
107,
42,
1411,
32,
60,
31,
22,
79,
14,
672,
26,
14,
64,
85,
462,
17,
31,
259,
20,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Lightweight web app server for PHP?
===
I'm doing PHP development. And coming from a Rails background, I'm looking for a like-for-like replacement for Webrick for PHP. Is there such a light weight server? Apache is actually fine. But I would like to know if there're other options. Or do most of you use Apache? | 0 | [
2,
13613,
2741,
4865,
8128,
26,
13,
26120,
60,
800,
3726,
3726,
31,
22,
79,
845,
13,
26120,
522,
9,
17,
880,
37,
21,
2240,
18,
2395,
15,
31,
22,
79,
699,
26,
21,
101,
8,
1106,
8,
1403,
4610,
26,
95,
21406,
26,
13,
26120,
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... |
Formatting a list of text into columns
===
I'm trying to output a list of string values into a 2 column format. The standard way of making a list of strings into "normal text" is by using the **string.join** method. However, it only takes 2 arguments so I can only make a single column using "\n". I thought trying to make a loop that would simply add a tab between columns would do it but the logic didn't work correctly.
I found an [ActiveState page][1] that has a fairly complicated way of doing it but it's from 4 years ago. Is there an easy way to do it nowadays?
[1]: http://code.activestate.com/recipes/302380/ | 0 | [
2,
2595,
1203,
21,
968,
16,
1854,
77,
7498,
800,
3726,
3726,
31,
22,
79,
749,
20,
5196,
21,
968,
16,
3724,
4070,
77,
21,
172,
4698,
2595,
9,
14,
1236,
161,
16,
544,
21,
968,
16,
7887,
77,
13,
7,
17462,
1854,
7,
25,
34,
568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 turn these 3 methods into one using C# generics?
===
I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the rest should just work anyway with the same solution.
private object EvaluateUInt64(UInt64 x, UInt64 y)
{
switch (Operation)
{
case BinaryOp.Add:
return x + y;
case BinaryOp.Subtract:
return x - y;
case BinaryOp.Multiply:
return x * y;
case BinaryOp.Divide:
return x / y;
case BinaryOp.Remainder:
return x % y;
default:
throw new ApplicationException("error");
}
}
private object EvaluateFloat(float x, float y)
{
switch(Operation)
{
case BinaryOp.Add:
return x + y;
case BinaryOp.Subtract:
return x - y;
case BinaryOp.Multiply:
return x * y;
case BinaryOp.Divide:
return x / y;
case BinaryOp.Remainder:
return x % y;
default:
throw new ApplicationException("error");
}
}
private object EvaluateDouble(double x, double y)
{
switch (Operation)
{
case BinaryOp.Add:
return x + y;
case BinaryOp.Subtract:
return x - y;
case BinaryOp.Multiply:
return x * y;
case BinaryOp.Divide:
return x / y;
case BinaryOp.Remainder:
return x % y;
default:
throw new ApplicationException("error");
}
}
I am building a simple expression parser that then needs to evaluate the simple binary operations such as addition/subtraction etc. I use the above methods to get the actual maths performed using the relevant types. But there has got to be a better answer! | 0 | [
2,
184,
20,
805,
158,
203,
3195,
77,
53,
568,
272,
5910,
12733,
18,
60,
800,
3726,
3726,
31,
57,
52,
147,
12733,
18,
212,
17,
86,
1967,
1465,
70,
100,
32,
25,
938,
20,
805,
14,
249,
132,
3195,
77,
53,
568,
12733,
18,
20,
413... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 create a Windows Media Player plugin in Visual Studio 2008
===
Ive been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template - MSDN provides advice <a href="http://msdn.microsoft.com/en-us/library/bb262076(VS.85).aspx">here</a>, but it does not appear to be relevant to VS2008.
Can anyone suggest how to start a WMP plugin in Visual Studio? | 0 | [
2,
184,
20,
1600,
21,
1936,
941,
517,
10922,
108,
19,
3458,
1120,
570,
800,
3726,
3726,
5568,
74,
749,
20,
1600,
21,
1936,
941,
517,
10922,
108,
19,
3458,
1120,
570,
15,
17,
589,
452,
374,
6967,
3007,
14,
4456,
22894,
13,
8,
423... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linking against a specific shared library version in linux
===
My build process consists of Qt's qmake Makefile generator and the typical make utility bundled with linux.
My application consists of a few shared libraries and the main application is linked against them.
How can I apply the typical linux versioning scheme on my libraries? (Use version 2 -> link against foo.so.2 that points to foo.so.2.y.z with an ldconfig generated link).
The answer doesn't have to be specific for my build process. | 0 | [
2,
12585,
149,
21,
1903,
2592,
1248,
615,
19,
13024,
800,
3726,
3726,
51,
1895,
953,
2043,
16,
2593,
38,
22,
18,
2593,
11115,
233,
16877,
15286,
17,
14,
3874,
233,
10082,
10194,
43,
29,
13024,
9,
51,
3010,
2043,
16,
21,
310,
2592,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Applying a common font scheme to multiple objects in wxPython
===
Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a **SetFont()** call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and *wxPython In Action* book don't discuss this.
Is there a way to easily apply the same SetFont() method to all these text objects without making separate calls each time? | 0 | [
2,
11989,
21,
757,
9978,
4276,
20,
1886,
3916,
19,
619,
396,
6448,
11570,
800,
3726,
3726,
151,
436,
31,
129,
275,
14,
205,
9978,
4276,
26,
12038,
1854,
19,
21,
619,
396,
6448,
11570,
3010,
9,
871,
31,
589,
544,
21,
13,
1409,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NHibernate session management in Windows Service applications
===
I'm developing and application that runs as a Windows service. There are other components which include a few WCF services, a client GUI and so on - but it is the Windows service that access the database.
So, the application is a long-running server, and I'd like to improve its performance and scalability, I was looking to improve data access among other things. I posted in another thread about second-level caching.
This post is about session management for the long-running thread that accesses the database.
Should I be using a thread-static context?
If so, is there any example of how that would be implemented.
Every one around the net who is using NHibernate seem to be heavily focussed on web-application style architectures. There seems to be a great lack of documentation / discussion for non-web app designs.
At the moment, my long running thread does this:
1. Call 3 or 4 DAO methods
2. Verify the state of the detached objects returned.
3. Update the state if needed.
4. Call a couple of DAO methods to persist the updated instances. (pass in the id of the object and the instance itself - the DAO will retrieve the object from the DB again, and set the updated values and session.SaveOrUpdate() before committing the transaction.
5. Sleep for 'n' seconds
6. Repeat all over again!
So, the following is a common pattern we use for each of the DAO methods:
- Open session using sessionFactory.OpenSession()
- Begin transaction
- Do db work. retrieve / update etc
- Commit trans
- (Rollback in case of exceptions)
- Finally always dispose transaction and session.Close()
This happens for *every* method call to a DAO class.
I suspect this is some sort of an anti-pattern the way we are doing it.
However, I'm not able to find enough direction anywhere as to how we could improve it.
Pls note, while this thread is running in the background, doing its stuff, there are requests coming in from the WCF clients each of which could make 2-3 DAO calls themselves - sometimes querying/updating the same objects the long running thread deals with.
Any ideas / suggestions / pointers to improve our design will be greatly appreciated.
If we can get some good discussion going, we could make this a community wiki, and possbily link to here from NHForge.org
Krishna | 0 | [
2,
12109,
15191,
8820,
3723,
1097,
19,
1936,
365,
3767,
800,
3726,
3726,
31,
22,
79,
3561,
17,
3010,
30,
1461,
28,
21,
1936,
365,
9,
80,
50,
89,
5090,
56,
468,
21,
310,
11801,
410,
687,
15,
21,
6819,
9457,
17,
86,
27,
13,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LaTeX Beamer package, change frame title in \againframe
===
Is it possible to change the frame title when using \againframe from the Beamer package, in LaTeX? I would like to have a previous frame displayed, at a specific slide inside the frame, but with a different title this time.
Thanks. | 0 | [
2,
456,
396,
5581,
106,
6030,
15,
753,
3523,
581,
19,
13,
1,
18762,
8361,
800,
3726,
3726,
25,
32,
938,
20,
753,
14,
3523,
581,
76,
568,
13,
1,
18762,
8361,
37,
14,
5581,
106,
6030,
15,
19,
456,
396,
60,
31,
83,
101,
20,
57,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using Java-classes with C#
===
I have a project written in Java (>1.5).
Is it possible to write parts of the project with C#?<br>
For instance the GUI and calling the methods and instanciate the classes written in java?
If yes, how? | 0 | [
2,
568,
8247,
8,
1898,
160,
29,
272,
5910,
800,
3726,
3726,
31,
57,
21,
669,
642,
19,
8247,
13,
5,
1,
165,
9,
264,
6,
9,
25,
32,
938,
20,
2757,
1341,
16,
14,
669,
29,
272,
5910,
60,
1,
5145,
1,
26,
4851,
14,
9457,
17,
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... |
Functional languages - when to use?
===
There's more and more attention on languages such as haskell and f# and although i can see the parallelisation benefits where processing large amounts of data. I cannot see where a functional language would fit into standard lob development. So for the majority is there a use for functional languages? | 4 | [
2,
7652,
2556,
13,
8,
76,
20,
275,
60,
800,
3726,
3726,
80,
22,
18,
91,
17,
91,
1220,
27,
2556,
145,
28,
63,
16507,
17,
398,
5910,
17,
419,
31,
92,
196,
14,
3821,
4330,
5800,
113,
5511,
370,
8545,
16,
1054,
9,
31,
1967,
196,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Delete all tables in Derby DB
===
How do i delete all the tables in the schema on Apache Derby DB using JDBC? | 0 | [
2,
27448,
65,
7484,
19,
6473,
13,
9007,
800,
3726,
3726,
184,
107,
31,
27448,
65,
14,
7484,
19,
14,
23874,
27,
17140,
6473,
13,
9007,
568,
487,
43,
7229,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Interface "recursion" and reference counting
===
I have a small problem with interfaces. Here it is in Pseudo code :
type
Interface1 = interface
end;
Interface2 = interface
end;
TParentClass = class(TInterfacedObject, Interface1)
private
fChild : Interface2;
public
procedure AddChild(aChild : Interface2);
end;
TChildClass = class(TInterfacedObject, Interface2)
private
fParent : Interface2;
public
constructor Create(aPArent : Interface1);
end;
Can anyone see the flaw? I need the child to have a reference to it's parent, but the reference counting doesn't work in this situation. If I create a ParentClass instance, and add a child, then the parent class is never released. I can see why. How do I get round it?
| 0 | [
2,
6573,
13,
7,
99,
4734,
5991,
7,
17,
2801,
11195,
800,
3726,
3726,
31,
57,
21,
284,
1448,
29,
6573,
18,
9,
235,
32,
25,
19,
8452,
1797,
13,
45,
1001,
6573,
165,
800,
6573,
241,
73,
6573,
135,
800,
6573,
241,
73,
13,
38,
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... |
monitoring memcached stats with openNMS
===
did anyone tried monitoring memcached statistics with openNMS?
If you did, what did you use?
| 0 | [
2,
8984,
55,
79,
793,
6261,
12819,
18,
29,
368,
103,
79,
18,
800,
3726,
3726,
144,
1276,
794,
8984,
55,
79,
793,
6261,
5818,
29,
368,
103,
79,
18,
60,
100,
42,
144,
15,
98,
144,
42,
275,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Visitor Pattern + Open/Closed Principle
===
Is it possible to implement the [Visitor Pattern][1] respecting the [Open/Closed Principle][2], but still be able to add new visitable classes?
The Open/Closed Principle states that "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification".
struct ConcreteVisitable1;
struct ConcreteVisitable2;
struct AbstractVisitor
{
virtual void visit(ConcreteVisitable1& concrete1) = 0;
virtual void visit(ConcreteVisitable2& concrete2) = 0;
};
struct AbstractVisitable
{
virtual void accept(AbstractVisitor& visitor) = 0;
};
struct ConcreteVisitable1 : AbstractVisitable
{
virtual void accept(AbstractVisitor& visitor)
{
visitor.visit(*this);
}
};
struct ConcreteVisitable2 : AbstractVisitable
{
virtual void accept(AbstractVisitor& visitor)
{
visitor.visit(*this);
}
};
You can implement any number of classes which derives from AbstractVisitor: It is open for extension. You cannot add a new visitable class as the classes derived from AbstractVisitor will not compile: It closed for modification.
The AbstractVisitor class tree respects the Open/Closed Principle.
The AbstractVisitable class tree does not respect the Open/Closed Principle, as it cannot be extended.
Is there any other solution than to extend the AbstractVisitor and AbstractVisitable as below?
struct ConcreteVisitable3;
struct AbstractVisitor2 : AbstractVisitor
{
virtual void visit(ConcreteVisitable3& concrete3) = 0;
};
struct AbstractVisitable2 : AbstractVisitable
{
virtual void accept(AbstractVisitor2& visitor) = 0;
};
struct ConcreteVisitable3 : AbstractVisitable2
{
virtual void accept(AbstractVisitor2& visitor)
{
visitor.visit(*this);
}
};
[1]: http://en.wikipedia.org/wiki/Visitor_pattern
[2]: http://en.wikipedia.org/wiki/Open/closed_principle
| 0 | [
2,
10875,
3732,
2754,
368,
118,
20372,
5897,
800,
3726,
3726,
25,
32,
938,
20,
8713,
14,
636,
3762,
242,
248,
3732,
500,
2558,
165,
500,
2873,
68,
14,
636,
10157,
118,
20372,
5897,
500,
2558,
135,
500,
15,
47,
174,
44,
777,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the best way to get all the divisors of a number?
===
Here's the very dumb way:
def divisorGenerator(n):
for i in xrange(1,n+1):
if n%i == 0: yield i
The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb :-)
I can find prime factors and their multiplicity fast enough.
I've an generator that generates factor in this way:
(factor1, multiplicity1)
(factor2, multiplicity2)
(factor3, multiplicity3)
and so on...
i.e. the output of
for i in factorGenerator(100):
print i
is:
(2, 2)
(5, 2)
I don't know how much is this useful for what I want to do (I coded it for other problems), anyway I'd like a smarter way to make
for i in divisorGen(100):
print i
output this:
1
2
4
5
10
20
25
50
100
| 0 | [
2,
98,
25,
14,
246,
161,
20,
164,
65,
14,
13,
11390,
18,
248,
18,
16,
21,
234,
60,
800,
3726,
3726,
235,
22,
18,
14,
253,
9317,
161,
45,
6312,
13,
11390,
18,
248,
17083,
3457,
5,
103,
6,
45,
26,
31,
19,
993,
8366,
5,
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... |
How can I force a complete load along a navigation relationship in Entity Framework?
===
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework.
My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship.
I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct association. Now I want to do this:
ObjectQuery<Member> members = entities.Member;
IQueryable<Member> membersQuery = from m in members select m;
foreach (Member m in membersQuery)
{
Profile p = m.Profile;
...
}
Which halfway works. I am able to iterate through all of the Members. But the problem I'm having is that m.Profile is always null. The examples for LINQ to Entities on the MSDN library seem to suggest that I will be able to seamlessly follow the navigation relationships like that, but it doesn't seem to work that way. I found that if I first load the profiles in a separate call somehow, such as using entities.Profile.ToList, then m.Profile will point to a valid Profile.
So my question is, is there an elegant way to force the framework to automatically load the data along the navigation relationships, or do I need to do that explicitly with a join or something else?
Thanks | 0 | [
2,
184,
92,
31,
558,
21,
1279,
6305,
303,
21,
8368,
1429,
19,
9252,
6596,
60,
800,
3726,
3726,
1705,
15,
86,
31,
22,
79,
845,
51,
64,
26,
3707,
77,
568,
14,
21,
537,
9,
2328,
9252,
6596,
9,
51,
1289,
610,
193,
130,
1103,
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... |
Where is the benefit in using the Strategy Pattern?
===
I've looked at [this explanation on Wikipedia][1], specifically the C++ sample, and fail to recognize the difference between just defining 3 classes, creating instances and calling them, and that example. What I saw was just placing two other classes into the process and cannot see where there would be a benefit. Now I'm sure I'm missing something obvious (wood for the trees) - could someone please explain it using a definitive real-world example?
[1]: http://en.wikipedia.org/wiki/Strategy_pattern | 0 | [
2,
113,
25,
14,
4234,
19,
568,
14,
4427,
3732,
60,
800,
3726,
3726,
31,
22,
195,
292,
35,
636,
1565,
5764,
27,
20169,
500,
2558,
165,
500,
15,
3524,
14,
272,
20512,
5717,
15,
17,
7476,
20,
5844,
14,
2841,
128,
114,
14684,
203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
nhibernate - sort null at end
===
Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle).
Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order? | 0 | [
2,
12109,
15191,
8820,
13,
8,
2058,
16203,
35,
241,
800,
3726,
3726,
568,
12109,
15191,
8820,
37,
272,
5910,
17,
104,
746,
22402,
13,
5,
1270,
4444,
255,
6,
19,
21,
161,
30,
25,
14961,
29,
4235,
4444,
255,
8128,
812,
118,
2753,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 organize Python modules?
===
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them.
How do you keep everything manageable? | 0 | [
2,
184,
107,
42,
9213,
20059,
17113,
60,
800,
3726,
3726,
76,
32,
1624,
20,
11725,
20059,
17113,
15,
51,
1572,
13,
759,
993,
329,
25,
21,
3957,
9,
31,
22,
195,
16875,
3262,
140,
6417,
27,
51,
8590,
43,
17,
90,
1498,
329,
20,
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,
0,
0,
0,
0,
0,
0,
0... |
Where can I learn about the C++ Standard Template Library (STL)?
===
This question is a lot like [Good book for learning the C++ standard template library?][1] but aimed at the cash-strapped student type. I remember searching for some reference material about the STL a while back, but I couldn't find any good links.
Are there any worthwile free tutorials / references / best-practises available?
[1]: http://stackoverflow.com/questions/38499/good-book-for-learning-the-c-standard-template-library | 4 | [
2,
113,
92,
31,
2484,
88,
14,
272,
20512,
1236,
22894,
1248,
13,
5,
18,
7786,
6,
60,
800,
3726,
3726,
48,
1301,
25,
21,
865,
101,
636,
3264,
360,
26,
2477,
14,
272,
20512,
1236,
22894,
1248,
60,
500,
2558,
165,
500,
47,
5414,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: Pulling lowest values in multiple arrays
===
I have one element of a project that is holding me back and try as I might I have not been able to get this to work. Can someone please assist me - I am sure I am just confused by it all and that there is an easy answer. I have 3 multi-dimensional arrays (3 different pricing data from different companies), EACH holding this sort of data:
[0] => Array
(
[itemcode] => 27663
[buy] => 50000
[perquantity] => 5
)
[1] => Array
(
[itemcode] => 38663
[buy] => 41000
[perquantity] => 4
)
The same itemcodes appear in the data from all 3 companies. I was to create an html table that has the following columns from this data:
ItemCode | Supplier1 | Supplier2 | Supplier3 | Difference (2nd lowest minus lowest)
38663 | 12500 | 12425 | 16440 | 75
My question: Is there a shortcut to doing this, say by creating another array to temp store data? Or is there a concept you feel is required to complete this easily?
Any help is VERY appreciated.
| 0 | [
2,
13,
26120,
45,
3303,
6543,
4070,
19,
1886,
7718,
18,
800,
3726,
3726,
31,
57,
53,
4520,
16,
21,
669,
30,
25,
1337,
55,
97,
17,
1131,
28,
31,
530,
31,
57,
52,
74,
777,
20,
164,
48,
20,
170,
9,
92,
737,
2247,
5404,
55,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error 1155. No application is associated
===
everyone.
I've made a setup project for my application in VS 2010.
In XP and WinServer 2008 the application is installed fine, but in Windows 7 it fails in the beginning of the installation with message: "ShellExecuteEx failed; code 1155. No application is associated with the specific file for this operation"
Proper MS Installer is installed on the machine, hh.exe in windows exists to, so .msi and .chm files opens correctly. I think the right question is what is the file type in the install pack that isn't associated with any application.
Any suggestions..? | 0 | [
2,
7019,
137,
11055,
9,
90,
3010,
25,
1598,
800,
3726,
3726,
1266,
9,
31,
22,
195,
117,
21,
18161,
669,
26,
51,
3010,
19,
4611,
498,
9,
19,
23045,
17,
628,
10321,
106,
570,
14,
3010,
25,
4066,
1123,
15,
47,
19,
1936,
453,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Inno setup Exec() function Wait for a limited time
===
In My Inno setup Script I am executing 3rd party executable. I am using Exec() function as below:
Exec(expandconstant('{app}\SomeExe.exe'),'','',SW_HIDE,ewwaituntilterminated,ErrorCode);
By mentioning "ewwaituntilterminated" it waits until the SomeExe.exe doesn't quit. I want to wait only for 10 secs.
Is there any solution for that? | 0 | [
2,
19,
251,
18161,
1396,
3319,
5,
6,
1990,
1760,
26,
21,
1317,
85,
800,
3726,
3726,
19,
51,
19,
251,
18161,
3884,
31,
589,
25836,
203,
897,
346,
1396,
17194,
5924,
9,
31,
589,
568,
1396,
3319,
5,
6,
1990,
28,
1021,
45,
1396,
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... |
Trouble using replaceCurrentItemWithPlayerItem when using MacRuby
===
I am using AVFoundation and MacRuby to handle video playback. I have no trouble getting a video to play in my AVPlayer initially using the code below:
videoWindow.setFrame(@frame, display:true, animate:true)
@content_view = self.videoWindow.contentView
@content_view.wantsLayer = true
asset = AVAsset.assetWithURL(url)
item = AVPlayerItem.new
item.initWithAsset(asset)
$video = AVPlayer.alloc.initWithPlayerItem(item)
@player_layer = AVPlayerLayer.playerLayerWithPlayer($video)
@player_layer.Frame = @frame
@content_view.layer.addSublayer(@player_layer)
@player_layer.videoGravity = AVLayerVideoGravityResize
$video.seekToTime(CMTimeMake(4, 1))
$video.play
Where I run into trouble is when I am trying to change the playback to a new video. To do this I am trying to use the same AVPlayer object and use the replaceCurrentItemWithPlayerItem command. When I try to run this the application stops responding.
asset2 = AVAsset.assetWithURL(@url2)
item2 = AVPlayerItem.new
item2.initWithAsset(asset2)
$video.pause
$video.replaceCurrentItemWithPlayerItem(item2)
I have also tried performingSelectorOnMainThread but I get the same results.
$video.performSelectorOnMainThread('replaceCurrentItemWithPlayerItem:', withObject:item2, waitUntilDone:true)
I am wondering if there is a way to reuse my AVPlayer object to play new items in?
| 0 | [
2,
2572,
568,
3934,
17657,
2119,
79,
1410,
14049,
2119,
79,
76,
568,
1572,
1820,
779,
800,
3726,
3726,
31,
589,
568,
14026,
12235,
857,
17,
1572,
1820,
779,
20,
3053,
763,
21306,
9,
31,
57,
90,
2572,
1017,
21,
763,
20,
418,
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... |
iOS: GLPaint can't draw on large frame
===
Apple example of freehand drawing [GLPaint][1], painting using OpenGL ES can't draw with large frame. I need to draw on a large canvas more than about {2410, 1808}. But when I attempt to draw, get a message on console saying,
2012-06-05 14:29:40.780 GLPaint[3390:707] Frame of drawingView: {{-827.222, -567.004}, {2410, 1808}}
2012-06-05 14:29:40.884 GLPaint[3390:707] failed to make complete framebuffer object 8cd6
On my code I have set the frame as-
//PaintingViewGL performing the freehand drawing of OpenGL ES
//drawingView is a UIView with dynamic frame size
paintingViewGL = [[PaintingViewGL alloc] initWithFrame:drawingView.frame];
paintingViewGL.backgroundColor = [UIColor clearColor];
[drawingView addSubview:paintingViewGL];
paintingViewGL.center = drawingView.center;
paintingViewGL.hidden = NO;
I am getting nice result with frame size {1435, 1076} and on a little larger frame like {1600, 1200} the drawing brush gone like a wave and start dancing on the screen. Sometimes I get Received memory warning. Level=1 on this case.
If anyone face the problem please help me. Thanks in advance
[1]: http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html | 0 | [
2,
13,
7760,
45,
13,
8430,
20578,
92,
22,
38,
2003,
27,
370,
3523,
800,
3726,
3726,
4037,
823,
16,
551,
3203,
3533,
636,
8430,
20578,
500,
2558,
165,
500,
15,
2469,
568,
368,
8430,
13,
160,
92,
22,
38,
2003,
29,
370,
3523,
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 change cell background color or image on click in ipad
===
i want to try ,when i click on cell then color should change and color should stay on that cell which i was clicked.till here i was success in this .But when the table is refresh then cell background color is disappear where i am wrong please help me on this i got code from apple document i use this .I miss some line in code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
//here i create view with color for cell when cell is click this view should display as background i am write or wrong by doing this please help me here why my view is disappear when my tableview is refresh then this view is disapper from cell i want to stay that place till user not click other cell&mt tableview is grouped tableview.
UIView *v = [[[UIView alloc] init] autorelease];
v.layer.cornerRadius =6.0f;
v.backgroundColor = [UIColor darkGrayColor];
cell.selectedBackgroundView = v;
}
return cell;
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0 || indexPath.row%1 == 0) {
UIColor *altCellColor = [UIColor colorWithWhite:0.2 alpha:0.1];
cell.backgroundColor = altCellColor;
}
}
| 0 | [
2,
184,
20,
753,
1667,
2395,
1665,
54,
1961,
27,
10840,
19,
31,
8240,
800,
3726,
3726,
31,
259,
20,
1131,
13,
15,
3185,
31,
10840,
27,
1667,
94,
1665,
378,
753,
17,
1665,
378,
1179,
27,
30,
1667,
56,
31,
23,
15802,
9,
38,
6049... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Endianness fun with SHA-2 algorithm
===
I'm trying to write a SHA-2 implementation, but the result keeps coming back incorrect- I've tested on such things as the empty string. I implemented it in two steps, preprocessing and primary body.
template<typename T> Output<T> sha2(Input<T> in) {
T w[64];
for(int i = 0; i < 16; i++)
w[i] = in.c[i];
for(int i = 16; i < 64; i++) {
auto s0 = _rotr(w[i - 15], 7) ^ _rotr(w[i - 15], 18) ^ (w[i - 15] >> 3);
auto s1 = _rotr(w[i - 2], 17) ^ _rotr(w[i - 2], 19) ^ (w[i - 2] >> 10);
w[i] = w[i - 16] + s0 + w[i - 7] + s1;
}
static const T k[] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
static const T h[] = {
0x6a09e667,
0xbb67ae85,
0x3c6ef372,
0xa54ff53a,
0x510e527f,
0x9b05688c,
0x1f83d9ab,
0x5be0cd19
};
T loopvars[8];
for(int i = 0; i < 8; i++)
loopvars[i] = h[i];
for(int i = 0; i < 64; i++) {
auto&& la = loopvars[0];
auto&& lb = loopvars[1];
auto&& lc = loopvars[2];
auto&& ld = loopvars[3];
auto&& le = loopvars[4];
auto&& lf = loopvars[5];
auto&& lg = loopvars[6];
auto&& lh = loopvars[7];
auto s0 = _rotr(la, 2) ^ _rotr(la, 13) ^ _rotr(la, 22);
auto maj = (la & lb) ^ (la & lc) ^ (lb & lc);
auto t2 = s0 + maj;
auto s1 = _rotr(le, 6) ^ _rotr(le, 11) ^ _rotr(le, 25);
auto ch = (le & lf) ^ ((~le) & lg);
auto t1 = lh + s1 + ch + k[i] + w[i];
lh = lg;
lg = lf;
lf = le;
le = ld + t1;
ld = lc;
lc = lb;
lb = la;
la = t1 + t2;
}
Output<T> output;
for(int i = 0; i < 8; i++) {
output.h[i] = h[i] + loopvars[i];
}
return output;
}
Output<unsigned int> SHA2(std::vector<char> bytes) {
auto bitlen = bytes.size() * 8;
auto big_endian_bitlen = ::_byteswap_uint64(bitlen);
if (bitlen > 440)
throw std::runtime_error("Epic fail!");
Input<unsigned int> in;
for(int i = 0; i < 16; i++) {
in.c[i] = 0;
}
for(int i = 0; i < bitlen; i++) {
in.c[i / 32] |= ((bytes[i / 8] >> ((i % 8) & 1)) << (i % 32));
}
in.c[bitlen / 32] |= (1 << (bitlen % 32));
// all zero by default, so no need to append the extra bits
in.c[14] = (big_endian_bitlen >> 32);
in.c[15] = big_endian_bitlen;
return sha2(in);
}
I suspect endianness error. For example, when I listed the output of the second function, it came back as `1 .. (511x)0`, which I'm pretty sure was correct. But when I tried swapping the values to respect endianness, I still did not get the correct output.
I'm *fairly* sure that the error is in the preprocessing step, as the primary body is endianness-independent, as far as I can tell.
Any suggestions as to where the implementation is incorrect? | 0 | [
2,
241,
806,
720,
2414,
29,
4116,
8,
135,
9083,
800,
3726,
3726,
31,
22,
79,
749,
20,
2757,
21,
4116,
8,
135,
6123,
15,
47,
14,
829,
8968,
880,
97,
18867,
8,
31,
22,
195,
7631,
27,
145,
564,
28,
14,
2424,
3724,
9,
31,
6807,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding control to vb.net tabpage
===
I am trying to display an usercontrol on tabpage. I am using below code to achieve this.
Dim ctrl As TechniciansControl = New TechniciansControl
TabControl1.TabPages(2).Controls.Add(ctrl)
The problem is that the control size is blown up when I run the application. But in the designer, I don't see any issues.
Appreciate any ideas to fix this issue. | 0 | [
2,
4721,
569,
20,
13,
20468,
9,
2328,
6523,
6486,
800,
3726,
3726,
31,
589,
749,
20,
3042,
40,
4155,
12898,
27,
6523,
6486,
9,
31,
589,
568,
1021,
1797,
20,
4689,
48,
9,
5937,
13,
4812,
6362,
28,
12664,
18,
12898,
800,
78,
12664... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Exception in integration of banking api
===
This is an exception referred to me for checking. This exception was raised when doing an API integration of ICICI bank.
> java.lang.Exception: CreateInstance failed: new
> com.opus.epg.sfa.java.BillToAddress
reference URL: http://kndexim.com/java/SFAClient/TestPages/TestSsl.php
I am basically a J2EE developer, i do know only a little bit about php and . I know this is related to some class path problems. can i get a solution for this. If my question is not clear, please ask i will provide more details. | 0 | [
2,
5391,
19,
8078,
16,
8350,
21,
2159,
800,
3726,
3726,
48,
25,
40,
5391,
1870,
20,
55,
26,
9886,
9,
48,
5391,
23,
1127,
76,
845,
40,
21,
2159,
8078,
16,
13,
596,
9198,
965,
9,
13,
1,
8247,
9,
9949,
9,
10066,
872,
45,
1600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
TSVN DNS error: The requested name is valid, but no data of the requested type was found
===
Colleagues,
I've updated my TSVN client and now I'm getting this error when trying to update or commit to different repositories. Any ideas on how I can solve this? Thanks. IE shows up appropriate URL just fine.
TortoiseSVN 1.5.3, Build 13783 | 0 | [
2,
13,
38,
18,
16578,
13,
43,
2172,
7019,
45,
14,
6602,
204,
25,
7394,
15,
47,
90,
1054,
16,
14,
6602,
1001,
23,
216,
800,
3726,
3726,
8493,
15,
31,
22,
195,
6372,
51,
13,
38,
18,
16578,
6819,
17,
130,
31,
22,
79,
1017,
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... |
Is there any LaTeX package for drawing Gantt diagrams?
===
Are there LaTeX packages for (more or less) easily drawing Gantt diagrams?
Thanks. | 0 | [
2,
25,
80,
186,
456,
396,
6030,
26,
3533,
7890,
38,
38,
14161,
18,
60,
800,
3726,
3726,
50,
80,
456,
396,
16875,
26,
13,
5,
1995,
54,
787,
6,
2351,
3533,
7890,
38,
38,
14161,
18,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Programmatically showing a View from an Eclipse Plug-in
===
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.
I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere. | 0 | [
2,
625,
6732,
1326,
3187,
21,
1418,
37,
40,
11652,
10922,
8,
108,
800,
3726,
3726,
31,
57,
21,
10922,
8,
108,
20,
40,
11652,
761,
7439,
3010,
30,
63,
21,
1418,
9,
75,
40,
807,
3690,
19,
14,
761,
7439,
3010,
15,
14,
10922,
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... |
Looking for a Complete Delphi (object pascal) syntax
===
I need a complete Object Pascal syntax (preferably Delphi 2009). Some of the syntax is given by the help files, but not all information is provided. So I started collecting loose bits of information. Recently I added these to a more or less complete syntax description (EBNF like).
Although it looks extensive, there are still bugs and I'm sure parts are missing (specially in the .NET syntax). So I'm asking the SO Delphi community. Do you have any information or can you correct the errors? In return I provide the complete syntax to the community. It probably saves you some time ;-).
In the future, I like to do the same for other languages (Like C#/C++/Java).
The syntax description I already have is given: [My Syntax sofar][1]. Or if you like a [Text version][2]. (The XHTML is generated from the text version).
Please note that the syntax focusses on the syntactical part, because the lexical part is not really a problem.
[1]: http://www.dragonkiller.nl/Delphi/syntax.html
[2]: http://www.dragonkiller.nl/Delphi/syntax.txt | 0 | [
2,
699,
26,
21,
1279,
23030,
13,
5,
23793,
18661,
6,
22649,
800,
3726,
3726,
31,
376,
21,
1279,
3095,
18661,
22649,
13,
5,
3515,
2407,
4801,
23030,
588,
6,
9,
109,
16,
14,
22649,
25,
504,
34,
14,
448,
6488,
15,
47,
52,
65,
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... |
How best to store Subversion version information in EAR's?
===
When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question.
I the case of releasing Java JAR (ear, jar, rar, war) files I would like to be able to look in/at the JAR and switch to the same branch, version or tag that was the source of the released JAR.
How can I best adjust the ant build process so that the version information in the svn checkout remains in the created build?
I was thinking along the lines of:
- adding a VERSION file, but with what content?
- storing information in the META-INF file, but under what property with which content?
- copying sources into the result archive
- added svn:properties to all sources with keywords in places the compiler leaves them be
| 0 | [
2,
184,
246,
20,
1718,
972,
10898,
615,
676,
19,
2330,
22,
18,
60,
800,
3726,
3726,
76,
3396,
21,
6256,
1330,
54,
40,
32,
8,
24364,
38,
8,
3783,
2802,
53,
16,
51,
2104,
18,
2346,
25,
550,
98,
615,
60,
29,
21,
421,
1895,
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... |
Double buffer child controls in custom control (C#)
===
I want to double buffer a custom control which contains buttons. I have tried various ways to double buffer the control; SetStyle, BufferedGraphicsContext, and drawing to a bitmap. These all work fine for the custom drawing of the control, but none of them handle drawing the button to a back buffer. How do I achieve this? | 0 | [
2,
1494,
17497,
850,
8671,
19,
5816,
569,
13,
5,
150,
5910,
6,
800,
3726,
3726,
31,
259,
20,
1494,
17497,
21,
5816,
569,
56,
1588,
12861,
9,
31,
57,
794,
617,
2847,
20,
1494,
17497,
14,
569,
73,
309,
4381,
15,
17497,
69,
12084,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Python book would you recommend for a Linux Sysadmin?
===
[Python for Unix and Linux System Administration][1] is aimed at sysadmins.
Any other favorites besides this.
[1]: http://oreilly.com/catalog/9780596515829/ | 0 | [
2,
56,
20059,
360,
83,
42,
12360,
26,
21,
13024,
10315,
18,
1283,
2160,
60,
800,
3726,
3726,
636,
6448,
11570,
26,
22540,
17,
13024,
329,
1603,
500,
2558,
165,
500,
25,
5414,
35,
10315,
18,
1283,
2160,
18,
9,
186,
89,
3839,
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... |
Problem using the ASP.NET FileUpload control in an UpdatePanel?
===
I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine.
Any ideas why this might be happening? And is there a work-around?
![Screenshot][1]
[1]: http://farm4.static.flickr.com/3086/2914877750_0a68e10ffd.jpg?v=0 | 0 | [
2,
1448,
568,
14,
28,
306,
9,
2328,
3893,
576,
8294,
569,
19,
40,
11100,
3206,
532,
60,
800,
3726,
3726,
31,
22,
79,
946,
77,
40,
1513,
113,
31,
57,
21,
3893,
576,
8294,
569,
19,
40,
11100,
3206,
532,
9,
76,
31,
1735,
20,
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... |
Excel 2003 XML format - AutoFitWidth not working
===
I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically.
A snippet of what I produce:
<Table >
<Column ss:AutoFitWidth="1" ss:Width="2"/>
<Row ss:AutoFitHeight="0" ss:Height="14.55">
<Cell ss:StyleID="s62"><Data ss:Type="String">Database</Data></Cell>
This does not set the column to autofit. I have tried not setting width, I have tried many things and I am stuck.
Thanks. | 0 | [
2,
20700,
973,
23504,
2595,
13,
8,
3108,
11765,
3976,
43,
96,
52,
638,
800,
3726,
3726,
31,
57,
21,
625,
30,
9286,
18,
70,
40,
20700,
170,
5199,
19,
20700,
973,
23504,
2595,
9,
32,
693,
1123,
29,
53,
1448,
15,
31,
1967,
164,
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... |
Detecting appearance/disapperance of volumes on osx
===
I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then only sometimes.
What's the right way to do this?
| 0 | [
2,
9092,
68,
1468,
118,
2906,
22306,
14866,
16,
6127,
27,
13,
759,
396,
800,
3726,
3726,
31,
259,
20,
11100,
21,
968,
16,
4326,
4690,
28,
14,
4155,
14692,
18,
182,
220,
5534,
15,
10621,
4886,
8582,
18,
17,
2149,
18,
8582,
3502,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Namespaces and Operator Overloading in C++
===
When authoring a library in a particular namespace, it's often convenient to provide overloaded operators for the classes in that namespace. It seems (at least with g++) that the overloaded operators can be implemented either in the library's namespace:
namespace Lib {
class A {
};
A operator+(const A&, const A&);
} // namespace Lib
or the global namespace
namespace Lib {
class A {
};
} // namespace Lib
Lib::A operator+(const Lib::A&, const Lib::A&);
From my testing, they both seem to work fine. Is there any practical difference between these two options? Is either approach better? | 0 | [
2,
204,
5582,
18,
17,
6022,
84,
16866,
19,
272,
20512,
800,
3726,
3726,
76,
1314,
68,
21,
1248,
19,
21,
1498,
204,
5582,
15,
32,
22,
18,
478,
12845,
20,
1181,
84,
22546,
9475,
26,
14,
2684,
19,
30,
204,
5582,
9,
32,
2206,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to find and tail the Oracle alert log
===
When you take your first look at an Oracle database, one of the first questions is often "where's the alert log?". Grid Control can tell you, but its often not available in the environment.
I posted some bash and perl scripts to find and tail the alert log [on my blog][1] some time back, and I'm surprised to see that post still getting lots of hits.
The technique used is to lookup background\_dump\_dest from v$parameter. But I only tested this on Oracle Database 10g.
Is there a better approach than this? And does anyone know if this still works in 11g?
[1]: http://tardate.blogspot.com/2007/04/find-and-tail-oracle-alert-log.html | 0 | [
2,
184,
20,
477,
17,
3424,
14,
15759,
7863,
6738,
800,
3726,
3726,
76,
42,
247,
154,
64,
361,
35,
40,
15759,
6018,
15,
53,
16,
14,
64,
2346,
25,
478,
13,
7,
2798,
22,
18,
14,
7863,
6738,
60,
7,
9,
7354,
569,
92,
494,
42,
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... |
KSH scripting: how to split on ',' when values have escaped commas?
===
I try to write KSH script for processing a file consisting of name-value pairs, several of them on each line.
Format is:
NAME1 VALUE1,NAME2 VALUE2,NAME3 VALUE3, etc
Suppose I write:
read l
IFS=","
set -A nvls $l
echo "$nvls[2]"
This will give me second name-value pair, nice and easy. Now, suppose that the task is extended so that values could include commas. They should be escaped, like this:
NAME1 VALUE1,NAME2 VALUE2_1\,VALUE2_2,NAME3 VALUE3, etc
Obviously, my code no longer works, since "read" strips all quoting and second element of array will be just "NAME2 VALUE2_1".
I'm stuck with older ksh that does not have "read -A array". I tried various tricks with "read -r" and "eval set -A ....", to no avail. I can't use "read nvl1 nvl2 nvl3" to do unescaping and splitting inside read, since I dont know beforehand how many name-value pairs are in each line.
Does anyone have a useful trick up their sleeve for me? | 0 | [
2,
680,
1635,
3884,
68,
45,
184,
20,
2132,
27,
13,
22,
15,
22,
76,
4070,
57,
5409,
11951,
472,
60,
800,
3726,
3726,
31,
1131,
20,
2757,
680,
1635,
3884,
26,
5511,
21,
3893,
4160,
16,
204,
8,
15165,
7473,
15,
238,
16,
105,
27,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How does two-phase commits prevent last-second failure?
===
I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to go ahead and commit.
What prevents the following failure?
1) All nodes respond that they are ready to commit
2) The transaction coordinator tells them to "go ahead and commit" but one of the nodes crashes before receiving this message
3) All other nodes commit successfully, but now the distributed transaction is corrupt
4) It is my understanding that when the crashed node comes back, its transaction will have been rolled back (since it never got the commit message)
What did I miss? | 0 | [
2,
184,
630,
81,
8,
20043,
9686,
18,
2501,
236,
8,
5007,
2990,
60,
800,
3726,
3726,
31,
589,
4493,
184,
81,
8,
20043,
9686,
693,
464,
21,
4387,
12799,
9,
32,
25,
51,
3260,
30,
19,
14,
236,
141,
16,
14,
2702,
14,
12799,
10512,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Browsing directory without using mapped drive
===
Is there an app or way to browse a directory that requires different login credentials without using a mapped drive?
The issue is given one login credential Windows Explorer only allows you to map it to one drive and disallows using the same login credential to map to a different drive. | 0 | [
2,
10175,
68,
16755,
366,
568,
20877,
1493,
800,
3726,
3726,
25,
80,
40,
4865,
54,
161,
20,
10175,
62,
21,
16755,
30,
4781,
421,
6738,
108,
5059,
43,
10107,
18,
366,
568,
21,
20877,
1493,
60,
14,
1513,
25,
504,
53,
6738,
108,
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... |
Example websites using db4o
===
I'm very impressed with my initial tests with db4o. However, i'm wondering just how many enterprise class websites are out there powered by db4o, i couldn't see any on the main website?
I can't see any reason why db4o should not be used. There appears to be decent enough support for transactions and ways to handle concurrency for example.
Anyone got a list of websites i could look at? | 0 | [
2,
823,
13931,
568,
13,
9007,
300,
111,
800,
3726,
3726,
31,
22,
79,
253,
7059,
29,
51,
2104,
4894,
29,
13,
9007,
300,
111,
9,
207,
15,
31,
22,
79,
5712,
114,
184,
151,
6002,
718,
13931,
50,
70,
80,
7462,
34,
13,
9007,
300,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best generic strategy to group items using multiple criteria
===
I have a simple, real life problem I want to solve using an OO approach. **My harddrive is a mess.** I have 1.500.000 files, duplicates, complete duplicate folders, and so on...
The first step, of course, is parsing all the files into my database. No problems so far, now I got a lot of nice entries which are kind of "naturaly grouped". Examples for this simple grouping can be obtained using simple queries like:
1. Give me all files bigge than 100MB
2. Show all files older than 3 days
3. Get me all files ending with docx
But now assume I want to find groups with a little more natural meaning. There are different strategies for this, depending on the "use case".
Assume I have a bad habit of putting all my downloaded files first on the desktop. Then I extract them to the appropriate folder, without deleting the ZIP file always. The I move them into a "attic" folder. For the system, to find this group of files a **time orientied** search approach, perhaps combined with a "check if ZIP is same then folder X" would be suitable.
Assume another bad habit of duplicating files, having some folder where "the clean files" are located in a **nice structure**, and another **messy folders**. Now my clean folder has 20 picture galleries, my messy folder has 5 duplicated and 1 new gallery. A human user could easily identify this logic by seeing "Oh, thats all just duplicates, thats a new one, so I put the new one in the clean folder and trash all the duplicates".
**So, now to get to the point:**
Which combination of strategies or patterns would you use to tackle such a situation. If I chain filters the "hardest" would win, and I have no idea how to let the system "test" for suitable combination. And it seemes to me it is more then just filtering. Its dynamic grouping by combining multiple criteria to find the "best" groups.
One very rough approach would be this:
1. In the beginning, all files are equal
2. The first, not so "good" group is the directory
3. If you are a big, clean directory, you earn points (evenly distributed names)
4. If all files have the same creation date, you may be "autocreated"
5. If you are a child of Program-Files, I don't care for you at all
6. If I move you, group A, into group C, would this improve the "entropy"
What are the best patterns fitting this situation. Strategy, Filters and Pipes, "Grouping".. Any comments welcome!
Chris
| 0 | [
2,
246,
12733,
4427,
20,
214,
3755,
568,
1886,
9157,
800,
3726,
3726,
31,
57,
21,
1935,
15,
683,
201,
1448,
31,
259,
20,
8402,
568,
40,
13,
4328,
2141,
9,
13,
1409,
915,
552,
14573,
25,
21,
3957,
9,
1409,
31,
57,
137,
9,
6000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
State of "memset" functionality in C++ with modern compilers
===
<h2>Context:</h2>
A while ago, I stumbled upon this 2001 DDJ article by Alexandrescu:
<http://www.ddj.com/cpp/184403799>
It's about comparing various ways to initialized a buffer to some value. Like what "memset" does for single-byte values. He compared various implementations (memcpy, explicit "for" loop, duff's device) and did not really find the best candidate across all dataset sizes and all compilers.
Quote:
> There is a very deep, and sad, realization underlying all this. We are in 2001, the year of the Spatial Odyssey. (...) Just step out of the box and look at us — after 50 years, we're still not terribly good at filling and copying memory.
<h2>Question:</h2>
<ol>
<li>does anyone have more recent information about this problem ? Do recent GCC and Visual C++ implementations perform significantly better than 7 years ago ?
<li>I'm writing code that has a lifetime of 5+ (probably 10+) years and that will process arrays' sizes from a few bytes to hundred of megabytes. I can't assume that my choices now will still be optimal in 5 years. What should I do:
<ul>
<li>a) use the system's memset (or equivalent) and forget about optimal performance or assume the runtime and compiler will handle this for me.
<li>b) benchmark once and for all on various array sizes and compilers and switch at runtime between several routines.
<li>c) run the benchmark at program initialization and switch at runtime based on accurate (?) data.
</ul>
</ol>
| 0 | [
2,
146,
16,
13,
7,
790,
79,
3554,
7,
18548,
19,
272,
20512,
29,
773,
21486,
18,
800,
3726,
3726,
13,
1,
252,
135,
1,
1126,
11969,
45,
1,
118,
252,
135,
1,
21,
133,
1464,
15,
31,
10282,
685,
48,
1089,
13,
43,
14365,
2002,
34,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 check syntax in bash (without running the script)
===
Is it possible to check a bash script syntax without executing it?
Using Perl, I can run perl -c 'script name', is there any equivalent command for bash scripts?
Thanks. | 0 | [
2,
184,
20,
2631,
22649,
19,
13158,
13,
5,
14506,
946,
14,
3884,
6,
800,
3726,
3726,
25,
32,
938,
20,
2631,
21,
13158,
3884,
22649,
366,
25836,
32,
60,
568,
416,
255,
15,
31,
92,
485,
416,
255,
13,
8,
150,
13,
22,
8741,
204,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... |
Hook into dialog close event
===
I am using the dialog from jquery-ui.
I am looking for way to refresh the page when in some circumstances when the dialog is closed.
Is there a way to capture a close event from the dialog?
I know I can run code when the close button is clicked but that doesn't cover the user closing with escape or the x in the top right corner. | 0 | [
2,
5559,
77,
28223,
543,
807,
800,
3726,
3726,
31,
589,
568,
14,
28223,
37,
487,
8190,
93,
8,
5661,
9,
31,
589,
699,
26,
161,
20,
24905,
14,
2478,
76,
19,
109,
5072,
76,
14,
28223,
25,
827,
9,
25,
80,
21,
161,
20,
3683,
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... |
Computer upgrade cycle
===
How often do you upgrade your development PC? I upgrade mine every 3 years or so. I'm just curious. Do you upgrade when you find your computer slowing or for other reasons? | 0 | [
2,
1428,
9483,
4150,
800,
3726,
3726,
184,
478,
107,
42,
9483,
154,
522,
5168,
60,
31,
9483,
1114,
352,
203,
122,
54,
86,
9,
31,
22,
79,
114,
7686,
9,
107,
42,
9483,
76,
42,
477,
154,
1428,
21745,
54,
26,
89,
2932,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
What does it mean to run a virtual OS in "headless mode"?
===
I've been hearing a lot about about how the new version of VMWare Fusion can run virtual operating systems in "headless mode".
A Google search makes it clear that other virtualisation products also have similar features, however, I have not been able to find a good description of what this actually means? What is happening when you do this? | 0 | [
2,
98,
630,
32,
884,
20,
485,
21,
6599,
13,
759,
19,
13,
7,
1743,
923,
3740,
7,
60,
800,
3726,
3726,
31,
22,
195,
74,
3229,
21,
865,
88,
88,
184,
14,
78,
615,
16,
13,
20147,
5011,
11117,
92,
485,
6599,
2455,
1242,
19,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.