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
16,400
2
null
16,363
0
null
I have also been highly annoyed by that behavior. The only solution I have found is to manually change the properties page for each web appllication so it hits a real running instance in IIS. I prefer this anyway, because debugging with the integrated web server can give you a very false impression of how your applic...
null
CC BY-SA 2.5
null
2008-08-19T15:26:01.020
2008-08-19T15:26:01.020
null
null
1,219
null
16,395
2
null
9,033
24
null
# Partial Methods [Charlie Calvert explains partial methods on his blog](http://blogs.msdn.com/charlie/archive/2007/11/11/partial-methods.aspx) [Scott Cate has a nice partial method demo here](http://weblogs.asp.net/scottcate/archive/2008/06/18/teched-orlando-compiler-tricks.aspx) 1. Points of extensibility in C...
null
CC BY-SA 2.5
null
2008-08-19T15:23:12.040
2008-08-20T17:24:49.830
2008-08-20T17:24:49.830
1,950
1,950
null
16,387
2
null
16,340
1
null
Is using the existing hashcode from the byte array field not good enough? Also note that in the Equals method you should check that the arrays are the same size before doing the compare.
null
CC BY-SA 2.5
null
2008-08-19T15:19:32.203
2008-08-19T15:19:32.203
null
null
748
null
16,406
1
null
null
1
1,503
You can easily use the `PropertyChanges` events to set the flag. But how do you easily reset it after a save to the `ObjectContext`?
Best way to implement a dirty flag in EF
CC BY-SA 3.0
null
2008-08-19T15:30:48.203
2012-04-25T16:37:37.403
2012-04-25T16:37:37.403
1,332,690
1,956
[ "frameworks", "entity" ]
16,408
2
null
16,340
1
null
Generating a good hash is easier said than done. Remember, you're basically representing n bytes of data with m bits of information. The larger your data set and the smaller m is, the more likely you'll get a collision ... two pieces of data resolving to the same hash. The simplest hash I ever learned was simply XOR...
null
CC BY-SA 2.5
null
2008-08-19T15:31:02.757
2008-08-19T15:31:02.757
null
null
1,954
null
16,403
1
16,546
null
7
3,811
One of my biggest typographical frustrations about HTML is the way that it mangles conjoined whitespace. For example if I have: ``` <span>Following punctuation rules. With two spaces after the period. </span> ``` One of the two spaces following the period will be considered to be insignificant whitespace and be r...
How do you handle white space in your HTML
CC BY-SA 2.5
0
2008-08-19T15:27:31.470
2012-07-31T16:03:34.743
2011-09-09T02:35:40.103
540,162
1,948
[ "html", "whitespace" ]
16,409
2
null
16,155
0
null
You could drop off the constructor and just put them in each individual class. Then what you have is each class has its own __construct, which is probably the same depending on if it is a shipper or vendor. If you want to only have those constructs defined once I don't think you want to go down that route. What I thi...
null
CC BY-SA 2.5
null
2008-08-19T15:31:47.390
2008-08-19T15:31:47.390
null
null
1,797
null
16,410
2
null
16,403
1
null
You can use a styled pre block to preserve whitespace. Most WYSIWYG editors also insert &nbsp; for you... Overall, it's good that the browser ignores whitespace. Just view the source on this website for yourself and imagine how crazy the site would look if every space was displayed.
null
CC BY-SA 2.5
null
2008-08-19T15:31:59.277
2008-12-25T01:56:10.583
null
null
40
null
16,385
2
null
15,695
4
null
I've never used (or even heard of) Stripes. Regardless, there's a book from [The Pragmatic Bookshelf](http://www.pragprog.com/) called [Stripes: ...and Java web development is fun again](http://www.pragprog.com/titles/fdstr/stripes) that may be worth checking out. You could also check out the Stripes [mailing list arc...
null
CC BY-SA 2.5
null
2008-08-19T15:19:16.040
2008-08-19T15:19:16.040
null
null
1,318
null
16,412
2
null
16,403
7
null
If you really want your white space to be preserved, try the css property: white-space: pre; Or, you could just use a <pre> tag in your markup. By the way, it's a good thing that HTML browsers ignore white space in general, it allows us to have clearly formatted source code, without affecting the output.
null
CC BY-SA 2.5
null
2008-08-19T15:33:49.630
2008-08-19T15:33:49.630
null
null
1,951
null
16,414
2
null
14,527
14
null
The following is an example of a template that would produce the required output in XSLT 1.0: ``` <xsl:template name="getExtension"> <xsl:param name="filename"/> <xsl:choose> <xsl:when test="contains($filename, '.')"> <xsl:call-template name="getExtension"> <xsl:with-param name="filename" select="subs...
null
CC BY-SA 2.5
null
2008-08-19T15:34:44.903
2008-08-19T15:34:44.903
null
null
1,908
null
16,416
2
null
16,402
2
null
Sounds like `robocopy` tool is exactly what you need. Very replication command-line tool. - [MS TechNet reference](http://technet.microsoft.com/en-us/library/cc733145)- [Wikipedia article](http://en.wikipedia.org/wiki/Robocopy)`robocopy`- [guide](http://atlex.nl/tmp/robocopy_switches.txt)- [guide](http://www.tacktech...
null
CC BY-SA 3.0
null
2008-08-19T15:35:27.163
2012-08-17T15:08:48.130
2012-08-17T15:08:48.130
761,095
770
null
16,411
2
null
16,140
1
null
I really like the [Apache Felix tutorials](http://felix.apache.org/site/tutorials-examples-and-presentations.html). However, I think in general leveraging OSGi in your application isn't one of those "let's use this framework, because it's hype" decision. It's more of a design question, but then everything that OSGi giv...
null
CC BY-SA 2.5
null
2008-08-19T15:32:05.017
2008-08-19T15:32:05.017
null
null
198
null
16,417
2
null
16,403
2
null
It may not be very elegant, but I apply CSS to a <pre> tag. There's always the "white-space" CSS attribute, but it can be a bit hit and miss.
null
CC BY-SA 2.5
null
2008-08-19T15:36:44.710
2008-08-19T15:36:44.710
null
null
1,025
null
16,420
2
null
16,406
1
null
what about the event? See also [http://www.thedatafarm.com/blog/2008/07/13/OverridingObjectContextSaveChanges.aspx](http://www.thedatafarm.com/blog/2008/07/13/OverridingObjectContextSaveChanges.aspx).
null
CC BY-SA 2.5
null
2008-08-19T15:39:20.230
2008-08-19T15:39:20.230
null
null
1,659
null
16,421
2
null
16,403
1
null
Take a look at the [pre tag](http://www.w3schools.com/TAGS/tag_pre.asp). It might do what you want.
null
CC BY-SA 2.5
null
2008-08-19T15:39:58.807
2008-08-19T15:39:58.807
null
null
1,959
null
16,422
2
null
16,413
3
null
This won't solve your problem, but if you only needed lat/long data for these addresses, the Google Maps API will parse non-formatted addresses pretty well.
null
CC BY-SA 2.5
null
2008-08-19T15:40:15.593
2008-08-19T15:40:15.593
null
null
72
null
16,427
2
null
16,403
0
null
You'd better use white-space: pre-wrap than white-space: pre or &nbsp; With your example, the latter solutions can start a new line on "rules.&nbsp;" just because your on-reakable ace hit the end of the line.
null
CC BY-SA 2.5
null
2008-08-19T15:43:17.990
2008-08-19T15:43:17.990
null
null
1,730
null
16,431
2
null
15,133
15
null
Here's one: [http://www.codeplex.com/ResourceRefactoring](http://www.codeplex.com/ResourceRefactoring) It'a actually a Microsoft "open source" Visual Studio(2005 and up) tool that integrates with the IDE. You can easily replace every occurence of a string with a ressource reference with a few clicks.
null
CC BY-SA 2.5
null
2008-08-19T15:45:17.330
2008-08-19T19:18:30.490
2008-08-19T19:18:30.490
1,165,587
1,165,587
null
16,423
2
null
16,413
6
null
Are there any standards at all in the way that the addresses are recorded? For example: 1. Are there always commas or new-lines separating street1 from street2 from city from state from zip? 2. Are address types (road, street, boulevard, etc) always spelled out? always abbreviated? Some of each? 3. Define "error". ...
null
CC BY-SA 2.5
null
2008-08-19T15:40:18.917
2008-08-19T15:40:18.917
null
null
51
null
16,433
2
null
15,695
0
null
We considered it when we were looking at open source frameworks. But we saw the same thing your did that there really just isn't much support or information for it. You should always weight the community support factor surrounding open source projects before picking one. (which is what you are doing here)
null
CC BY-SA 4.0
null
2008-08-19T15:47:10.040
2018-12-19T06:01:47.287
2018-12-19T06:01:47.287
1,997,093
1,940
null
16,432
1
18,342
null
184
99,801
Let's say that you want to output or concat strings. Which of the following styles do you prefer? - `var p = new { FirstName = "Bill", LastName = "Gates" };`- `Console.WriteLine("{0} {1}", p.FirstName, p.LastName);`- `Console.WriteLine(p.FirstName + " " + p.LastName);` Do you rather use format or do you simply concat...
String output: format or concat in C#?
CC BY-SA 3.0
0
2008-08-19T15:46:53.863
2021-07-11T16:29:30.573
2013-10-28T17:41:13.077
63,550
920
[ "c#", "string", "coding-style", "string.format" ]
16,437
2
null
16,432
2
null
I think this depends heavily on how complex the output is. I tend to choose whichever scenario works best at the time. Pick the right tool based on the job :D Whichever looks cleanest!
null
CC BY-SA 2.5
null
2008-08-19T15:50:34.933
2008-08-19T15:50:34.933
null
null
1,951
null
16,436
2
null
16,432
1
null
Personally, the second one as everything you are using is in the direct order it will be output in. Whereas with the first you have to match up the {0} and {1} with the proper var, which is easy to mess up. At least it's not as bad as the C++ sprint where if you get the variable type wrong the whole thing will blow up...
null
CC BY-SA 4.0
null
2008-08-19T15:49:57.010
2021-07-11T16:29:30.573
2021-07-11T16:29:30.573
2,667,173
194
null
16,434
1
129,435
null
8
1,609
Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code? One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like having one matrix being the identity) may not fully test the functionality...
How to test numerical analysis routines?
CC BY-SA 3.0
0
2008-08-19T15:48:07.857
2017-09-30T00:28:58.807
2017-09-30T00:28:58.807
3,924,118
277
[ "testing", "numerical" ]
16,441
2
null
16,432
2
null
I prefer the second as well but I have no rational arguments at this time to support that position.
null
CC BY-SA 2.5
null
2008-08-19T15:51:26.537
2008-08-19T15:51:26.537
null
null
null
null
16,438
2
null
16,432
7
null
For very simple manipulation I'd use concatenation, but once you get beyond 2 or 3 elements Format becomes more appropriate IMO. Another reason to prefer String.Format is that .NET strings are immutable and doing it this way creates fewer temporary/intermediate copies.
null
CC BY-SA 2.5
null
2008-08-19T15:50:44.170
2008-08-19T15:50:44.170
null
null
null
null
16,340
1
null
null
54
50,403
Say I have an object that stores a byte array and I want to be able to efficiently generate a hashcode for it. I've used the cryptographic hash functions for this in the past because they are easy to implement, but they are doing a lot more work than they should to be cryptographically oneway, and I don't care about th...
How do I generate a hashcode from a byte array in C#?
CC BY-SA 3.0
0
2008-08-19T14:55:33.173
2019-05-07T17:41:22.180
2015-06-26T01:24:48.177
63,550
1,948
[ "c#", "hash" ]
16,443
1
null
null
9
21,770
Is it possible (in Vb.Net 2005), without manually parsing the dataset table properties, to create the table and add it to the database? We have old versions of our program on some machines, which obviously has our old database, and we are looking for a way to detect if there is a missing table and then generate the ta...
Create DB table from dataset table
CC BY-SA 2.5
0
2008-08-19T15:51:34.057
2018-12-14T12:19:27.437
2011-01-03T02:05:49.673
481,927
1,936
[ "database", "vb.net", "visual-studio-2005" ]
16,446
2
null
16,413
1
null
There are data services that given a zip code will give you list of street names in that zip code. Use a regex to extract Zip or City State - find the correct one or if a error get both. pull the list of streets from a [data source](http://www.melissadata.com/lookups/zipstreet.asp) Correct the city and state, and then...
null
CC BY-SA 2.5
null
2008-08-19T15:52:48.313
2008-08-19T15:52:48.313
null
null
805
null
16,449
2
null
16,432
5
null
Generally, I prefer the former, as especially when the strings get long it can be much easier to read. The other benefit is I believe one of the performances, as the latter actually performs 2 string creation statements before passing the final string to the `Console.Write` method. `String.Format` uses a StringBuilder ...
null
CC BY-SA 4.0
null
2008-08-19T15:53:59.060
2021-07-11T16:22:43.043
2021-07-11T16:22:43.043
2,667,173
1,908
null
16,448
2
null
16,340
4
null
Have you compared with the [SHA1CryptoServiceProvider.ComputeHash](http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.computehash.aspx) method? It takes a byte array and returns a SHA1 hash, and I believe it's pretty well optimized. I used it in an [Identicon Handler](http://...
null
CC BY-SA 2.5
null
2008-08-19T15:53:28.983
2008-08-19T15:53:28.983
null
null
5
null
16,444
2
null
16,413
119
null
I've done a lot of work on this kind of parsing. Because there are errors you won't get 100% accuracy, but there are a few things you can do to get most of the way there, and then do a visual BS test. Here's the general way to go about it. It's not code, because it's pretty academic to write it, there's no weirdness, j...
null
CC BY-SA 2.5
null
2008-08-19T15:52:05.397
2022-12-25T14:56:20.893
2022-12-25T14:56:20.893
722
722
null
16,450
2
null
9,033
98
null
Maybe not an advanced technique, but one I see all the time that drives me crazy: ``` if (x == 1) { x = 2; } else { x = 3; } ``` can be condensed to: ``` x = (x==1) ? 2 : 3; ```
null
CC BY-SA 2.5
null
2008-08-19T15:54:52.677
2008-08-19T15:54:52.677
null
null
1,865
null
16,451
1
711,398
null
23
14,055
I need to call a web service written in .NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have). The information that I received from the service provider included WSDL, a policyCache.config file, some sample C# code, and a sample applicat...
Calling .NET Web Service (WSE 2/3, WS-Security) from Java
CC BY-SA 2.5
0
2008-08-19T15:54:59.153
2013-11-15T00:18:58.997
null
null
1,958
[ "java", ".net", "axis2", "ws-security", "wse" ]
16,452
2
null
16,432
5
null
For basic string concatenation, I generally use the second style - easier to read and simpler. However, if I am doing a more complicated string combination I usually opt for String.Format. String.Format saves on lots of quotes and pluses... ``` Console.WriteLine("User {0} accessed {1} on {2}.", user.Name, fileName...
null
CC BY-SA 2.5
null
2008-08-19T15:55:01.273
2008-08-19T15:55:01.273
null
null
1,573
null
16,453
2
null
16,434
1
null
Check out a book by [David Gries](http://en.wikipedia.org/wiki/David_Gries) called [The Science of Programming](https://rads.stackoverflow.com/amzn/click/com/0387964800). It's about proving the correctness of programs. If you want to be sure that your programs are correct (to the point of proving their correctness), th...
null
CC BY-SA 2.5
null
2008-08-19T15:55:28.263
2008-08-19T15:55:28.263
null
null
1,318
null
16,322
1
null
null
190
23,020
## Overview One of the things I've asked a lot about on this site is [LINQ](http://msdn.microsoft.com/en-us/netframework/aa904594.aspx). The questions I've asked have been wide and varied and often don't have much context behind them. So in an attempt to consolidate the knowledge I've acquired on Linq I'm posting th...
Learning about LINQ
CC BY-SA 3.0
0
2008-08-19T14:50:43.430
2018-10-05T10:50:03.593
2020-06-20T09:12:55.060
-1
493
[ "linq", "linq-to-sql", "linq-to-entities", "linq-to-objects" ]
16,402
1
16,416
null
0
345
I have a bunch of files that I need to be able to and quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome. My idea for a solution would be to write up a quick script to move files around that I ...
Easy installation method for windows/ Batch Reference needed?
CC BY-SA 3.0
null
2008-08-19T15:26:40.287
2017-02-10T20:06:02.590
2017-02-10T20:06:02.590
1,773,434
652
[ "windows", "batch-file", "installation" ]
16,456
2
null
16,233
2
null
> Note that a responsible web developer does not use fonts that are only available on Windows (and especially ones that are only available on Vista), nor do they use a technology that isn't supported by at least the majority of browsers. There's nothing wrong or incorrect about using Windows/Vista-specific fonts...
null
CC BY-SA 3.0
null
2008-08-19T15:56:26.043
2014-05-03T17:56:12.340
2014-05-03T17:56:12.340
707,111
null
null
16,357
2
null
16,320
2
null
I like a single object to be correlated to a single record in the database, i.e. an object must be instantiated. This is your basic [ActiveRecord](http://martinfowler.com/eaaCatalog/activeRecord.html) pattern. In my experience, the one-object-to-one-row approach creates a much more fluid and literate presentation in ...
null
CC BY-SA 2.5
null
2008-08-19T15:06:37.923
2008-08-19T15:06:37.923
null
null
1,227
null
16,447
1
16,465
null
4
19,160
I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: > connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: `q1 = SELECT column1 INTO #temp FROM databaseA..table1 WHERE xyz="A"` `q2 =...
Select Query on 2 tables, on different database servers
CC BY-SA 4.0
0
2008-08-19T15:53:19.373
2019-03-22T10:32:59.860
2020-06-20T09:12:55.060
-1
1,311
[ "sql", "asp-classic", "vbscript", "sybase" ]
16,455
2
null
16,432
9
null
Concatenating strings is fine in a simple scenario like that - it is more complicated with anything more complicated than that, even LastName, FirstName. With the format you can see, at a glance, what the final structure of the string will be when reading the code, with concatenation it becomes almost impossible to imm...
null
CC BY-SA 2.5
null
2008-08-19T15:56:23.377
2008-08-19T15:56:23.377
null
null
541
null
16,454
2
null
16,413
5
null
Based on the sample data: 1. I would start at the end of the string. Parse a Zip-code (either format). Read end to first space. If no Zip Code was found Error. 2. Trim the end then for spaces and special chars (commas) 3. Then move on to State, again use the Space as the delimiter. Maybe use a lookup list to validate...
null
CC BY-SA 2.5
null
2008-08-19T15:55:41.303
2008-08-19T15:55:41.303
null
null
733
null
16,460
1
16,500
null
2
790
I was writing some control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition. The `RemoveAll` method of the generic `List` class does a good job, but removes items that match the condition, specified by the predicate. What if I want to only remove a c...
Removing N items from a list conditionally
CC BY-SA 3.0
0
2008-08-19T15:57:51.300
2012-04-25T17:01:35.703
2012-04-25T17:01:35.703
1,332,690
1,801
[ ".net" ]
16,464
2
null
16,460
1
null
Unless the method provides a "limit" parameter (which it doesn't) your best option is to go with a simple loop that removes the items that match, breaking when your incremented "match counter" hits your limit. That's pretty much how the internal function works anyway, but in a more optimized way.
null
CC BY-SA 2.5
null
2008-08-19T15:59:41.640
2008-08-19T16:13:05.170
2008-08-19T16:13:05.170
1,951
1,951
null
16,466
2
null
16,460
1
null
In framework 3.5, RemoveAll method takes a predicate as a parameter. So you may use ``` list.RemoveAll(item => ShouldIRemoveThis(item)); ``` where ShouldIRemoveThis is a method that returns a boolean indicating whether the item must be removed from the list.
null
CC BY-SA 2.5
null
2008-08-19T16:00:46.550
2008-08-19T16:00:46.550
null
null
31,505
null
16,468
2
null
16,460
0
null
Can you use LINQ? If so, you can just use the .Take() method and specify how many records you want (maybe as total - N).
null
CC BY-SA 2.5
null
2008-08-19T16:01:11.543
2008-08-19T16:01:11.543
null
null
5
null
16,465
2
null
16,447
4
null
With both queries, it looks like you are trying to insert into #temp. #temp is located on one of the databases (for arguments sake, databaseA). So when you try to insert into #temp from databaseB, it reports that it does not exist. Try changing it from to in both statements. Also, make sure that the connection str...
null
CC BY-SA 2.5
null
2008-08-19T15:59:47.833
2008-08-19T16:28:32.783
2008-08-19T16:28:32.783
51
51
null
16,470
2
null
16,402
0
null
I like to use VBscript for this kind of thing. The VBS engine is on every recent windows machine and the language is a little more like real programming than a batch script. Also, if your installer grows to require WMI functions too, this becomes a piece of cake.
null
CC BY-SA 2.5
null
2008-08-19T16:01:41.323
2008-08-19T16:01:41.323
null
null
1,490
null
16,463
2
null
16,432
4
null
1. Formatting is the “.NET” way of doing it. Certain refactoring tools (Refactor! for one) will even propose to refactor the concat-style code to use the formatting style. 2. Formatting is easier to optimize for the compiler (although the second will probably be refactored to use the 'Concat' method which is fast). 3....
null
CC BY-SA 2.5
null
2008-08-19T15:59:21.623
2008-08-19T15:59:21.623
null
null
1,968
null
16,471
2
null
16,432
6
null
While I totally understand the style preference and picked concatenation for my first answer partly based on my own preference, part of my decision was based on the thought that concatenation would be faster. So, out of curiosity, I tested it and the results were staggering, especially for such a small string. Using ...
null
CC BY-SA 2.5
null
2008-08-19T16:02:27.967
2008-08-19T16:02:27.967
null
null
194
null
16,472
2
null
16,413
6
null
Another request for sample data. As has been mentioned I would work backwards from the zip. Once you have a zip I would query a zip database, store the results, and remove them & the zip from the string. That will leave you with the address mess. MOST (All?) addresses will start with a number so find the first occ...
null
CC BY-SA 2.5
null
2008-08-19T16:03:28.387
2008-08-19T16:03:28.387
null
null
null
null
16,474
2
null
16,447
2
null
# temp is out of scope in q2. All your work can be done in one query: ``` SELECT a.columnA, a.columnB,..., a.columnZ FROM table2 a INNER JOIN (SELECT databaseA..table1.column1 FROM databaseA..table1 WHERE databaseA..table1.xyz = 'A') b ON a.columnB = b.column1 ```
null
CC BY-SA 2.5
null
2008-08-19T16:03:52.160
2008-08-19T16:03:52.160
2020-06-20T09:12:55.060
-1
1,960
null
16,473
1
16,484
null
20
6,853
Say we have the following method: ``` private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) => { firedCount++;Console.Write(firedCount);}; foo.MethodThatFiresAnEvent(); } ``` If the class with this method is instantiated...
Can using lambdas as event handlers cause a memory leak?
CC BY-SA 3.0
0
2008-08-19T16:03:46.187
2012-06-27T13:20:33.513
2012-04-25T17:01:41.663
1,332,690
null
[ "memory-leaks", "lambda", "event-handling" ]
16,461
2
null
16,447
4
null
your temp table is out of scope, it is only 'alive' during the first connection and will not be available in the 2nd connection Just move all of it in one block of code and execute it inside one conection
null
CC BY-SA 2.5
null
2008-08-19T15:58:06.463
2008-08-19T15:58:06.463
null
null
740
null
16,482
2
null
9,033
9
null
Preprocessor Directives can be nifty if you want different behavior between Debug and Release modes. [http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx](http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx)
null
CC BY-SA 2.5
null
2008-08-19T16:07:50.390
2008-08-19T16:07:50.390
null
null
1,767
null
16,475
2
null
16,413
17
null
I've done this in the past. Either do it manually, (build a nice gui that helps the user do it quickly) or have it automated and check against a recent address database (you have to buy that) and manually handle errors. Manual handling will take about 10 seconds each, meaning you can do 3600/10 = 360 per hour, so 40...
null
CC BY-SA 2.5
null
2008-08-19T16:04:45.340
2008-08-19T16:31:12.993
2008-08-19T16:31:12.993
479
479
null
16,480
2
null
16,432
4
null
I'd use the `String.Format`, but I would also have the format string in the resource files so it can be localised for other languages. Using a simple string concat doesn't allow you to do that. Obviously, if you won't ever need to localise that string, this isn't a reason to think about it. It really depends on what th...
null
CC BY-SA 4.0
null
2008-08-19T16:06:37.880
2021-07-11T16:26:25.620
2021-07-11T16:26:25.620
2,667,173
1,367
null
16,484
2
null
16,473
16
null
Yes, save it to a variable and unhook it. ``` DelegateType evt = (o, e) => { firedCount++; Console.Write(firedCount); }; foo.AnEvent += evt; foo.MethodThatFiresAnEvent(); foo.AnEvent -= evt; ``` And yes, if you don't, you'll memory, as you'll hook up a new delegate object each time. You'll also notice this because ...
null
CC BY-SA 2.5
null
2008-08-19T16:08:24.663
2008-08-19T16:08:24.663
null
null
267
null
16,413
1
16,444
null
133
160,871
Problem: I have an address field from an Access database which has been converted to SQL Server 2005. This field has everything all in one field. I need to parse out the address's individual sections into their appropriate fields in a normalized table. I need to do this for approximately 4,000 records, and it needs to ...
Parse usable Street Address, City, State, Zip from a string
CC BY-SA 4.0
0
2008-08-19T15:34:41.703
2022-12-25T14:56:20.893
2021-02-08T07:36:45.097
7,927,776
149
[ "string", "parsing", "sql-server-2005", "street-address" ]
16,489
2
null
16,473
4
null
You wont just leak memory, you will also get your lambda called multiple times. Each call of 'PotentialMemoryLeaker' will add another copy of the lambda to the event list, and every copy will be called when 'AnEvent' is fired.
null
CC BY-SA 2.5
null
2008-08-19T16:11:30.227
2008-08-19T16:11:30.227
null
null
1,367
null
16,486
2
null
16,473
0
null
Yes in the same way that normal event handlers can cause leaks. Because the lambda is actually changed to: ``` someobject.SomeEvent += () => ...; someobject.SomeEvent += delegate () { ... }; // unhook Action del = () => ...; someobject.SomeEvent += del; someobject.SomeEvent -= del; ``` So basically it is just ...
null
CC BY-SA 3.0
null
2008-08-19T16:09:37.283
2012-06-27T13:20:33.513
2012-06-27T13:20:33.513
7,116
17
null
16,487
1
1,449,595
null
12
8,594
I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism doesn't seem to work unless you do some manual preparation work. I have come across some old postings on oth...
How can I deploy artifacts from a Maven build to the SourceForge File Release System?
CC BY-SA 2.5
0
2008-08-19T16:11:16.297
2010-12-09T19:52:08.020
null
null
1,969
[ "java", "maven-2", "sourceforge" ]
16,478
2
null
16,451
0
null
[CXF](http://cwiki.apache.org/CXF20DOC/ws-support.html) - I'd look into CXF. I've used it to create a web service and client in java using ws-secuirty. I also connected a .net web service to it. They have pretty good documentation too. I had more luck with it than axis.
null
CC BY-SA 2.5
null
2008-08-19T16:06:09.003
2008-08-19T16:06:09.003
null
null
1,310
null
16,491
1
16,502
null
50
88,202
How do you restore a database backup using SQL Server 2005 over the network? I recall doing this before but there was something odd about the way you had to do it.
Restore database backup over the network
CC BY-SA 2.5
0
2008-08-19T16:13:31.813
2019-02-01T10:17:42.900
2014-11-25T21:06:35.830
2,641,576
1,545
[ "sql-server", "database", "sql-server-2005", "backup", "restore" ]
16,496
2
null
16,460
5
null
@buyutec Instead of ``` list.RemoveAll(item => ShouldIRemoveThis(item)); ``` you can use: ``` list.RemoveAll(ShouldIRemoveThis); ``` The lambda has the same signature as the method, so they are equivalent so you can just pass the method directly.
null
CC BY-SA 2.5
null
2008-08-19T16:18:23.100
2008-08-19T16:18:23.100
null
null
1,367
null
16,497
2
null
15,656
2
null
In IIS, check the settings on the application pool that SSRS is running in. On the properties pane->Performance tab you can set the amount of time the worker process needs to be idle for before it shuts down. You can also disable this entirely.
null
CC BY-SA 2.5
null
2008-08-19T16:18:30.463
2008-08-19T16:18:30.463
null
null
1,644
null
16,493
2
null
16,460
0
null
Anonymous delegates are useful here. A simple example to remove the first even numbers from a list. ``` List<int> myList = new List<int>; for (int i = 0; i < 20; i++) myList.add(i); int total = 0; int limit = 5; myList.RemoveAll(delegate(int i) { if (i % 2 == 0 && total < limit) { total++; return true; } return fals...
null
CC BY-SA 2.5
null
2008-08-19T16:16:08.470
2008-08-19T16:16:08.470
null
null
1,200
null
16,498
2
null
16,473
2
null
Your example just compiles to a compiler-named private inner class (with field firedCount and a compiler-named method). Each call to PotentialMemoryLeaker creates a new instance of the closure class to which where foo keeps a reference by way of a delegate to the single method. If you don't reference the whole object ...
null
CC BY-SA 2.5
null
2008-08-19T16:19:24.453
2008-08-19T16:19:24.453
null
null
1,659
null
16,499
2
null
16,451
2
null
- [http://ws.apache.org/axis/java/user-guide.html#UsingWSDLWithAxis](http://ws.apache.org/axis/java/user-guide.html#UsingWSDLWithAxis)- [http://ebay.custhelp.com/cgi-bin/ebay.cfg/php/enduser/std_adp.php?p_faqid=1230](http://ebay.custhelp.com/cgi-bin/ebay.cfg/php/enduser/std_adp.php?p_faqid=1230)
null
CC BY-SA 2.5
null
2008-08-19T16:19:51.177
2008-08-19T16:19:51.177
null
null
150
null
16,501
1
16,509
null
840
372,979
For a person without a comp-sci background, what is a lambda in the world of Computer Science?
What is a lambda (function)?
CC BY-SA 3.0
0
2008-08-19T16:20:37.650
2022-08-13T21:41:45.270
2014-07-04T06:04:33.790
661,933
1,344
[ "lambda", "language-agnostic", "computer-science", "terminology", "theory" ]
16,500
2
null
16,460
8
null
If you want to specify both a limit for number of items to remove and a condition to select the items to remove, you can use this approach: ``` int limit = 30; // Suppose you want to remove 30 items at most list.RemoveAll(item => ShouldIRemoveThis(item) && limit-- > 0); ```
null
CC BY-SA 2.5
null
2008-08-19T16:19:51.397
2008-08-19T16:19:51.397
null
null
31,505
null
16,502
2
null
16,491
22
null
The database is often running as a service under an account with no network access. If this is the case, then you wouldn't be able to restore directly over the network. Either the backup needs to be copied to the local machine or the database service needs to run as a user with the proper network access.
null
CC BY-SA 2.5
null
2008-08-19T16:20:53.687
2008-08-19T16:20:53.687
null
null
533
null
16,505
2
null
16,501
4
null
You can think of it as an anonymous function - here's some more info: [Wikipedia - Anonymous Function](http://en.wikipedia.org/wiki/Anonymous_function)
null
CC BY-SA 2.5
null
2008-08-19T16:23:33.073
2008-08-19T16:23:33.073
null
null
1,951
null
16,507
2
null
16,403
0
null
The PRE tag can be a valid solution, depending on your needs. However, if you are trying to use the 2 space rule in sentences throughout your site, you'll soon find that the other characters the PRE tag preserves are the line feed/carriage returns (or lack of) will muck up any styling you try to do. In general, I t...
null
CC BY-SA 2.5
null
2008-08-19T16:25:02.367
2008-08-19T16:25:02.367
null
null
1,580
null
16,504
2
null
16,501
64
null
It refers to [lambda calculus](http://en.wikipedia.org/wiki/Lambda_calculus), which is a formal system that just has lambda expressions, which represent a function that takes a function for its sole argument and returns a function. All functions in the lambda calculus are of that type, i.e., `λ : λ → λ`. Lisp used the...
null
CC BY-SA 3.0
null
2008-08-19T16:23:19.033
2018-02-01T20:50:01.897
2018-02-01T20:50:01.897
2,756,409
1,659
null
16,511
2
null
16,501
3
null
It is a function that has no name. For e.g. in c# you can use ``` numberCollection.GetMatchingItems<int>(number => number > 5); ``` to return the numbers that are greater than 5. ``` number => number > 5 ``` is the lambda part here. It represents a function which takes a parameter (number) and returns a boolean v...
null
CC BY-SA 2.5
null
2008-08-19T16:28:41.753
2008-08-19T16:28:41.753
null
null
31,505
null
16,512
2
null
15,851
1
null
This question was not about optimizing the algorithm - but thanks anyway ;-) At the time I wrote it, I considered the labeled continue as a readable solution. I asked SO a [question](https://stackoverflow.com/questions/15481/java-coding-standard-best-practices-labeled-brakecontinue#15501) about the convention (havin...
null
CC BY-SA 2.5
null
2008-08-19T16:28:43.093
2008-08-19T16:28:43.093
2017-05-23T12:10:51.083
-1
1,870
null
16,513
2
null
16,501
9
null
I like the explanation of Lambdas in this article: [The Evolution Of LINQ And Its Impact On The Design Of C#](http://msdn.microsoft.com/en-us/magazine/cc163400.aspx). It made a lot of sense to me as it shows a real world for Lambdas and builds it out as a practical example. Their quick explanation: Lambdas are a way t...
null
CC BY-SA 2.5
null
2008-08-19T16:29:06.027
2008-08-19T16:29:06.027
null
null
5
null
16,510
2
null
16,501
114
null
A lambda is a type of function, defined inline. Along with a lambda you also usually have some kind of variable type that can hold a reference to a function, lambda or otherwise. For instance, here's a C# piece of code that doesn't use a lambda: ``` public Int32 Add(Int32 a, Int32 b) { return a + b; } public Int...
null
CC BY-SA 3.0
null
2008-08-19T16:27:49.320
2011-11-23T01:44:01.113
2011-11-23T01:44:01.113
558,592
267
null
16,457
2
null
16,432
1
null
I actually like the first one because when there are a lot of variables intermingled with the text it seems easier to read to me. Plus, it is easier to deal with quotes when using the string.Format(), uh, format. Here is [decent analysis](http://blog.cumps.be/string-concatenation-vs-memory-allocation/) of string concat...
null
CC BY-SA 2.5
null
2008-08-19T15:57:20.567
2008-08-19T15:57:20.567
null
null
1,962
null
16,517
1
16,519
null
45
24,140
I'm working on a quick setup program in Visual Studio and wanted to change the banner bitmap. Anyone know off-hand what the ideal (or the required) dimensions are for the new banner image? Thanks.
Image size for BannerBitmap property in Windows Installer
CC BY-SA 3.0
0
2008-08-19T16:32:01.417
2017-11-28T20:32:47.417
2014-03-03T15:15:34.387
1,683
1,683
[ "windows-installer" ]
16,458
1
137,090
null
9
3,296
I'm using `ColdFusion` to return a result set from a SQL database and turn it into a list. I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available. I'm looking to generate something like this: ``` A | B | C | ...      - A - A - B - B - B - C - D ...
Dynamic Alphabetical Navigation
CC BY-SA 3.0
0
2008-08-19T15:57:33.827
2020-03-01T01:32:13.547
2017-12-14T07:02:20.910
4,248,328
666
[ "javascript", "jquery", "sql", "html", "coldfusion" ]
16,519
2
null
16,517
76
null
Found it on MSDN docs for [BannerBitmap Property](https://msdn.microsoft.com/en-us/library/3kbk77sf(v=vs.100).aspx): > For best results, you should use a bitmap with dimensions of 500 pixels wide by 70 pixels high.
null
CC BY-SA 3.0
null
2008-08-19T16:33:47.560
2017-11-28T20:32:47.417
2017-11-28T20:32:47.417
975,724
1,683
null
16,509
2
null
16,501
1,196
null
Lambda comes from the [Lambda Calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and refers to anonymous functions in programming. Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this. ...
null
CC BY-SA 4.0
null
2008-08-19T16:27:22.643
2020-04-22T10:01:10.667
2020-04-22T10:01:10.667
257,796
1,797
null
16,515
2
null
13,678
0
null
I started with LabVIEW about 2 years ago and now use it all the time so may be biased but find it ideal for applications where data acquisition and control are involved. We use LabVIEW mainly for testing where we take continuous measurements and control gas valves and ATE enclosures. This involves both digital and ana...
null
CC BY-SA 2.5
null
2008-08-19T16:31:17.987
2008-08-19T17:57:57.920
2008-08-19T17:57:57.920
186
186
null
16,525
2
null
16,233
3
null
You can of course use [SIFR](http://www.mikeindustries.com/blog/sifr/). This degrades gracefully in browsers that do not support it and is accessible. It's not really suitable for using on loads of text but for headings and highlight text it's perfect. Of course this is a work around to an intrinsic limitation of br...
null
CC BY-SA 3.0
null
2008-08-19T16:42:13.003
2013-04-02T15:27:24.190
2013-04-02T15:27:24.190
830,691
1,970
null
16,516
2
null
16,473
3
null
Well you can extend what has been done [here](http://diditwith.net/PermaLink,guid,aacdb8ae-7baa-4423-a953-c18c1c7940ab.aspx) to make delegates safer to use (no memory leaks)
null
CC BY-SA 2.5
null
2008-08-19T16:31:26.020
2008-08-19T16:31:26.020
null
null
380
null
16,528
2
null
15,496
62
null
I think another "overlooked" feature of java is the JVM itself. It is probably the best VM available. And it supports lots of interesting and useful languages (Jython, JRuby, Scala, Groovy). All those languages can easily and seamlessly cooperate. If you design a new language (like in the scala-case) you immediately h...
null
CC BY-SA 2.5
null
2008-08-19T16:47:35.740
2008-08-19T16:47:35.740
null
null
1,870
null
16,531
2
null
16,413
8
null
> This won't solve your problem, but if you only needed lat/long data for these addresses, the Google Maps API will parse non-formatted addresses pretty well. Good suggestion, alternatively you can execute a CURL request for each address to Google Maps and it will return the properly formatted address. From t...
null
CC BY-SA 2.5
null
2008-08-19T16:51:08.913
2008-08-19T16:51:08.913
null
null
40
null
16,490
2
null
16,483
2
null
HTTPS requests are not cached so sending an doesn't make any sense. The not caching is a security precaution.
null
CC BY-SA 2.5
null
2008-08-19T16:12:00.897
2008-08-19T16:12:00.897
null
null
17
null
16,514
2
null
16,501
17
null
Slightly oversimplified: a lambda function is one that can be passed round to other functions and it's logic accessed. In C# lambda syntax is often compiled to simple methods in the same way as anonymous delegates, but it can also be broken down and its logic read. For instance (in C#3): ``` LinqToSqlContext.Where( ...
null
CC BY-SA 2.5
null
2008-08-19T16:30:34.913
2008-08-19T17:40:58.097
2008-08-19T17:40:58.097
905
905
null
16,535
2
null
16,529
0
null
I'd implement some sort of custom `text serialization` and transmit plain text. As you say, you can rebuild the information doing the reversed process.
null
CC BY-SA 3.0
null
2008-08-19T16:51:42.937
2012-08-11T16:07:40.477
2012-08-11T16:07:40.477
1,477,076
1,782
null
16,529
1
16,549
null
3
1,275
I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/radio), mandatory status, and the general sorting o...
Communication between Javascript and the server
CC BY-SA 3.0
null
2008-08-19T16:49:30.913
2015-10-14T12:53:30.417
2015-10-14T12:53:30.417
5,284,246
1,951
[ "javascript", "server" ]
16,527
2
null
16,413
4
null
If it's human entered data, then you'll spend too much time trying to code around the exceptions. Try: 1. Regular expression to extract the zip code 2. Zip code lookup (via appropriate government DB) to get the correct address 3. Get an intern to manually verify the new data matches the old
null
CC BY-SA 2.5
null
2008-08-19T16:47:16.677
2008-08-19T16:47:16.677
null
null
175
null
16,532
2
null
16,233
11
null
This is a timely thread; we switched to Arial because Calibri is WAY small compared to all the other fallback fonts! It pained me greatly to switch to (gag) Arial because it's a crap copy of Helvetica: [http://www.ms-studio.com/articles.html](http://www.ms-studio.com/articles.html) The sizing difficulties (too big if...
null
CC BY-SA 2.5
null
2008-08-19T16:51:17.103
2008-08-19T16:51:17.103
null
null
1
null
16,540
2
null
13,204
0
null
Is cron sending emails with logs? If not, pipe the output of cron to a log file. Make sure to redirect STDERR to the log.
null
CC BY-SA 2.5
null
2008-08-19T16:56:04.113
2008-08-19T16:56:04.113
null
null
175
null
16,545
2
null
16,458
1
null
I would get the SQL result set to return the list in the first place, you can easily just take the first letter of the required item, and a count. The quickest way would be to do a join on a table of 26 characters (less string manipulation that way). In CF use the count value to ensure that if there is no result you ...
null
CC BY-SA 2.5
null
2008-08-19T16:59:39.413
2008-08-19T16:59:39.413
null
null
null
null
16,544
2
null
12,855
2
null
I don't know whether this would work in DB2, but I'll tell you how I'd do this in SQL Server. I the way MSSQL does this is ANSI standard, though the specific collation strings may differ. Anyway, if you can do this without trashing the rest of your application -- are there other places where the "name" column needs ...
null
CC BY-SA 2.5
null
2008-08-19T16:59:22.657
2008-08-19T17:07:22.033
2008-08-19T17:07:22.033
1,818
1,818
null