Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
30,678
2
null
29,980
1
null
To make this less tedious, you will need to encapsulate/refactor the mapping between the DataReader and the Object you hold in the list. There is quite of few steps to encapsulate that logic out. If that is the road you want to take, I can post code for you. I am just not sure how practical it would be to post the c...
null
CC BY-SA 2.5
null
2008-08-27T17:22:46.140
2008-08-27T17:34:28.517
2008-08-27T17:34:28.517
1,117
1,117
null
30,681
2
null
19,744
3
null
What you probably want is a combination of a queue that contains updates for the linked server and a process that reads data from the queue and updates the remote server. The trigger will then insert a message into the queue as part of the normal transaction. This data will be read by the separate process and used to...
null
CC BY-SA 2.5
null
2008-08-27T17:24:42.250
2008-08-27T17:24:42.250
null
null
533
null
30,677
2
null
30,627
2
null
You've done a good job of explaining what you want to do but not why. There are several XML frameworks that simplify marshalling and unmarshalling Java objects to/from XML. The simplest is [Commons Digester](http://commons.apache.org/digester/) which I typically use to parse configuration files. But if you are want t...
null
CC BY-SA 2.5
null
2008-08-27T17:22:33.770
2008-08-27T17:22:33.770
null
null
1,969
null
30,682
2
null
30,543
1
null
We develop a 32-bit application using VS 2005 (2008 soon) and have just purchased some new machines with XP Pro x64 or Vista Business 64-bit on them so that we can take advantage of the extra RAM whilst holding a watching brief on the possibility of doing a 64-bit port if it becomes commercially necessary to do so. We ...
null
CC BY-SA 2.5
null
2008-08-27T17:24:43.797
2008-08-27T17:24:43.797
null
null
1,236
null
30,655
2
null
28,982
204
null
Going all the way down to the basics for Map and Reduce. --- is a function which "transforms" items in some kind of list to another kind of item and put them back in the same kind of list. suppose I have a list of numbers: [1,2,3] and I want to double every number, in this case, the function to "double every num...
null
CC BY-SA 3.0
null
2008-08-27T17:09:09.497
2011-12-11T08:06:21.443
2011-12-11T08:06:21.443
3,055
3,055
null
30,679
2
null
30,354
8
null
@Matt Dillard - Did setting these to nothing fix your memory leak? VB6 doesn't have a formal garbage collector, more along the lines of what @Konrad Rudolph said. Actually calling unload on your forms seems to me to be the best way to ensure that the main form is cleaned up and that each subform cleans up their actio...
null
CC BY-SA 2.5
null
2008-08-27T17:23:30.600
2008-08-27T17:23:30.600
null
null
2,818
null
30,686
1
30,708
null
176
280,684
How can you get the version information from a `.dll` or `.exe` file in PowerShell? I am specifically interested in `File Version`, though other version information (that is, `Company`, `Language`, `Product Name`, etc.) would be helpful as well.
Get file version in PowerShell
CC BY-SA 3.0
0
2008-08-27T17:28:48.903
2022-06-14T21:09:56.150
2014-12-01T00:21:42.887
63,550
2,495
[ "file", "powershell", "versioninfo" ]
30,684
2
null
30,653
1
null
[Here](http://www.codeproject.com/KB/COM/BuildCOMServersInDotNet.aspx) we can read that it is possible, but the exe will be loaded as an library and not started in it's own process like an exe. I don't know if that is a problem for you? It also contains some possible solutions if you do want to make it act like a real ...
null
CC BY-SA 2.5
null
2008-08-27T17:25:28.770
2008-08-27T17:25:28.770
null
null
1,242
null
30,685
2
null
30,328
10
null
The source code seemed to be geared for an executable, you might need to rewire stuffs a bit so it would build as a DLL instead. I don't have much experience with Visual C++ but I think it shouldn't be too hard with some research. My guess is that someone might have had made a library version already, you should try Go...
null
CC BY-SA 2.5
null
2008-08-27T17:26:42.807
2008-08-27T18:02:25.593
2008-08-27T18:02:25.593
3,055
3,055
null
30,687
2
null
30,485
2
null
What you're really asking is a related, but substantially different question: how often do I want to truncate names in order to fit them in the database? The answer depends both on the frequency of different lengths of names as well as the maximum lengths chosen. This concern is balanced by the concerns about resources...
null
CC BY-SA 2.5
null
2008-08-27T17:29:35.110
2008-08-27T17:29:35.110
null
null
332
null
30,689
2
null
30,627
2
null
I have tried the SAXParser once, but once I found [XStream](http://xstream.codehaus.org/) I never went back to it. With XStream you can create Java Objects and convert them to XML. Send them over and use XStream to recreate the object. Very easy to use, fast, and creates clean XML. Either way you have to know what dat...
null
CC BY-SA 2.5
null
2008-08-27T17:30:23.360
2008-08-27T17:30:23.360
null
null
1,992
null
30,628
2
null
30,571
175
null
Please take a look at [this page](https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges) (section "Dependency Version Ranges"). What you might want to do is something like ``` <version>[1.2.3,)</version> ``` ...
null
CC BY-SA 3.0
null
2008-08-27T16:56:03.053
2016-03-16T15:02:01.050
2016-03-16T15:02:01.050
1,310,566
1,793
null
30,688
2
null
26,670
2
null
A PDF is what I'm after, so I'm not sure how outputting another format would help. As it turns out, the footer space just wasn't enough to fit all of this text; verified by the fact that changing the font size to 4pt would fit it all in without a problem. I spent some time attempting to rewrite the footer code using ...
null
CC BY-SA 2.5
null
2008-08-27T17:30:21.787
2008-08-27T17:30:21.787
null
null
751
null
30,696
1
null
null
0
4,104
I posted the code below to the Sun developers forum since I thought it was erroring (the true error was before this code was even hit). One of the responses I got said it would not work and to throw it away. But it is actually working. It might not be the best code (I am new to Java) but is there something inherentl...
Java code to import CSV into Access
CC BY-SA 3.0
null
2008-08-27T17:38:30.503
2012-01-17T17:05:46.700
2012-01-17T17:05:46.700
287,783
2,786
[ "java", "ms-access", "csv" ]
30,691
2
null
29,030
2
null
Generally speaking I try and copy whatever approach the product group has taken when looking to add functionality of my own. In this case they add their own edit/view/add pages via the list definition itself. I built a solution that also needed its own custom "New" form, not open source unfortunately, though if you ar...
null
CC BY-SA 3.0
null
2008-08-27T17:30:42.720
2016-06-17T09:50:55.513
2016-06-17T09:50:55.513
2,577,734
897
null
30,697
2
null
30,627
3
null
As I understand it, the problem is that you don't know what format the document is prior to parsing. You could use a delegate pattern. I'm assuming you're not validating against a DTD/XSD/etcetera and that it is OK for the DefaultHandler to have state. ``` public class DelegatingHandler extends DefaultHandler { p...
null
CC BY-SA 2.5
null
2008-08-27T17:38:38.753
2008-08-27T17:38:38.753
null
null
304
null
30,699
2
null
21,725
97
null
[Nerdtree](http://www.vim.org/scripts/script.php?script_id=1658) The NERD tree allows you to explore your filesystem and to open files and directories. It presents the filesystem to you in the form of a tree which you manipulate with the keyboard and/or mouse. It also allows you to perform simple filesystem operations...
null
CC BY-SA 2.5
null
2008-08-27T17:40:51.730
2009-06-24T13:35:10.780
2009-06-24T13:35:10.780
907
907
null
30,702
2
null
30,686
5
null
``` [System.Diagnostics.FileVersionInfo]::GetVersionInfo("Path\To\File.dll") ```
null
CC BY-SA 2.5
null
2008-08-27T17:41:59.293
2008-08-27T17:41:59.293
null
null
1,358
null
30,703
2
null
29,980
0
null
Just to clarify, you want to be able to test your call into SQL Server returned some data, or that if you had some data you could map it back into the model? If you want to test your call into SQL returned some data checkout my answer found [here](https://stackoverflow.com/questions/12374/has-anyone-had-any-success-in...
null
CC BY-SA 2.5
null
2008-08-27T17:42:35.673
2008-08-27T17:42:35.673
2017-05-23T11:48:36.327
-1
2,701
null
30,701
2
null
30,660
3
null
First, do you really want to ignore errors? If you get an error, it is likely that the data is not in sync any more. Perhaps what you want is to drop the slave database and restart the sync process when you get an error. Second, I think the error you are getting is not when you replicate an item that does not exist (w...
null
CC BY-SA 2.5
null
2008-08-27T17:41:40.837
2008-08-27T17:41:40.837
null
null
3,267
null
30,706
1
30,798
null
3
4,083
I want to create a draggable and resizable window in JavaScript for cross browser use, but I want to try and avoid using a framework if I can. Has anyone got a link or some code that I can use?
How do I create a draggable and resizable JavaScript popup window?
CC BY-SA 2.5
0
2008-08-27T17:45:06.743
2008-11-08T12:42:00.777
null
null
1,478
[ "javascript", "dialog" ]
30,690
2
null
29,971
1
null
We use [buildbot](http://buildbot.net/trac), with the build broken down into discrete steps. There is a balance to be found between having build steps be broken down with enough granularity and being a complete unit. For example at my current position, we build the sub-pieces for each of our platforms (Mac, Linux, Win...
null
CC BY-SA 2.5
null
2008-08-27T17:30:39.053
2008-08-27T17:30:39.053
null
null
3,265
null
30,708
2
null
30,686
172
null
Since PowerShell can call [.NET](https://en.wikipedia.org/wiki/.NET_Framework) classes, you could do the following: ``` [System.Diagnostics.FileVersionInfo]::GetVersionInfo("somefilepath").FileVersion ``` Or as [noted here](https://web.archive.org/web/20081004113553/https://kamhungsoh.com/blog/2008/01/powershell-fil...
null
CC BY-SA 4.0
null
2008-08-27T17:45:54.493
2020-01-24T09:14:17.263
2020-01-24T09:14:17.263
70,345
1,242
null
30,700
2
null
29,557
29
null
MSTest is certainly not as efficient or extensible as some of the open source frameworks, but it is workable. Since the question asks about making life easier with MSTest and not about alternatives, here are my MSTest tips. - - - - - - - -
null
CC BY-SA 3.0
null
2008-08-27T17:40:52.447
2014-02-24T06:29:35.660
2014-02-24T06:29:35.660
2,096,990
308
null
30,707
2
null
29,460
2
null
@thomas -- Amazingly Microsoft's own [Windows Vista User Experience Guidelines](http://msdn.microsoft.com/en-us/library/aa511446.aspx) agree with you ... > While having a background window flash its taskbar button is better than having it automatically come to the top and steal input focus, flashing taskbar buttons ar...
null
CC BY-SA 2.5
null
2008-08-27T17:45:48.753
2008-08-27T17:45:48.753
null
null
2,508
null
30,710
1
30,818
null
170
97,229
I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files. I'm using PHP and Python but I think it's a question that applies to most/all langua...
How to unit test an object with database queries
CC BY-SA 2.5
0
2008-08-27T17:46:02.763
2022-03-14T23:43:04.960
null
null
1,384,652
[ "database", "unit-testing" ]
30,714
2
null
30,660
2
null
Modern `mysqldump` commands have a couple options to help with setting up consistent replication. Check out `--master-data` which will put the binary log file and position in the dump and automatically set when loaded into slave. Also `--single-transaction` will do the dump inside a transaction so that no write lock is...
null
CC BY-SA 2.5
null
2008-08-27T17:48:59.043
2008-08-27T17:48:59.043
null
null
163
null
30,713
2
null
29,621
2
null
@ allain > Sure. Be aware, however, that this is a one way street. You can't even get back to where you started. And even fairly small reductions in priority can have startlingly large effects on running time when there is significant load on the system.
null
CC BY-SA 2.5
null
2008-08-27T17:48:31.587
2008-08-27T17:48:31.587
null
null
2,509
null
30,709
2
null
30,686
2
null
As EBGreen said, [System.Diagnostics.FileVersionInfo]::GetVersionInfo(path) will work, but remember that you can also get all the members of FileVersionInfo, for example: ``` [System.Diagnostics.FileVersionInfo]::GetVersionInfo(path).CompanyName ``` You should be able to use every member of FileVersionInfo documente...
null
CC BY-SA 2.5
null
2008-08-27T17:46:00.517
2008-08-27T17:46:00.517
null
null
194
null
30,716
2
null
30,710
11
null
You should mock the database access if you want to unit test your classes. After all, you don't want to test the database in a unit test. That would be an integration test. Abstract the calls away and then insert a mock that just returns the expected data. If your classes don't do more than executing queries, it may ...
null
CC BY-SA 2.5
null
2008-08-27T17:49:28.213
2008-08-27T17:49:28.213
null
null
1,793
null
30,718
2
null
11,586
1
null
Yes, design patterns are largely used in the real world - and daily by many of the people I work with. In my opinion the biggest value provided by design patterns is that they provide a universal, high level language for you to convey software design to other programmers. For instance instead of describing your new...
null
CC BY-SA 2.5
null
2008-08-27T17:50:05.980
2008-08-27T17:50:05.980
null
null
2,890
null
30,715
2
null
30,710
29
null
Ideally, your objects should be persistent ignorant. For instance, you should have a "data access layer", that you would make requests to, that would return objects. This way, you can leave that part out of your unit tests, or test them in isolation. If your objects are tightly coupled to your data layer, it is difficu...
null
CC BY-SA 4.0
null
2008-08-27T17:49:24.407
2022-03-14T23:43:04.960
2022-03-14T23:43:04.960
7,487,335
2,993
null
30,712
1
30,874
null
5
1,421
When setting up a new virtual directory for hosting a SOAP web service in IIS 6.0 on a Server 2003 box I am required to set the access permissions for the virtual directory. The various permissions are to allow/disallow the following: - - - - - The SOAP web service is being published through the SOAP3.0 ISAPI serve...
What is the proper virtual directory access permission level required for a SOAP web service?
CC BY-SA 2.5
null
2008-08-27T17:48:21.867
2017-11-07T17:25:56.670
2008-08-27T18:47:44.953
1,339
1,339
[ "web-services", "soap", "file-permissions" ]
30,721
2
null
30,710
6
null
I usually try to break up my tests between testing the objects (and ORM, if any) and testing the db. I test the object-side of things by mocking the data access calls whereas I test the db side of things by testing the object interactions with the db which is, in my experience, usually fairly limited. I used to get f...
null
CC BY-SA 2.5
null
2008-08-27T17:51:40.610
2008-08-27T17:51:40.610
null
null
1,314
null
30,719
2
null
29,011
2
null
Well I'm still new to rails and I'm not sure exactly what you're going for here, but if you're just going for code reuse why not use a regular class method? ``` def self.ab(a, b) a(a).b(b) end ``` You could make that more flexible by taking *args instead of a and b, and then possibly make one or ...
null
CC BY-SA 2.5
null
2008-08-27T17:50:49.600
2008-08-27T17:50:49.600
null
null
3,230
null
30,723
2
null
30,710
3
null
You could use to abstract out the database engine. I don't know if PHP/Python got some but for typed languages (C#, Java etc.) there are plenty of choices It also depends on how you designed those database access code, because some design are easier to unit test than other like the earlier posts have mentioned.
null
CC BY-SA 2.5
null
2008-08-27T17:51:47.320
2008-08-27T17:59:02.950
2008-08-27T17:59:02.950
3,055
3,055
null
30,722
2
null
30,706
0
null
Avoiding a framework altogether will leave you with lots of code and a bunch of tedious browser-testing. If you would consider a framework I'd suggest jQuery with the [jqDnR](http://dev.iceburg.net/jquery/jqDnR/) plugin. I think it will solve your problem or perhaps you could combine the functionality of the [jQuery d...
null
CC BY-SA 2.5
null
2008-08-27T17:51:46.850
2008-08-27T17:59:42.387
2008-08-27T17:59:42.387
2,114
2,114
null
30,729
1
30,766
null
4
2,572
I want to create a simple http proxy server that does some very basic processing on the http headers (i.e. if header x == y, do z). The server may need to support hundreds of users. I can write the server in C# (pretty easy) or c++ (much harder). However, would a C# version have as good of performance as a C++ versi...
C# Performance For Proxy Server (vs C++)
CC BY-SA 2.5
0
2008-08-27T17:55:16.577
2009-01-30T18:29:36.380
null
null
3,291
[ "c#", "c++", "performance", "sockets", "system.net" ]
30,724
2
null
29,030
0
null
I'd like to think my issue is "special" here, since I am using a custom form. I chose to use a custom form rather than a custom FormTemplate simply because I'm doing a lot of stuff that's not very SharePoint list-like (making ajax calls to get info from a third-party app then generating some dynamic form elements base...
null
CC BY-SA 2.5
null
2008-08-27T17:52:19.160
2008-08-27T17:52:19.160
null
null
404
null
30,720
2
null
30,696
6
null
The literal answer is no - there is never anything "inherently wrong" with code, it's a matter of whether it meets the requirements - which may or may not include being maintainable, secure, robust or fast. The code you are running is actually a JET query purely within Access - the Java code is doing nothing except te...
null
CC BY-SA 2.5
null
2008-08-27T17:51:23.030
2008-08-27T17:51:23.030
null
null
3,267
null
30,732
2
null
30,710
3
null
I agree with the first post - database access should be stripped away into a DAO layer that implements an interface. Then, you can test your logic against a stub implementation of the DAO layer.
null
CC BY-SA 2.5
null
2008-08-27T17:56:19.320
2008-08-27T17:56:19.320
null
null
96
null
30,731
2
null
30,710
2
null
I've never done this in PHP and I've never used Python, but what you want to do is mock out the calls to the database. To do that you can implement some [IoC](http://en.wikipedia.org/wiki/Inversion_of_Control) whether 3rd party tool or you manage it yourself, then you can implement some mock version of the database ca...
null
CC BY-SA 2.5
null
2008-08-27T17:55:53.377
2008-08-27T17:55:53.377
null
null
3,030
null
30,735
2
null
30,706
1
null
Sometimes you can't choose your environment or architecture, so you're stuck working within constraints like not being able to use frameworks...
null
CC BY-SA 2.5
null
2008-08-27T17:58:26.803
2008-08-27T17:58:26.803
null
null
null
null
30,704
2
null
30,563
0
null
Try this: ``` SELECT B.[Group], COUNT(*) AS GroupCount FROM Table1 A LEFT JOIN Table2 B ON B.ItemType=A.ItemType GROUP BY B.[Group] ```
null
CC BY-SA 2.5
null
2008-08-27T17:43:04.720
2008-08-27T17:43:04.720
null
null
3,043
null
30,737
2
null
30,710
7
null
The book [xUnit Test Patterns](https://rads.stackoverflow.com/amzn/click/com/0131495054) describes some ways to handle unit-testing code that hits a database. I agree with the other people who are saying that you don't want to do this because it's slow, but you gotta do it sometime, IMO. Mocking out the db connection...
null
CC BY-SA 2.5
null
2008-08-27T17:59:51.123
2008-08-27T17:59:51.123
null
null
404
null
30,603
2
null
30,430
0
null
And bear in mind that all this stuff about the being compatible between 2005 and 2008 is NOT true for C/C++ projects.
null
CC BY-SA 2.5
null
2008-08-27T16:40:44.727
2008-08-27T16:40:44.727
null
null
987
null
30,733
2
null
28,196
5
null
I misunderstood you. I thought you wanted Nuclear or Deals. The below should give you only Nuclear and Deals. ``` select p.* from wp_posts p, wp_terms t, wp_term_taxonomy tt, wp_term_relationship tr, wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2 wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship t...
null
CC BY-SA 3.0
null
2008-08-27T17:57:29.053
2012-07-06T20:25:52.140
2012-07-06T20:25:52.140
190,829
2,610
null
30,705
2
null
30,585
9
null
Yes, you just run xcode builds via the command line (xcodebuild) which makes it simple to target from CC via an ant `<exec>`. I've been using just regular CC, not the ruby version and it works fine. Here's a barebones example: ``` <project name="cocoathing" default="build"> <target name="build"> <exec executable...
null
CC BY-SA 2.5
null
2008-08-27T17:43:09.757
2008-08-27T17:52:43.540
2008-08-27T17:52:43.540
1,329,401
1,329,401
null
30,745
2
null
24,901
1
null
@wilhelmtell The compiler can elide the temporary. Verbatim from the other thread: The C++ compiler is allowed to eliminate stack based temporaries even if doing so changes program behavior. MSDN link for VC 8: [http://msdn.microsoft.com/en-us/library/ms364057(VS.80).aspx](http://msdn.microsoft.com/en-us/library/ms...
null
CC BY-SA 3.0
null
2008-08-27T18:03:38.837
2012-07-03T14:56:32.000
2012-07-03T14:56:32.000
142,162
1,799
null
30,739
2
null
30,710
4
null
Unit testing your database access is easy enough if your project has high cohesion and loose coupling throughout. This way you can test only the things that each particular class does without having to test everything at once. For example, if you unit test your user interface class the tests you write should only t...
null
CC BY-SA 2.5
null
2008-08-27T18:00:38.500
2008-08-27T18:00:38.500
2017-05-23T12:02:42.293
-1
2,701
null
30,747
2
null
9,304
18
null
One thing nobody seems to have mentioned is how auto-properties are unfortunately not useful for immutable objects (usually immutable structs). Because for that you really should do: ``` private readonly string title; public string Title { get { return this.title; } } ``` (where the field is initialized in the c...
null
CC BY-SA 2.5
null
2008-08-27T18:04:14.293
2008-08-27T18:04:14.293
null
null
3,191
null
30,741
2
null
29,980
0
null
@Toran: What I'm testing is the programmatic mapping from data returned from the database to quote-unquote domain model. Hence I want to mock out the database connection. For the other kind of test, I'd go for all-out integration testing. @Dale: I guess you nailed it pretty well there, and I was afraid that might be t...
null
CC BY-SA 2.5
null
2008-08-27T18:01:49.917
2008-08-27T18:01:49.917
null
null
266
null
30,752
1
null
null
6
793
I want to build an ASP.NET MVC application with Boo instead of C#. If you know the steps to configure this type of project setup, I'd be interested to know what I need to do. The MVC project setup is no problem. What I'm trying to figure out how to configure the pages and project to switch to use the Boo language and...
How do I configure an ASP.NET MVC project to work with Boo
CC BY-SA 3.0
0
2008-08-27T18:07:26.097
2013-12-02T12:51:15.107
2013-12-02T12:51:15.107
2,432,317
3,289
[ "asp.net", "asp.net-mvc", "boo" ]
30,753
2
null
29,011
0
null
@[PJ](https://stackoverflow.com/questions/29011/is-there-a-way-to-combine-named-scopes-into-a-new-named-scope#30719): you know, I had considered that, but dismissed it because I thought I wouldn't be able to later chain on a named scope, like so: ``` Foo.ab(x, y).c(z) ``` But since `ab(x, y)` returns whatever `b(y)...
null
CC BY-SA 2.5
null
2008-08-27T18:08:52.457
2008-08-27T18:08:52.457
2017-05-23T12:30:19.840
-1
1,190
null
30,755
2
null
30,729
0
null
The proxy server you describe would deal mostly with string data and I think its reasonable to implement in C#. In your example, ``` if header x == y, do z ``` the slowest part might actually be doing whatever 'z' is and you'll have to do that work regardless of the language.
null
CC BY-SA 2.5
null
2008-08-27T18:10:43.873
2008-08-27T18:10:43.873
null
null
1,254
null
30,756
2
null
30,729
2
null
Why do you expect a much higher performance from the C++ application? There is no inherent slowdown added by a C# application when you are doing it right. (not too many dropped references, frequent object creation/dropping per call, etc.) The only time a C++ application really outperforms an equivalent C# application...
null
CC BY-SA 2.5
null
2008-08-27T18:10:58.070
2008-08-27T18:10:58.070
null
null
3,186
null
30,754
1
30,796
null
21
3,886
Reading [this question](https://stackoverflow.com/questions/437/what-is-your-solution-to-the-fizzbuzz-problem) I found this as (note the quotation marks) "code" to solve the problem (that's perl by the way). ``` 100,{)..3%!'Fizz'*\5%!'Buzz'*+\or}%n* ``` Obviously this is an intellectual example without real (I hope...
Performance vs Readability
CC BY-SA 2.5
0
2008-08-27T18:09:42.877
2009-11-05T21:04:05.147
2017-05-23T10:29:27.687
-1
2,695
[ "performance" ]
30,757
2
null
30,729
0
null
In my experience, the design and implementation has much more to do with performance than do the choice of language/framework (however, the usual caveats apply: eg, don't write a device driver in C# or java). I wouldn't think twice about writing the type of program you describe in a managed language (be it Java, C#, e...
null
CC BY-SA 2.5
null
2008-08-27T18:11:20.267
2008-08-27T18:11:20.267
null
null
1,314
null
30,746
2
null
26,020
12
null
I've used this with great success: [http://system.data.sqlite.org/](http://system.data.sqlite.org/) Free with no restrictions. (Note from review: Original site no longer exists. The above link has a link pointing the the 404 site and has all the info of the original) --Bruce
null
CC BY-SA 3.0
null
2008-08-27T18:03:45.683
2013-04-25T21:35:45.960
2013-04-25T21:35:45.960
527,574
3,298
null
30,750
2
null
29,761
2
null
1.6 comes with Git GUI that works pretty well on my Mac.
null
CC BY-SA 3.0
null
2008-08-27T18:05:47.083
2012-08-25T01:26:23.607
2012-08-25T01:26:23.607
651,104
1,425
null
30,762
2
null
30,754
1
null
Choose readability over performance unless you can prove that you need the performance.
null
CC BY-SA 2.5
null
2008-08-27T18:12:17.363
2008-08-27T18:12:17.363
null
null
2,284
null
30,763
1
30,771
null
5
648
I have class method that returns a list of employees that I can iterate through. What's the best way to return the list? Typically I just return an ArrayList. However, as I understand, interfaces are better suited for this type of action. Which would be the best interface to use? Also, why is it better to return an i...
Understanding Interfaces
CC BY-SA 2.5
null
2008-08-27T18:12:20.203
2009-02-13T17:26:12.433
null
null
2,121
[ "interface" ]
30,764
2
null
30,754
1
null
I would say that you should only sacrifice readability for performance if there's a proven performance problem that's significant. Of course "significant" is the catch there, and what's significant and what isn't should be specific to the code you're working on.
null
CC BY-SA 2.5
null
2008-08-27T18:12:20.407
2008-08-27T18:12:20.407
null
null
2,147
null
30,744
2
null
30,706
2
null
[JQuery](http://jquery.com/) would be a good way to go. And with the [Jquery UI](http://ui.jquery.com/) plugins (such as [draggable](http://docs.jquery.com/UI/Draggables)), it's a breeze.. (there's a [demo](http://ui.jquery.com/repository/real-world/photo-manager/) here). Not using a framework, to keep it 'pure', seem...
null
CC BY-SA 2.5
null
2008-08-27T18:02:54.423
2008-08-27T18:02:54.423
null
null
2,452
null
30,767
2
null
30,754
7
null
Readability is most important. With modern computers, only the most intensive routines of the most demanding applications need to worry too much about performance.
null
CC BY-SA 2.5
null
2008-08-27T18:13:04.913
2008-08-27T18:13:04.913
null
null
3,044
null
30,769
2
null
11,831
1
null
I've used singletons a bunch of times in conjunction with [Spring](http://www.springframework.org/) and didn't consider it a crutch or lazy. What this pattern allowed me to do was create a single class for a bunch of configuration-type values and then share the single (non-mutable) instance of that specific configurat...
null
CC BY-SA 2.5
null
2008-08-27T18:14:06.783
2008-08-27T18:14:06.783
null
null
2,890
null
30,766
2
null
30,729
4
null
You can use C# code and in critical bottleneck points to make it run faster. Those behave much like C++ code and I believe it executes . But most of the time, C# is JIT-ted to uber-fast already, I don't believe there will be much differences as with what everyone has said. But one thing you might want to consider i...
null
CC BY-SA 2.5
null
2008-08-27T18:12:53.773
2008-08-27T18:20:36.657
2008-08-27T18:20:36.657
3,055
3,055
null
30,770
1
null
null
0
3,158
Yes, it sounds crazy....It might be. The final updatepanel does not appear to trigger anything, it just refreshes the update panels and does not call back to the usercontrol hosting it. Any ideas? EDIT: I got it posting back, however the controls inside the final usercontrol have lost their data...I'm thinking its b...
Update Panel inside of a UserControl inside of a Repeater inside of another UpdatePanel
CC BY-SA 2.5
null
2008-08-27T18:14:46.063
2008-09-19T22:32:29.220
2008-09-19T22:32:29.220
811
1,965
[ "asp.net", "asp.net-ajax", "user-controls", "updatepanel" ]
30,771
2
null
30,763
4
null
Personally, I would use a [List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx)<Employee> for creating the list on the backend, and then use [IList](http://msdn.microsoft.com/en-us/library/5y536ey6.aspx) when you return. When you use interfaces, it gives you the flexability to change the implementation without...
null
CC BY-SA 2.5
null
2008-08-27T18:14:52.660
2008-08-27T18:14:52.660
null
null
2,688
null
30,759
2
null
30,710
5
null
Options you have: - - Inject the database. (Example in pseudo-Java, but applies to all OO-languages) class MockDatabase extends Database { public Result query(String query) { return "mock result"; } }class ObjectThatUsesDB { public ObjectThatUsesDB(Database db) { this.database = db; } } - `User``{name...
null
CC BY-SA 2.5
null
2008-08-27T18:11:37.787
2008-08-27T18:11:37.787
null
null
3,105
null
30,773
2
null
30,754
2
null
I apply common sense - this sort of thing is just one of the zillion trade-offs that engineering entails, and has few special characteristics that I can see. But to be more specific, the overwhelming majority of people doing weird unreadable things in the name of performance are doing them prematurely and without meas...
null
CC BY-SA 2.5
null
2008-08-27T18:15:23.813
2008-08-27T18:15:23.813
null
null
987
null
30,768
2
null
29,761
27
null
There's also [gitx](http://www.gitx.org), it's progressing well and under active development (multiple commits per day).
null
CC BY-SA 3.0
null
2008-08-27T18:13:49.793
2011-10-29T11:57:49.740
2011-10-29T11:57:49.740
310,121
444
null
30,774
2
null
30,763
1
null
The best way to do something like this would be to return, as you say, a List, preferably using generics, so it would be List`<Employee`>. Returning a List rather than an ArrayList means that if later you decide to use, say, a LinkedList, you don't have to change any of the code other than where you create the object ...
null
CC BY-SA 2.5
null
2008-08-27T18:15:33.487
2008-08-27T18:15:33.487
null
null
3,044
null
30,776
2
null
3,150
1
null
I like the CxxTest as well for the same reasons. It's a header file only so no linking required. You aren't stuck with Perl as there is a Python runner as well. I will be reviewing the google library soon. The Boost stuff pulls in too much other baggage.
null
CC BY-SA 2.5
null
2008-08-27T18:15:50.350
2008-08-27T18:15:50.350
null
null
2,587,612
null
30,772
2
null
30,710
14
null
The easiest way to unit test an object with database access is using transaction scopes. For example: ``` [Test] [ExpectedException(typeof(NotFoundException))] public void DeleteAttendee() { using(TransactionScope scope = new TransactionScope()) { Attendee anAttendee = Attendee.Get(3); ...
null
CC BY-SA 2.5
null
2008-08-27T18:14:54.220
2008-08-27T18:14:54.220
null
null
2,349
null
30,781
1
30,792
null
0
212
What are the ways to retrieve data submitted to the web server from a form in the client HTML in ASP.NET?
How do I retrieve data sent to the web server in ASP.NET?
CC BY-SA 2.5
null
2008-08-27T18:16:37.510
2017-12-13T12:56:22.263
2017-12-13T12:56:22.263
1,773,603
1,341
[ "html", "asp.net" ]
30,780
2
null
30,763
0
null
Return type for your method should be `IList<Employee>`. That means that the caller of your method can use anything that `IList` offers but cannot use things specific to `ArrayList`. Then if you feel at some point that `LinkedList` or `YourCustomSuperDuperList` offers better performance or other advantages you can sa...
null
CC BY-SA 2.5
null
2008-08-27T18:16:28.477
2009-02-13T17:26:12.433
2009-02-13T17:26:12.433
2,688
3,105
null
30,778
2
null
30,706
0
null
Just trying to avoid large framework downloads to the client for one very small thing, perhaps I am being daft. I had looked at jQuery but also ExtJS, the documentation and UI 'look' seem far superior and professional in ExtJS ... are there particular reasons for you guys recommending jQuery?
null
CC BY-SA 2.5
null
2008-08-27T18:16:01.787
2008-08-27T18:16:01.787
null
null
1,478
null
30,782
2
null
30,754
3
null
You should always go for readability first. The shape of a system will typically evolve as you develop it, and the real performance bottlenecks will be unexpected. Only when you have the system running and can see real evidence - as provided by a profiler or other such tool - will the best way to optimise be revealed. ...
null
CC BY-SA 2.5
null
2008-08-27T18:16:38.290
2008-08-27T18:16:38.290
null
null
1,000
null
30,783
2
null
30,763
0
null
An interface is a contract between the implementation and the user of the implementation. By using an interface, you allow the implementation to change as much as it wants as long as it maintains the contract for the users. It also allows multiple implementations to use the same interface so that users can reuse code...
null
CC BY-SA 2.5
null
2008-08-27T18:17:27.570
2008-08-27T18:17:27.570
null
null
2,284
null
30,786
2
null
30,763
2
null
@ Jason You may as well return IList<> because an array actually implements this interface.
null
CC BY-SA 2.5
null
2008-08-27T18:17:56.430
2008-08-27T18:17:56.430
null
null
1,143
null
30,784
2
null
30,781
0
null
In VB.NET For POST requests: ``` value = Request.Form("formElementID") ``` For GET requests: ``` value = Request.QueryString("formElementID") ```
null
CC BY-SA 2.5
null
2008-08-27T18:17:29.660
2008-08-27T18:17:29.660
null
null
1,341
null
30,789
2
null
30,754
1
null
"Premature optimization is the root of all evil." - Donald Knuth
null
CC BY-SA 2.5
null
2008-08-27T18:18:24.557
2008-08-27T18:18:24.557
null
null
2,600
null
30,788
1
null
null
0
122
Does anyone have a script or can anyone point me in the right direction to query an Exchange (2003) public folder tree to determine all the forms being used ? I need an output of form object/display name and count for each form type in each folder.
In Exchange (2003) how do I list the forms used in the public folder tree?
CC BY-SA 2.5
null
2008-08-27T18:18:16.663
2011-06-21T21:53:09.443
2008-09-09T23:13:42.897
-1
3,300
[ "reporting", "exchange-server", "scripting" ]
30,787
2
null
30,754
4
null
> Programs must be written for people to read, and only incidentally for machines to execute.   — Abelson & Sussman, SICP Well written programs are probably easier to [profile and hence improve performance](http://en.wikipedia.org/wiki/Optimization_%28computer_science%29#When_to_optimize).
null
CC BY-SA 2.5
null
2008-08-27T18:18:15.353
2008-08-27T18:18:15.353
null
null
2,543
null
30,775
1
31,368
null
4
580
How do I use Windows Authentication to connect to an Oracle database? Currently, I just use an Oracle Username and password, however, a requirement is to give the user on install the option of selecting Windows Authentication since we offer the same as SQL.
NHibernate and Oracle connect through Windows Authenication
CC BY-SA 3.0
null
2008-08-27T18:15:39.837
2017-12-16T10:53:16.263
2017-12-16T10:53:16.263
4,803,173
2,469
[ "windows", "oracle", "nhibernate" ]
30,785
2
null
30,763
0
null
You don't say what language you're talking about, but in something .NETish, then it's no more work to return an IList than a List or even an ArrayList, though the mere mention of that obsolete class makes me think you're not talking about .NET.
null
CC BY-SA 2.5
null
2008-08-27T18:17:51.280
2008-08-27T18:17:51.280
null
null
987
null
30,790
1
30,809
null
17
24,423
I can connect with the DataContext to the Oracle database however I get errors in running the query against the oracle database. I looked at the SQL generated and it is for MSSQL and not Oracle PSQL. Does anybody know of a decent easy to use wrapper to use LINQ against an Oracle Database?
Is there a Way to use Linq to Oracle
CC BY-SA 2.5
0
2008-08-27T18:18:29.033
2013-06-07T09:51:23.800
2008-08-27T18:19:00.187
905
2,469
[ "linq", "oracle" ]
30,792
2
null
30,781
4
null
You can also search through both the Form and QueryString collections at the same time so that the data will be found regardless of the the request method. ``` value = Request("formElementID") ```
null
CC BY-SA 2.5
null
2008-08-27T18:19:20.607
2008-08-27T18:19:20.607
null
null
312
null
30,791
2
null
30,754
0
null
at times when optimization is necessary, i'd rather sacrifice compactness and keep the performance enhancement. perl obviously has some deep waters to plumb in search of the conciseness/performance ratio, but as cute as it is to write one-liners, the person who comes along to maintain your code (who in my experience, ...
null
CC BY-SA 2.5
null
2008-08-27T18:18:42.963
2008-08-27T18:18:42.963
null
null
null
null
30,794
2
null
30,763
1
null
If all you are doing is iterating through the list, you can define a method that returns the list as IEnumerable (for .NET). By returning the interface that provides just the functionality you need, if some new collection type comes along in the future that is better/faster/a better match for your application, as long...
null
CC BY-SA 2.5
null
2008-08-27T18:20:34.910
2008-08-27T18:20:34.910
null
null
2,194
null
30,798
2
null
30,706
2
null
JQuery is more focused on a lot of nice utility functions, and makes DOM manipulation a whole lot easier. Basically, I consider it to be Javascript as it should have been. It's a supremely helpful addition to the Javascript language itself. ExtJS is a suite of GUI components with specific APIs... Use it if you want to...
null
CC BY-SA 2.5
null
2008-08-27T18:21:49.667
2008-08-27T18:21:49.667
null
null
3,044
null
30,799
2
null
30,763
0
null
An interface is essentially a contract that a class has certain methods or attributes; programming to an interface rather then a direct implementation allows for more dynamic and manageable code, as you can completely swap out implementations as long as the "contract" is still held. In the case you describe, passing a...
null
CC BY-SA 2.5
null
2008-08-27T18:23:04.390
2008-08-27T18:23:04.390
null
null
1,638
null
30,796
2
null
30,754
29
null
My process for situations where I think performance may be an issue: 1. Make it work. 2. Make it clear. 3. Test the performance. 4. If there are meaningful performance issues: refactor for speed. Note that this does not apply to higher-level design decisions that are more difficult to change at a later stage.
null
CC BY-SA 2.5
null
2008-08-27T18:21:26.327
2008-08-27T18:21:26.327
null
null
1,314
null
30,627
1
30,697
null
2
1,903
I'm looking for the best method to parse various XML documents using a Java application. I'm currently doing this with SAX and a custom content handler and it works great - zippy and stable. I've decided to explore the option having the same program, that currently recieves a single format XML document, receive two ...
How would you use Java to handle various XML documents?
CC BY-SA 2.5
null
2008-08-27T16:55:59.327
2016-04-09T19:24:20.560
2017-05-23T12:33:27.093
-1
828
[ "java", "xml", "sax", "stax" ]
30,802
2
null
30,790
0
null
Not an easy way, at least until a good provider is produced. Really MS should provide at least an OLEDB Linq provider. After all, Linq to Sql is basically an implementation of IQueryable with designer support.
null
CC BY-SA 2.5
null
2008-08-27T18:24:01.640
2008-08-27T18:24:01.640
null
null
905
null
30,809
2
null
30,790
12
null
No, LINQ to SQL is very much MS SQL only - think of it as a client driver. [Microsoft is/was helping Oracle and DataDirect develop providers for Oracle and other non-MS database servers.](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1623471&SiteID=1)
null
CC BY-SA 2.5
null
2008-08-27T18:26:12.213
2008-08-27T18:26:12.213
null
null
35
null
30,811
1
31,139
null
17
7,813
I would like to create a database backed interactive AJAX webapp which has a custom (specific kind of events, editing) calendaring system. This would involve quite a lot of JavaScript and AJAX, and I thought about Google Web Toolkit for the interface and Ruby on Rails for server side. Is Google Web Toolkit reliable an...
Should I use Google Web Toolkit for my new webapp?
CC BY-SA 2.5
0
2008-08-27T18:26:42.023
2011-04-02T06:06:42.293
2008-08-27T18:52:44.770
2,534
2,534
[ "javascript", "ruby", "gwt" ]
30,765
2
null
28,268
1
null
1. I use Parallels. I used Vista for 4 months then switched to XP. I prefer XP as it is faster. 2. Key bindings are quirky. Using function keys while debugging in the hosted XP will trigger events in OS X, effectively popping you out. 3. I have 3 "spaces" set up. One for OS X, one for XP VM, and the last for a RDC to ...
null
CC BY-SA 2.5
null
2008-08-27T18:12:41.917
2008-08-27T20:03:19.843
2008-08-27T20:03:19.843
2,640
2,640
null
30,760
2
null
30,754
8
null
I always start with the most readable version I can think of. If performance is a problem, I refactor. If the readable version makes it hard to generalize, I refactor. The key is to have good tests so that refactoring is easy. I view readability as the #1 most important issue in code, though working correctly is a ...
null
CC BY-SA 2.5
null
2008-08-27T18:11:57.380
2008-08-27T18:11:57.380
null
null
1,190
null