unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Which CodePlex/Google code project to study in order by learn SharePoint best practices
===
I am new to sharepoint development but have about 10 years of expirence in C++, VB6 and C#. It is my expirence that a great way to learn a new language or coding style is to spend some time "dissecting" one of the open source projects available at CodePlex or Google code.
In order to avoid picking out some bad habits without knowing it, I would like to hear which projects you can recommend.
TIA | 0 | [
2,
56,
1797,
11326,
118,
16111,
4875,
1797,
669,
20,
949,
19,
389,
34,
2484,
1891,
3132,
246,
5242,
800,
3726,
3726,
31,
589,
78,
20,
1891,
3132,
522,
47,
57,
88,
332,
122,
16,
25910,
6175,
19,
272,
20512,
15,
13,
20468,
379,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XSLT Transform Efficiency
===
I am a support engineer and our company's product allows XSLT transforms to customize outputs.
I made a xsl transform for this purpose. It works well for source files of typical size (several 100k), but occasionally a really huge (10M) source file will come by. In such case, the output is not generated even if I let it grind several days.
The SW engineering team tested it and discovered that for the transform and large source file in question is indeed very slow (>days), if our product is compiled to use the transform engine in .Net 1.1, but if they compile it with .Net 2.0, it is plenty fast (about 1-2 minutes).
The long term solution obviously is, wait for the next release.
For the short term I am wondering the following:
1) Is XSLT flexible enough that there are more efficient and less efficient ways to acheive the same result? For example, is it possible that the way I structured the xsl, the transform engine has to iterate from the beginning of the source file many many times, taking longer and longer as the next result piece gets farther and farther from the beginning? (Schlemiel the Painter), or
2) Is it more dependent on how the transform engine interprets the xsl?
If 2 is the case, I don't want to waste a lot of time trying to improve the xsl (I am not a big xsl genius, it was hard enough for me to achieve what little I did...).
Thanks! | 0 | [
2,
993,
18,
255,
38,
8007,
7836,
800,
3726,
3726,
31,
589,
21,
555,
2335,
17,
318,
237,
22,
18,
2374,
2965,
993,
18,
255,
38,
8007,
18,
20,
5816,
2952,
5196,
18,
9,
31,
117,
21,
993,
18,
255,
8007,
26,
48,
2131,
9,
32,
693,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UAC need for console application
===
I have a console application that require to use some code that need administrator level. I have read that I need to add a Manifest file myprogram.exe.manifest that look like that :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator">
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
But it still doesn't raise the UAC (in the console or in debugging in VS). How can I solve this issue?
| 0 | [
2,
287,
1738,
376,
26,
8650,
3010,
800,
3726,
3726,
31,
57,
21,
8650,
3010,
30,
4077,
20,
275,
109,
1797,
30,
376,
8890,
662,
9,
31,
57,
1302,
30,
31,
376,
20,
3547,
21,
13160,
3893,
51,
19746,
9,
1706,
62,
9,
8002,
9962,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the best way to serialize SVG from the client DOM?
===
I am working on interactive SVG/AJAX interfaces where elements are created and repositioned on-the-fly by users. I'd like to support the ability for users to export their current view to a PNG image and/or an SVG document. I'd really like the SVG document to be as simple as possible (without a lot of nested transforms). Is there any framework that already supports this?
I'm currently asking my users to use the Ctrl+Alt+PrntScrn technique, and I don't want to ask them to install any software/plugins.
The server-side code is implemented in PHP right now, if that helps. I've already implemented the ability to generate a PNG image from the "original" document (before the client makes any modifications) using ImageMagick. | 0 | [
2,
98,
25,
14,
246,
161,
20,
5956,
2952,
13,
18,
22955,
37,
14,
6819,
11859,
60,
800,
3726,
3726,
31,
589,
638,
27,
9194,
13,
18,
22955,
118,
6881,
7522,
6573,
18,
113,
2065,
50,
679,
17,
302,
9339,
69,
27,
8,
124,
8,
9700,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 number of lines changed between CVS versions?
===
I've spent most of the day making what are basically some housekeeping changes to the codebase of one of our projects (replacing all `System.out.println()` calls with log4j).
I'm kind of curious how many lines of code I've updated with this set of changes.
Is there anyway with `cvs diff` or another command to get an accurate count of how many lines have changed?
I've tried
cvs diff -b -B -R
to get all of the changes in the working directory (and recursively the subdirectories), but for each file changed it also prints out file/version information, which makes just counting the lines of output useless.
Any ideas? | 0 | [
2,
184,
20,
477,
234,
16,
1560,
1015,
128,
13,
12732,
18,
3281,
60,
800,
3726,
3726,
31,
22,
195,
1111,
127,
16,
14,
208,
544,
98,
50,
11374,
109,
191,
15880,
1693,
20,
14,
1797,
8436,
16,
53,
16,
318,
2314,
13,
5,
99,
17994,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sort tag cloud alphabetically in acts_as_taggable_on_steroids
===
I got the acts\_as\_taggable\_on\_steroids plugin to work fine. The tag_cloud method in my view create and formats the cloud properly however the tags are listed in order of 'count desc'.
How to I present my tags in the cloud in alphabetical order? | 0 | [
2,
2058,
3383,
4005,
27169,
102,
19,
3167,
1,
472,
1,
536,
4572,
579,
1,
218,
1,
20641,
18,
800,
3726,
3726,
31,
330,
14,
3167,
1,
472,
1,
536,
4572,
579,
1,
218,
1,
20641,
18,
10922,
108,
20,
170,
1123,
9,
14,
3383,
1,
1917... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Send Email in .NET, with email saved in user's Sent Items
===
I am attempting to send an email using VB.NET.
There are two requirements
1. The email be saved in their "Sent Items" folder in Outlook (their only email client).
2. A PDF (generated on the fly) is attached to the email.
I am currently creating a new [MailMessage][1] & sending via a [SmtpClient][2], but I believe that this sends from the server, and not from the client.
Is this possible?
Thanks,
[1]: http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
[2]: http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx | 0 | [
2,
2660,
8517,
19,
13,
9,
2328,
15,
29,
8517,
4377,
19,
4155,
22,
18,
795,
3755,
800,
3726,
3726,
31,
589,
6314,
20,
2660,
40,
8517,
568,
13,
20468,
9,
2328,
9,
80,
50,
81,
4786,
137,
9,
14,
8517,
44,
4377,
19,
66,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to extract Hardware ID usingo Python?
===
How to extract HD and Bios Unique ID, using python script? | 0 | [
2,
184,
20,
10962,
7610,
4924,
568,
111,
20059,
60,
800,
3726,
3726,
184,
20,
10962,
8590,
17,
3136,
18,
2619,
4924,
15,
568,
20059,
3884,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Is combining DAO and entities a bad thing?
===
So like most new .NET developers you start of passing DataSets everywhere and although things do the job it doesn't seem right.
The next progression is usually to create entity objects that extend a DAL base class so you have i.e.
public class User : UserDAL
{
//User specific methods
}
public class UserDAL
{
//Bunch of user specific properties
public User Load(int Id)
{
//Some low level ADO calls
}
private User LoadFromDataSet(DataSet ds)
{
//Load entity properties from DataSet
}
}
User extends UserDAL objects that has low level data access calls using ADO.NET.
From here you go on to learn that this implementation means your tied to a data access layer and you make use of a separate entity, data access object and DAO interface for mocking or to easily swap out the DAO if need be. i.e.
public UserDAO : IUserDAO
{
//Data access Functions
}
With use of generics and reflection or a good ORM you can relieve some of the more common data access CRUD operations i.e.
Public UserDAO<User> : BaseDAO<User>, IUserDAO
{
//BaseDAO deals with basic crud so more custom data access methods can go here
}
So basically that's where I am currently at, aside from some other nice practices like using IoC to resolve the specific IUserDAO I want. But while I see the advantage to this structure I am also left feeling like I miss the old User.Load(1) method calls.
What I was wondering is would it be such a bad thing to inject my IUserDAO into the User entity and have that take care of the basic CRUD operations?
My understanding is that as a POCO the User entity would have no problems been passed over the wire and adding methods like Save(), Load() etc would have no relavence in the sense of a data transfer object.
But with that said my entities usually have lazy loaded collections which mean nothing in a DTO sense. Also, with WFP I believe can pick and chose which properties I want serializing, or at very least I could create a new UserDTO when I need to send it across the wire.
So basically, aside from that issue what are the other problems with making my User entity include DataAccess related methods? Also could someone clarify whether what I am talking about is referred to as an active record pattern or is this something else? | 0 | [
2,
25,
12803,
13,
17104,
17,
12549,
21,
896,
584,
60,
800,
3726,
3726,
86,
101,
127,
78,
13,
9,
2328,
10168,
42,
799,
16,
2848,
1054,
3554,
18,
6417,
17,
419,
564,
107,
14,
1205,
32,
1437,
22,
38,
2260,
193,
9,
14,
328,
16283,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Visual Studio Solution Explorer Locks Up
===
I have an issue with Visual Studio 2005 w/ TFS where, from time to time, the Solution Explorer will stop responding to interaction. Instead it does the beep, like I'm trying to click on a parent window with a modal dialog visible, but there isn't one. The only thing I've found to do so far, is to restart VS, but that's kind of a pain because our solution is rather large. And it's not even a guarantee... it might happen again when I load the solution.
I was curious if anyone else has had this problem and knows of a better solution that restarting VS until it goes away. | 0 | [
2,
3458,
1120,
4295,
8520,
12941,
71,
800,
3726,
3726,
31,
57,
40,
1513,
29,
3458,
1120,
812,
619,
118,
13,
11720,
18,
113,
15,
37,
85,
20,
85,
15,
14,
4295,
8520,
129,
747,
15887,
20,
7754,
9,
700,
32,
630,
14,
22899,
15,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF: ListBox vs. ListView - how to choose for data binding
===
I'm considering either a ListBox or a ListView for a WPF application. It seems either supports data binding and item templates. My application has a simple list of items that I intend to be able to search/sort/filter based on user input. The data binding demo (http://msdn.microsoft.com/en-us/library/ms771319.aspx) uses a ListBox with a CollectionViewSource.
Does anyone have pros/cons for which control to use and when? | 0 | [
2,
619,
7721,
45,
968,
5309,
4611,
9,
968,
4725,
13,
8,
184,
20,
3538,
26,
1054,
8728,
800,
3726,
3726,
31,
22,
79,
5154,
694,
21,
968,
5309,
54,
21,
968,
4725,
26,
21,
619,
7721,
3010,
9,
32,
2206,
694,
6747,
1054,
8728,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Convert Word doc to HTML programmatically in Java
===
I need to convert a Word document into HTML file(s) in Java. The function will take input an word document and the output will be html file(s) based on the number of pages the word document has i.e. if the word document has 3 pages then there will be 3 html files generated having the required page break.
I searched for open source/non-commercial APIs which can convert doc to html but for no result. Anybody who have done this type of job before please help.
Thanks | 0 | [
2,
8406,
833,
9765,
20,
13,
15895,
625,
6732,
1326,
19,
8247,
800,
3726,
3726,
31,
376,
20,
8406,
21,
833,
4492,
77,
13,
15895,
3893,
5,
18,
6,
19,
8247,
9,
14,
1990,
129,
247,
6367,
40,
833,
4492,
17,
14,
5196,
129,
44,
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... |
Java: Any way of squirreling an object about a Component somewhere in the Component?
===
As a followup to my <a href="http://stackoverflow.com/questions/227143/java-what-is-javaawtcomponentgetname-and-setname-used-for">question about the java.awt.Component.getName() property</a>, I'm wondering if there is a way of squirreling an arbitrary object somewhere in a Component, similar to the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tag.aspx">tag property in .NET</a>? This would be really handy for any code that does work to a component but doesn't necessarily know what that component is.
For example, say I'm trying to implement an application-wide help system that knows to look at any component currently pointed to by the mouse, reach into that component and pull out it's help text and display it in it's own pane on the screen (no, I don't want to use a tooltip). My answer currently is to use the Name (getName()/setName()) to store the help text, and this will work, but the Name has to be a string. If I wanted to get fancier and store anything other than a string, I think I'd be stuck. | 0 | [
2,
8247,
45,
186,
161,
16,
15150,
68,
40,
3095,
88,
21,
5912,
3493,
19,
14,
5912,
60,
800,
3726,
3726,
28,
21,
1740,
576,
20,
51,
13,
1,
58,
746,
14057,
3726,
7,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 move a CVS repository from one server to another and maintain history?
===
I have a CVS repository on my local workstation. I've demonstrated to my employer that version control is a great idea. Alright! So now I want to migrate my CVS history from my local workstation onto a real server.
I have installed CVS on the server and it is working.
Now, can I just move my repository files? Or do I have to do some sort of import command?
I know I could just check the current codebase into the new CVS server, but that'd lose the history, right? | 0 | [
2,
184,
107,
31,
780,
21,
13,
12732,
18,
24869,
37,
53,
8128,
20,
226,
17,
4027,
447,
60,
800,
3726,
3726,
31,
57,
21,
13,
12732,
18,
24869,
27,
51,
375,
170,
10839,
9,
31,
22,
195,
6861,
20,
51,
11726,
30,
615,
569,
25,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the best way to copy and insert data from related tables into a new set of related tables with Linq
===
I work on a web game , I use asp.net mvc, linqtosql.
I have 3 tables that store default game values: DefaultRegions, DefaultSubRegions and DefaultCountries. These 3 tables are related to each other thanks to primary / foreign keys.
I need to copy the values of these tables into 3 tables called Regions, SubRegions and Countries when someone creates a new Game. In these 3 tables the values for the ongoing games are saved (GameId is added to differentiate the games).
Now, I need to update the relationships, since the primary keys obviously change.
Anyone knows a way to achieve this in an efficient manner?
My idea would involve cumbersome foreach loops, maybe someone else has an idea? | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
4344,
17,
14692,
1054,
37,
1597,
7484,
77,
21,
78,
309,
16,
1597,
7484,
29,
6294,
1251,
800,
3726,
3726,
31,
170,
27,
21,
2741,
250,
13,
15,
31,
275,
28,
306,
9,
2328,
307,
8990,
15,
6294,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java RMI not closing socket after lease expiration
===
My RMI enabled application seems to be leaking sockets. I have a Java application providing a service over RMI. It is using the Java SE 1.6 RMI implementation running on Linux. The problem I am observing is that if a client obtains a reference to my Remote object, using the Registry, and then the connection is severed abruptly (power loss, cable unplugged, etc...), the server keeps the socket open. I would expect the RMI implementation to clean up after the client's lease expires, but that is not happening. On the server, my Remote object's <code>unreferenced()</code> method is called when the lease expires, but the socket remains visible in netstat in the "ESTABLISHED" state indefinitely.
Since we are not able to force the clients into any specific behavior, after several days we are hitting the default limit, 1024 in our Linux distro, for open file descriptors, causing the server to become unable to open any new sockets or files. I thought about TCP keepalives, but since RMI is abstracting away the network layer, I don't have access to the actual server socket after the connection has been established.
Is there any way to force the RMI layer to cleanup sockets tied to client connections with expired leases? | 0 | [
2,
8247,
761,
1435,
52,
4239,
18482,
75,
9140,
29529,
800,
3726,
3726,
51,
761,
1435,
9338,
3010,
2206,
20,
44,
26334,
18482,
18,
9,
31,
57,
21,
8247,
3010,
2674,
21,
365,
84,
761,
1435,
9,
32,
25,
568,
14,
8247,
1353,
137,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you simple Google Talk Client using the Twisted Words Python library?
===
I am interested in making a Google Talk client using Python and would like to use the Twisted libraries Words module. I have looked at the examples, but they don't work with the current implementation of Google Talk.
Has anybody had any luck with this? Would you mind documenting a brief tutorial?
As a simple task, I'd like to create a client/bot that tracks the Online time of my various Google Talk accounts so that I can get an aggregate number. I figure I could friend the bot in each account and then use the XMPP presence information to keep track of the times that I can then aggregate.
Thanks. | 0 | [
2,
184,
107,
42,
1935,
8144,
930,
6819,
568,
14,
5308,
715,
20059,
1248,
60,
800,
3726,
3726,
31,
589,
3158,
19,
544,
21,
8144,
930,
6819,
568,
20059,
17,
83,
101,
20,
275,
14,
5308,
8649,
715,
12613,
9,
31,
57,
292,
35,
14,
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... |
Solving an inequality for minimum value
===
I'm working on a programming problem which boils down to a set of an equation and inequality:
x[0]*a[0] + x[1]*a[1] + ... x[n]*a[n] >= D
x[0]*b[0] + x[1]*b[1] + ... x[n]*b[n] = C
I want to solve for the values of `X` that will give the absolute minimum of `C`, given the input `D` and lists and `A` and `B` consisting of `a[0 - n]` and `b[0 - n ]`.
I'm doing the problem at the moment in Python, but the problem in general is language-agnostic.
| 0 | [
2,
17533,
40,
18340,
26,
5187,
1923,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
3143,
1448,
56,
22941,
18,
125,
20,
21,
309,
16,
40,
8020,
17,
18340,
45,
993,
2558,
387,
500,
2483,
58,
2558,
387,
500,
2754,
993,
2558,
165,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multicast Join on Linux and IGMPv3
===
We've run into a thorny problem. We are writing a c++ program that receives multicast UDP traffic. We're in the process of moving our applications to a different network environment and our operations team has requested that we support IGMPv3 membership announcements from our applications. Initial investigations indicate that Linux 2.6 kernels do support IGMPv3. Therefore, I'm puzzled that when we run tcpdump we see the following output traces:
[rtv@myhost]$ sudo /usr/sbin/tcpdump -i eth1.22 igmp
tcpdump: listening on eth1.22
00:20:09.007094 switch-a.stage > ALL-SYSTEMS.MCAST.NET: igmp query v2 [max resp time 20] [ttl 1]
00:20:09.241946 10.129.22.236 > 232.0.1.10: igmp v2 report 232.0.1.10 (DF) [tos 0xc0] [ttl 1]
00:20:10.472159 10.129.22.236 > 236.0.1.101: igmp v2 report 236.0.1.101 (DF) [tos 0xc0] [ttl 1]
44 packets received by filter
My understanding is that one could force the kernel to use a lower version of IGMP by specifying a non-zero value in the file /proc/sys/net/ipv4/conf/eth1.22/force\_igmp\_version; however, I've confirmed that the file has a zero value configuration.
Our application is using the following code to join the multicast group:
... joinMulticast(in_addr mcast_addr, in_addr interface_addr)
{
struct ip_mreq mcast_req;
mcast_req.imr_multiaddr.s_addr = mcast_addr;
mcast_req.imr_interface.s_addr = interface_addr;
int err = setsockopt(fFileDesc, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char*)&theMulti, sizeof(theMulti));
// handle errors etc.
// ...
}
Is there something extra that we need to include in the source program to force IGMPv3?
| 0 | [
2,
1889,
6146,
1865,
27,
13024,
17,
31,
14020,
10166,
240,
800,
3726,
3726,
95,
22,
195,
485,
77,
21,
9057,
93,
1448,
9,
95,
50,
1174,
21,
272,
20512,
625,
30,
8359,
1889,
6146,
287,
7431,
2227,
9,
95,
22,
99,
19,
14,
953,
16,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I use regular expressions to find a method on a class in java?
===
I know how to find a method in java using a fixed string,
someClass.getMethod("foobar", argTypes);
but is there a way to use a regular expression rather than a fixed string to find a method on a given class?
An example of the usage might be if I wanted to find a method that was called either "foobar" or "fooBar". Using a regular expression like "foo[Bb]ar" would match either of these method names. | 0 | [
2,
92,
31,
275,
1290,
13832,
20,
477,
21,
2109,
27,
21,
718,
19,
8247,
60,
800,
3726,
3726,
31,
143,
184,
20,
477,
21,
2109,
19,
8247,
568,
21,
3535,
3724,
15,
109,
1898,
9,
3060,
5909,
1807,
43,
5,
7,
4120,
111,
1850,
7,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to automate JavaScript files compression with YUI Compressor?
===
[YUI Compressor][1] does not accept wildcard parameters, so I cannot run it like this:
C:>java -jar yuicompressor.jar *.js
But I have over 500 files and would rather not have to create a batch file like this:
C:>java -jar yuicompressor.jar file1.js -o deploy\file1.js
C:>java -jar yuicompressor.jar file2.js -o deploy\file2.js
...
C:>java -jar yuicompressor.jar file500.js -o deploy\file500.js
And of course my file names are *not* in such uniform way.
Is there way to automate this without writing any code? :)
[1]: http://developer.yahoo.com/yui/compressor/ | 0 | [
2,
184,
20,
3108,
5281,
8247,
8741,
6488,
14864,
29,
2600,
49,
26810,
60,
800,
3726,
3726,
636,
4703,
49,
26810,
500,
2558,
165,
500,
630,
52,
3440,
23003,
12905,
15,
86,
31,
1967,
485,
32,
101,
48,
45,
272,
45,
1,
1004,
1385,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are the steps to repair the .Net framework (2.0 / 3.5) on Windows XP?
===
I have 2.0 SP2 and 3.5 SP1 installed on a windows xp machine. What are the steps to repair those frameworks?
| 0 | [
2,
98,
50,
14,
2382,
20,
5612,
14,
13,
9,
2328,
6596,
13,
5,
135,
9,
387,
13,
118,
203,
9,
264,
6,
27,
1936,
23045,
60,
800,
3726,
3726,
31,
57,
172,
9,
387,
3782,
135,
17,
203,
9,
264,
3782,
165,
4066,
27,
21,
1936,
23045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How to find (or generate) thousands of company names for test/demo purposes
===
Ok, so this is rightfully a testing question more than a development question, but the two should go hand in hand :)
So, I've got a system I'm building which includes business contact information. Pretty common no doubt.
My test/demo database currently has randomly generated individual's names loaded (thanks to a handy IRS spreadsheet I found). This has worked great for internal testing and review purposes, but it looks really odd when shown to prospective customers.
So.... Does anyone know where I can grab or find a listing of thousands of business names (address information too would be nice)?
I've tried various online public information sources (e.g. EDGAR, and county based property records searches), but these all require me to manually stitch together the results in blocks of 50 names or so at a time. I could do this, but was really hoping for a search service or data store out there that had this type of information readily searchable and retrievable in very large batches.
Thanks! | 0 | [
2,
184,
20,
477,
13,
5,
248,
7920,
6,
3805,
16,
237,
1817,
26,
1289,
118,
19274,
4612,
800,
3726,
3726,
5854,
15,
86,
48,
25,
193,
5655,
21,
4431,
1301,
91,
119,
21,
522,
1301,
15,
47,
14,
81,
378,
162,
224,
19,
224,
13,
45,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create blurred text in an iPhone view?
===
I am building up a view with various text and image elements.
I want to display some of text in the view with a blurry copy of the text behind it, but not just a text shadow.
How do I apply Gaussian blurred text onto a UIImage or layer? | 0 | [
2,
184,
107,
31,
1600,
21322,
1854,
19,
40,
21024,
1418,
60,
800,
3726,
3726,
31,
589,
353,
71,
21,
1418,
29,
617,
1854,
17,
1961,
2065,
9,
31,
259,
20,
3042,
109,
16,
1854,
19,
14,
1418,
29,
21,
10330,
622,
4344,
16,
14,
1854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 implement .lastChild using Prototype or jQuery
===
Currently we are using prototype and jQuery as our js frameworks. Right now, jQuery is set to $j() to prevent conflicts from prototype.
In the past, we've used a lot of prototype's Element.down(), Element.next(), and Element.previous() to traverse the DOM. However, I need a simple way to retrieve the last child element. I know i can loop through an array by using Element.childElements() but I would like something inline that reads cleanly and can be pipelined.
Just thought I would ask before I go reinventing the wheel. Here's a snippet of code that has lastChild in it that needs to be replaced:
_find : function(rows, address) {
var obj = null;
for (var i=0; i < rows.length && obj == null; i++) {
if (rows[i].down().className == 'b')
obj = this._find(rows[i].lastChild.down().down().childElements(), address);
else if (rows[i].lastChild.getAttribute('tabAddress') == address)
return rows[i].lastChild;
}
return obj;
}
| 0 | [
2,
246,
161,
20,
8713,
13,
9,
8558,
11287,
568,
7063,
54,
487,
8190,
93,
800,
3726,
3726,
871,
95,
50,
568,
7063,
17,
487,
8190,
93,
28,
318,
487,
18,
6596,
18,
9,
193,
130,
15,
487,
8190,
93,
25,
309,
20,
5579,
728,
5,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's a good resource for learning CGI programming in Python?
===
I need to write a browser interface for an application running embedded on a single board computer ([Gumstix Verdex][1] for anyone who's interested), so I won't be able to use any web frameworks due to space and processor constraints (and availability for the environment I'm running in). I'm limited to the core Python and cgi modules to create pages that will communicate with a C++ application.
Can anyone recommend a good resource (web or book) for learning CGI programming in Python?
[1]: http://www.gumstix.com/store/catalog/product_info.php?products_id=178 | 0 | [
2,
98,
22,
18,
21,
254,
6577,
26,
2477,
272,
2234,
3143,
19,
20059,
60,
800,
3726,
3726,
31,
376,
20,
2757,
21,
16495,
6573,
26,
40,
3010,
946,
12138,
27,
21,
345,
686,
1428,
13,
5,
2558,
13491,
384,
4028,
14944,
396,
500,
2558,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Labview "driver" - getting started
===
I have written a standalone app that controls a device through rs-232 port and some customers want to be able to use the device with Labview. I have seen some threads describing where to start when learning to use labview, but I was wondering if anyone has experience with writing a plugin/driver (is that the right word?) for Labview and perhaps point me in the right direction.
The existing app is GUI that allows people to control the device with higher level concepts - rather than have to know the syntax and protocol of the serial port comms stuff. I want to abstract that away as well so that users can just plug something into labview and I suppose it exposes some verbs and methods that allow the device to be manipulated and also provide data to clients.
I think there is a serial port interface from labview, but I am sure the people using this device do not want to have to write the code (parsers and etc) to communicate with the device. | 0 | [
2,
4343,
4725,
13,
7,
21752,
7,
13,
8,
1017,
373,
800,
3726,
3726,
31,
57,
642,
21,
26986,
4865,
30,
8671,
21,
3646,
120,
13,
1224,
8,
20730,
1295,
17,
109,
5279,
259,
20,
44,
777,
20,
275,
14,
3646,
29,
4343,
4725,
9,
31,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Software protection by encryption
===
For our software we use hardware dongles to protect the software. No protection is perfect but this commercial solution is affordable and keeps honest people honest (as mentioned in another thread). The advantage is the 128 bit key that is stored 'unreadable' on the hardware dongle.
We want to remove this hardware dongle and start using software protection. Basically we can use a commercial product, but on the other hand that won't be unbreakable either. I don't know much about encryption and that's why I am posting this. How do I store a key on a windows computer that will not be possible to read by using reflector or something else? However I should be able to access the key for testing the license code.
I would just like a simple solution that can't be hacked by simply using reflector.
Or am I asking a very stupid question?
Erik | 0 | [
2,
2306,
2057,
34,
24420,
800,
3726,
3726,
26,
318,
2306,
95,
275,
7610,
11827,
1355,
20,
2196,
14,
2306,
9,
90,
2057,
25,
2107,
47,
48,
1439,
4295,
25,
17792,
17,
8968,
6964,
148,
6964,
13,
5,
472,
2211,
19,
226,
9322,
6,
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... |
Calling an existing SAP report in ABAP, with GUI suppression
===
I want to expose the functionality of an SAP program (transaction) as a BAPI.
I need to call a report and supply range filters such that the GUI is bypassed.
Does anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish what I need to do?
| 0 | [
2,
2555,
40,
3149,
7508,
1330,
19,
5941,
2552,
15,
29,
9457,
19594,
800,
3726,
3726,
31,
259,
20,
13833,
14,
18548,
16,
40,
7508,
625,
13,
5,
7028,
8645,
6,
28,
21,
2683,
2159,
9,
31,
376,
20,
645,
21,
1330,
17,
2837,
978,
210... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I make a link in a master page, which includes dynamic information from the current page?
===
I have a master page, with a help link in the top menu. This link should contain the a dynamic bookmark from the current page, so that the user scrolls to the help for the page he is currently seeing.
<a href="help.aspx#[NameOfCurentPage]">Help</a>
How would you implement this? | 0 | [
2,
184,
107,
31,
233,
21,
3508,
19,
21,
1129,
2478,
15,
56,
1103,
7782,
676,
37,
14,
866,
2478,
60,
800,
3726,
3726,
31,
57,
21,
1129,
2478,
15,
29,
21,
448,
3508,
19,
14,
371,
11379,
9,
48,
3508,
378,
3717,
14,
21,
7782,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Round to increments of 2.5?
===
I need to round a value up to the next closest 2.5 increment.
IE:
6 --> 7.5
7.6 --> 10
ect.
This seem like the best way to do this?
Function RoundToIncrement(ByVal orignialNumber As Decimal, ByVal increment As Decimal) As Decimal
Dim num = Math.Round(orignialNumber / increment, MidpointRounding.AwayFromZero) * increment
If orignialNumber Mod increment <> 0 And num < orignialNumber Then
num += increment
End If
Return num
End Function | 0 | [
2,
560,
20,
13,
28461,
18,
16,
172,
9,
264,
60,
800,
3726,
3726,
31,
376,
20,
560,
21,
1923,
71,
20,
14,
328,
6993,
172,
9,
264,
13,
28461,
9,
13,
660,
45,
400,
13,
8,
8,
1,
453,
9,
264,
453,
9,
379,
13,
8,
8,
1,
332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best practice for a collection of generic classes
===
Consider the following code:
abstract class SomeClassX<T>
{
// blah
}
abstract class SomeClassY: SomeClassX<int>
{
// blah
}
abstract class SomeClassZ: SomeClassX<long>
{
// blah
}
I want a collection of SomeClassX<T>'s, however, this isn't possible since SomeClassX<int> != SomeClassX<long> and List<SomeClassX<>> isn't allowed.
So my solution is to have SomeClassX<T> implement an interface and define my collection as, where ISomeClassX is the interface:
class CollectionOfSomeClassX: List<ISomeClassX>
{
// blah
}
Is this the best way to do this, or is there better way?
| 0 | [
2,
246,
1345,
26,
21,
1206,
16,
12733,
2684,
800,
3726,
3726,
3563,
14,
249,
1797,
45,
8502,
718,
109,
1898,
396,
1,
38,
1,
13,
1,
12894,
27220,
13,
1,
8502,
718,
109,
1898,
93,
45,
109,
1898,
396,
1,
6391,
1,
13,
1,
12894,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 programmatically return the max of two integers without...
===
... using any comparison operators... and without using if, else, etc.
Here is my solution... what's a better solution?
int max(int a, int b){
int nlz = __builtin_clz(a ^ b);
int bit = 1 << (31 - nlz);
int res = a * __builtin_popcount(a & bit) + b * __builtin_popcount(b & bit);
return res;
}
Does this solution work? I can't test it right now because I don't know what __builtin etc is in .NET. | 0 | [
2,
184,
107,
31,
625,
6732,
1326,
788,
14,
2049,
16,
81,
13820,
18,
366,
9,
9,
9,
800,
3726,
3726,
13,
9,
9,
9,
568,
186,
6050,
9475,
9,
9,
9,
17,
366,
568,
100,
15,
962,
15,
2722,
9,
235,
25,
51,
4295,
9,
9,
9,
98,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a way to know, programatically, how much space an object is taking in memory? (.Net 2.0)
===
I would like to be able to know, in run-time in my code, how much memory a certain object is taking (a Dataset in this case, but i'm looking for a "general" solution).
Is this possible through reflection?
This is for .Net 2.0.
Thanks! | 0 | [
2,
25,
80,
21,
161,
20,
143,
15,
625,
721,
8438,
15,
184,
212,
726,
40,
3095,
25,
741,
19,
1912,
60,
13,
5,
9,
2328,
172,
9,
387,
6,
800,
3726,
3726,
31,
83,
101,
20,
44,
777,
20,
143,
15,
19,
485,
8,
891,
19,
51,
1797,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 does "Shift:=" mean in this VB6 code?
===
I've run across the following line in a VB6 application.
mobjParentWrkBk.ExcelWorkBook.Application.Selection.Insert Shift:=xlToRight
Unfortunately Google and other search engines have not been very useful as they seem to omit the := part.
What would be a C# equivalent? | 0 | [
2,
98,
630,
13,
7,
14157,
45,
3726,
7,
884,
19,
48,
13,
20468,
379,
1797,
60,
800,
3726,
3726,
31,
22,
195,
485,
464,
14,
249,
293,
19,
21,
13,
20468,
379,
3010,
9,
7327,
728,
18908,
7127,
197,
16356,
9,
1706,
11040,
3783,
519... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 preferred format to store date/times in an MSSQL database when PHP is your primary language?
===
I am planning a PHP application that needs to store date/times in an MSSQL database. (For the curious, it is a calendar application.) What is the preferred format to store this information?
MSSQL has its own datetime data type, which works well in the database itself and is very readable. However, there aren't any MSSQL functions to translate datetime values to PHP's preferred format--UNIX timestamp. This makes it a bit more painful to use with PHP. UNIX timestamp is attractive because that's what PHP likes, but it's certainly not as readable and there aren't a bunch of nice built-in MSSQL functions for working with the data.
Would you store this information as datetime data type, as UNIX timestamps (as int, bigint, or varchar datatype), as both formats side by side, or as something else entirely? | 0 | [
2,
98,
25,
14,
5981,
2595,
20,
1718,
1231,
118,
891,
18,
19,
40,
4235,
18,
22402,
6018,
76,
13,
26120,
25,
154,
1256,
816,
60,
800,
3726,
3726,
31,
589,
2334,
21,
13,
26120,
3010,
30,
2274,
20,
1718,
1231,
118,
891,
18,
19,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Suggestions to improve VB.NET URL shortener?
===
Here is my function:
Public Shared Function shortenUrl(ByVal URL As String) As String
Return shortenUrl(URL, 29)
End Function
Public Shared Function shortenUrl(ByVal URL As String, ByVal maxLength As Integer) As String
If URL.Length > maxLength Then
Dim temp As New List(Of String)
temp.AddRange(New String() {URL.Substring(0, maxLength / 2), URL.Substring(URL.Length - (maxLength / 2))})
Return String.Format("{0}...{1}", temp.Item(0), temp.Item(1))
Else
Return URL
End If
End Function
It seems to me that it is too complicated; any suggestions, comments, concerns are more than welcome. | 0 | [
2,
18389,
20,
3545,
13,
20468,
9,
2328,
287,
6362,
502,
17802,
60,
800,
3726,
3726,
235,
25,
51,
1990,
45,
317,
2592,
1990,
502,
219,
911,
255,
5,
779,
3377,
287,
6362,
28,
3724,
6,
28,
3724,
788,
502,
219,
911,
255,
5,
911,
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... |
How do I create a reusable "US State" type in an XML schema?
===
I have an XML schema that includes multiple addresses:
<xs:element name="personal_address" maxOccurs="1">
<!-- address fields go here -->
</xs:element>
<xs:element name="business_address" maxOccurs="1">
<!-- address fields go here -->
</xs:element>
Within each address element, I include a "US State" enumeration:
<xs:simpleType name="state">
<xs:restriction base="xs:string">
<xs:enumeration value="AL" />
<xs:enumeration value="AK" />
<xs:enumeration value="AS" />
....
<xs:enumeration value="WY" />
</xs:restriction>
</xs:simpleType>
How do I go about writing the "US State" enumeration once and re-using it in each of my address elements? I apologize in advance if this is a n00b question -- I've never written an XSD before.
My initial stab at it is the following:
<xs:element name="business_address" maxOccurs="1">
<!-- address fields go here -->
<xs:element name="business_address_state" type="state" maxOccurs="1"></xs:element>
</xs:element>
| 0 | [
2,
184,
107,
31,
1600,
21,
302,
267,
579,
13,
7,
267,
146,
7,
1001,
19,
40,
23504,
23874,
60,
800,
3726,
3726,
31,
57,
40,
23504,
23874,
30,
1103,
1886,
12636,
45,
13,
1,
396,
18,
45,
27567,
204,
3726,
7,
18160,
1,
27950,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL Server Row Length
===
I'm attempting to determine the row length in bytes of a table by executing the following stored procedure:
<pre>
CREATE TABLE #tmp([ID] int, Column_name varchar(640), Type varchar(640), Computed varchar(640), Length int, Prec int, Scale int, Nullable varchar(640), TrimTrailingBlanks varchar(640), FixedLenNullInSource varchar(640), Collation varchar(256))
INSERT INTO #tmp exec sp_help MyTable
SELECT SUM(Length) FROM #tmp
DROP TABLE #tmp
</pre>
The problem is that I don't know the table definition (data types, etc..) of the table returned by 'sp_help.'
I get the following error:
Insert Error: Column name or number of supplied values does not match table definition.
Looking at the sp_help stored procedure does not give me any clues.
What is the proper CREATE TABLE statement to insert the results of a sp_help? | 0 | [
2,
4444,
255,
8128,
3131,
1476,
800,
3726,
3726,
31,
22,
79,
6314,
20,
3746,
14,
3131,
1476,
19,
34,
3231,
16,
21,
859,
34,
25836,
14,
249,
8214,
7004,
45,
13,
1,
3515,
1,
1600,
859,
6926,
38,
2554,
5,
2558,
1340,
500,
19,
38,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Select Box onClick - Rails
===
i have a rails application that in the erb code, i use a select box. What i would like to do is reload the page passing the sort parameter. My controller already treat it, but i don't know how to reload the page with the selected value from my select box. Here is my code
<% @options = {:latest => 'lastest' , :alphabetical => 'alphabetical', :pricelow => 'price-low', :pricehigh =>'pricehigh'} %>
<%= select_tag 'sort[]', options_for_select(@options), :include_blank => true,:onchange => "location.reload('location?sort='+this.value)"%>
| 0 | [
2,
5407,
1649,
27,
150,
10129,
13,
8,
2240,
18,
800,
3726,
3726,
31,
57,
21,
2240,
18,
3010,
30,
19,
14,
13,
106,
220,
1797,
15,
31,
275,
21,
5407,
1649,
9,
98,
31,
83,
101,
20,
107,
25,
27339,
14,
2478,
2848,
14,
2058,
1890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the thread context for events in .Net using existing APIs?
===
When using APIs handling asynchronous events in .Net I find myself unable to predict how the library will scale for large numbers of objects.
For example, using the Microsoft.Office.Interop.UccApi library, when I create an endpoint it gets events when phone events happen. Now let's say I want to create 1000 endpoints. The number of events per endpoint is small, but is what's happening behind the scenes in the API able to keep up with the event flow? I don't know because it never says how it's architected.
Let's say I want to create all 1000 objects in the main thread. Then I want to put the Login method into a large thread pool so all objects login in parallel. Then once all the objects have logged in the next phase will begin.
Are the event callbacks the API raises happening in the original creating thread? A separate threadpool? Or the same threadpool I'm accessing with ThreadPool.QueueUserWorkItem?
Would I be better putting each object in it's own thread? Grouping a few objects in each thread? Or is it fine just creating all 1000 objects in the main thread and through .Net magic it will all be OK?
thanx
| 0 | [
2,
98,
22,
18,
14,
9322,
4141,
26,
963,
19,
13,
9,
2328,
568,
3149,
21,
8954,
60,
800,
3726,
3726,
76,
568,
21,
8954,
7988,
21,
16023,
1291,
963,
19,
13,
9,
2328,
31,
477,
992,
2343,
20,
9584,
184,
14,
1248,
129,
3464,
26,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I print a groovy Node with namespace preserved?
===
When I use this code to output some XML I parsed (and modified) with XmlParser
XmlParser parser = new XmlParser()
def records = parser.parseText(feedUrl.toURL().text)
def writer = new StringWriter()
new XmlNodePrinter(new PrintWriter(writer)).print(records)
println writer.toString()
the namespace declarations on the root node are not printed, even though they are there in the toString() of *records*... any ideas? | 0 | [
2,
184,
107,
31,
4793,
21,
3452,
2026,
93,
15421,
29,
204,
5582,
6190,
60,
800,
3726,
3726,
76,
31,
275,
48,
1797,
20,
5196,
109,
23504,
31,
2017,
18,
69,
13,
5,
290,
5372,
6,
29,
23504,
3574,
4104,
23504,
3574,
4104,
2017,
4104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Group by when joining the same table twice
===
I'm writing a query to summarize some data. I have a flag in the table that is basically boolean, so I need some sums and counts based on one value of it, and then the same thing for the other value, like so:
select
location
,count(*)
,sum(duration)
from my.table
where type = 'X'
and location = @location
and date(some_tstamp) = @date
group by location
And then the same for another value of the type column. If I join this table twice, how do I still group so I can only get aggregation for each table, i.e. count(a.`*`) instead of count(*)...
Would it be better to write two separate queries? | 0 | [
2,
214,
34,
76,
3765,
14,
205,
859,
2088,
800,
3726,
3726,
31,
22,
79,
1174,
21,
25597,
20,
18074,
139,
2952,
109,
1054,
9,
31,
57,
21,
3157,
19,
14,
859,
30,
25,
11374,
9827,
413,
210,
15,
86,
31,
376,
109,
3907,
18,
17,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASCII value of a character in python
===
How do I get the ASCII value of a character as an int in python? | 0 | [
2,
28,
1892,
49,
1923,
16,
21,
925,
19,
20059,
800,
3726,
3726,
184,
107,
31,
164,
14,
28,
1892,
49,
1923,
16,
21,
925,
28,
40,
19,
38,
19,
20059,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Open file, read it, process, and write back - shortest method in Python
===
I want to do some basic filtering on a file. Read it, do processing, write it back.
I'm not looking for "golfing", but want the simplest and most elegant method to achieve this. I came up with:
from __future__ import with_statement
filename = "..." # or sys.argv...
with open(filename) as f:
new_txt = # ...some translation of f.read()
open(filename, 'w').write(new_txt)
The `with` statement makes things shorter since I don't have to explicitly open and close the file.
Any other ideas ?
| 0 | [
2,
368,
3893,
15,
1302,
32,
15,
953,
15,
17,
2757,
97,
13,
8,
23576,
2109,
19,
20059,
800,
3726,
3726,
31,
259,
20,
107,
109,
2125,
25272,
27,
21,
3893,
9,
1302,
32,
15,
107,
5511,
15,
2757,
32,
97,
9,
31,
22,
79,
52,
699,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simple Search: passing form variable to URI?
===
Using Codeigniter.
I have a search form on each of my pages. If I use form helper, it defaults to POST. I'd like the search term to show up in the URI: example -- mysite.com/search/KEYWORD
I've been on Google for about an hour to no avail -- only articles on how "GET" is basically disabled because of the native URI convention. But seriously, I can't be the first person to want this kind of functionality. Am i?
Much thanks. | 0 | [
2,
1935,
2122,
45,
2848,
505,
7612,
20,
13,
3594,
60,
800,
3726,
3726,
568,
1797,
9693,
242,
106,
9,
31,
57,
21,
2122,
505,
27,
206,
16,
51,
4434,
9,
100,
31,
275,
505,
448,
106,
15,
32,
12838,
18,
20,
678,
9,
31,
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... |
Parse Phone Number into component parts
===
I need a well tested Regular Expression (.net style preferred), or some other simple bit of code that will parse a USA/CA phone number into component parts, so:
* 3035551234122
* 1-303-555-1234x122
* (303)555-1234-122
* 1 (303) 555 -1234-122
etc...
all parse into:
* AreaCode: 303
* Exchange: 555
* Suffix: 1234
* Extension: 122
| 0 | [
2,
2017,
870,
1132,
234,
77,
5912,
1341,
800,
3726,
3726,
31,
376,
21,
134,
7631,
1290,
1803,
13,
5,
9,
2328,
1034,
5981,
6,
15,
54,
109,
89,
1935,
1142,
16,
1797,
30,
129,
2017,
870,
21,
2563,
118,
793,
1132,
234,
77,
5912,
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... |
Would NTFS allocation blocks of 16KB or 32KB make compile time faster in comparison to the default 4KB?
===
Would NTFS allocation blocks of 16KB or 32KB make compile time faster in comparison to the default 4KB? | 0 | [
2,
83,
13,
2877,
11754,
16840,
5198,
16,
347,
18167,
54,
2512,
18167,
233,
26561,
85,
4233,
19,
6050,
20,
14,
12838,
268,
18167,
60,
800,
3726,
3726,
83,
13,
2877,
11754,
16840,
5198,
16,
347,
18167,
54,
2512,
18167,
233,
26561,
85,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Question about an event perculiarity in a TabControl.
===
I have a little demonstration below of a peculiar problem.
using System;
using System.Windows.Forms;
namespace WindowsApplication1
{
public class TestForm : Form
{
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TextBox textBox1;
public TestForm()
{
//Controls
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.textBox1 = new System.Windows.Forms.TextBox();
// tabControl1
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(260, 240);
this.tabControl1.TabIndex = 0;
this.tabControl1.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabControl1_Selected);
// tabPage1
this.tabPage1.Controls.Add(this.textBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(252, 214);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
// tabPage2
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(192, 74);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";
// textBox1
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(6, 38);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(240, 20);
this.textBox1.TabIndex = 0;
// TestForm
this.ClientSize = new System.Drawing.Size(284, 264);
this.Controls.Add(this.tabControl1);
this.Name = "Form1";
this.Text = "Form1";
}
//Tab Selected
private void tabControl1_Selected(object sender, EventArgs e)
{
this.Text = "TextBox Width: " + this.textBox1.Width.ToString();
}
}
//Main
static class Program
{
static void Main()
{
Application.Run(new TestForm());
}
}
}
If you run the above C# code you will have a small form containing a tabcontrol. Within the tabcontrol is a texbox on the first tab. If you follow these steps you will see the problem:
1. Select tabPage2 (textBox1's width is reported in the form title)
2. Resize the form
3. Select tabPage1 (The wrong textBox1 width is reported)
Any ideas what is going on here? The textbox is obviously bigger than what is being reported. If you click again on tabPage2 the correct size is then updated. Obviously there is an event updating the width of textBox1. Can i trigger this when tabPage1 is selected?
| 0 | [
2,
1301,
88,
40,
807,
416,
6635,
49,
512,
856,
19,
21,
6523,
12898,
9,
800,
3726,
3726,
31,
57,
21,
265,
10613,
1021,
16,
21,
13193,
1448,
9,
568,
329,
73,
568,
329,
9,
27508,
18,
9,
4190,
18,
73,
204,
5582,
1936,
2552,
20669,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find where java class is loaded from
===
Does anyone know how to programmaticly find out where the java classloader actually loads the class from?
I often work on large projects where the classpath gets very long and manual searching is not really an option. I recently had a [problem][1] where the classloader was loading an incorrect version of a class because it was on the classpath in two different places.
So how can I get the classloader to tell me where on disk the actual class file is coming from?
[1]: http://stackoverflow.com/questions/226280/eclipse-class-version-bug "problem" | 0 | [
2,
477,
113,
8247,
718,
25,
8572,
37,
800,
3726,
3726,
630,
1276,
143,
184,
20,
625,
6732,
102,
477,
70,
113,
14,
8247,
718,
8294,
106,
1121,
19069,
14,
718,
37,
60,
31,
478,
170,
27,
370,
2314,
113,
14,
718,
8353,
3049,
253,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JSTL, Beans, and method calls
===
I'm working on a JSP where I need to call methods on object that come from a Bean. The previous version of the page does not use JSTL and it works properly. My new version has a set up like this:
<jsp:useBean id="pageBean" scope="request" type="com.epicentric.page.website.PageBean" />
<c:set var="pageDividers" value="<%= pageBean.getPageDividers() %>" />
<c:set var="numColumns" value="${pageDividers.size()}" />
The variable pageDividers is a List object.
I'm encountering this issue: when I ask for pageDivider's size, an exception is thrown. I know this is a simple JTSL error -- what am I doing wrong?
The error message is:
> The function size must be used with a prefix when a default namespace is not specified
How do I correctly access or call the methods of my pageDividers object? | 0 | [
2,
487,
18,
7786,
15,
14685,
15,
17,
2109,
3029,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
487,
3401,
113,
31,
376,
20,
645,
3195,
27,
3095,
30,
340,
37,
21,
15322,
9,
14,
1158,
615,
16,
14,
2478,
630,
52,
275,
487,
18,
7786... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a Perl-style regex interpreter behave like a basic or extended regex interpreter
===
I am writing a tool to help students learn regular expressions. I will probably be writing it in Java.
The idea is this: the student types in a regular expression and the tool shows which parts of a text will get matched by the regex. Simple enough.
But I want to support several different regex "flavors" such as:
- Basic regular expressions (think: grep)
- Extended regular expressions (think: egrep)
- A subset of Perl regular expressions, including the character classes \w, \s, etc.
- Sed-style regular expressions
Java has the java.util.Regex class, but it supports only Perl-style regular expressions, which is a superset of the basic and extended REs. What I think I need is a way to take any given regular expression and escape the meta-characters that aren't part of a given flavor. Then I could give it to the Regex object and it would behave as if it was written for the selected RE interpreter.
For example, given the following regex:
^\w+[0-9]{5}-(\d{4})?$
As a basic regular expression, it would be interpreted as:
^\\w\+[0-9]\{5\}-\(\\d\{4\}\)\?$
As an extended regular expression, it would be:
^\\w+[0-9]{5}-(\\d{4})?$
And as a Perl-style regex, it would be the same as the original expression.
Is there a "regular expression for regular expressions" than I could run through a regex search-and-replace to quote the non-meta characters? What else could I do? | 0 | [
2,
233,
21,
416,
255,
8,
4381,
7953,
1706,
19336,
14149,
101,
21,
2125,
54,
1984,
7953,
1706,
19336,
800,
3726,
3726,
31,
589,
1174,
21,
5607,
20,
448,
573,
2484,
1290,
13832,
9,
31,
129,
910,
44,
1174,
32,
19,
8247,
9,
14,
882,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bus or listeners/delegates in client-side Swing application?
===
Building a client-side swing application what should be notified on a bus (application-wide message system, similar in concept to JMS but much simpler) and what should be notified using direct listeners?
When using a bus, I always have an unescapable feeling of "I have no idea who uses that and where". Also, no set order, hard to veto events, hard to know exactly what's going on at a set time.
On the other hand, using listeners means either directly referencing the source object (coupling) or passing the reference through myriad conversions (A--b_listener-->B, B--c_listener-->C only because a needs to know something only C can to tell, but B has no interest in).
So, are there any rule of the thumb regarding this? Any suggestion how to balance? | 0 | [
2,
1683,
54,
15672,
118,
24249,
3322,
18,
19,
6819,
8,
1416,
5587,
3010,
60,
800,
3726,
3726,
353,
21,
6819,
8,
1416,
5587,
3010,
98,
378,
44,
22904,
27,
21,
1683,
13,
5,
2552,
20669,
8,
8077,
2802,
329,
15,
835,
19,
2420,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Dynamically add menu items to master page in ASP.NET 3.5 MVC app
===
I want to dynamically add menuitems to my master page based on membership security login role. From what I've read RenderAction in the master page html could perhaps do this. Since I'm fumbling thru this I am not sure how it would look and how in the controller I check my current role. I am considering creating a table and relating the allowable menu items to role relationship so I can pass to the master page for rendering the dynamic menu items. Any suggestions answers or comments appreciated. Thanks - Mike | 0 | [
2,
184,
20,
7782,
1326,
3547,
11379,
3755,
20,
1129,
2478,
19,
28,
306,
9,
2328,
203,
9,
264,
307,
8990,
4865,
800,
3726,
3726,
31,
259,
20,
7782,
1326,
3547,
11379,
2119,
79,
18,
20,
51,
1129,
2478,
432,
27,
4363,
1221,
6738,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I pass model data beween a view state and action state in Spring Web Flow 2.
===
In the Web Flow below I bind form data to a flow variable (lifeCycleForm) on a submit event in the view state. I have verified that the name, label and description properties are all populated as expected.
However, when the expression in the action state is evaluated all three properties are null. My form bean is serializable and I am just using simple string properties.
What I am doing wrong?
I am pretty new to Spring WebFlow so I might have missed something obvious.
<var name="lifeCycleForm" class="com.btmatthews.freelancer.lifecycle.portlet.LifeCycleForm" />
<view-state id="createLifeCycle" model="lifeCycleForm">
<binder>
<binding property="name" required="true" />
<binding property="label" required="true" />
<binding property="description" required="false" />
</binder>
<transition on="submit" to="createLifeCycleAction" />
<transition on="cancel" to="lifeCycleCreationCancelled" bind="false" />
</view-state>
<action-state id="createLifeCycleAction">
<evaluate expression="lifeCycleService.createLifeCycle(lifeCycleForm.name, lifeCycleForm.label, lifeCycleForm.description, null, null)" />
<transition on="success" to="lifeCycleCreated" />
<transition on="failure" to="createLifeCycle" />
</action-state>
<end-state id="lifeCycleCreated" />
<end-state id="lifeCycleCreationCancelled" />
Thanks in advance,
Brian | 0 | [
2,
184,
107,
31,
1477,
1061,
1054,
44,
458,
219,
21,
1418,
146,
17,
1028,
146,
19,
1573,
2741,
3312,
172,
9,
800,
3726,
3726,
19,
14,
2741,
3312,
1021,
31,
10193,
505,
1054,
20,
21,
3312,
7612,
13,
5,
4102,
12467,
4190,
6,
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 can I get "Copy to Output Directory" to work with Unit Tests?
===
When I build a unit test project before the tests are executed the test output is copied to a TestResults folder and then the tests are executed. The issue I'm having is that not all the files in the Debug/bin directory are copied to the TestResults project.
How can I get a file that is copied to the Debug/bin directory to also be copied to the TestResults folder? | 0 | [
2,
184,
92,
31,
164,
13,
7,
19625,
20,
5196,
16755,
7,
20,
170,
29,
1237,
4894,
60,
800,
3726,
3726,
76,
31,
1895,
21,
1237,
1289,
669,
115,
14,
4894,
50,
5557,
14,
1289,
5196,
25,
18225,
20,
21,
1289,
29955,
18,
19294,
17,
94... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Checking RAM Bays (Windows API)
===
I know that it is possible to check how much physical RAM is installed using `GetPhysicallyInstalledSystemMemory` or how much ram the operating system can see using `GlobalMemoryStatusEx`. However, I am wondering if there is any way to check how much ram a user has installed by slot. That is, to be able to programmatically tell the difference between 1x2GB of ram and 2x1GB of ram, thus checking if the computer can be upgraded easily via software. Ideally, a way to check this without .Net. | 0 | [
2,
9886,
2843,
899,
18,
13,
5,
27508,
18,
21,
2159,
6,
800,
3726,
3726,
31,
143,
30,
32,
25,
938,
20,
2631,
184,
212,
1825,
2843,
25,
4066,
568,
13,
1,
3060,
23274,
102,
108,
21300,
69,
10724,
790,
5171,
93,
1,
54,
184,
212,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Common sources of unterminated string literal
===
I am trying to debug a javascript script that gets read in a Firefox extension and executed. I only can see errors via the Firebug console (my code is invisible to Firebug), and it's reporting a "unterminated string literal."
I checked the line and the lines around it and everything seems fine-parentheses, braces, and quotes are balanced, etc. What are other possible causes that I should be looking for?
| 0 | [
2,
757,
2662,
16,
367,
3964,
12721,
3724,
20665,
800,
3726,
3726,
31,
589,
749,
20,
121,
16254,
21,
8247,
8741,
3884,
30,
3049,
1302,
19,
21,
535,
18219,
3896,
17,
5557,
9,
31,
104,
92,
196,
11908,
1197,
14,
535,
16254,
8650,
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... |
Is it dumb to develop for LAMP on WAMP?
===
After becoming somewhat estranged open source, and spending some years developing web applications in ASP.Net, I'm going to start doing quite a lot of PHP / MySQL development.
I've quite painlessly installed [WampServer][1] to get a development environment up and running on my Windows machine, but the platform I'll be targeting will most likely be Linux. So my question is, am I likely to run into problems due to developing on Windows while targeting Linux? Is it advisable to invest in getting a Linux environment setup in which to develop my LAMP apps?
[1]: http://www.wampserver.com/ | 0 | [
2,
25,
32,
9317,
20,
2803,
26,
6792,
27,
619,
10158,
60,
800,
3726,
3726,
75,
1535,
4131,
27288,
368,
1267,
15,
17,
4837,
109,
122,
3561,
2741,
3767,
19,
28,
306,
9,
2328,
15,
31,
22,
79,
228,
20,
799,
845,
1450,
21,
865,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Winforms Disposing IDisposable
===
Does anyone have a good articles or tutorial on correctly using dispose and IDisposable. I am trying to explain this to some junior dev and wanted to get some extra material, examples, etc. | 0 | [
2,
628,
4190,
18,
1460,
14717,
13,
19405,
12551,
579,
800,
3726,
3726,
630,
1276,
57,
21,
254,
3376,
54,
29724,
27,
12044,
568,
17913,
17,
13,
19405,
12551,
579,
9,
31,
589,
749,
20,
3271,
48,
20,
109,
1630,
9664,
17,
417,
20,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Encoding problem with HttpWebResponse
===
Here is a snippet of the code :
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(myURL);
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
Stream resStream = response.GetResponseStream();
string tempString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Encoding.ASCII.GetString(buf, 0, count);
sb.Append(tempString);
}
}
while (count > 0);
return (sb.ToString());
The problem is if I test with this html code :
<html>
Nous sommes dans le mois de décembre qui n'est pas en été!
</html>
All "é" are not displaying well. I have try to change ASCII to UTF8 and it still display wrong. I have tested the html file in a browser and the browser display the html text well so I am pretty sure the problem is in the method I use to download the html file.
What should I change?
![alt text][1]
[1]: http://img386.imageshack.us/img386/9665/encodingxn2.png | 0 | [
2,
19608,
1448,
29,
7775,
458,
3692,
18,
8782,
870,
800,
3726,
3726,
235,
25,
21,
13,
29061,
16,
14,
1797,
13,
45,
3724,
20904,
13,
18,
220,
800,
78,
3724,
20904,
5,
6,
73,
34,
591,
2558,
500,
3183,
410,
800,
78,
34,
591,
2558... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF throwing an exception parsing XAML that includes a Winforms User Control
===
I have a WPF app that makes use of a Winforms User Control that I have created using C++/CLI. When my app goes to parse the XAML for my main window, it throws an exception. The information appears to be somewhat abbreviated, but it says:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) Error in markup file 'OsgViewer;component/osgviewerwin.xaml' Line 1 Position 9.
I commented out my Winforms control in the XAML and everything loads fine. I figured maybe the constructor for my control is doing something bad, so I put a breakpoint in it, but the breakpoint does not appear to be enabled when I start to run the app, and is never hit, which I understand to mean the DLL containing that line is not loaded. Which would most likely cause an exception to be thrown when an object of a type in the DLL is instantiated - the body of the object's constructor couldn't be found.
I have done this successfully on a different project in the past, so I pulled in a different WinForms User Control from that app, and instantiated it in the XANL, and that all works fine.
So it's something in this DLL. I have a reference to the DLL in my WPF C# app, and when I load the DLL in Object Browser all the required classes and namespaces show up fine. The app compiles fine, the problem just shows up when parsing the XAML. Anybody seen something like this? Any ideas as to what could be causing this? Ideas for debugging it? Thanks! | 0 | [
2,
619,
7721,
6033,
40,
5391,
2017,
18,
68,
13,
6791,
8184,
30,
1103,
21,
628,
4190,
18,
4155,
569,
800,
3726,
3726,
31,
57,
21,
619,
7721,
4865,
30,
1364,
275,
16,
21,
628,
4190,
18,
4155,
569,
30,
31,
57,
679,
568,
272,
2051... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 you standardize on a scripting language in a dev group?
===
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc...
Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a better job on a script (as they know more tricks in one language). It can also lead to less development time per script.
Other times I think that we would benefit the most from standardizing so that there might be more shared libraries and so that we don't get into the situation of "I can't work on that script because I don't know python".
Do you think that we should standardize or let people choose for each script they write? | 0 | [
2,
378,
42,
1236,
2952,
27,
21,
3884,
68,
816,
19,
21,
9664,
214,
60,
800,
3726,
3726,
35,
170,
95,
2757,
21,
284,
20,
8063,
2006,
16,
17505,
20,
3096,
182,
19,
1826,
522,
9,
95,
57,
109,
148,
30,
50,
91,
5733,
19,
20059,
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... |
Unique identifier for an iPhone app.
===
For an iPhone app that submits images to a server I need somehow to tie all the images from a particular phone together. With every submit I'd like to send some unique phone id. Looked at <pre>
[[UIDevice mainDevice] uniqueIdentifier]
and
[[NSUserDefaults standardDefaults] stringForKey:@"SBFormattedPhoneNumber"]
</pre>
but getting errors in the simulator.
Is there an Apple sanctioned way of doing this?
| 0 | [
2,
2619,
25570,
26,
40,
21024,
4865,
9,
800,
3726,
3726,
26,
40,
21024,
4865,
30,
12298,
18,
3502,
20,
21,
8128,
31,
376,
3625,
20,
3795,
65,
14,
3502,
37,
21,
1498,
1132,
429,
9,
29,
352,
12298,
31,
22,
43,
101,
20,
2660,
109... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading RAW image files as GDI+ bitmaps
===
Is there a good way to read RAW image files (especially Canon CR2 and Adobe DNG files) as GDI+ bitmaps that is reasonably fast?
I found an example running under WPF that would read an image using any installed image codec and then display it in an image control. And I modified this example to create a GDI+ bitmap by writing the WPF image to a MemoryStream and creating the Bitmap from that. But this process is slow! Horribly slow! Opening a simple image takes around 10 seconds on my computer. This solution also requires references to the WPF assemblies and that doesn't feel right, especially not since I would like to run the code in an ASP.NET project.
There are programs that will do batch conversions of the images, but I would prefer converting the images dynamically when requested.
So, any suggestions? | 0 | [
2,
1876,
4333,
1961,
6488,
28,
489,
1115,
2430,
1142,
15022,
18,
800,
3726,
3726,
25,
80,
21,
254,
161,
20,
1302,
4333,
1961,
6488,
13,
5,
12183,
5742,
6186,
135,
17,
20299,
13,
43,
2723,
6488,
6,
28,
489,
1115,
2430,
1142,
15022,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Date time parsing that accepts 05/05/1999 and 5/5/1999, etc...
===
Is there a simple way to parse a date that may be in MM/DD/yyyy, or M/D/yyyy, or some combination? i.e. the zero is optional before a single digit day or month.
To do it manually, one could use:
String[] dateFields = dateString.split("/");
int month = Integer.parseInt(dateFields[0]);
int day = Integer.parseInt(dateFields[1]);
int year = Integer.parseInt(dateFields[2]);
And validate with:
dateString.matches("\\d\\d?/\\d\\d?/\\d\\d\\d\\d")
Is there a call to SimpleDateFormat or JodaTime that would handle this? | 0 | [
2,
1231,
85,
2017,
18,
68,
30,
16548,
13,
4071,
118,
4071,
118,
3889,
17,
13,
10551,
10551,
3889,
15,
2722,
9,
9,
9,
800,
3726,
3726,
25,
80,
21,
1935,
161,
20,
2017,
870,
21,
1231,
30,
123,
44,
19,
1620,
118,
8096,
118,
93,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does Columns.Insert not update the DisplayIndex in DataGridView (C#)?
===
I am inserting a column in a DataGridView programmatically (i.e., not bound to any data tables/databases) as follows:
int lastIndex = m_DGV.Columns.Count - 1; // Count = 4 in this case
DataGridViewTextBoxColumn col = (DataGridViewTextBoxColumn)m_DGV.Columns[lastIndex];
m_DGV.Columns.RemoveAt(lastIndex);
m_DGV.Columns.Insert(insertIndex, col); // insertIndex = 2
I have found that my columns are visually out of order sometimes using this method. A workaround is to manually set the DisplayIndex property of the column afterwards. Adding this code "fixes it", but I don't understand why it behaves this way.
Console.Write(m_DGV.Columns[0].DisplayIndex); // Has value of 0
Console.Write(m_DGV.Columns[1].DisplayIndex); // Has value of 1
Console.Write(m_DGV.Columns[2].DisplayIndex); // Has value of 3
Console.Write(m_DGV.Columns[3].DisplayIndex); // Has value of 2
col.DisplayIndex = insertIndex;
Console.Write(m_DGV.Columns[0].DisplayIndex); // Has value of 0
Console.Write(m_DGV.Columns[1].DisplayIndex); // Has value of 1
Console.Write(m_DGV.Columns[2].DisplayIndex); // Has value of 2
Console.Write(m_DGV.Columns[3].DisplayIndex); // Has value of 3
As an aside, my grid can grow its column count dynamically. I wanted to grow it in chunks, so each insert didn't require a column allocation (and associated initialization). Each "new" column would then be added by grabbing an unused column from the end, inserting it into the desired position, and making it visible.
| 0 | [
2,
483,
630,
7498,
9,
108,
18,
6767,
52,
11100,
14,
3042,
25671,
19,
1054,
16375,
4725,
13,
5,
150,
5910,
6,
60,
800,
3726,
3726,
31,
589,
14692,
68,
21,
4698,
19,
21,
1054,
16375,
4725,
625,
6732,
1326,
13,
5,
49,
9,
62,
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... |
copy directory recursively and filter filenames in perl
===
How do I copy a directory including sub directories excluding files that match a certain regex? | 0 | [
2,
4344,
16755,
302,
24244,
102,
17,
11945,
3893,
7259,
18,
19,
416,
255,
800,
3726,
3726,
184,
107,
31,
4344,
21,
16755,
215,
972,
559,
1596,
13,
14938,
6488,
30,
730,
21,
1200,
7953,
1706,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Credit Card Payment Solutions for Desktop Applications
===
There are a whole raft of questions regarding payment processors for <b>web</b> applications but I haven't seen one yet for desktop applications. What are your experiences?
Perhaps to put this into a little context, the requirements:
1. Should be customisable
2. Should be available in Australia at least, if not world wide (less critical).
3. No storage of credit card details
4. Recurrent micro payments of varying amounts each time
5. 1-click payment. It's ok for the user to be registered with the payment processor provider.
| 0 | [
2,
3251,
2056,
7582,
6776,
26,
17404,
3767,
800,
3726,
3726,
80,
50,
21,
979,
15780,
16,
2346,
3467,
7582,
21034,
26,
13,
1,
220,
1,
14113,
1,
118,
220,
1,
3767,
47,
31,
2933,
22,
38,
541,
53,
768,
26,
17404,
3767,
9,
98,
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... |
Can MSTest run a specific method each time it startsup?
===
**Question**
Is there a way to have a method that will *always* run anytime that test assembly is run through MSTest?
Similar to how the [TestInitialize] and [ClassInitialize] attributes work, but for the entire assembly. I do not want to have to add code to every test class's [ClassInitialize] method.
**Reasoning**
Some of my tests interact with the database. They delete data and other things that would be very harmful to a production database. There is only a configuration file that tells my unit test project to run against the non-production database.
I would feel better if there was a method that would run on startup that would say "Okay Database name is not 'production'"
**Ideas**
Log4Net uses an assembly attribute to configure itself.
using log4net.Config;
[assembly: XmlConfigurator()]
Perhaps I can do something simliar?
[assembly: CheckDatabaseNameNot("production")] | 0 | [
2,
92,
4235,
10543,
485,
21,
1903,
2109,
206,
85,
32,
3244,
576,
60,
800,
3726,
3726,
13,
1409,
24652,
1409,
25,
80,
21,
161,
20,
57,
21,
2109,
30,
129,
1637,
21284,
2483,
485,
19711,
30,
1289,
1475,
25,
485,
120,
4235,
10543,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET MVC controller actions that return JSON or partial html
===
I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously? | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
9919,
3078,
30,
788,
487,
528,
54,
7284,
13,
15895,
800,
3726,
3726,
31,
589,
749,
20,
1600,
9919,
3078,
56,
129,
788,
694,
487,
528,
54,
7284,
13,
15895,
4758,
685,
21,
18906,
9,
98,
25,
14,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
Fortran Array to C array. Stupid macro tricks wanted
===
I have this 'simplified' fortran code
real B(100, 200)
real A(100,200)
... initialize B array code.
do I = 1, 100
do J = 1, 200
A(I,J) = B(I,J)
end do
end do
One of the programming gurus warned me, that fortran accesses data efficiently in column order, while c accesses data efficiently in row order. He suggested that I take a good hard look at the code, and be prepared to switch loops around to maintain the speed of the old program.
Being the lazy programmer that I am, and recognizing the days of effort involved, and the mistakes I am likely to make, I started wondering if there might a #define technique that would let me convert this code safely, and easily.
Do you have any suggestions? | 0 | [
2,
26,
17685,
7718,
20,
272,
7718,
9,
3553,
9069,
13747,
417,
800,
3726,
3726,
31,
57,
48,
13,
22,
11268,
22,
26,
17685,
1797,
683,
334,
5,
4031,
15,
2327,
6,
683,
21,
5,
4031,
15,
4621,
6,
13,
9,
9,
9,
2104,
2952,
334,
7718... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 smoothly does a website launch usually go for you?
===
My coworkers and I were having a discussion about this yesterday. It seems that no matter how well we prepare and no matter how much we test and no matter what the client says immediately before the site becomes public, initial site launches almost always seem to be somewhat rocky. Some clients are better than others, but often things that were just fine during testing suddenly go horribly wrong when the site becomes public.
Is this a common experience? I'm not just talking about functionality breaking down (although that's often a problem as well). I'm also talking about sites that work exactly the way we wanted them to, but suddenly are not satisfactory to the client when it's time to make the site public. And I'm talking about clients that have been familiar with the site during most of the development process. Meaning, the public launch is definitely not the first time they've seen the site.
If you've dealt with this problem before, have you found a way to improve the situation? Or is this just something that will always be somewhat of a problem? | 0 | [
2,
184,
17532,
630,
21,
2271,
3394,
951,
162,
26,
42,
60,
800,
3726,
3726,
51,
326,
16355,
17,
31,
46,
452,
21,
5460,
88,
48,
7124,
9,
32,
2206,
30,
90,
1161,
184,
134,
95,
5723,
17,
90,
1161,
184,
212,
95,
1289,
17,
90,
116... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 work around this error while copying SVN repository by svnsync?
===
I am copying a repository by using svnsync and am receiving this error on the same revision every time.
> Transmitting file data ...svnsync: REPORT of 'https://svn1.avlux.net/xxxxxx.net': Could not read response body: Secure connection truncated https://svn1.avlux.net)
It is a large revision and I don't have admin access to the server. Is there a way around this, even if it involves checking out and copying the revision manually? | 0 | [
2,
184,
107,
31,
170,
140,
48,
7019,
133,
4344,
68,
13,
18,
16578,
24869,
34,
13,
18,
16578,
9507,
150,
60,
800,
3726,
3726,
31,
589,
4344,
68,
21,
24869,
34,
568,
13,
18,
16578,
9507,
150,
17,
589,
3396,
48,
7019,
27,
14,
205... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Question about skipping IDs in the indentity column in MSSQL...
===
Say I have an MSSQL table with two columns: an int ID column that's the identity column and some other datetime or whatever column. Say the table has 10 records with IDs 1-10. Now I delete the record with ID = 5.
Are there any scenarios where another record will "fill-in" that missing ID? I.e. when would a record be inserted and given an ID of 5?
| 0 | [
2,
1301,
88,
27225,
13,
9178,
19,
14,
19,
817,
38,
856,
4698,
19,
4235,
18,
22402,
9,
9,
9,
800,
3726,
3726,
395,
31,
57,
40,
4235,
18,
22402,
859,
29,
81,
7498,
45,
40,
19,
38,
4924,
4698,
30,
22,
18,
14,
3270,
4698,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Latency in playing short sounds in Flash 9, Actionscript 3
===
I've got a few very short audio clips (less than a second long) to be played on various events (button hover, click, etc). However, there is usually a significant lag between the action and the actual playing of the sound. I have tried both embedding the sound in the .swf, and loading it externally at the start, but both lead to the same results. Likewise, I've tried with compressed and uncompressed audio.
What it *seems* like is that the audio buffers are just a lot longer than I need them to be, like perhaps Flash is optimized more towards playing longer sounds without any stutter at the expense of a little more latency in starting sounds. Could this be it? Is there any way to change them? Since what I'm working on will never need to play sounds more than a second or so long and will always be loaded completely at the start, it wouldn't hurt it at all to have really short buffers.
One other possible thing that might be the cause: if I use .wav files when using loadSound()... I can't get it to actually play the sounds. There's no errors, and everything returns as it should, but no actual sound is played, which is why I have them as .mp3 currently. Perhaps when using .mp3 audio (or any compressed audio), there just will be lag in decoding it? The reason I still have doubts about this, though, is that when embedding them in the .swf as .wav files (by importing them into the library), they still have the same latency on playback.
Just for a sanity check, I'll include the code I've got, minus irrelevant parts and error checking. First, loading them at runtime:
var soundArray:Array = new Array();
loadSound( "click", "sounds/buttondroop4.mp3" );
loadSound( "hover", "sounds/Dink-Public_D-146.mp3" );
function loadSound( name:String, url:String ):void
{
var req:URLRequest = new URLRequest( url );
soundArray[ name ] = new Sound( req );
soundArray[ name ].addEventListener( Event.COMPLETE, soundLoaded );
}
function soundLoaded( event:Event ):void
{
for( var name:String in soundArray )
{
if( event.target == soundArray[name] )
{
trace( "Loaded sound [" + name + "]" );
return;
}
}
}
function playSound( name:String ):void
{
for( var nameSrc:String in soundArray )
{
if( name == nameSrc )
{
var channel:SoundChannel = soundArray[ name ].play();
return;
}
}
}
// Sometime later, well after soundLoaded() callback is triggered...
playSound( "click" );
playSound( "hover" );
And an alternate way, embedding them in the library as classes and going from there:
var sClick:soundClick = new soundClick();
var sHover:soundHover = new soundHover();
sClick.play();
sHover.play();
The sound files are tiny, less than 10kb generally. The lag is apparent enough that one of the first complaints someone had when looking at it was that the sound effects on button hovers seemed delayed, so it wasn't just me being picky. I feel like I must just be doing something wrong; there's too many flash things out there that have snappy sound effects without anywhere near this kind of lag. | 0 | [
2,
456,
14386,
19,
791,
502,
2795,
19,
4433,
561,
15,
1028,
8741,
203,
800,
3726,
3726,
31,
22,
195,
330,
21,
310,
253,
502,
4023,
17270,
13,
5,
923,
119,
21,
153,
175,
6,
20,
44,
257,
27,
617,
963,
13,
5,
811,
444,
21350,
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... |
Reacting to click on ListItems in CheckboxList
===
I would like to apply some logic to a page containing a CheckBoxList control when the user checks or unchecks individual checkbox items. Say, for instance to dynamically show or hide a related control.
I came up with a way using ASP.Net 2.0 callback mechanism (AJAX) with a combination of client-side Javascript and server-side logic in the code-behind. However, this solution is not very bullet-proof (i.e. most likely suffers from timing issues). It is not portable, because the code needs to know the sequential ids of individual items, etc.
The code I came up with is separated in two functions, one handling the `onclick` event, and the other processing the returned callback string :
<script type="text/javascript">
function OnCheckBoxClicked()
{
// gathers the semi-colon separated list of labels,
// associated with the currently checked items
var texts = '';
// iterate over each individual checkbox item
// items in a checkboxlist are sequential, so
// stop iteration at the first missing sequence number
for (var index = 0; index < 99; index++)
{
var checkbox = document.getElementById('ctl00_cphAdmin_cblCategories_' + index);
if (checkbox == null)
break;
if (checkbox.checked)
{
// find label associated with the current checkbox item
var labels = document.getElementsByTagName('label');
for (var index_ = 0; index_ < labels.length; index_ ++)
{
if (labels[index_].htmlFor == checkbox.id)
{
texts = texts + labels[index_].innerHTML + ';';
break;
}
}
}
}
// perform callback request
// result will be processed by the UpdateCheckBoxes function
WebForm_DoCallback('__Page', '_checkbox' + texts, UpdateCheckBoxes, 'checkbox', null, true /* synchronous */);
}
function UpdateCheckBoxes(returnmessage, context)
{
if (returnmessage == null || returnmessage == '')
return ;
// iterate over each individual checkbox item
// items in a checkboxlist are sequential, so
// stop iteration at the first missing sequence number
for (var index = 0; index < 99; index++)
{
var checkbox = document.getElementById('ctl00_cphAdmin_cblCategories_' + index);
if (checkbox == null)
break;
// find label associated with the current checkbox item
var label = '';
var labels = document.getElementsByTagName('label');
for (var index_ = 0; index_ < labels.length; index_ ++)
{
if (labels[index_].htmlFor == checkbox.id)
{
label = ';' + labels[index_].innerHTML + ';';
break;
}
}
// perform custom processing based on the contents
// of the returned callback string
// for instance, here we check whether the returnmessage
// contains the string ';' + label + ';'
if (returnmessage.indexOf(label, 1) > 0)
{
// do something
}
}
}
</script>
Isn't there a more elegant solution to this problem?
| 0 | [
2,
7749,
68,
20,
10840,
27,
968,
2119,
79,
18,
19,
2631,
5309,
5739,
800,
3726,
3726,
31,
83,
101,
20,
5645,
109,
7085,
20,
21,
2478,
3503,
21,
2631,
5309,
5739,
569,
76,
14,
4155,
16602,
54,
367,
12542,
18,
1359,
2631,
5309,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Apart from initial cost, are there any other benefits of using MySQL over MSQL server with .net?
===
I've used both and I've found MySql to have several frustrating bugs, limited support for: IDE integration, profiling, integration services, reporting, and even lack of a decent manager. Total cost of ownership of MSSQL Server is touted to be less than MySQL too (.net environment), but maintaining an open mind could someone point out any killer features of MySql? | 0 | [
2,
2629,
37,
2104,
1516,
15,
50,
80,
186,
89,
5800,
16,
568,
51,
18,
22402,
84,
4235,
22402,
8128,
29,
13,
9,
2328,
60,
800,
3726,
3726,
31,
22,
195,
147,
156,
17,
31,
22,
195,
216,
51,
18,
22402,
20,
57,
238,
25568,
13925,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to select unique nodes in XSLT
===
I found [this page][1] describing the Muenchian method, but I think I'm applying it wrong.
Consider that this would return a set of ages:
/doc/class/person/descriptive[(@name='age')]/value
> 1..2..2..2..3..3..4..7
But I would like a nodeset only one node for each age.
> 1..2..3..4..7
Each of these seem to return all of the values, instead of unique values:
/doc/class/person/descriptive[(@name='age')][not(value=preceding-sibling::value)]/value
/doc/class/person/descriptive[(@name='age')]/value[not(value=preceding-sibling::value)]
What am I missing?
[1]: http://www.jenitennison.com/xslt/grouping/muenchian.html | 0 | [
2,
184,
20,
5407,
2619,
16272,
19,
993,
18,
255,
38,
800,
3726,
3726,
31,
216,
636,
1565,
2478,
500,
2558,
165,
500,
7153,
14,
2832,
219,
1594,
210,
2109,
15,
47,
31,
277,
31,
22,
79,
11989,
32,
1389,
9,
3563,
30,
48,
83,
788,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Does powershell have an equivalent to popen?
===
I need to be able to launch a process and read the output into a variable. Then based on the return of the command I can choose to show the full output or just a selected subset. | 0 | [
2,
630,
414,
15984,
57,
40,
4602,
20,
3075,
103,
60,
800,
3726,
3726,
31,
376,
20,
44,
777,
20,
3394,
21,
953,
17,
1302,
14,
5196,
77,
21,
7612,
9,
94,
432,
27,
14,
788,
16,
14,
1202,
31,
92,
3538,
20,
298,
14,
503,
5196,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is it possible to use MSBuild to build a .NET 1.1 VB project w/ Crystal Reports?
===
I have a project with Crystal Reports files that doesn't seem to build correctly if I upgrade it to VS 2005 and .NET 2.0. I think the reason is that the new version of Crystal Reports is incompatible with the older report format. Since I am now running Vista, and .NET 2003 doesn't work correctly on Vista, I want to be able to build using MSBuild to target the .NET 1.1 framework. Is this possible? | 0 | [
2,
25,
32,
938,
20,
275,
4235,
29361,
20,
1895,
21,
13,
9,
2328,
137,
9,
165,
13,
20468,
669,
619,
118,
4282,
2813,
60,
800,
3726,
3726,
31,
57,
21,
669,
29,
4282,
2813,
6488,
30,
1437,
22,
38,
2260,
20,
1895,
12044,
100,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Should I dynamically recreate a PDF, rather than store it in either the database or the filesystem?
===
I need customers to be able to download PDFs of letters that have been sent to them.
I have read the threads about database vs filesystem storage of documents or images, and it does sound like the consensus is that, for anything more than just a few images, filesystem is the way to go.
What I want to know: would a reasonable alternative be to just store the letter details in the database, and recreate the PDF 'on the fly' when it is requested?
Is that approach superior or inferior to fetching the PDF from the filesystem? | 0 | [
2,
378,
31,
7782,
1326,
21119,
21,
13,
11124,
15,
864,
119,
1718,
32,
19,
694,
14,
6018,
54,
14,
3893,
10724,
60,
800,
3726,
3726,
31,
376,
5279,
20,
44,
777,
20,
7121,
13,
11124,
18,
16,
2516,
30,
57,
74,
795,
20,
105,
9,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Refactor to n-tier
===
I am a self taught vb6 programmer who uses DAO. Below is an example of a typical piece of code
that I could churn out :
Sub cmdMultiplier_Click() 'Button on form, user interface
dim Rec1 as recordset
dim strSQL as string
strSQL = "select * from tblCustomers where ID = " & CurrentCustomerID 'inline SQL
set rec1 = GlobalDataBase.openrecordset(strSQL) ' Data access
if rec1.bof <> true or rec1.eof <> true then
if rec1.fields("Category").value = 1 then
PriceMultiplier = 0.9 'Business Logic
else
priceMultiplier = 1
end if
end if
End Sub
Please pretend that the above is the entire source code of a CRUD application.
I know this design is bad, everything is mixed up together. Ideally it should have three distinct layers, user interface, business logic
and data access. I sort-of get why this is desirable but I don't know how it's done and I suspect
that's why I don't fully get why such a separation is good.
I think I'd be a lot further down the road if someone could refactor the above ridiculously
trivial example into 3 tiers. | 0 | [
2,
302,
17455,
20,
13,
103,
8,
5259,
800,
3726,
3726,
31,
589,
21,
1119,
2359,
13,
20468,
379,
17968,
72,
2027,
13,
17104,
9,
1021,
25,
40,
823,
16,
21,
3874,
1855,
16,
1797,
30,
31,
110,
4834,
5778,
70,
13,
45,
972,
2390,
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... |
Int128 in .Net?
===
I need to do some large integer math. Are there any classes or structs out there that represent a 128-bit integer and implement all of the usual operators?
BTW, I realize that decimal can be used to represent a 96-bit int.
| 0 | [
2,
19,
38,
22545,
19,
13,
9,
2328,
60,
800,
3726,
3726,
31,
376,
20,
107,
109,
370,
13820,
5057,
9,
50,
80,
186,
2684,
54,
13,
10346,
18,
70,
80,
30,
3501,
21,
13218,
8,
3326,
13820,
17,
8713,
65,
16,
14,
3820,
9475,
60,
334... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 an upper limit to z-index values in web browsers?
===
I have a case where a 3rd party ad is bleeding through my modal window implementation. I'd like to up the z-index of the modal overlay as high as possible so the ad won't show on top of it. Is there a limit to z-index values? I'm sure if there is it varies by browser. Anyone know? | 0 | [
2,
25,
80,
40,
1508,
4496,
20,
2052,
8,
25671,
4070,
19,
2741,
16495,
18,
60,
800,
3726,
3726,
31,
57,
21,
610,
113,
21,
203,
897,
346,
21,
43,
25,
10065,
120,
51,
13,
20756,
1463,
6123,
9,
31,
22,
43,
101,
20,
71,
14,
2052,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
StringBuilder how to get the final String?
===
Someone told me that it's faster to concatenate String with a String builder. How I have changed all my code but I do not see any Property or Method to get the final build string. How can I get the string? | 0 | [
2,
3724,
20904,
184,
20,
164,
14,
426,
3724,
60,
800,
3726,
3726,
737,
470,
55,
30,
32,
22,
18,
4233,
20,
1065,
9530,
8820,
3724,
29,
21,
3724,
14960,
9,
184,
31,
57,
1015,
65,
51,
1797,
47,
31,
107,
52,
196,
186,
1354,
54,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
Looking for 16-bit x86 compiler
===
I am working on an embedded systems project and have run into an issue of the compiler being programatically embedded in the Paradigm C++ IDE. I would like to be able to automate building.
The processor is the AMD186ES. I am not working with the OS - just baremetal stuff.
I need to generate real-mode 16-bit 8086 machine code from C++.
My googling indicates that G++ can build such code.
My questions are:
Can g++ be configured to build this machine code?
Are there other C++ compilers that can do it as well? | 0 | [
2,
699,
26,
347,
8,
3326,
993,
3274,
21486,
800,
3726,
3726,
31,
589,
638,
27,
40,
12138,
1242,
669,
17,
57,
485,
77,
40,
1513,
16,
14,
21486,
142,
625,
721,
8438,
12138,
19,
14,
20234,
272,
20512,
13,
3448,
9,
31,
83,
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... |
Java Web Application Sync Question
===
Let's say I have a class in my web app called class "Foo". It has an initialise() method that is called when the bean is created using Spring. The initialise() method then tries to load an external service and assign it to a field. If the service could not be contacted, the field will be set to null.
private Service service;
public void initialise() {
// load external service
// set field to the loaded service if contacted
// set to field to null if service could not be contacted
}
When someone calls the method get() on the class "Foo" the service will be invoked if it was started in the initialise() method. If the field for the service is null, I want to try and load the external service.
public String get() {
if (service == null) {
// try and load the service again
}
// perform operation on the service is service is not null
}
Is it possible that I may have sync issues if I would do something like this? | 0 | [
2,
8247,
2741,
3010,
6063,
150,
1301,
800,
3726,
3726,
408,
22,
18,
395,
31,
57,
21,
718,
19,
51,
2741,
4865,
227,
718,
13,
7,
4120,
111,
7,
9,
32,
63,
40,
2104,
2628,
5,
6,
2109,
30,
25,
227,
76,
14,
15322,
25,
679,
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... |
Change version informaiton in a built binary
===
How does one go about changing the version information in a built binary?
Specifically I have a .exe which is built with VS6 but doesn't seem to include up any of the company information or version information strings. I'm not really even sure how they get in there in the first place, actually. Is there a command line tool for updating this informaiton? How do you embed it from a command line build? | 0 | [
2,
753,
615,
10361,
3622,
444,
19,
21,
392,
14171,
800,
3726,
3726,
184,
630,
53,
162,
88,
4226,
14,
615,
676,
19,
21,
392,
14171,
60,
3524,
31,
57,
21,
13,
9,
1706,
62,
56,
25,
392,
29,
4611,
379,
47,
1437,
22,
38,
2260,
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... |
Passing a list while retaining the original
===
So I'm teaching myself Python, and I'm having an issue with lists. I want to pass my function a list and pop items off it while retaining the original list. How do I make python "instance" the passed list rather that passing a pointer to the original one?
Example:
def burninate(b):
c = []
for i in range(3):
c.append(b.pop())
return c
a = range(6)
d = burninate(a)
print a, d
Output: [0, 1, 2] [5, 4, 3]<br>
Desired output: [0, 1, 2, 3, 4, 5] [5, 4, 3]
Thanks! | 0 | [
2,
2848,
21,
968,
133,
14151,
14,
501,
800,
3726,
3726,
86,
31,
22,
79,
2540,
992,
20059,
15,
17,
31,
22,
79,
452,
40,
1513,
29,
7227,
9,
31,
259,
20,
1477,
51,
1990,
21,
968,
17,
1675,
3755,
168,
32,
133,
14151,
14,
501,
96... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can you detect a ctrl-click (context menu) request in the mouseDown event?
===
In my cross-platform architecture, I would like to act on a context menu click (right button click) during a mouse click event. In Cocoa, can you detect that the user either did <Ctrl><Click> or double-tap on touchpad (right-click equivalent) DURING the mouseDown event? I am aware of NSView's menuForEvent but do not wish to handle it here. | 0 | [
2,
92,
42,
9092,
21,
13,
4812,
6362,
8,
150,
10129,
13,
5,
1126,
11969,
11379,
6,
3772,
19,
14,
7567,
2968,
807,
60,
800,
3726,
3726,
19,
51,
919,
8,
27035,
2607,
15,
31,
83,
101,
20,
601,
27,
21,
4141,
11379,
10840,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SystemIcons default size
===
What is the default (i.e. native) size of a System.Drawing.SystemIcons icon? | 0 | [
2,
329,
49,
12124,
12838,
1072,
800,
3726,
3726,
98,
25,
14,
12838,
13,
5,
49,
9,
62,
9,
1275,
6,
1072,
16,
21,
329,
9,
3030,
3546,
9,
10724,
49,
12124,
9801,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Rails Cookie Setting Problems
===
I have a Rails app that sets a cookie and does a redirect to another server once the user is logged in. However, the cookie that the Rails app sets isn't seen by the server for some reason. I've tried setting http_only to false but I still can't even see the cookie unless the domain is the same as my Rails app. Here's the code I'm using to set the cookie:
cookies[:dev_appserver_login] =
{ :value => "#{email}:#{nick}:#{admin}:#{hsh}",
:domain => "webserver-to-redirect-to",
:expires => 30.days.from_now }
redirect_to session[:dest_url]
If I manually create a cookie with the [Web Developer extension][1] in Firefox it works fine, but not when Rails does it. Any ideas?
[1]: https://addons.mozilla.org/en-US/firefox/addon/60 | 0 | [
2,
2240,
18,
19980,
2697,
1716,
800,
3726,
3726,
31,
57,
21,
2240,
18,
4865,
30,
3415,
21,
19980,
17,
630,
21,
302,
14706,
20,
226,
8128,
382,
14,
4155,
25,
13,
19287,
19,
9,
207,
15,
14,
19980,
30,
14,
2240,
18,
4865,
3415,
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... |
How do I help senior team members improve?
===
I have a pretty good team. We are all friends and get along well. When a problem does occur it is usually patched up rather quickly. However, one of the senior members of the team has become a little reluctant to suggestions for improvement. And in an angered moment lashed out with "It always has to be YOUR way!"
I will be the first to admit that I am not the best coder. I have questions from time to time. I get things wrong... often. But I would have to say that my code is pretty clean when I am finished with it. I am the team lead, so improving the team is one of my responsibilities.
How do I help this developer improve without upsetting them again? | 2 | [
2,
184,
107,
31,
448,
1101,
173,
443,
3545,
60,
800,
3726,
3726,
31,
57,
21,
1772,
254,
173,
9,
95,
50,
65,
954,
17,
164,
303,
134,
9,
76,
21,
1448,
630,
3744,
32,
25,
951,
7331,
69,
71,
864,
976,
9,
207,
15,
53,
16,
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... |
Why is it bad to use a iteration variable in a lambda expression
===
I was just writing some quick code and noticed this complier error
Using the iteration variable in a lambda expression may have unexpected results.
Instead, create a local variable within the loop and assign it the value of the iteration variable.
I know what it means and I can easily fix it, not a big deal.
But I was wondering why it is a bad idea to use a iteration variable in a lambda? What problems can I cause later on?
EDIT! Sorry I'm using VB.net | 0 | [
2,
483,
25,
32,
896,
20,
275,
21,
23534,
7612,
19,
21,
13,
24187,
1803,
800,
3726,
3726,
31,
23,
114,
1174,
109,
2231,
1797,
17,
2711,
48,
6479,
10491,
7019,
568,
14,
23534,
7612,
19,
21,
13,
24187,
1803,
123,
57,
9380,
1736,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I make Bash history permanent under FreeBSD?
===
I have a FreeBSD box with Bash set up.
I'm used to Debian Linux where my command history is automatically saved when I log out, so that when I log back in I can press up or Ctrl-R or whatever and have access to my history.
How do I set up Bash to do this on FreeBSD? | 0 | [
2,
184,
107,
31,
233,
13158,
447,
3032,
131,
551,
4562,
43,
60,
800,
3726,
3726,
31,
57,
21,
551,
4562,
43,
1649,
29,
13158,
309,
71,
9,
31,
22,
79,
147,
20,
121,
10035,
13024,
113,
51,
1202,
447,
25,
7499,
4377,
76,
31,
6738,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java Applet Locale setting
===
I am running an english language version of WindowsXP, but have set Spanish as my only accepted language in Firefox. I had naively expected the browser's language to be set as the default when I load an applet in a browser session, but this does not appear to be the case. The applet starts up in English, the default language of the OS.
I could add a new <param> to my Applet and call Locale.setDefault() during initialization, but before I start hacking away I'd like to know if I'm missing something obvious. Is there a common mechanism by which the browser or invoking web page can set the default language of an <applet> ? | 0 | [
2,
8247,
4037,
38,
375,
62,
2697,
800,
3726,
3726,
31,
589,
946,
40,
486,
816,
615,
16,
1936,
396,
306,
15,
47,
57,
309,
1273,
28,
51,
104,
2217,
816,
19,
535,
18219,
9,
31,
41,
16288,
102,
1727,
14,
16495,
22,
18,
816,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to avoid Anemic Domain Models and maintain Separation of Concerns?
===
It seems that the decision to make your objects fully cognizant of their roles within the system, and still avoid having too many dependencies within the domain model on the database, and service layers?
For example: Say that I've got an entity with a revision history, and several "lookup tables" that the data references, your entity object should have methods to get the details from some of the lookup tables, whether by providing access to the lookup table rows, or by delegating methods down to them, but in order to do so it depends on the database layer to read the data from those rows. Also, when the entity is saved, It needs to know not only how to save itself, but also to save entries into the revision history. Is it necessary to pass references to dozens of different data layer objects and service objects to the model object? This seems like it makes the logic far more complex to understand than just passing back and forth thin models to service layer objects, but I've heard many "wise men" recommending this sort of structure.
| 0 | [
2,
184,
20,
2658,
40,
62,
5410,
4603,
2761,
17,
4027,
8312,
16,
4823,
60,
800,
3726,
3726,
32,
2206,
30,
14,
1401,
20,
233,
154,
3916,
2337,
326,
16606,
6220,
38,
16,
66,
2954,
363,
14,
329,
15,
17,
174,
2658,
452,
266,
151,
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... |
Does Dependency Walker work with .NET apps
===
Does Dependency Walker work with managed apps? I've downloaded the latest and tried profiling the app, but it just exits without much of an explanation. If it doesn't work with .NET, then is there some other tool that would help me debug a run-time DLL loading issue? | 0 | [
2,
630,
26835,
3764,
170,
29,
13,
9,
2328,
4865,
18,
800,
3726,
3726,
630,
26835,
3764,
170,
29,
1471,
4865,
18,
60,
31,
22,
195,
23887,
14,
5736,
17,
794,
8721,
49,
802,
14,
4865,
15,
47,
32,
114,
4350,
18,
366,
212,
16,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Solve the interview question that stumped me
===
I just finished a test as part of a job interview, and one question stumped me - even using google for reference. I'd like to see what the stackoverflow crew can do with it:
**The “memset_16aligned” function requires a 16byte aligned pointer passed to it, or it will crash.**
a) How would you allocate 1024 bytes of memory, and align it to a 16 byte boundary?
b) Free the memory after the memset_16aligned has executed.
{
void *mem;
void *ptr;
// answer a) here
memset_16aligned(ptr, 0, 1024);
// answer b) here
}
| 0 | [
2,
8402,
14,
2421,
1301,
30,
15781,
69,
55,
800,
3726,
3726,
31,
114,
842,
21,
1289,
28,
141,
16,
21,
1205,
2421,
15,
17,
53,
1301,
15781,
69,
55,
13,
8,
166,
568,
8144,
26,
2801,
9,
31,
22,
43,
101,
20,
196,
98,
14,
7566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.