PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
49,925
09/08/2008 15:19:33
3,208
08/27/2008 13:12:45
23
2
What is the difference between UNION and UNION ALL in Oracle
What is the difference between UNION and UNION ALL in Oracle. ( not sure that it matters which database ).
sql
oracle
sybase
null
null
null
open
What is the difference between UNION and UNION ALL in Oracle === What is the difference between UNION and UNION ALL in Oracle. ( not sure that it matters which database ).
0
49,926
09/08/2008 15:19:59
3,002
08/26/2008 11:21:07
1,401
38
Open source alternative to matlab's fmincon function?
Does anyone know of an open-source alternative to Matlab's [`fmincon`][1] function for constrained linear optimization? I'm rewriting a matlab program to use Python / [numpy][2] / [SciPy][3] and this is the only function I haven't found an equivalent to. A numpy-based solution would be ideal, but any language will do. [1]: http://www.mathworks.com/access/helpdesk/help/toolbox/optim/index.html?/access/helpdesk/help/toolbox/optim/ug/fmincon.html [2]: http://numpy.scipy.org/ [3]: http://www.scipy.org/
python
matlab
numerical
numpy
scientific
null
open
Open source alternative to matlab's fmincon function? === Does anyone know of an open-source alternative to Matlab's [`fmincon`][1] function for constrained linear optimization? I'm rewriting a matlab program to use Python / [numpy][2] / [SciPy][3] and this is the only function I haven't found an equivalent to. A numpy-based solution would be ideal, but any language will do. [1]: http://www.mathworks.com/access/helpdesk/help/toolbox/optim/index.html?/access/helpdesk/help/toolbox/optim/ug/fmincon.html [2]: http://numpy.scipy.org/ [3]: http://www.scipy.org/
0
49,934
09/08/2008 15:23:07
2,811
08/25/2008 11:09:26
176
14
How come a 32 bit kernel can run a 64 bit binary?
On my OS X box, the kernel is a 32 bit binary and yet it can run a 64 bit binary. How does this work? <pre> cristi:~ diciu$ file ./a.out ./a.out: Mach-O 64-bit executable x86_64 cristi:~ diciu$ file /mach_kernel /mach_kernel: Mach-O universal binary with 2 architectures /mach_kernel (for architecture i386): Mach-O executable i386 /mach_kernel (for architecture ppc): Mach-O executable ppc cristi:~ diciu$ ./a.out cristi:~ diciu$ echo $? 1 </pre>
c
64bit
32bit
macosx
null
null
open
How come a 32 bit kernel can run a 64 bit binary? === On my OS X box, the kernel is a 32 bit binary and yet it can run a 64 bit binary. How does this work? <pre> cristi:~ diciu$ file ./a.out ./a.out: Mach-O 64-bit executable x86_64 cristi:~ diciu$ file /mach_kernel /mach_kernel: Mach-O universal binary with 2 architectures /mach_kernel (for architecture i386): Mach-O executable i386 /mach_kernel (for architecture ppc): Mach-O executable ppc cristi:~ diciu$ ./a.out cristi:~ diciu$ echo $? 1 </pre>
0
49,937
09/08/2008 15:23:46
2,915
08/25/2008 23:15:12
2,129
88
What is Dynamic Code Analysis?
What is Dynamic Code Analysis? How is it different from [Static Code Analysis][1] (ie, what can it catch that can't be caught in static)? I've heard of bounds checking and memory analysis - what are these? What other things are checked using dynamic analysis? -Adam [1]: http://stackoverflow.com/questions/49716/what-is-static-code-analysis
code-review
code-analysis
dynamic-analysis
null
null
null
open
What is Dynamic Code Analysis? === What is Dynamic Code Analysis? How is it different from [Static Code Analysis][1] (ie, what can it catch that can't be caught in static)? I've heard of bounds checking and memory analysis - what are these? What other things are checked using dynamic analysis? -Adam [1]: http://stackoverflow.com/questions/49716/what-is-static-code-analysis
0
49,950
09/08/2008 15:34:43
4,770
09/05/2008 14:24:23
3
4
Garbage Collection
Is it necessary to set large objects to null when implementing a Dispose method?
.net
garbage-collection
null
null
null
null
open
Garbage Collection === Is it necessary to set large objects to null when implementing a Dispose method?
0
49,962
09/08/2008 15:40:49
2,915
08/25/2008 23:15:12
2,144
88
Task Schedulers
Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies. For your answer, please choose one strategy and go over it in some detail, rather than giving a little info on several strategies. If you have something to add to soemone else's description and it's short, add a comment rather than a new answer (if it's long or useful, or simply a much better description, then please use an answer) - What is the strategy - describe the general case (assume people know what a task queue is, semaphores, locks, and other OS fundamentals outside the scheduler itself) - What is this strategy optimized for (task latency, efficiency, realtime, jitter, resource sharing, etc) - Is it realtime, or can it be made realtime -Adam
kernel
operating-system
scheduling
null
null
null
open
Task Schedulers === Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies. For your answer, please choose one strategy and go over it in some detail, rather than giving a little info on several strategies. If you have something to add to soemone else's description and it's short, add a comment rather than a new answer (if it's long or useful, or simply a much better description, then please use an answer) - What is the strategy - describe the general case (assume people know what a task queue is, semaphores, locks, and other OS fundamentals outside the scheduler itself) - What is this strategy optimized for (task latency, efficiency, realtime, jitter, resource sharing, etc) - Is it realtime, or can it be made realtime -Adam
0
49,964
09/08/2008 15:41:57
453,046
08/22/2008 10:55:53
30
2
Count a list of cells with the same background color
Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells? I have tried =COUNTIF(D3:D9,CELL("color",D3)) with no success (Where D3 is red).
excel
null
null
null
null
null
open
Count a list of cells with the same background color === Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells? I have tried =COUNTIF(D3:D9,CELL("color",D3)) with no success (Where D3 is red).
0
49,966
09/08/2008 15:43:27
4,540
09/04/2008 17:35:05
86
5
how to remove black border around hyperlinked image?
When I turn an image (<img>) into a hyperlink (by wrapping it in <a>), Firefox adds a black border around the image. Safari does not display the same border. What CSS directive would be best to eliminate the border?
html
css
null
null
null
null
open
how to remove black border around hyperlinked image? === When I turn an image (<img>) into a hyperlink (by wrapping it in <a>), Firefox adds a black border around the image. Safari does not display the same border. What CSS directive would be best to eliminate the border?
0
49,972
09/08/2008 15:45:25
3,619
08/29/2008 15:08:14
223
39
In what order are locations searched to load referenced DLLs?
I know that the .NET framework looks for referenced DLLs in several locations * Global assembly cache (GAC) * Environment variables > System variables > PATH * Any private paths added to the AppDomain * The current directory of the executing assembly What order are those locations searched? Is the search for a DLL ceased if a match is found or does it continue through all locations (and if so, how are conflicts resolved)? *Also, please confirm or deny those locations and provide any other locations I have failed to mention.*
.net
dll
null
null
null
null
open
In what order are locations searched to load referenced DLLs? === I know that the .NET framework looks for referenced DLLs in several locations * Global assembly cache (GAC) * Environment variables > System variables > PATH * Any private paths added to the AppDomain * The current directory of the executing assembly What order are those locations searched? Is the search for a DLL ceased if a match is found or does it continue through all locations (and if so, how are conflicts resolved)? *Also, please confirm or deny those locations and provide any other locations I have failed to mention.*
0
49,987
09/08/2008 15:48:24
672
08/07/2008 16:18:07
241
27
Is there a good free SQL Server IDE?
For Oracle, I have found TOAD to be an excellent tool. Oracle's SQL Developer isn't too bad either. But for SQL Server, the only good choice seems to be the SQL Server Management Studio, where even simple things are made difficult. Can anyone recommend a good (preferably free) SQL Editor / Object Browser for SQL Server?
sql-server
null
null
null
null
null
open
Is there a good free SQL Server IDE? === For Oracle, I have found TOAD to be an excellent tool. Oracle's SQL Developer isn't too bad either. But for SQL Server, the only good choice seems to be the SQL Server Management Studio, where even simple things are made difficult. Can anyone recommend a good (preferably free) SQL Editor / Object Browser for SQL Server?
0
49,988
09/08/2008 15:48:31
1,694
08/18/2008 02:45:22
1,195
39
Really killing a process in Windows
Occasionally a program on a Windows machine goes crazy and just hangs. So I'll call up the task manager and hit the "End Process" button for it. However, this doesn't always work; if I try it enough times then it'll usually die eventually, but I'd really like to be able to just kill it immediately. On Linux I could just <code>kill -9</code> to guarantee that a process will die. Is there some program or command that comes with Windows that will always kill a process? A free third-party app would be fine, although I'd prefer to be able to do this on machines I sit down at for the first time.
windows
null
null
null
null
null
open
Really killing a process in Windows === Occasionally a program on a Windows machine goes crazy and just hangs. So I'll call up the task manager and hit the "End Process" button for it. However, this doesn't always work; if I try it enough times then it'll usually die eventually, but I'd really like to be able to just kill it immediately. On Linux I could just <code>kill -9</code> to guarantee that a process will die. Is there some program or command that comes with Windows that will always kill a process? A free third-party app would be fine, although I'd prefer to be able to do this on machines I sit down at for the first time.
0
50,003
09/08/2008 15:51:00
2,291
08/21/2008 14:00:19
1
0
SQL 2000 database copy to SQL 2005 options...
We have a production web and database server with SQL Server 2000. (However, a few clients they have their own servers with SQL 2005.) So we have local installs of SQL 2005 Express for development on Windows XP SP3 boxes (which don't allow SQL 2000 Enterprise installations). We often need to copy SQL 2000 databases to SQL 2005 instances. In the past, we have used the SQL Publishing tool (also mentioned [here][1]). However, one of our databases is so big that using that tool fails as it creates SQL scripts that get too large for Management Studio to handle them properly. Besides, it takes too long... :) We would use the Copy Database Wizard included with SQL 2005, but our development machines run SQL 2005 Express which don't included SQL Server Agent, which is required for Copy Database Wizard to work. So, I guess our solution will be to upgrade our development installs with the full version of SQL 2005 (we have an MSDN subscription of course). I was wondering what other solutions, if any, work well for you guys? (Besides complaining to the bosses to upgrade our production servers to 2005 or even 2008--which I've already tried.) [1]: http://stackoverflow.com/questions/1600/best-way-to-copy-a-database-in-sql-server-20058#1776
sql-server
null
null
null
null
null
open
SQL 2000 database copy to SQL 2005 options... === We have a production web and database server with SQL Server 2000. (However, a few clients they have their own servers with SQL 2005.) So we have local installs of SQL 2005 Express for development on Windows XP SP3 boxes (which don't allow SQL 2000 Enterprise installations). We often need to copy SQL 2000 databases to SQL 2005 instances. In the past, we have used the SQL Publishing tool (also mentioned [here][1]). However, one of our databases is so big that using that tool fails as it creates SQL scripts that get too large for Management Studio to handle them properly. Besides, it takes too long... :) We would use the Copy Database Wizard included with SQL 2005, but our development machines run SQL 2005 Express which don't included SQL Server Agent, which is required for Copy Database Wizard to work. So, I guess our solution will be to upgrade our development installs with the full version of SQL 2005 (we have an MSDN subscription of course). I was wondering what other solutions, if any, work well for you guys? (Besides complaining to the bosses to upgrade our production servers to 2005 or even 2008--which I've already tried.) [1]: http://stackoverflow.com/questions/1600/best-way-to-copy-a-database-in-sql-server-20058#1776
0
50,005
09/08/2008 15:51:41
1,306
08/14/2008 13:22:40
129
14
Flash hyperlinks spacing error
I have a weird bug involving Flash text and hyperlinks, htmlText in a TextField with `<a>` tags seem to truncate surrounding space: ![output][1] Once I place my cursor over the text, it "fixes" itself: ![output with mouseover][2] Here is the HTML in the textField: <p>The speeches at both the <a href="http://www.demconvention.com/speeches/" target="_blank">Democratic National Convention</a> last week and the <a href="http://www.gopconvention2008.com/videos" target="_blank">Republican National Convention</a> this week, have been, for me at least, must see TV.</p> When I disable the styleSheet attached to it, the effect still occurs, but placing my mouse over it does not fix the spacing. I am using "Anti-alias for readability", and have embeded the all Uppercase, Lowercase, Numerals, and Punctuation. I will also point out that if I change the rendering setting to "Use Device fonts" the bug goes away. Any thoughts? [1]: http://www.anti-pattern.net/tvo/output1.gif [2]: http://www.anti-pattern.net/tvo/output2.gif
flash
actionscript-3
null
null
null
null
open
Flash hyperlinks spacing error === I have a weird bug involving Flash text and hyperlinks, htmlText in a TextField with `<a>` tags seem to truncate surrounding space: ![output][1] Once I place my cursor over the text, it "fixes" itself: ![output with mouseover][2] Here is the HTML in the textField: <p>The speeches at both the <a href="http://www.demconvention.com/speeches/" target="_blank">Democratic National Convention</a> last week and the <a href="http://www.gopconvention2008.com/videos" target="_blank">Republican National Convention</a> this week, have been, for me at least, must see TV.</p> When I disable the styleSheet attached to it, the effect still occurs, but placing my mouse over it does not fix the spacing. I am using "Anti-alias for readability", and have embeded the all Uppercase, Lowercase, Numerals, and Punctuation. I will also point out that if I change the rendering setting to "Use Device fonts" the bug goes away. Any thoughts? [1]: http://www.anti-pattern.net/tvo/output1.gif [2]: http://www.anti-pattern.net/tvo/output2.gif
0
50,033
09/08/2008 15:57:36
3,617
08/29/2008 15:02:13
1
1
Asp.Net Form DefaultButton Error in Firefox
The .Net generated code for a form with the "DefaultButton" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens inside of a &lt;textarea&gt; control. The result is a multiline text area control that cannot be multiline in Firefox as the enter key submits the form instead of creating a new line. For more information on the bug, [read it here][1]. This could be fixed in Asp.Net 3.0+ but a workaround still has to be created for 2.0. Any ideas for the lightest workaround (a hack that doesn't look like a hack =D)? [1]: http://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html
asp.net
firefox
textarea
webforms
null
null
open
Asp.Net Form DefaultButton Error in Firefox === The .Net generated code for a form with the "DefaultButton" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens inside of a &lt;textarea&gt; control. The result is a multiline text area control that cannot be multiline in Firefox as the enter key submits the form instead of creating a new line. For more information on the bug, [read it here][1]. This could be fixed in Asp.Net 3.0+ but a workaround still has to be created for 2.0. Any ideas for the lightest workaround (a hack that doesn't look like a hack =D)? [1]: http://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html
0
50,037
09/08/2008 15:58:48
404
08/05/2008 13:34:59
617
43
What are some good SharePoint security resources?
I've got a SharePoint application and I'm sad to say that in my SharePoint-induced excitement, I ignored a lot of the security concerns I should have been paying more attention to. Though we didn't before, now we actually *need* granular security, so I need to get educated. I'm mostly interested in how to best create groups and add users to those groups. We have a single main site collection and a couple dozen subsites under that collection. How can I best create a granular security world where I can independently assign rights to each of these subsites?
security
sharepoint
null
null
null
null
open
What are some good SharePoint security resources? === I've got a SharePoint application and I'm sad to say that in my SharePoint-induced excitement, I ignored a lot of the security concerns I should have been paying more attention to. Though we didn't before, now we actually *need* granular security, so I need to get educated. I'm mostly interested in how to best create groups and add users to those groups. We have a single main site collection and a couple dozen subsites under that collection. How can I best create a granular security world where I can independently assign rights to each of these subsites?
0
50,042
09/08/2008 16:03:03
3,317
08/27/2008 20:10:13
1
0
Graphics card memory usage in linux
What tools are available to monitor graphics card memory usage in linux?
linux
graphics
null
null
null
null
open
Graphics card memory usage in linux === What tools are available to monitor graphics card memory usage in linux?
0
50,046
09/08/2008 16:05:17
770
08/08/2008 17:20:44
1,680
69
Is Visual Studio 2003 still available/supported
Pretty much what the title says really. We have some code that is .NET 1.1 based and no real desire to up-convert it. However, we are looking to add developers to the team and they will need copies of Visual Studio. My understanding is that they will need VS 2003 - as this is the only IDE that supports .NET 1.1 but I am wondering if we are still able to purchase it!
.net
visual-studio
visual-studio-2003
null
null
null
open
Is Visual Studio 2003 still available/supported === Pretty much what the title says really. We have some code that is .NET 1.1 based and no real desire to up-convert it. However, we are looking to add developers to the team and they will need copies of Visual Studio. My understanding is that they will need VS 2003 - as this is the only IDE that supports .NET 1.1 but I am wondering if we are still able to purchase it!
0
50,064
09/08/2008 16:12:57
3,415
08/28/2008 13:44:19
132
11
Setting Colors in SWT.
This is pretty simple, I come from a swing/awt background. I'm just wondering what the proper way to set the background color for a SWT widget is? I've been trying: widget.setBackGround( ); Am I on the right track? Thanks, Brian Gianforcaro
java
colors
swt
null
null
null
open
Setting Colors in SWT. === This is pretty simple, I come from a swing/awt background. I'm just wondering what the proper way to set the background color for a SWT widget is? I've been trying: widget.setBackGround( ); Am I on the right track? Thanks, Brian Gianforcaro
0
50,066
09/08/2008 16:15:10
5,045
09/07/2008 14:37:29
1
0
Impressions of D?
I've checked the tags and there is nothing for D - the programming language from Digital Mars. It is listed 12th on the TIOBE index, just after Ruby, so it must have some following. Anybody been using this? What are initial impressions?
programming-languages
null
null
null
null
null
open
Impressions of D? === I've checked the tags and there is nothing for D - the programming language from Digital Mars. It is listed 12th on the TIOBE index, just after Ruby, so it must have some following. Anybody been using this? What are initial impressions?
0
50,074
09/08/2008 16:21:25
2,961
08/26/2008 09:02:24
467
31
Where do the linux TCP/IP hackers live?
Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent & knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and **crying tears of blood**! To no avail. (Google ['unkn-4'][1] and you'll see many posts with my name all over.) Work-a-rounds are in place, so the issue is not a priority. But the geek in me really would like to understand and solve this problem. ***So, where can a moderately competent systems programmer go to ask detailed questions and receive detailed answers from The Lords of TCP/IP stacks?*** I assume that their world so close to the bare metal, their population so small, is different from my own. That, and they don't want to answer emails to "My modem doesn't work" so they hide in the shadows. Any pointers would be greatly appreciated. [1]: http://www.google.ch/search?source=ig&hl=en&rlz=&=&q=unkn-4&btnG=Google+Search&meta=
linux
tcp-ip
kernel
null
null
null
open
Where do the linux TCP/IP hackers live? === Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent & knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and **crying tears of blood**! To no avail. (Google ['unkn-4'][1] and you'll see many posts with my name all over.) Work-a-rounds are in place, so the issue is not a priority. But the geek in me really would like to understand and solve this problem. ***So, where can a moderately competent systems programmer go to ask detailed questions and receive detailed answers from The Lords of TCP/IP stacks?*** I assume that their world so close to the bare metal, their population so small, is different from my own. That, and they don't want to answer emails to "My modem doesn't work" so they hide in the shadows. Any pointers would be greatly appreciated. [1]: http://www.google.ch/search?source=ig&hl=en&rlz=&=&q=unkn-4&btnG=Google+Search&meta=
0
50,079
09/08/2008 16:21:54
3,180
08/27/2008 09:02:55
123
10
C Image Library
Can anyone recommend a decent C image library? I'm after loaders for bmp, gif, jpg, png and tga. I want to use this for programming my Sony Playstation Portable, so opensource would be very handy. After some googleing I've found FreeImage and CImg, but both feel rather heavy, and CImg is C++ not C. Cheers thing2k
c
image
psp
null
null
null
open
C Image Library === Can anyone recommend a decent C image library? I'm after loaders for bmp, gif, jpg, png and tga. I want to use this for programming my Sony Playstation Portable, so opensource would be very handy. After some googleing I've found FreeImage and CImg, but both feel rather heavy, and CImg is C++ not C. Cheers thing2k
0
50,089
09/08/2008 16:25:06
5,232
09/08/2008 16:15:20
1
2
How do you backup IIS's metabase in C#?
exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it.
iis
directoryservices
metabase
null
null
null
open
How do you backup IIS's metabase in C#? === exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it.
0
50,096
09/08/2008 16:35:09
2,992
08/26/2008 10:45:27
61
4
How to pass password to scp?
I know it is not recommended, but is it at all possible to pass the users password to scp? I'd like to copy a file via scp as part of a batch job and the receiving server does of course need a password (no, I cannot easily change that to key-based authentication). TIA Argelbargel
linux
batch
scp
null
null
null
open
How to pass password to scp? === I know it is not recommended, but is it at all possible to pass the users password to scp? I'd like to copy a file via scp as part of a batch job and the receiving server does of course need a password (no, I cannot easily change that to key-based authentication). TIA Argelbargel
0
50,097
09/08/2008 16:36:03
5,236
09/08/2008 16:36:03
1
0
How do I get a result from a modal dialog in JQuery
I would like to use an add-in like simplemodal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some ajaxy interaction with the server and return the result for the calling code to do some stuff with. Thanks.
javascript
jquery
jquery-ui
simplemodal
null
null
open
How do I get a result from a modal dialog in JQuery === I would like to use an add-in like simplemodal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some ajaxy interaction with the server and return the result for the calling code to do some stuff with. Thanks.
0
50,098
09/08/2008 16:36:15
810
08/09/2008 03:49:52
852
33
Comparing two collections for equality
I would like to compare two collections (in C#), but I'm not sure of the best way to implement this efficiently. I've read the other thread about [Enumerable.SequenceEqual][1], but it's not exactly what I'm looking for. In my case, two collections would be equal if they both contain the same items (no matter the order). Example: collection1 = {1, 2, 3, 4}; collection2 = {2, 4, 1, 3}; collection1 == collection2; // true What I usually do is to loop through each item of one collection and see if it exists in the other collection, then loop through each item of the other collection and see if it exists in the first collection. (I start by comparing the lengths). if (collection1.Count != collection2.Count) return false; // the collections are not equal foreach (Item item in collection1) { if (!collection2.Contains(item)) return false; // the collections are not equal } foreach (Item item in collection2) { if (!collection1.Contains(item)) return false; // the collections are not equal } return true; // the collections are equal However, this is not entirely correct, and it's probably not the most efficient way to do compare two collections for equality. An example I can think of that would be wrong is: collection1 = {1, 2, 3, 3, 4} collection2 = {1, 2, 2, 3, 4} Which would be equal with my implementation. Should I just count the number of times each item is found and make sure the counts are equal in both collections? --- The examples are in some sort of C# (let's call it pseudo-C#), but give your answer in whatever language you wish, it does not matter. [1]: http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c
collections
comparison
equality
null
null
null
open
Comparing two collections for equality === I would like to compare two collections (in C#), but I'm not sure of the best way to implement this efficiently. I've read the other thread about [Enumerable.SequenceEqual][1], but it's not exactly what I'm looking for. In my case, two collections would be equal if they both contain the same items (no matter the order). Example: collection1 = {1, 2, 3, 4}; collection2 = {2, 4, 1, 3}; collection1 == collection2; // true What I usually do is to loop through each item of one collection and see if it exists in the other collection, then loop through each item of the other collection and see if it exists in the first collection. (I start by comparing the lengths). if (collection1.Count != collection2.Count) return false; // the collections are not equal foreach (Item item in collection1) { if (!collection2.Contains(item)) return false; // the collections are not equal } foreach (Item item in collection2) { if (!collection1.Contains(item)) return false; // the collections are not equal } return true; // the collections are equal However, this is not entirely correct, and it's probably not the most efficient way to do compare two collections for equality. An example I can think of that would be wrong is: collection1 = {1, 2, 3, 3, 4} collection2 = {1, 2, 2, 3, 4} Which would be equal with my implementation. Should I just count the number of times each item is found and make sure the counts are equal in both collections? --- The examples are in some sort of C# (let's call it pseudo-C#), but give your answer in whatever language you wish, it does not matter. [1]: http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c
0
50,106
09/08/2008 16:38:36
4,337
09/02/2008 22:43:39
223
23
Looking for a SQL Transaction Log file viewer
I am trying my luck here after not getting answers in some other forums. If any of you have worked with a cool tool for viewing/querying the SQL Transaction logs, please let me know. This should show all the transactional sql statements which are committed, rolledback or waiting etc. for the log files. For Database files, if it has some additional graphical capabilities like showing the internal Binary Tree structure of the indexes, that will be awesome but I guess I am asking for too much huh..
sql-server
logging
null
null
null
null
open
Looking for a SQL Transaction Log file viewer === I am trying my luck here after not getting answers in some other forums. If any of you have worked with a cool tool for viewing/querying the SQL Transaction logs, please let me know. This should show all the transactional sql statements which are committed, rolledback or waiting etc. for the log files. For Database files, if it has some additional graphical capabilities like showing the internal Binary Tree structure of the indexes, that will be awesome but I guess I am asking for too much huh..
0
50,114
09/08/2008 16:42:21
2,536
08/22/2008 17:37:07
715
27
WCF: WTF! Does WCF raise the bar or just the complexity level?
I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? Is there an alternative to using SvcUtil's command line step back in time to generate the proxy? With ASMX services a test harness was automatically provided; is there a good alternative today with WCF? I appreciate that the WS* stuff is more tightly integrated with WCF and hope to find some payoff for WCF there, but geeze, otherwise I'm perplexed. Also, the state of books available for WCF is abysmal at best. Juval Lowy, a superb author, has written a good O'Reilly reference book "Programming WCF Services" but it doesn't do that much (for me anyway) for learning now to use WCF. That book's precursor (and a little better organized, but not much, as a tutorial) is Michele Leroux Bustamante's Learning WCF. It has good spots but is outdated in place and its corresponding Web site is gone. Do you have good WCF learning references besides just continuing to Google the bejebus out of things? Thanks, rp
web-services
wcf
null
null
null
null
open
WCF: WTF! Does WCF raise the bar or just the complexity level? === I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? Is there an alternative to using SvcUtil's command line step back in time to generate the proxy? With ASMX services a test harness was automatically provided; is there a good alternative today with WCF? I appreciate that the WS* stuff is more tightly integrated with WCF and hope to find some payoff for WCF there, but geeze, otherwise I'm perplexed. Also, the state of books available for WCF is abysmal at best. Juval Lowy, a superb author, has written a good O'Reilly reference book "Programming WCF Services" but it doesn't do that much (for me anyway) for learning now to use WCF. That book's precursor (and a little better organized, but not much, as a tutorial) is Michele Leroux Bustamante's Learning WCF. It has good spots but is outdated in place and its corresponding Web site is gone. Do you have good WCF learning references besides just continuing to Google the bejebus out of things? Thanks, rp
0
50,115
09/08/2008 16:42:31
5,234
09/08/2008 16:25:48
1
0
Using shadowbox disables keyboard shortcuts?
So my site uses shadowbox (http://mjijackson.com/shadowbox/) to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. Right-clicking and selecting copy works but ctrl+c doesn't (no keyboard shortcuts do) and most people use Ctrl+c right? You can see an example of what I'm talking about here: http://mjijackson.com/shadowbox/. Just go to the "web" exapmles and click "inline". Notice keyboard shortcuts do work on the "this page" example. The only difference between the two I see is the player js files they use. "Inline" uses the html.js player and "this page" uses iframe.js. Also, I believe it uses the mootools library. Any ideas?
javascript
keyboard-shortcuts
mootools
null
null
null
open
Using shadowbox disables keyboard shortcuts? === So my site uses shadowbox (http://mjijackson.com/shadowbox/) to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. Right-clicking and selecting copy works but ctrl+c doesn't (no keyboard shortcuts do) and most people use Ctrl+c right? You can see an example of what I'm talking about here: http://mjijackson.com/shadowbox/. Just go to the "web" exapmles and click "inline". Notice keyboard shortcuts do work on the "this page" example. The only difference between the two I see is the player js files they use. "Inline" uses the html.js player and "this page" uses iframe.js. Also, I believe it uses the mootools library. Any ideas?
0
50,135
09/08/2008 16:50:47
292
08/04/2008 13:14:31
573
33
LINQ to Java?
I'm looking for something simlar to linq except for java? any suggestions of where to go?
java
linq
null
null
null
null
open
LINQ to Java? === I'm looking for something simlar to linq except for java? any suggestions of where to go?
0
50,140
09/08/2008 16:53:51
3,208
08/27/2008 13:12:45
43
2
Replace huge Case statement in Classic ASP
I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case. Databases or files are not an option for this application. Coming from the Perl world I would use a hash to store this info.
classicasp
null
null
null
null
null
open
Replace huge Case statement in Classic ASP === I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case. Databases or files are not an option for this application. Coming from the Perl world I would use a hash to store this info.
0
50,142
09/08/2008 16:54:39
2,596
08/23/2008 13:04:07
1
0
Symmetric key storage
My company is going to be storing sensitive data for our customers, and will be encrypting data using one of the managed .NET encryption algorithm classes. Most of the work is done, but we haven't figured out how/where to store the key. I've done some light searching and reading, and it seems like a hardware solution might be the most secure. Does anyone have any recommendations on a key storage solution or method?
security
symmetric-key
key-storage
null
null
null
open
Symmetric key storage === My company is going to be storing sensitive data for our customers, and will be encrypting data using one of the managed .NET encryption algorithm classes. Most of the work is done, but we haven't figured out how/where to store the key. I've done some light searching and reading, and it seems like a hardware solution might be the most secure. Does anyone have any recommendations on a key storage solution or method?
0
50,144
09/08/2008 16:55:41
4,939
09/06/2008 20:36:05
21
1
A good algorithm similar to Levenstein but weighted for Qwerty keyboards?
I noticed some posts here on string matching, which reminded me of an old problem I'd like to solve. Does anyone have a good Levenstein-like algorithm that is weighted toward Qwerty keyboards? I want to compare two strings, and and allow for typos. Levenstein is okay, but I'd prefer to also accept spelling errors based on the physical distance between keys on Qwerty keyboard. In other words, the algorithm should prefer "yelephone" to "zelephone" since the "y" key is located nearer to the "t" key than to the "z" key on most keyboards. Any help would be great... this feature isn't central to my project, so I don't want to veer off into a rat-hole when I should be doing something more productive.
algorithm
string
comparison
text
null
null
open
A good algorithm similar to Levenstein but weighted for Qwerty keyboards? === I noticed some posts here on string matching, which reminded me of an old problem I'd like to solve. Does anyone have a good Levenstein-like algorithm that is weighted toward Qwerty keyboards? I want to compare two strings, and and allow for typos. Levenstein is okay, but I'd prefer to also accept spelling errors based on the physical distance between keys on Qwerty keyboard. In other words, the algorithm should prefer "yelephone" to "zelephone" since the "y" key is located nearer to the "t" key than to the "z" key on most keyboards. Any help would be great... this feature isn't central to my project, so I don't want to veer off into a rat-hole when I should be doing something more productive.
0
50,145
09/08/2008 16:55:41
2,915
08/25/2008 23:15:12
2,169
89
How to promote WCF to a non-techie?
How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc? What are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)? What is WCF *not* good for that you've seen people try to shoehorn it into? -Adam
c#
.net
web-services
wcf
null
null
open
How to promote WCF to a non-techie? === How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc? What are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)? What is WCF *not* good for that you've seen people try to shoehorn it into? -Adam
0
50,148
09/08/2008 16:57:22
572
08/06/2008 20:56:54
3,163
244
Why does a "file exists" method in many languages return true for a directory?
I know that it does in PHP, and I'm pretty sure it does in Java. I haven't used the latest versions of .NET, so I won't speak for them. It seems very awkward, but I was wondering if there was an underlying reason for this.
file-io
methods
language-design
null
null
null
open
Why does a "file exists" method in many languages return true for a directory? === I know that it does in PHP, and I'm pretty sure it does in Java. I haven't used the latest versions of .NET, so I won't speak for them. It seems very awkward, but I was wondering if there was an underlying reason for this.
0
50,149
09/08/2008 16:58:26
1,980
08/19/2008 16:40:39
99
3
Best way to convert DateTime to "n Hours Ago" in SQL
I wrote a SQL function to convert a datetime value in SQL to a friendlier "n Hours Ago" or "n Days Aog" etc type of message. And I was wondering if there was a better way to do it. (Yes I know "don't do it in SQL" but for design reasons I have to do it this way). Here is the function I've written: CREATE FUNCTION dbo.GetFriendlyDateTimeValue ( @CompareDate DateTime ) RETURNS nvarchar(48) AS BEGIN DECLARE @Now DateTime DECLARE @Hours int DECLARE @Suff nvarchar(256) DECLARE @Found bit SET @Found = 0 SET @Now = getDate() SET @Hours = DATEDIFF(MI, @CompareDate, @Now)/60 IF @Hours <= 1 BEGIN SET @Suff = 'Just Now' SET @Found = 1 RETURN @Suff END IF @Hours < 24 BEGIN SET @Suff = ' Hours Ago' SET @Found = 1 END IF @Hours >= 8760 AND @Found = 0 BEGIN SET @Hours = @Hours / 8760 SET @Suff = ' Years Ago' SET @Found = 1 END IF @Hours >= 720 AND @Found = 0 BEGIN SET @Hours = @Hours / 720 SET @Suff = ' Months Ago' SET @Found = 1 END IF @Hours >= 168 AND @Found = 0 BEGIN SET @Hours = @Hours / 168 SET @Suff = ' Weeks Ago' SET @Found = 1 END IF @Hours >= 24 AND @Found = 0 BEGIN SET @Hours = @Hours / 24 SET @Suff = ' Days Ago' SET @Found = 1 END RETURN Convert(nvarchar, @Hours) + @Suff END
sql
datetime
function
null
null
null
open
Best way to convert DateTime to "n Hours Ago" in SQL === I wrote a SQL function to convert a datetime value in SQL to a friendlier "n Hours Ago" or "n Days Aog" etc type of message. And I was wondering if there was a better way to do it. (Yes I know "don't do it in SQL" but for design reasons I have to do it this way). Here is the function I've written: CREATE FUNCTION dbo.GetFriendlyDateTimeValue ( @CompareDate DateTime ) RETURNS nvarchar(48) AS BEGIN DECLARE @Now DateTime DECLARE @Hours int DECLARE @Suff nvarchar(256) DECLARE @Found bit SET @Found = 0 SET @Now = getDate() SET @Hours = DATEDIFF(MI, @CompareDate, @Now)/60 IF @Hours <= 1 BEGIN SET @Suff = 'Just Now' SET @Found = 1 RETURN @Suff END IF @Hours < 24 BEGIN SET @Suff = ' Hours Ago' SET @Found = 1 END IF @Hours >= 8760 AND @Found = 0 BEGIN SET @Hours = @Hours / 8760 SET @Suff = ' Years Ago' SET @Found = 1 END IF @Hours >= 720 AND @Found = 0 BEGIN SET @Hours = @Hours / 720 SET @Suff = ' Months Ago' SET @Found = 1 END IF @Hours >= 168 AND @Found = 0 BEGIN SET @Hours = @Hours / 168 SET @Suff = ' Weeks Ago' SET @Found = 1 END IF @Hours >= 24 AND @Found = 0 BEGIN SET @Hours = @Hours / 24 SET @Suff = ' Days Ago' SET @Found = 1 END RETURN Convert(nvarchar, @Hours) + @Suff END
0
50,151
09/08/2008 16:59:31
3,047
08/26/2008 13:36:37
38
5
What is the best way to display a status message in WPF?
I have several wpf pages with update/delete/add buttons. I want to display to the user messages like "successful delete", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from anywhere?
wpf
null
null
null
null
null
open
What is the best way to display a status message in WPF? === I have several wpf pages with update/delete/add buttons. I want to display to the user messages like "successful delete", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from anywhere?
0
50,153
09/08/2008 17:00:00
5,190
09/08/2008 12:03:43
31
3
Interprocess communication for Windows in C# (.NET 2.0)
I've never had to do IPC on Windows before. Currently I'm developing a pair of programs, a standard GUI/CLI app and a windows service. The app has to tell the service what to do. So, assuming the communication is local only, what would be the best communication method for these two processes? Where best is defined as more robust and less error prone, not the most performant nor the easiest to code. Code examples will be very welcome, but aren't required :-) Note I'm asking about what to use, a standard TCP socket, named pipes, or some other means of communication only. Thanks!
c#
.net
ipc
null
null
null
open
Interprocess communication for Windows in C# (.NET 2.0) === I've never had to do IPC on Windows before. Currently I'm developing a pair of programs, a standard GUI/CLI app and a windows service. The app has to tell the service what to do. So, assuming the communication is local only, what would be the best communication method for these two processes? Where best is defined as more robust and less error prone, not the most performant nor the easiest to code. Code examples will be very welcome, but aren't required :-) Note I'm asking about what to use, a standard TCP socket, named pipes, or some other means of communication only. Thanks!
0
50,159
09/08/2008 17:02:25
3,756
08/30/2008 15:05:40
1
0
Show all libraries used by executables on linux
I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?
linux
null
null
null
null
null
open
Show all libraries used by executables on linux === I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?
0
50,164
09/08/2008 17:04:17
685
08/07/2008 19:18:05
162
13
How can I lock down my MS-SQL DB from my users and yet still access it through ODBC?
I've got an ms-access application that's accessing and ms-sql db through an ODBC connection. I'm trying to force my users to update the data _only_ through the application portion, but I don't care if they read the data directly or through their own custom ms-access db (they use it for creating ad hoc reports). What I'm looking for is a way to make the data only editable if they are using the compiled .mde file I distribute to them. I know I can make the data read only for the general population, and editable for select users. Is there a way I can get ms-sql to make the data editable only if they are accessing it through the my canned mde? Thought, is there a way to get ms-access to log into the database as a different user (or change the login once connected)?
ms-access
odbc
ms-sql
null
null
null
open
How can I lock down my MS-SQL DB from my users and yet still access it through ODBC? === I've got an ms-access application that's accessing and ms-sql db through an ODBC connection. I'm trying to force my users to update the data _only_ through the application portion, but I don't care if they read the data directly or through their own custom ms-access db (they use it for creating ad hoc reports). What I'm looking for is a way to make the data only editable if they are using the compiled .mde file I distribute to them. I know I can make the data read only for the general population, and editable for select users. Is there a way I can get ms-sql to make the data editable only if they are accessing it through the my canned mde? Thought, is there a way to get ms-access to log into the database as a different user (or change the login once connected)?
0
50,169
09/08/2008 17:05:22
4,269
09/02/2008 15:26:27
97
6
Optimizing a LINQ query.
I have a query that looks like this: public IList<Post> FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o).Skip(pageIndex * recordCount).Take(recordCount).ToList(); } I need to print the information of the order and the user who created it: foreach (var o in FetchLatestOrders(0, 10)) { Console.WriteLine("{0} {1}", o.Code, o.Customer.Name); } This produces a SQL query to bring the orders and one query for each order to bring the customer. Is it possible to optimize the query so that it brings each order and it's customers in one SQL query? Thanks
linq
linq-to-sql
optimization
null
null
null
open
Optimizing a LINQ query. === I have a query that looks like this: public IList<Post> FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o).Skip(pageIndex * recordCount).Take(recordCount).ToList(); } I need to print the information of the order and the user who created it: foreach (var o in FetchLatestOrders(0, 10)) { Console.WriteLine("{0} {1}", o.Code, o.Customer.Name); } This produces a SQL query to bring the orders and one query for each order to bring the customer. Is it possible to optimize the query so that it brings each order and it's customers in one SQL query? Thanks
0
50,170
09/08/2008 17:05:30
3,191
08/27/2008 12:32:21
346
19
Does "display: marker" work in any current browsers, and if so, how?
I can't be sure if my code is sucking, or if it's just that the browsers haven't caught up with the spec yet. My goal is to simulate list markers using generated content, so as to get e.g. continuation of the counters from list to list in pure CSS. So the HTML is like this: <ol> <li>The<li> <li>quick</li> <li>brown</li> </ol> <ol> <li>fox</li> <li>jumped</li> <li>over</li> </ol> and the CSS, which I *think* is correct according to <a href="http://www.w3.org/TR/CSS2/generate.html#markers">the spec</a>, is like this: html { counter-reset: myCounter; } li { counter-increment: myCounter; } li:before { content: counter(myCounter)". "; display: marker; width: 5em; text-align: right; marker-offset: 1em; } But this doesn't seem to generate markers, in either FF3, Chrome, or IE8 beta 2, and if I recall correctly not Opera either (although I've since uninstalled Opera). So, does anyone know if markers are *supposed* to work? Quirksmode.org isn't being its usual helpful self in this regard :(.
css
crossbrowser
null
null
null
null
open
Does "display: marker" work in any current browsers, and if so, how? === I can't be sure if my code is sucking, or if it's just that the browsers haven't caught up with the spec yet. My goal is to simulate list markers using generated content, so as to get e.g. continuation of the counters from list to list in pure CSS. So the HTML is like this: <ol> <li>The<li> <li>quick</li> <li>brown</li> </ol> <ol> <li>fox</li> <li>jumped</li> <li>over</li> </ol> and the CSS, which I *think* is correct according to <a href="http://www.w3.org/TR/CSS2/generate.html#markers">the spec</a>, is like this: html { counter-reset: myCounter; } li { counter-increment: myCounter; } li:before { content: counter(myCounter)". "; display: marker; width: 5em; text-align: right; marker-offset: 1em; } But this doesn't seem to generate markers, in either FF3, Chrome, or IE8 beta 2, and if I recall correctly not Opera either (although I've since uninstalled Opera). So, does anyone know if markers are *supposed* to work? Quirksmode.org isn't being its usual helpful self in this regard :(.
0
50,179
09/08/2008 17:08:10
244
08/04/2008 00:23:06
116
17
An IDE for D
Does anyone know of an IDE for the D Programming Language?
ide
programming-languages
d
null
null
null
open
An IDE for D === Does anyone know of an IDE for the D Programming Language?
0
50,182
09/08/2008 17:09:40
5,070
09/07/2008 17:33:08
1
0
Linux/X11 input library without creating a window
Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a window, which is troublesome if you have abstracted control so the control machine doesn't have to be the same as the render machine. However, if the control and render machines are the same, this results in an ugly little SDL window on top of your display.
linux
sdl
user-input
null
null
null
open
Linux/X11 input library without creating a window === Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a window, which is troublesome if you have abstracted control so the control machine doesn't have to be the same as the render machine. However, if the control and render machines are the same, this results in an ugly little SDL window on top of your display.
0
50,213
09/08/2008 17:20:03
4,099
09/01/2008 18:59:39
1
3
any issues with using log4net in a multi-threaded environment?
Just like the title, I'm wondering if anyone has any experience using log4net in a multi-threaded environment like asp.net. We are currently using log4net and I want to make sure we won't run into any issues.
log4net
null
null
null
null
null
open
any issues with using log4net in a multi-threaded environment? === Just like the title, I'm wondering if anyone has any experience using log4net in a multi-threaded environment like asp.net. We are currently using log4net and I want to make sure we won't run into any issues.
0
50,217
09/08/2008 17:21:38
572
08/06/2008 20:56:54
3,165
244
Does a language-specific IDE have any advantages over a plugin for a multi-language IDE?
I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good). Currently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easier for me to find a plugin and use Eclipse for all of my development languages. But are there cases where a language-specific IDE (EiffelStudio for Eiffel, as an example) would be better than Eclipse?
ide
null
null
null
null
null
open
Does a language-specific IDE have any advantages over a plugin for a multi-language IDE? === I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good). Currently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easier for me to find a plugin and use Eclipse for all of my development languages. But are there cases where a language-specific IDE (EiffelStudio for Eiffel, as an example) would be better than Eclipse?
0
50,221
09/08/2008 17:24:07
4,099
09/01/2008 18:59:39
1
3
multithreading in asp.net
What kind of multi-threading issues do you have to be careful for in asp.net?
asp.net
multithreading
null
null
null
null
open
multithreading in asp.net === What kind of multi-threading issues do you have to be careful for in asp.net?
0
50,223
09/08/2008 17:27:16
956
08/11/2008 03:33:26
461
18
How to repeatedly merge branches in Mercurial
We're using Mercurial where I work and I want to have a setup similar to how I used SVN: * Trunk * Tags * Production * Branches Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'. Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial?
version-control
mercurial
null
null
null
null
open
How to repeatedly merge branches in Mercurial === We're using Mercurial where I work and I want to have a setup similar to how I used SVN: * Trunk * Tags * Production * Branches Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'. Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial?
0
50,236
09/08/2008 17:31:55
2,494
08/22/2008 14:29:22
140
13
How do you programmatically change the tab order in a Win32 dialog?
Often time I need to add a control to a dialog after the dialog has been generated via dialog template and CreateDialogIndirect. In these cases the tab order is set by the dialog template and there is no obvious way to change the tab order by including a newly created control.
winapi
dialog
null
null
null
null
open
How do you programmatically change the tab order in a Win32 dialog? === Often time I need to add a control to a dialog after the dialog has been generated via dialog template and CreateDialogIndirect. In these cases the tab order is set by the dialog template and there is no obvious way to change the tab order by including a newly created control.
0
50,237
09/08/2008 17:32:55
1,365
08/14/2008 18:28:56
88
7
View of allocated memory
I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references. I've looked at things like Ants Profiler from RedGate, but it's not quite what I want: I can't view specific instances.
.net
memory
null
null
null
null
open
View of allocated memory === I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references. I've looked at things like Ants Profiler from RedGate, but it's not quite what I want: I can't view specific instances.
0
50,251
09/08/2008 17:36:16
3,396
08/28/2008 12:43:15
33
1
Dynamic linq:Creating an extension method that produces JSON result
I'm stuck trying to create a dynamic linq extension method that returns a string in JSON format - I'm using System.Linq.Dynamic and Newtonsoft.Json and I can't get the Linq.Dynamic to parse the "cell=new object[]" part. Perhaps too complex? Any ideas? : static void Main(string[] args) { NorthwindDataContext db = new NorthwindDataContext(); var query = db.Customers; string json = JSonify<Customer> .GetJsonTable( query, 2, 10, "CustomerID" , new string[] { "CustomerID", "CompanyName", "City", "Country", "Orders.Count" }); Console.WriteLine(json); } } public static class JSonify<T> { public static string GetJsonTable( this IQueryable<T> query, int pageNumber, int pageSize, string IDColumnName, string[] columnNames) { string selectItems = String.Format(@" new { {{0}} as ID, cell = new object[]{{{1}}} }", IDColumnName, String.Join(",", columnNames)); var items = new { page = pageNumber, total = query.Count(), rows = query .Select(selectItems) .Skip(pageNumber * pageSize) .Take(pageSize) }; return JavaScriptConvert.SerializeObject(items); // Should produce this result: // { // "page":2, // "total":91, // "rows": // [ // {"ID":"FAMIA","cell":["FAMIA","Familia Arquibaldo","Sao Paulo","Brazil",7]}, // {"ID":"FISSA","cell":["FISSA","FISSA Fabrica Inter. Salchichas S.A.","Madrid","Spain",0]}, // {"ID":"FOLIG","cell":["FOLIG","Folies gourmandes","Lille","France",5]}, // {"ID":"FOLKO","cell":["FOLKO","Folk och fä HB","Bräcke","Sweden",19]}, // {"ID":"FRANK","cell":["FRANK","Frankenversand","München","Germany",15]}, // {"ID":"FRANR","cell":["FRANR","France restauration","Nantes","France",3]}, // {"ID":"FRANS","cell":["FRANS","Franchi S.p.A.","Torino","Italy",6]}, // {"ID":"FURIB","cell":["FURIB","Furia Bacalhau e Frutos do Mar","Lisboa","Portugal",8]}, // {"ID":"GALED","cell":["GALED","Galería del gastrónomo","Barcelona","Spain",5]}, // {"ID":"GODOS","cell":["GODOS","Godos Cocina Típica","Sevilla","Spain",10]} // ] // } } }
c#
linq
json
null
null
null
open
Dynamic linq:Creating an extension method that produces JSON result === I'm stuck trying to create a dynamic linq extension method that returns a string in JSON format - I'm using System.Linq.Dynamic and Newtonsoft.Json and I can't get the Linq.Dynamic to parse the "cell=new object[]" part. Perhaps too complex? Any ideas? : static void Main(string[] args) { NorthwindDataContext db = new NorthwindDataContext(); var query = db.Customers; string json = JSonify<Customer> .GetJsonTable( query, 2, 10, "CustomerID" , new string[] { "CustomerID", "CompanyName", "City", "Country", "Orders.Count" }); Console.WriteLine(json); } } public static class JSonify<T> { public static string GetJsonTable( this IQueryable<T> query, int pageNumber, int pageSize, string IDColumnName, string[] columnNames) { string selectItems = String.Format(@" new { {{0}} as ID, cell = new object[]{{{1}}} }", IDColumnName, String.Join(",", columnNames)); var items = new { page = pageNumber, total = query.Count(), rows = query .Select(selectItems) .Skip(pageNumber * pageSize) .Take(pageSize) }; return JavaScriptConvert.SerializeObject(items); // Should produce this result: // { // "page":2, // "total":91, // "rows": // [ // {"ID":"FAMIA","cell":["FAMIA","Familia Arquibaldo","Sao Paulo","Brazil",7]}, // {"ID":"FISSA","cell":["FISSA","FISSA Fabrica Inter. Salchichas S.A.","Madrid","Spain",0]}, // {"ID":"FOLIG","cell":["FOLIG","Folies gourmandes","Lille","France",5]}, // {"ID":"FOLKO","cell":["FOLKO","Folk och fä HB","Bräcke","Sweden",19]}, // {"ID":"FRANK","cell":["FRANK","Frankenversand","München","Germany",15]}, // {"ID":"FRANR","cell":["FRANR","France restauration","Nantes","France",3]}, // {"ID":"FRANS","cell":["FRANS","Franchi S.p.A.","Torino","Italy",6]}, // {"ID":"FURIB","cell":["FURIB","Furia Bacalhau e Frutos do Mar","Lisboa","Portugal",8]}, // {"ID":"GALED","cell":["GALED","Galería del gastrónomo","Barcelona","Spain",5]}, // {"ID":"GODOS","cell":["GODOS","Godos Cocina Típica","Sevilla","Spain",10]} // ] // } } }
0
50,252
09/08/2008 17:36:36
3,927
08/31/2008 22:36:55
1
3
Modeling Geographic Locations in an Relational Database.
I am designing a contact management system and have come across an interesting issue regarding modeling geographic locations in a consistent way. I would like to be able to record locations associated with a particular person (mailing address(es) for work, school, home, etc.) My thought is to create a table of locales such as the following: **Locales (ID, LocationName, ParentID)** where autonomous locations (such as countries, e.g. USA) are parents of themselves. This way I can have an arbitrarily deep nesting of 'political units' (COUNTRY > STATE > CITY or COUNTRY > STATE > CITY > UNIVERSITY). Some queries will necessarily involve recursion. I would appreciate any other recommendations or perhaps advice regarding predictable issues that I am likely to encounter with such a scheme.
sql
database-design
null
null
null
null
open
Modeling Geographic Locations in an Relational Database. === I am designing a contact management system and have come across an interesting issue regarding modeling geographic locations in a consistent way. I would like to be able to record locations associated with a particular person (mailing address(es) for work, school, home, etc.) My thought is to create a table of locales such as the following: **Locales (ID, LocationName, ParentID)** where autonomous locations (such as countries, e.g. USA) are parents of themselves. This way I can have an arbitrarily deep nesting of 'political units' (COUNTRY > STATE > CITY or COUNTRY > STATE > CITY > UNIVERSITY). Some queries will necessarily involve recursion. I would appreciate any other recommendations or perhaps advice regarding predictable issues that I am likely to encounter with such a scheme.
0
50,255
09/08/2008 17:38:18
1,288
08/14/2008 12:14:17
658
49
Does Java need closures?
I've been reading a lot lately about the next release of Java possibly supporting closures. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Oriented language "better". Can anyone give me a specific use-case where a closure would be needed (or even preferred)?
java
closures
null
null
null
null
open
Does Java need closures? === I've been reading a lot lately about the next release of Java possibly supporting closures. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Oriented language "better". Can anyone give me a specific use-case where a closure would be needed (or even preferred)?
0
50,268
09/08/2008 17:44:56
4,779
09/05/2008 15:07:11
1
0
.MSI Not Always Uninstalling Previous Versions
In a number of applications we create an MSI Installer with the Visual Studio Setup Project. In most cases, the install works fine, but every now and then the previous version was not uninstalled correctly. The user ends up with two icons on the desktop, and in the Add/Remove program list, the application appears twice. We have yet to find any pattern and in most cases the installer works without any problems.
.net
msi
null
null
null
null
open
.MSI Not Always Uninstalling Previous Versions === In a number of applications we create an MSI Installer with the Visual Studio Setup Project. In most cases, the install works fine, but every now and then the previous version was not uninstalled correctly. The user ends up with two icons on the desktop, and in the Add/Remove program list, the application appears twice. We have yet to find any pattern and in most cases the installer works without any problems.
0
50,280
09/08/2008 17:50:07
1,385,358
08/25/2008 03:05:06
550
24
Floats messing up in Safari browsers
I have a site I made real fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE but on safari one of the divs is completely hidden. I've tried switching to padding and position:relative but nothing has worked for me. If I take out the code to display it to the right it shows up again but under the floated content The main section of css that seems to be causing the problem is: #settings{ float:left; } #right_content{ margin-top:20px; margin-left:440px; width:400px; } This gives me the same result whether I specify a size to the #settings div or not. Any ideas would be appreciated -- the site is available at: http://frickinsweet.com/tools/Theme.mvc.aspx to see the source code.
css
safari
float
null
null
null
open
Floats messing up in Safari browsers === I have a site I made real fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE but on safari one of the divs is completely hidden. I've tried switching to padding and position:relative but nothing has worked for me. If I take out the code to display it to the right it shows up again but under the floated content The main section of css that seems to be causing the problem is: #settings{ float:left; } #right_content{ margin-top:20px; margin-left:440px; width:400px; } This gives me the same result whether I specify a size to the #settings div or not. Any ideas would be appreciated -- the site is available at: http://frickinsweet.com/tools/Theme.mvc.aspx to see the source code.
0
50,306
09/08/2008 18:03:18
5,229
09/08/2008 16:08:47
1
1
Is it possible to do the Navision 5.0 export to Word/Excel to OpenOffice.org?
Navision 5.0 includes a feature to export to Word or Excel. Is it possible to make this work with OpenOffice.org Writer or Calc instead? If so, what has to be done to set it up?
export
5.0
navision
openoffice.org
null
null
open
Is it possible to do the Navision 5.0 export to Word/Excel to OpenOffice.org? === Navision 5.0 includes a feature to export to Word or Excel. Is it possible to make this work with OpenOffice.org Writer or Calc instead? If so, what has to be done to set it up?
0
50,310
09/08/2008 18:04:11
5,252
09/08/2008 17:54:32
1
0
Why the option to use attributes in new ATL projects was removed from Visual Studio 2008?
This is the text from MSDN comment: "According to the book ATL Internals (2ed) the use of attributes is deprecated and should not be used in new ATL projects." But WHY?!!
visual-studio
vs2008
vc++
atl
null
null
open
Why the option to use attributes in new ATL projects was removed from Visual Studio 2008? === This is the text from MSDN comment: "According to the book ATL Internals (2ed) the use of attributes is deprecated and should not be used in new ATL projects." But WHY?!!
0
50,311
09/08/2008 18:05:14
779
08/08/2008 20:48:29
133
3
create and stream large XML document in C++
I have some code that creates a fairly large xml DOM and writes it off to a file (up to 50-100MB) . It basically creates the DOM and then calls a toString on it and writes it out with ofstream. Is there a way to get streaming output of the generated dom so that it doesn't create the whole structure in memory all at once and then copy it, etc? I will not modify any node after i create it so it can write it out and free up the memory right away. I could write my own xml class that does the xml construction but ... i don't think that's a good idea since i'll probably miss something when it comes down to escaping etc.
c++
xml
null
null
null
null
open
create and stream large XML document in C++ === I have some code that creates a fairly large xml DOM and writes it off to a file (up to 50-100MB) . It basically creates the DOM and then calls a toString on it and writes it out with ofstream. Is there a way to get streaming output of the generated dom so that it doesn't create the whole structure in memory all at once and then copy it, etc? I will not modify any node after i create it so it can write it out and free up the memory right away. I could write my own xml class that does the xml construction but ... i don't think that's a good idea since i'll probably miss something when it comes down to escaping etc.
0
50,312
09/08/2008 18:05:34
4,249
09/02/2008 14:13:06
318
26
Get CPU usage in shell script?
I'm running some [JMeter][1] tests against a Java process to determine how responsive a web application is under load (500+ users). JMeter will give the response time for each web request, and I've written a script to ping the Tomcat Manager every X seconds which will get me the current size of the JVM heap. I'd like to collect stats on the server of the % of CPU being used by Tomcat. I tried to do it in a shell script using `ps` like this: PS_RESULTS=`ps -o pcpu,pmem,nlwp -p $PID` ... running the command every X seconds and appending the results to a text file. However I've found that this gives a different definition of "% of CPU Utilization" than I'd like - according to the manpages for ps, `pcpu` is defined as: >cpu utilization of the process in "##.#" format. It is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. In other words, `pcpu` gives me the % CPU utilization for the process for the *lifetime* of the process. Since I want to take a sample every X seconds, I'd like to be collecting the CPU utilization of the process at the current time only - similar to what `top` would give me (CPU utilization of the process since the last update). How can I collect this from within a shell script? [1]: http://jakarta.apache.org/jmeter/
linux
shell
scripting
null
null
null
open
Get CPU usage in shell script? === I'm running some [JMeter][1] tests against a Java process to determine how responsive a web application is under load (500+ users). JMeter will give the response time for each web request, and I've written a script to ping the Tomcat Manager every X seconds which will get me the current size of the JVM heap. I'd like to collect stats on the server of the % of CPU being used by Tomcat. I tried to do it in a shell script using `ps` like this: PS_RESULTS=`ps -o pcpu,pmem,nlwp -p $PID` ... running the command every X seconds and appending the results to a text file. However I've found that this gives a different definition of "% of CPU Utilization" than I'd like - according to the manpages for ps, `pcpu` is defined as: >cpu utilization of the process in "##.#" format. It is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. In other words, `pcpu` gives me the % CPU utilization for the process for the *lifetime* of the process. Since I want to take a sample every X seconds, I'd like to be collecting the CPU utilization of the process at the current time only - similar to what `top` would give me (CPU utilization of the process since the last update). How can I collect this from within a shell script? [1]: http://jakarta.apache.org/jmeter/
0
50,315
09/08/2008 18:06:45
106
08/02/2008 00:12:12
933
77
How do you allow multiple file uploads on an internal windows-authentication intranet?
I have a couple of solutions, but none of them work perfectly. **Platform** 1. ASP.NET / VB.NET / .NET 2.0 2. IIS 6 3. IE6 (primarily), with some IE7; Firefox not necessary, but useful *Allowed 3rd Party Options* 1. Flash 2. ActiveX (would like to avoid) 3. Java (would like to avoid) **Current Attempts** *Gmail Style*: You can use javascript to add new Upload elements (input type='file'), then upload them all at once with the click of a button. This works, but still requires a lot of clicks. (I was able to use an invisible ActiveX control to detect things like File Size, which would be useful.) *Flash Uploader*: I discovered a couple of Flash Upload controls that use a 1x1 flash file to act as the uploader, callable by javascript. (One such control is [FancyUpload][1], another is [Dojo's Multiple File Uploader][2], yet another is one by [darick_c at CodeProject][3].) These excited me, but I quickly ran into two issues: 1. Flash 10 will break the functionality that is used to call the multiple file upload dialogue box. The workaround is to use a transparent flash frame, or just use a flash button to call the dialogue box. That's not a huge deal. 2. The integrated windows authentication used on our intranet is not used when the Flash file attempts to upload the files, prompting the user for credentials. The workaround for this is to use cookieless sessions, which would be a nightmare for our project due to several other reasons. *Java Uploader*: I noticed several Java-based multiple-file uploaders, but most of the appear to cost money. If I found one that worked really well, I could arrange to purchase it. I'd just rather not. I also don't like the look of most of them. I liked FancyUpload because it interacted with html/javascript so that I could easily style and manage it any way I want. *ActiveX Uploader*: I found [an ActiveX solution][4] as well. It appears that ActiveX will work. I would just write my own instead of buying that one. This will be my last resort, I think. **Resolution** I would love to be able to use something like FancyUpload. If I can just get by the credentials prompt some way, it would be perfect. But, from my research, it appears that the only real workaround is cookieless sessions, which I just can't do. So, the question is: Is there a way to resolve the issues presented above OR is there a different solution that I have not listed which accomplishes the same goal? [1]: http://digitarald.de/project/fancyupload/ [2]: http://www.sitepen.com/blog/2008/09/02/the-dojo-toolkit-multi-file-uploader/ [3]: http://www.codeproject.com/KB/aspnet/FlashUpload.aspx [4]: http://support.persits.com/xupload/demo1.asp
javascript
flash
authentication
activex
file-upload
null
open
How do you allow multiple file uploads on an internal windows-authentication intranet? === I have a couple of solutions, but none of them work perfectly. **Platform** 1. ASP.NET / VB.NET / .NET 2.0 2. IIS 6 3. IE6 (primarily), with some IE7; Firefox not necessary, but useful *Allowed 3rd Party Options* 1. Flash 2. ActiveX (would like to avoid) 3. Java (would like to avoid) **Current Attempts** *Gmail Style*: You can use javascript to add new Upload elements (input type='file'), then upload them all at once with the click of a button. This works, but still requires a lot of clicks. (I was able to use an invisible ActiveX control to detect things like File Size, which would be useful.) *Flash Uploader*: I discovered a couple of Flash Upload controls that use a 1x1 flash file to act as the uploader, callable by javascript. (One such control is [FancyUpload][1], another is [Dojo's Multiple File Uploader][2], yet another is one by [darick_c at CodeProject][3].) These excited me, but I quickly ran into two issues: 1. Flash 10 will break the functionality that is used to call the multiple file upload dialogue box. The workaround is to use a transparent flash frame, or just use a flash button to call the dialogue box. That's not a huge deal. 2. The integrated windows authentication used on our intranet is not used when the Flash file attempts to upload the files, prompting the user for credentials. The workaround for this is to use cookieless sessions, which would be a nightmare for our project due to several other reasons. *Java Uploader*: I noticed several Java-based multiple-file uploaders, but most of the appear to cost money. If I found one that worked really well, I could arrange to purchase it. I'd just rather not. I also don't like the look of most of them. I liked FancyUpload because it interacted with html/javascript so that I could easily style and manage it any way I want. *ActiveX Uploader*: I found [an ActiveX solution][4] as well. It appears that ActiveX will work. I would just write my own instead of buying that one. This will be my last resort, I think. **Resolution** I would love to be able to use something like FancyUpload. If I can just get by the credentials prompt some way, it would be perfect. But, from my research, it appears that the only real workaround is cookieless sessions, which I just can't do. So, the question is: Is there a way to resolve the issues presented above OR is there a different solution that I have not listed which accomplishes the same goal? [1]: http://digitarald.de/project/fancyupload/ [2]: http://www.sitepen.com/blog/2008/09/02/the-dojo-toolkit-multi-file-uploader/ [3]: http://www.codeproject.com/KB/aspnet/FlashUpload.aspx [4]: http://support.persits.com/xupload/demo1.asp
0
50,316
09/08/2008 18:07:50
3,757
08/30/2008 15:17:20
121
11
How do I suppress firefox password field completion?
I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to change a password. How can i prevent Firefox from automatically filling out these fields? I already tried giving them different names and ids.
html
firefox
null
null
null
null
open
How do I suppress firefox password field completion? === I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to change a password. How can i prevent Firefox from automatically filling out these fields? I already tried giving them different names and ids.
0
50,318
09/08/2008 18:09:32
635
08/07/2008 12:16:06
54
3
How do I stop Visual Studio's 'Publish Web Site' from publishing my _ReSharper folder?
It's really quite annoying as they are not part of the project.
asp.net
visual-studio
deployment
null
null
null
open
How do I stop Visual Studio's 'Publish Web Site' from publishing my _ReSharper folder? === It's really quite annoying as they are not part of the project.
0
50,327
09/08/2008 18:16:38
1,013
08/11/2008 13:24:18
247
36
WPF DatePicker: Whats the best?
I need a Datepicker for a WPF application. What is considered to be the best one? Thank you
wpf
null
null
null
null
07/31/2012 19:29:17
not constructive
WPF DatePicker: Whats the best? === I need a Datepicker for a WPF application. What is considered to be the best one? Thank you
4
50,330
09/08/2008 18:17:11
60
08/01/2008 14:04:09
1,645
66
Would you override ScriptControl or BaseValidator for an async ASP.NET validator control?
I'm planning to develop an ASP.NET server control to provide asynchronous username availability validation for new user registrations. The control will allow a developer to point it at a "username" TextBox and it will provide an indication of whether or not the username is available. Like [this example][1], but without the clunky UpdatePanel. One design decision that's giving me headaches is whether to inherit from **ScriptControl** or **BaseValidator**. By implementing it as a **ScriptControl**, I can make the client side portion easier to deal with and easily localize it with a resx. However, I want to make sure that the validator functions properly with respect to Page.IsValid. The only way I know to do this is to override **BaseValidator** and implement EvaluateIsValid(). So, my question is, how would you suggest structuring this control? Is inheriting from BaseValidator the best (only) way to get the validator part right, or can I do that in some other way? [1]: http://encosia.com/2007/07/02/aspnet-username-availability-checking-via-ajax/
asp.net
ajax
validation
null
null
null
open
Would you override ScriptControl or BaseValidator for an async ASP.NET validator control? === I'm planning to develop an ASP.NET server control to provide asynchronous username availability validation for new user registrations. The control will allow a developer to point it at a "username" TextBox and it will provide an indication of whether or not the username is available. Like [this example][1], but without the clunky UpdatePanel. One design decision that's giving me headaches is whether to inherit from **ScriptControl** or **BaseValidator**. By implementing it as a **ScriptControl**, I can make the client side portion easier to deal with and easily localize it with a resx. However, I want to make sure that the validator functions properly with respect to Page.IsValid. The only way I know to do this is to override **BaseValidator** and implement EvaluateIsValid(). So, my question is, how would you suggest structuring this control? Is inheriting from BaseValidator the best (only) way to get the validator part right, or can I do that in some other way? [1]: http://encosia.com/2007/07/02/aspnet-username-availability-checking-via-ajax/
0
50,332
09/08/2008 18:17:53
4,398
09/03/2008 13:51:01
11
0
TreeView Drag & Drop help - _Invalid FORMATETC structure_ exception
I'm trying to implement Drag & Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting: _Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV\_E\_FORMATETC))_ The ItemDrag handler (where the exception takes place), looks like: private void treeView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { this.DoDragDrop(e.Item, DragDropEffects.Move); } Does anyone know the root cause of this and how to remedy it? (.NET 2.0, Windows XP SP2)
c#
.net
winforms
null
null
null
open
TreeView Drag & Drop help - _Invalid FORMATETC structure_ exception === I'm trying to implement Drag & Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting: _Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV\_E\_FORMATETC))_ The ItemDrag handler (where the exception takes place), looks like: private void treeView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { this.DoDragDrop(e.Item, DragDropEffects.Move); } Does anyone know the root cause of this and how to remedy it? (.NET 2.0, Windows XP SP2)
0
50,345
09/08/2008 18:24:48
3,798
08/30/2008 22:09:59
140
13
Why is AppDomain.CurrentDomain.BaseDirectory different between Windows Forms and Library...
In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to "C:\Projects\TestProject\bin\Debug\" In my unit tests it is "C:\Projects\TestProject\bin\Debug" (no final slash). Why is this?
.net
null
null
null
null
null
open
Why is AppDomain.CurrentDomain.BaseDirectory different between Windows Forms and Library... === In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to "C:\Projects\TestProject\bin\Debug\" In my unit tests it is "C:\Projects\TestProject\bin\Debug" (no final slash). Why is this?
0
50,346
09/08/2008 18:25:01
2,701
08/24/2008 15:51:24
261
21
How to convince my co-workers that the parameterized SQL generated by NHibernate is just as fast as a stored procedure
One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?
orm
sql
null
null
null
null
open
How to convince my co-workers that the parameterized SQL generated by NHibernate is just as fast as a stored procedure === One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?
0
50,371
09/08/2008 18:32:13
3,798
08/30/2008 22:09:59
140
13
Better Merge Tool for Subversion
Is there a good external merge tool for tortoisesvn (I don't particularly like the built in Merge tool). I use WinMerge for diffs, but it doesn't work with the three way merge (maybe a better question would be is there a way to force tortoisesvn to merge like tortoisecvs?)
svn
tortoisesvn
null
null
null
null
open
Better Merge Tool for Subversion === Is there a good external merge tool for tortoisesvn (I don't particularly like the built in Merge tool). I use WinMerge for diffs, but it doesn't work with the three way merge (maybe a better question would be is there a way to force tortoisesvn to merge like tortoisecvs?)
0
50,373
09/08/2008 18:32:58
4,893
09/06/2008 12:55:06
41
3
Multimap in Scala
I'm trying to mixin the MultiMap trait with a HashMap like so: val children:MultiMap[Integer, TreeNode] = new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode] The definition for the MultiMap trait is: trait MultiMap[A, B] extends Map[A, Set[B]] Meaning that a MultiMap of types A & B is a Map of types A & Set[B], or so it seems to me. However, the compiler complains: > C:\...\TestTreeDataModel.scala:87: error: illegal inheritance; > template $anon inherits different type instances of trait Map: > scala.collection.mutable.Map[Integer,scala.collection.mutable.Set[package.TreeNode]] and scala.collection.mutable.Map[Integer,Set[package.TreeNode]] > new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode] > ^ one error found It seems that generics are tripping me up again.
generics
scala
null
null
null
null
open
Multimap in Scala === I'm trying to mixin the MultiMap trait with a HashMap like so: val children:MultiMap[Integer, TreeNode] = new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode] The definition for the MultiMap trait is: trait MultiMap[A, B] extends Map[A, Set[B]] Meaning that a MultiMap of types A & B is a Map of types A & Set[B], or so it seems to me. However, the compiler complains: > C:\...\TestTreeDataModel.scala:87: error: illegal inheritance; > template $anon inherits different type instances of trait Map: > scala.collection.mutable.Map[Integer,scala.collection.mutable.Set[package.TreeNode]] and scala.collection.mutable.Map[Integer,Set[package.TreeNode]] > new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode] > ^ one error found It seems that generics are tripping me up again.
0
50,384
09/08/2008 18:36:40
1,965
08/19/2008 15:51:08
3,509
214
WScript.Shell and blocking execution?
I'm using WScript to automate some tasks, by using WScript.Shell to call external programs. However, right now it does not wait for the external program to finish, and instead moves on. This causes issues because I have some tasks dependant on others finishing first. I am using code like: ZipCommand = "7za.exe a -r -y " & ZipDest & BuildLabel & ".zip " & buildSourceDir Set wshShell = WScript.CreateObject("Wscript.Shell") wshShell.run ZipCommand Is there a way to do this so it blocks until the shell executed program returns?
shell
vbscript
wscript
null
null
null
open
WScript.Shell and blocking execution? === I'm using WScript to automate some tasks, by using WScript.Shell to call external programs. However, right now it does not wait for the external program to finish, and instead moves on. This causes issues because I have some tasks dependant on others finishing first. I am using code like: ZipCommand = "7za.exe a -r -y " & ZipDest & BuildLabel & ".zip " & buildSourceDir Set wshShell = WScript.CreateObject("Wscript.Shell") wshShell.run ZipCommand Is there a way to do this so it blocks until the shell executed program returns?
0
50,386
09/08/2008 18:37:42
4,541
09/04/2008 17:37:04
104
2
Good Featurs for an ORM
I'm currently working on putting together a fairly simple ORM tool to serve as a framework for various web projects for a client. Most of the projects are internal and will not require massive amounts of concurrency and all will go against SQL Server. I've suggested that they go with ORM tools like SubSonic, NHibernate, and a number of other open source projects out there, but for maintainability and flexibility reasons they want to create something custom. So my question is this: What are some features that I should make sure to include in this ORM tool? BTW, I'll be using MyGeneration to do the code generation templates.
c#
orm
null
null
null
null
open
Good Featurs for an ORM === I'm currently working on putting together a fairly simple ORM tool to serve as a framework for various web projects for a client. Most of the projects are internal and will not require massive amounts of concurrency and all will go against SQL Server. I've suggested that they go with ORM tools like SubSonic, NHibernate, and a number of other open source projects out there, but for maintainability and flexibility reasons they want to create something custom. So my question is this: What are some features that I should make sure to include in this ORM tool? BTW, I'll be using MyGeneration to do the code generation templates.
0
50,389
09/08/2008 18:39:35
2,577
08/23/2008 03:18:09
89
6
Does having a registry full of old stuff slow down Windows?
I know this isn't strictly speaking a programming question but something I always hear from pseudo-techies is that having a lot of entries in your registry slows down your Windows-based PC. I think this notion comes from people who are trying to troubleshoot their PC and why it's running so slow and they open up the registry at some point and see leftover entries from programs they uninstalled ages ago. But is there any truth to this idea? I would not think so since the registry is essentially just a database and drilling down to an entry wouldn't take significantly longer on a larger registry. But does it?
windows
registry
null
null
null
05/03/2011 15:52:33
off topic
Does having a registry full of old stuff slow down Windows? === I know this isn't strictly speaking a programming question but something I always hear from pseudo-techies is that having a lot of entries in your registry slows down your Windows-based PC. I think this notion comes from people who are trying to troubleshoot their PC and why it's running so slow and they open up the registry at some point and see leftover entries from programs they uninstalled ages ago. But is there any truth to this idea? I would not think so since the registry is essentially just a database and drilling down to an entry wouldn't take significantly longer on a larger registry. But does it?
2
50,391
09/08/2008 18:41:16
2,642
08/23/2008 21:37:02
1
0
Is it possible to track allocation/deallocation in C#?
As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function. I want a way to track allocations like in [_CrtSetAllocHook][1], but for C#/.net. The only visibility to the garbage collector/allocation appears to be [GC.CollectionCount][2]. Anyone have any other .net memory mojo? [1]: http://msdn.microsoft.com/en-us/library/cy8c7wz5.aspx [2]: http://msdn.microsoft.com/en-us/library/system.gc.collectioncount(VS.80).aspx
c#
memory
hook
allocation
null
null
open
Is it possible to track allocation/deallocation in C#? === As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function. I want a way to track allocations like in [_CrtSetAllocHook][1], but for C#/.net. The only visibility to the garbage collector/allocation appears to be [GC.CollectionCount][2]. Anyone have any other .net memory mojo? [1]: http://msdn.microsoft.com/en-us/library/cy8c7wz5.aspx [2]: http://msdn.microsoft.com/en-us/library/system.gc.collectioncount(VS.80).aspx
0
50,394
09/08/2008 18:43:52
4,172
09/02/2008 08:54:52
11
3
What Python way would you suggest to check whois database records?
I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly. I did some search to try to find a pythonic way to do this task. Generally I got quite much nothing - [this old discussion list link][1] has a way to check if domain exist. Quite not what I was looking for... But still, it was best anwser Google gave me - everything else is just a bunch of unanwsered questions. Any of you have succeeded to get some method up and running? I'd very much appreciate some tips, or should I just do it the opensource-way, sit down and code something by myself? :) [1]: http://mail.python.org/pipermail/python-list/2000-March/028122.html
python
sysadmin
whois
null
null
null
open
What Python way would you suggest to check whois database records? === I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly. I did some search to try to find a pythonic way to do this task. Generally I got quite much nothing - [this old discussion list link][1] has a way to check if domain exist. Quite not what I was looking for... But still, it was best anwser Google gave me - everything else is just a bunch of unanwsered questions. Any of you have succeeded to get some method up and running? I'd very much appreciate some tips, or should I just do it the opensource-way, sit down and code something by myself? :) [1]: http://mail.python.org/pipermail/python-list/2000-March/028122.html
0
50,398
09/08/2008 18:46:09
5,208
09/08/2008 13:23:19
1
0
Calling C# code from Java?
Does anyone have a good solution for integrating some C# code into a java application? The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. Also, I know I can expose the C# as a web service or whatever, but it has some security/encryption stuff in there, so I would rather keep it tightly integrated if possible.
java
c#
jni
null
null
null
open
Calling C# code from Java? === Does anyone have a good solution for integrating some C# code into a java application? The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. Also, I know I can expose the C# as a web service or whatever, but it has some security/encryption stuff in there, so I would rather keep it tightly integrated if possible.
0
50,417
09/08/2008 18:56:14
4,872
09/06/2008 09:14:55
1
0
How do I get list of recent files in GNU Emacs?
When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows)
ide
emacs
null
null
null
null
open
How do I get list of recent files in GNU Emacs? === When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows)
0
50,418
09/08/2008 18:56:46
5,240
09/08/2008 16:47:37
11
3
Can you recommend books about generative programming?
I currently have following books: * _Code Generation in Action_ by Jack Herrington * _Generative Programming_ by Krzysztof Czarnecki and Ulrich W. Eisenecker * _Program Generators with XML and Java_ by J. Craig Cleaveland * _Framing Software Reuse_ by Paul G. Bassett And now my question is, what other books or resources about generative programming, model driven software development and software production lines would you recommend? And why?
books
code-generation
generator
generative
null
06/13/2012 13:29:16
not constructive
Can you recommend books about generative programming? === I currently have following books: * _Code Generation in Action_ by Jack Herrington * _Generative Programming_ by Krzysztof Czarnecki and Ulrich W. Eisenecker * _Program Generators with XML and Java_ by J. Craig Cleaveland * _Framing Software Reuse_ by Paul G. Bassett And now my question is, what other books or resources about generative programming, model driven software development and software production lines would you recommend? And why?
4
50,421
09/08/2008 19:00:01
1,220
08/13/2008 13:44:48
1,222
99
Does silverlight work on chrome?
Does anyone know if silverlight plugs into chrome, or when they plan to support it?
silverlight
google-chrome
null
null
null
null
open
Does silverlight work on chrome? === Does anyone know if silverlight plugs into chrome, or when they plan to support it?
0
50,426
09/08/2008 19:01:38
1,782
08/18/2008 14:30:58
1,256
91
Preventing accidental double clicking on a button
I have a few controls that inherit from ASP.NET buttons and use 'onserverclick'. If the user clicks twice, the button fires two server side events. How can I prevent this? I tried setting "this.disabled='true'" after the click (in the 'onclick' attribute) via javascript, but that blocks the first postback as well.
asp.net
javascript
button
null
null
null
open
Preventing accidental double clicking on a button === I have a few controls that inherit from ASP.NET buttons and use 'onserverclick'. If the user clicks twice, the button fires two server side events. How can I prevent this? I tried setting "this.disabled='true'" after the click (in the 'onclick' attribute) via javascript, but that blocks the first postback as well.
0
50,430
09/08/2008 19:03:27
4,646
09/04/2008 23:39:08
1
2
CSS - Placement of a div in the lower left-hand corner
I wish I were a CSS smarty .... How can you place a div container in the lower left-hand corner of the web page; taking into account the users scroll-position? Thanks in advance for any assistance.
divpositioning
null
null
null
null
null
open
CSS - Placement of a div in the lower left-hand corner === I wish I were a CSS smarty .... How can you place a div container in the lower left-hand corner of the web page; taking into account the users scroll-position? Thanks in advance for any assistance.
0
50,467
09/08/2008 19:21:19
1,967
08/19/2008 15:58:15
1
1
How do I size a UITextView to it's content?
Is there a good way to adjust the size of a UITextView to conform to it's content? Say for instance I have a UITextView that contains one line of text: "Hello world" I then add another line of text: "Goodbye world" Is there a good way in Cocoa Touch to get the rect that will hold all of the lines in the text view so that I can adjust the parent view accordingly? As another example, look at the Notes field for events in the Calendar application--note how the cell (and the UITextView it contains) expands to hold all lines of text in the notes string.
iphone
cocoa
null
null
null
null
open
How do I size a UITextView to it's content? === Is there a good way to adjust the size of a UITextView to conform to it's content? Say for instance I have a UITextView that contains one line of text: "Hello world" I then add another line of text: "Goodbye world" Is there a good way in Cocoa Touch to get the rect that will hold all of the lines in the text view so that I can adjust the parent view accordingly? As another example, look at the Notes field for events in the Calendar application--note how the cell (and the UITextView it contains) expands to hold all lines of text in the notes string.
0
50,470
09/08/2008 19:23:00
366
08/05/2008 06:49:49
140
4
Can I prevent user pasting Javascript into Design Mode IFrame?
I'm building a webapp that contains an IFrame in design mode so my user's can "tart" their content up and paste in content to be displayed on their page. Like the WYSIWYG editor on most blog engines or forums. I'm trying to think of all potential security holes I need to plug, one of which is a user pasting in Javascript: &lt;script type="text/javascript"&gt; // Do some nasty stuff &lt;/script&gt; Now I know I can strip this out at the server end, before saving it and/or serving it back, but I'm worried about the possibility of someone being able to paste some script in and run it there and then, without even sending it back to the server for processing. Am I worrying over nothing? Any advice would be great, couldn't find much searching Google. Anthony
javascript
iframe
null
null
null
null
open
Can I prevent user pasting Javascript into Design Mode IFrame? === I'm building a webapp that contains an IFrame in design mode so my user's can "tart" their content up and paste in content to be displayed on their page. Like the WYSIWYG editor on most blog engines or forums. I'm trying to think of all potential security holes I need to plug, one of which is a user pasting in Javascript: &lt;script type="text/javascript"&gt; // Do some nasty stuff &lt;/script&gt; Now I know I can strip this out at the server end, before saving it and/or serving it back, but I'm worried about the possibility of someone being able to paste some script in and run it there and then, without even sending it back to the server for processing. Am I worrying over nothing? Any advice would be great, couldn't find much searching Google. Anthony
0
50,488
09/08/2008 19:32:22
767
08/08/2008 17:04:18
91
3
WebDev.WebServer.EXE Crashes After VS 2008 SP1 Install
Since, for various reasons, I can't use IIS for an ASP.NET website I'm developing, I run Cassini from the command line to test the site. However, after installing Visual Studio 2008 SP1, I get a System.Net.Sockets.SocketException when I try to start up the web server. Is anyone else having this problem, and if so, how did you fix it?
asp.net
webserver
null
null
null
null
open
WebDev.WebServer.EXE Crashes After VS 2008 SP1 Install === Since, for various reasons, I can't use IIS for an ASP.NET website I'm developing, I run Cassini from the command line to test the site. However, after installing Visual Studio 2008 SP1, I get a System.Net.Sockets.SocketException when I try to start up the web server. Is anyone else having this problem, and if so, how did you fix it?
0
50,499
09/08/2008 19:41:10
4,872
09/06/2008 09:14:55
6
0
How do I in Python get the path and name of the file that is currently executing?
I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. (Executing os.getcwd() returns the original starting script's filepath not the current file's.)
python
scripting
file
null
null
null
open
How do I in Python get the path and name of the file that is currently executing? === I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. (Executing os.getcwd() returns the original starting script's filepath not the current file's.)
0
50,518
09/08/2008 19:53:18
4,244
09/02/2008 13:59:09
1
1
Designing a new UI for a legacy WinForms MDI application
I'm working on moving a client/server application created with C# and WinForms into the SOA/WPF/Silverlight world. One of the big hurdles is the design of the UI. My current UI is MDI driven and users rely heavily on child windows, having many open at the same time and toggling back and forth between them. What might be the best way to recreate the UI functionality in an MDI-less environment? (I've no desire to create MDI functionality on my own in WPF). Tabs? A list panel that toggles different controls?
c#
wpf
gui
silverlight
null
null
open
Designing a new UI for a legacy WinForms MDI application === I'm working on moving a client/server application created with C# and WinForms into the SOA/WPF/Silverlight world. One of the big hurdles is the design of the UI. My current UI is MDI driven and users rely heavily on child windows, having many open at the same time and toggling back and forth between them. What might be the best way to recreate the UI functionality in an MDI-less environment? (I've no desire to create MDI functionality on my own in WPF). Tabs? A list panel that toggles different controls?
0
50,524
09/08/2008 19:57:03
4,265
09/02/2008 15:04:51
1
1
What is an 'independent capturing group'
From the java 6 regex documentation: >Special constructs (non-capturing) (?:X) X, as a non-capturing group ... (?>X) X, as an independent, non-capturing group What is the difference between (?:X) and (?>X)? What does the **independent** mean in this context?
java
regex
null
null
null
null
open
What is an 'independent capturing group' === From the java 6 regex documentation: >Special constructs (non-capturing) (?:X) X, as a non-capturing group ... (?>X) X, as an independent, non-capturing group What is the difference between (?:X) and (?>X)? What does the **independent** mean in this context?
0
50,525
09/08/2008 19:57:12
2,064
08/20/2008 03:39:44
62
0
Implicit casting and interger overflowing in the evaluation of expressions question in c.
Lets take the code int a, b, c; ... if ((a + b) > C) If the values of a and b add to exceed the max value of an int will the integrity of the comparison be compromised? I was thinking that there might be an implicit up cast or overflow bit checked and factored into the evaluation of this expression.
c
null
null
null
null
null
open
Implicit casting and interger overflowing in the evaluation of expressions question in c. === Lets take the code int a, b, c; ... if ((a + b) > C) If the values of a and b add to exceed the max value of an int will the integrity of the comparison be compromised? I was thinking that there might be an implicit up cast or overflow bit checked and factored into the evaluation of this expression.
0
50,528
09/08/2008 19:58:22
3,191
08/27/2008 12:32:21
373
22
Font-size independent UI: everything broke when I switched to 120 DPI!?
So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL! Everything's all jumbled: some containers aren't big enough for their text; some controls that were positioned "next to each other" are now all squished together/spread apart; some buttons aren't tall enough; my `ListView` columns aren't wide enough... eeek. It sounds like a completely different approach is in order. My previous one was basically using the VS2008 Windows Forms designer to create, I guess, a pixel-based layout. I can see that if I were to stick with Windows Forms, `FlowLayoutPanel`s would be helpful, although I've found them rather inflexible in the past. They also don't solve the problem where the containers (e.g. the form itself) aren't big enough; presumably there's a way to do that? Maybe that `AutoSize` property? This might also be a sign that it's time to jump ship to WPF; I'm under the impression that it's specifically designed for this kind of thing. The basic issue seems to come down to these: * If I were to stick with Windows Forms, what are all the tricks to achieving a font-size-independent layout that can survive the user setting his fonts large, or setting the display to 120 DPI? * Does WPF have significant advantages here, and if so, can you try to convince me that it's worth the switch? * Are there any general "best-practices" for font-size-independent layouts, either in the .NET stack or in general?
.net
wpf
gui
fonts
winforms
null
open
Font-size independent UI: everything broke when I switched to 120 DPI!? === So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL! Everything's all jumbled: some containers aren't big enough for their text; some controls that were positioned "next to each other" are now all squished together/spread apart; some buttons aren't tall enough; my `ListView` columns aren't wide enough... eeek. It sounds like a completely different approach is in order. My previous one was basically using the VS2008 Windows Forms designer to create, I guess, a pixel-based layout. I can see that if I were to stick with Windows Forms, `FlowLayoutPanel`s would be helpful, although I've found them rather inflexible in the past. They also don't solve the problem where the containers (e.g. the form itself) aren't big enough; presumably there's a way to do that? Maybe that `AutoSize` property? This might also be a sign that it's time to jump ship to WPF; I'm under the impression that it's specifically designed for this kind of thing. The basic issue seems to come down to these: * If I were to stick with Windows Forms, what are all the tricks to achieving a font-size-independent layout that can survive the user setting his fonts large, or setting the display to 120 DPI? * Does WPF have significant advantages here, and if so, can you try to convince me that it's worth the switch? * Are there any general "best-practices" for font-size-independent layouts, either in the .NET stack or in general?
0
50,529
09/08/2008 19:58:22
2,454
08/22/2008 11:22:25
147
4
Can you be terrible at math and still a great programmer?
I'm just after reading Jeff's 'Five Things You Didn't Know About Me (and my office)' blog entry on Coding Horror and right at the bottom of this page he mentions (to my surprise) that he is terrible at math: [http://www.codinghorror.com/blog/archives/000770.html][1] He's obviously not that bad as I do reckon that a certain level of math is required to be a half decent programmer; I'm therefore taking his statement with a pinch of salt. However, I was just wondering if any of you reckon it's possible to be a great programmer but still be mediocre at math? [1]: http://www.codinghorror.com/blog/archives/000770.html
math
null
null
null
null
null
open
Can you be terrible at math and still a great programmer? === I'm just after reading Jeff's 'Five Things You Didn't Know About Me (and my office)' blog entry on Coding Horror and right at the bottom of this page he mentions (to my surprise) that he is terrible at math: [http://www.codinghorror.com/blog/archives/000770.html][1] He's obviously not that bad as I do reckon that a certain level of math is required to be a half decent programmer; I'm therefore taking his statement with a pinch of salt. However, I was just wondering if any of you reckon it's possible to be a great programmer but still be mediocre at math? [1]: http://www.codinghorror.com/blog/archives/000770.html
0
50,532
09/08/2008 19:59:45
1,310
08/14/2008 13:42:16
738
33
How do I format a number in java?
How do I format a number in java? What are the "Best Practices"? Will I need to round a number before I format it? "32.302342342342343" formatted to "32.30" ".7323" formatted to "0.73" etc.
java
null
null
null
null
null
open
How do I format a number in java? === How do I format a number in java? What are the "Best Practices"? Will I need to round a number before I format it? "32.302342342342343" formatted to "32.30" ".7323" formatted to "0.73" etc.
0
50,539
09/08/2008 20:02:26
2,486
08/22/2008 13:39:26
28
15
Multiline ddl Custom Control
One of the guys I work with needs a custom control that would work like a multiline ddl since such a thing does not exist as far as we have been able to discover does anyone have any ideas or have created such a thing before we have a couple ideas but they involve to much database usage
c#
asp.net
custom-controls
null
null
null
open
Multiline ddl Custom Control === One of the guys I work with needs a custom control that would work like a multiline ddl since such a thing does not exist as far as we have been able to discover does anyone have any ideas or have created such a thing before we have a couple ideas but they involve to much database usage
0
50,558
09/08/2008 20:09:45
1,048
08/11/2008 19:34:31
125
13
How do you initialize a 2 dimensional array when you do not know the size
I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height. I have it declared as follows: float[,] _calibrationSet; .... int calibrationRow = 0; While (recordsToRead) { for (int i = 0; i < SensorCount; i++) { _calibrationSet[calibrationRow, i] = calibrationArrayView.ReadFloat(); } calibrationRow++; } This causes a NullReferenceException, so when I try to initialize it like this: _calibrationSet = new float[,]; I get an "Array creation must have array size or array initializer." Thank you, Keith
c#
array-initialize
null
null
null
null
open
How do you initialize a 2 dimensional array when you do not know the size === I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height. I have it declared as follows: float[,] _calibrationSet; .... int calibrationRow = 0; While (recordsToRead) { for (int i = 0; i < SensorCount; i++) { _calibrationSet[calibrationRow, i] = calibrationArrayView.ReadFloat(); } calibrationRow++; } This causes a NullReferenceException, so when I try to initialize it like this: _calibrationSet = new float[,]; I get an "Array creation must have array size or array initializer." Thank you, Keith
0
50,561
09/08/2008 20:10:55
4,220
09/02/2008 11:59:43
6
4
What thread is holding a synchronization lock
Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?
java
null
null
null
null
null
open
What thread is holding a synchronization lock === Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?
0
50,565
09/08/2008 20:15:09
299
08/04/2008 13:31:09
334
28
Context Menu Resets ComboBox's SelectedIndex
I have a ContextMenu that is displayed after a user right clicks on a ComboBox. When the user selects an item in the context menu, a form is brought up using the ShowDialog() method. If frmOptions.ShowDialog() = Windows.Forms.DialogResult.Cancel Then LoadComboBoxes() End If When that form is closed, I refresh all the data in the ComboBoxes on the parent form. However, when this happens the ComboBox that opened the ContextMenu is reset to have a selected index of -1 but the other selected indexes of the other ComboBoxes remain the same. How do I prevent the ComboBox that opened the context menu from being reset?
contextmenu
combobox
selectedindex
null
null
null
open
Context Menu Resets ComboBox's SelectedIndex === I have a ContextMenu that is displayed after a user right clicks on a ComboBox. When the user selects an item in the context menu, a form is brought up using the ShowDialog() method. If frmOptions.ShowDialog() = Windows.Forms.DialogResult.Cancel Then LoadComboBoxes() End If When that form is closed, I refresh all the data in the ComboBoxes on the parent form. However, when this happens the ComboBox that opened the ContextMenu is reset to have a selected index of -1 but the other selected indexes of the other ComboBoxes remain the same. How do I prevent the ComboBox that opened the context menu from being reset?
0
50,568
09/08/2008 20:16:16
4,072
09/01/2008 16:28:18
1
1
Django Sessions
I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?
django
python
null
null
null
null
open
Django Sessions === I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?
0
50,571
09/08/2008 20:18:40
4,831
09/05/2008 20:11:54
11
1
Windows XP support for Remote NDIS
I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it over RNDIS, as opposed to rolling my own CDC driver for XP. I've been reading some older documentation that says even XP is pretty buggy with NDIS (suprise!). Does anyone have experience with XP's RNDIS drivers? Are they safe for product development? Any insight would be much appreciated.
windows
embedded
usb
drivers
ndis
null
open
Windows XP support for Remote NDIS === I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it over RNDIS, as opposed to rolling my own CDC driver for XP. I've been reading some older documentation that says even XP is pretty buggy with NDIS (suprise!). Does anyone have experience with XP's RNDIS drivers? Are they safe for product development? Any insight would be much appreciated.
0
50,575
09/08/2008 20:21:32
3,381
08/28/2008 11:39:48
476
57
What's your favorite (free) log viewer for EntLib or Log4Net?
Currently we have Enterprise Library Logging going to the Event Log & a rolling flat file, but I'd like to implement database level logging so that I can have much better browsing/filtering/grouping ability. While I could write this by hand (and have, in fact, for log4net in the past) I though I'd ask the question: Are there any good log viewers that I can leverage to avoid having to write one myself?
logging
enterprise-library
log4net
null
null
09/23/2011 05:09:22
not constructive
What's your favorite (free) log viewer for EntLib or Log4Net? === Currently we have Enterprise Library Logging going to the Event Log & a rolling flat file, but I'd like to implement database level logging so that I can have much better browsing/filtering/grouping ability. While I could write this by hand (and have, in fact, for log4net in the past) I though I'd ask the question: Are there any good log viewers that I can leverage to avoid having to write one myself?
4
50,576
09/08/2008 20:21:36
2,295
08/21/2008 14:11:18
26
4
Simultaneous calls from CDR
I need to come up with an analysis of simultaneus events, when having only starttime and duration of each event. **Details** I've a standard CDR call detail record, that contains among others: * calldate (timedate of each call start * duration (int, seconds of call duration) * channel (a string) What I need to come up with is some sort of analysys of simultaneus calls on each second, for a given timedate period. For example, a graph of simultaneous calls we had yesterday. (The problem is the same if we have visitors logs with duration on a website and wish to obtain simultaneous clients for a group of web-pages) What would your algoritm be? I can iterate over records in the given period, and fill an array, where each bucket of the array corresponds to 1 second in the overall period. This works and seems to be fast, but if the timeperiod is big (say..1 year), I would need lots of memory (3600x24x365x4 bytes ~ 120MB aprox). This is for a web-based, interactive app, so my memory footprint should be small enough.
sql
language-agnostic
asterisk
null
null
null
open
Simultaneous calls from CDR === I need to come up with an analysis of simultaneus events, when having only starttime and duration of each event. **Details** I've a standard CDR call detail record, that contains among others: * calldate (timedate of each call start * duration (int, seconds of call duration) * channel (a string) What I need to come up with is some sort of analysys of simultaneus calls on each second, for a given timedate period. For example, a graph of simultaneous calls we had yesterday. (The problem is the same if we have visitors logs with duration on a website and wish to obtain simultaneous clients for a group of web-pages) What would your algoritm be? I can iterate over records in the given period, and fill an array, where each bucket of the array corresponds to 1 second in the overall period. This works and seems to be fast, but if the timeperiod is big (say..1 year), I would need lots of memory (3600x24x365x4 bytes ~ 120MB aprox). This is for a web-based, interactive app, so my memory footprint should be small enough.
0
50,579
09/08/2008 20:22:48
1,782
08/18/2008 14:30:58
1,263
91
__doPostBack not rendering on postback
I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas? This is what I'm missing after the postback: <script language="javascript" type="text/javascript"> <!-- function __doPostBack(eventTarget, eventArgument) { var theform; if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) { theform = document.Main; } else { theform = document.forms["Main"]; } theform.__EVENTTARGET.value = eventTarget.split("$").join(":"); theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); } // --> </script>
postback
aspnet
null
null
null
null
open
__doPostBack not rendering on postback === I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas? This is what I'm missing after the postback: <script language="javascript" type="text/javascript"> <!-- function __doPostBack(eventTarget, eventArgument) { var theform; if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) { theform = document.Main; } else { theform = document.forms["Main"]; } theform.__EVENTTARGET.value = eventTarget.split("$").join(":"); theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); } // --> </script>
0
50,585
09/08/2008 20:25:30
567
08/06/2008 19:14:16
367
22
How do you capture mouse events in FF, over Shockwave Object
How do you capture the mouse events, move and click over top of a shockwave object in Firefox, via Javascript. The code works in IE but not in FF.
shockwave
firefox
javscript
null
null
null
open
How do you capture mouse events in FF, over Shockwave Object === How do you capture the mouse events, move and click over top of a shockwave object in Firefox, via Javascript. The code works in IE but not in FF.
0
50,605
09/08/2008 20:36:45
4,828
09/05/2008 19:52:16
1
0
signed to unsigned conversion in C - is it always safe?
Suppose I have the following C code: unsigned int u = 1234; int i = -5678; unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (safe, in the sense that even though _result_ in this example will overflow to some huge positive number, I could cast it back to an *int* and get the real result)
c
null
null
null
null
null
open
signed to unsigned conversion in C - is it always safe? === Suppose I have the following C code: unsigned int u = 1234; int i = -5678; unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (safe, in the sense that even though _result_ in this example will overflow to some huge positive number, I could cast it back to an *int* and get the real result)
0