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
11,685
2
null
11,635
63
null
If you are on a POSIX system, you can use [strcasecmp](http://www.opengroup.org/onlinepubs/009695399/functions/strcasecmp.html). This function is not part of standard C, though, nor is it available on Windows. This will perform a case-insensitive comparison on 8-bit chars, so long as the locale is POSIX. If the loca...
null
CC BY-SA 3.0
null
2008-08-14T20:46:03.803
2015-06-04T14:13:48.350
2015-06-04T14:13:48.350
346,335
872
null
11,781
2
null
11,767
6
null
You could just use the `FolderBrowserDialog` class from the `System.Windows.Forms` namespace.
null
CC BY-SA 3.0
null
2008-08-14T23:32:21.720
2016-01-17T12:55:49.683
2016-01-17T12:55:49.683
490,018
489
null
11,770
2
null
11,764
2
null
> If 2 is true, then that seems bad if someone is using that specific page or DLL and it gets overwritten. It's not really an issue if you're using ASP.NET stack (Webforms, MVC or rolling your own) because all your aspx files get compiled and therefore not touched by webserver. /bin/ folder is completely shadowed somew...
null
CC BY-SA 2.5
null
2008-08-14T23:21:58.387
2008-11-17T12:28:08.517
2020-06-20T09:12:55.060
-1
275
null
11,780
2
null
11,199
1
null
Remotesoft offers a linker - $1250 for a single developer license: [http://www.remotesoft.com/linker/index.html](http://www.remotesoft.com/linker/index.html) If your application will run on Mono (and Mono's Winform desktop support is pretty good now), you can package your app as a Mono bundle, which is a single execut...
null
CC BY-SA 2.5
null
2008-08-14T23:31:35.327
2008-08-14T23:31:35.327
null
null
5
null
11,782
1
null
null
4
1,787
Is it possible to upload a file from a client's computer to the server through a web service? The client can be running anything from a native desktop app to a thin ajax client.
File Uploads via Web Services
CC BY-SA 2.5
null
2008-08-14T23:33:01.253
2015-12-14T09:19:02.697
2015-12-14T09:19:02.697
2,125,973
831
[ ".net", "web-services", "file-upload", "upload" ]
11,789
2
null
11,761
3
null
What about using a global or static collection object? Is that a good idea?
null
CC BY-SA 2.5
null
2008-08-14T23:39:07.497
2008-08-14T23:39:07.497
null
null
1,381
null
11,783
1
null
null
25
3,816
Given an empty method body, will the JIT optimize out the call (I know the C# compiler won't). How would I go about finding out? What tools should I be using and where should I be looking? Since I'm sure it'll be asked, the reason for the empty method is a preprocessor directive. --- @Chris: Makes sense, but it c...
In .NET, will empty method calls be optimized out?
CC BY-SA 3.0
0
2008-08-14T23:33:35.010
2017-04-18T13:50:15.460
2017-04-18T13:50:15.460
4,099,593
34
[ ".net", "performance" ]
11,800
2
null
11,767
1
null
Please don't try and roll your own with a TreeView/DirectoryInfo class. For one thing there are many nice features you get for free (icons/right-click/networks) by using SHBrowseForFolder. For another there are a edge cases/catches you will likely not be aware of.
null
CC BY-SA 2.5
null
2008-08-15T00:03:45.700
2008-08-15T00:03:45.700
null
null
1,043
null
11,791
2
null
11,783
2
null
No, empty methods are never optimized out. Here are a couple reasons why: - - Edit: Yes, from looking at that (exellent) code project doc the JITer will eliminate calls to empty methods. But the methods themselves will still be compiled and part of your binary for the reasons I listed.
null
CC BY-SA 2.5
null
2008-08-14T23:39:53.377
2008-08-14T23:53:20.430
2008-08-14T23:53:20.430
322
322
null
11,801
1
11,803
null
5
368
What's the general consensus on supporting Windows 2000 for software distribution? Are people supporting Windows XP SP2+ for new software development or is this too restrictive still?
What's the general consensus on supporting Windows 2000?
CC BY-SA 2.5
0
2008-08-15T00:05:13.760
2010-02-07T00:24:02.877
2010-02-07T00:24:02.877
748
748
[ "windows", "deployment", "compatibility" ]
11,794
2
null
11,783
15
null
This chap has quite a good treatment of JIT optimisations, do a search on the page for 'method is empty', it's about half way down the article - [http://www.codeproject.com/KB/dotnet/JITOptimizations.aspx](http://www.codeproject.com/KB/dotnet/JITOptimizations.aspx) Apparently empty methods do get optimised out throug...
null
CC BY-SA 3.0
null
2008-08-14T23:43:29.903
2013-11-24T07:37:39.103
2013-11-24T07:37:39.103
419
419
null
11,802
2
null
11,764
0
null
We do most of our updates in the wee small hours. Handy hint, if this is an ASP.NET site, whatever time of the day you roll out, drop in an App_Offline.htm file with a message explaining to users that the site is down for maintenance. Scott Guthrie has more info here: [http://weblogs.asp.net/scottgu/archive/2006/04...
null
CC BY-SA 2.5
null
2008-08-15T00:07:21.917
2008-08-15T00:07:21.917
null
null
419
null
11,803
2
null
11,801
8
null
"OK" is a subjective judgement. You'll need to take a look at your client base and see what they're using. Having said that, I dropped support for Win2K over a year ago with no negative impact.
null
CC BY-SA 2.5
null
2008-08-15T00:07:22.867
2008-08-15T00:07:22.867
null
null
722
null
11,792
2
null
11,783
1
null
All things being equal, yes it should be optimized out. The JIT inlines functions where appropriate and there are few things more appropriate than empty functions :) If you really want to be sure then change your empty method to throw an exception and print out the stack trace it contains.
null
CC BY-SA 2.5
null
2008-08-14T23:41:30.080
2008-08-14T23:41:30.080
null
null
1,043
null
11,805
2
null
11,801
0
null
A lot of computers at my company use Win2k, so we couldn't really drop support. It all depends on the client base.
null
CC BY-SA 2.5
null
2008-08-15T00:09:02.100
2008-08-15T00:09:02.100
null
null
30
null
11,807
2
null
11,801
0
null
With XP being 5/6 years old now, I think most home users will be using it, but many business users may still be using it. all in all, it depends on your target audience. Personally I would regard Windows 2000 support as a bonus rather than a requirement.
null
CC BY-SA 2.5
null
2008-08-15T00:09:46.683
2008-08-15T00:09:46.683
null
null
428
null
11,806
1
448,051
null
13
15,322
I'm trying to run powershell commands through a web interface (ASP.NET/C#) in order to create mailboxes/etc on Exchange 2007. When I run the page using Visual Studio (Cassini), the page loads up correctly. However, when I run it on IIS (v5.1), I get the error "unknown user name or bad password". The biggest problem tha...
How do you impersonate an Active Directory user in Powershell?
CC BY-SA 2.5
0
2008-08-15T00:09:16.407
2009-09-30T18:35:51.107
2009-03-10T02:24:30.793
5,640
889
[ "c#", "asp.net", "powershell", "active-directory" ]
11,811
2
null
11,806
2
null
In your ASP.NET app, you will need to impersonate a valid AD account with the correct permissions: [http://support.microsoft.com/kb/306158](http://support.microsoft.com/kb/306158)
null
CC BY-SA 2.5
null
2008-08-15T00:16:34.347
2008-08-15T00:24:05.110
2008-08-15T00:24:05.110
419
419
null
11,804
1
920,922
null
9
3,709
I'm working on a web service at the moment and there is the potential that the returned results could be quite large ( > 5mb). It's perfectly valid for this set of data to be this large and the web service can be called either sync or async, but I'm wondering what people's thoughts are on the following: 1. If the c...
Returning Large Results Via a Webservice
CC BY-SA 2.5
0
2008-08-15T00:08:15.533
2013-04-11T08:24:05.390
2008-08-23T19:09:16.730
2,134
493
[ "c#", ".net", "web-services" ]
11,808
2
null
11,801
0
null
This is very subjective, it really depends who you're selling to. If it's average Joe then Windows 2K owners are going to be at best a percent or two of your target market. If it's the military (who I believe still run 2K on their toughbooks) then you're in trouble.
null
CC BY-SA 2.5
null
2008-08-15T00:10:10.770
2008-08-15T00:10:10.770
null
null
1,043
null
11,747
2
null
11,690
1
null
Where's your Japanese input coming from? It could be that it's in a non-unicode (e.g. [http://en.wikipedia.org/wiki/JIS_X_0208](http://en.wikipedia.org/wiki/JIS_X_0208)) encoding, whereas your file is in unicode so the browser attempts to interpret the non-unicode characters as unicode and gets confused. I tried throwi...
null
CC BY-SA 2.5
null
2008-08-14T22:43:07.733
2008-08-14T22:43:07.733
null
null
1,370
null
11,823
2
null
11,804
0
null
I somewhat disagree with secretGeek's comment: > That's already happening for you -- it's called tcp/ip ;-) Re-implementing that could be overkill. There are times when you may want to do just this, but really only from a UI perspective. If you implement some way to either stream the data to the client (via somethin...
null
CC BY-SA 2.5
null
2008-08-15T00:31:36.360
2008-08-15T00:31:36.360
null
null
122
null
11,825
2
null
11,801
0
null
Its fine by me :) The company i work for (mining and construction) with <15k employees and we don't support Wink2k and have not for a while.
null
CC BY-SA 2.5
null
2008-08-15T00:31:58.373
2008-08-15T00:31:58.373
null
null
713
null
11,815
2
null
11,809
17
null
`<span>` is an inline element. The term is meaningless unless you're talking about a paragraph (which generally means a block element). You can, of course, change the margins on `<p>` or `<div>` or any other block element to get rid of extra vertical space between paragraphs. You may want something like `display: run...
null
CC BY-SA 3.0
null
2008-08-15T00:20:58.440
2013-06-25T19:19:25.640
2013-06-25T19:19:25.640
811
811
null
11,809
1
11,815
null
33
29,364
The only thing I've found has been; ``` .hang { text-indent: -3em; margin-left: 3em; } ``` The only way for this to work is putting text in a paragraph, which causes those horribly unsightly extra lines. I'd much rather just have them in a `<span class="hang"></span>` type of thing. I'm also looking for a w...
How to create an all browser-compatible hanging indent style in CSS in a span
CC BY-SA 3.0
0
2008-08-15T00:12:20.923
2021-04-15T14:26:08.830
2015-04-29T13:52:03.417
362
362
[ "html", "css", "indentation" ]
11,820
1
11,832
null
5
1,498
This [question and answer](https://stackoverflow.com/questions/11782/file-uploads-via-web-services) shows how to send a file as a byte array through an XML web service. How much overhead is generated by using this method for file transfer? I assume the data looks something like this: ``` <?xml version="1.0" encoding=...
How much extra overhead is generated when sending a file over a web service as a byte array?
CC BY-SA 2.5
null
2008-08-15T00:29:57.563
2015-06-30T03:43:19.153
2017-05-23T10:32:50.377
-1
26
[ "xml", "web-services" ]
11,830
2
null
11,820
0
null
I use this method for some internal corporate webservices, and I haven't noticed any major slow-downs (but that doesn't mean it's not there). You could probably use any of the numerous network traffic analysis tools to measure the size of the data, and make a judgment call based off that.
null
CC BY-SA 2.5
null
2008-08-15T00:36:54.073
2008-08-15T00:36:54.073
null
null
952
null
11,813
2
null
11,804
2
null
There's no hard law against 5 Mb as a result set size. Over 400 Mb can be [hard to send](http://msdn.microsoft.com/en-us/library/aa528822.aspx). You'll automatically get async handlers (since you're using .net) > implement some sort of "paging" where the resultset is generated and stored on the server and the cli...
null
CC BY-SA 2.5
null
2008-08-15T00:18:19.303
2008-08-15T00:18:19.303
null
null
49
null
11,819
2
null
10,933
3
null
I use [Warehouse](http://warehouseapp.com), as Lubos already pointed out, and it works very well. I looked at one point for a .NET version, but I was never able to find one. I was also at a point where I wanted to better myself as a programmer by learning a new language, and I ventured into learning Ruby and [Ruby on R...
null
CC BY-SA 3.0
null
2008-08-15T00:25:34.937
2016-11-26T17:45:07.157
2016-11-26T17:45:07.157
63,550
1,117
null
11,834
2
null
11,820
0
null
I'm not sure about all the details (compressing, encoding, etc) but I usually just use [WireShark](http://www.wireshark.org/) to analyze the network traffic (while trying various methods) which then allows you to see exactly how it's sent. For example, if it's compressed the data block of the packet shouldn't be reada...
null
CC BY-SA 2.5
null
2008-08-15T00:40:14.033
2008-08-15T00:40:14.033
null
null
194
null
11,831
1
null
null
69
20,097
Singletons are a hotly debated design pattern, so I am interested in what the Stack Overflow community thought about them. Please provide reasons for your opinions, not just "Singletons are for lazy programmers!" Here is a fairly good article on the issue, although it is against the use of Singletons: [scientificninj...
Singletons: good design or a crutch?
CC BY-SA 4.0
0
2008-08-15T00:39:01.150
2019-06-06T20:19:06.977
2019-06-06T20:19:06.977
637,987
1,366
[ "language-agnostic", "design-patterns", "singleton" ]
11,826
2
null
11,761
6
null
Extending on [Ice^^Heat](https://stackoverflow.com/questions/11761/persisting-data-in-net-web-service-memory#11779)'s idea, you might want to think about where you would cache - either cache the contents of the json file in the Application cache like so: ``` Context.Cache.Insert("foo", _ Foo, _ ...
null
CC BY-SA 2.5
null
2008-08-15T00:32:04.923
2008-08-15T00:32:04.923
2017-05-23T12:32:33.343
-1
952
null
11,858
2
null
11,724
1
null
We encountered an issue like this and found that it was a group policy issue. There's a group policy setting for debugging that needs to be enabled. It overrides the fact that you are in the right group.
null
CC BY-SA 2.5
null
2008-08-15T01:11:30.290
2008-08-15T01:11:30.290
null
null
697
null
11,840
2
null
11,820
0
null
To echo what Kevin said, in .net web services if you have a byte array it is sent as a base64 encoded string by default. You can also specify the encoding of the byte array beforehand. Obviously, once it gets to the server (or client) you need to manually decode the string back into a byte array as this isn't done au...
null
CC BY-SA 2.5
null
2008-08-15T00:48:55.420
2008-08-15T00:48:55.420
null
null
493
null
11,857
1
null
null
28
7,517
I would like to gauge what solutions other people put in place to get Team System functionality. We all know that Team System can be pricey for some of us. I know they offer a small team edition with five licenses with a MSDN subscription, but what if your team is bigger than five or you don't want to use Team System...
What do you use as a good alternative to Team System?
CC BY-SA 2.5
0
2008-08-15T01:05:30.520
2016-02-18T17:08:56.010
2016-02-18T17:08:56.010
781,754
1,117
[ "svn", "tfs", "cruisecontrol.net", "fogbugz" ]
11,832
2
null
11,820
11
null
Typically a byte array is sent as a `base64` encoded string, not as individual bytes in tags. [http://en.wikipedia.org/wiki/Base64](http://en.wikipedia.org/wiki/Base64) The `base64` encoded version is about of the size of the original content.
null
CC BY-SA 3.0
null
2008-08-15T00:39:05.987
2015-06-30T03:43:19.153
2015-06-30T03:43:19.153
725,306
9
null
11,839
2
null
11,831
27
null
The purpose of a Singleton is to ensure a class has only one instance, and provide a global point of access to it. Most of the time the focus is on the single instance point. Imagine if it were called a Globalton. It would sound less appealing as this emphasizes the (usually) negative connotations of a global variable....
null
CC BY-SA 2.5
null
2008-08-15T00:48:40.523
2008-08-15T00:48:40.523
null
null
748
null
11,859
2
null
11,854
0
null
Sometimes it's worth giving up the ideal for the realistic. If it's going to cause a massive problem to "do it right" with no real benefit, then I would do it wrong. With that said, I often think it's worth taking the time to do it right, because unnecessary multiple inheritance increases complexity, and it contribu...
null
CC BY-SA 2.5
null
2008-08-15T01:13:01.660
2008-08-15T01:13:01.660
null
null
872
null
11,842
2
null
11,724
0
null
You could try running "`VsJITDebugger.exe -p <PID>`" on the command line. I've had a simalar situation and been able to debug the application using the above. "`VsJITDebugger.exe /?`" will show you all the options. The PID can be found either in the task manager (view->Select Columns...) or Visual Studio's Attach to ...
null
CC BY-SA 2.5
null
2008-08-15T00:50:17.103
2008-08-15T00:50:17.103
null
null
788
null
11,868
2
null
11,854
0
null
"Doing it right" will have benefits in the long run, if only because someone maintaining the system later will find it easier to comprehend if it was done right to begin with. Depending on the language, you may well have the option of multiple inheritance, but normally simple interfaces make the most sense. By "simpl...
null
CC BY-SA 2.5
null
2008-08-15T01:29:00.770
2008-08-15T01:29:00.770
null
null
1,389
null
11,860
2
null
11,854
0
null
Normally when we talk about 'is a' vs 'has a' we're talking about Inheritance vs Composition. Um...damage counter would just be attribute of one of your derived classes and wouldn't really be discussed in terms of 'A person is a damage counter' with respect to your question. See this: [http://www.artima.com/designte...
null
CC BY-SA 2.5
null
2008-08-15T01:15:32.417
2008-08-15T01:28:42.843
2017-05-23T12:13:37.900
-1
419
null
11,854
1
11,935
null
6
1,600
In a project our team is using object lists to perform mass operations on sets of data that should all be processed in a similar way. In particular, different objects would ideally act the same, which would be very easily achieved with polymorphism. The problem I have with it is that inheritance implies the relation...
Inheritance and Polymorphism - Ease of use vs Purity
CC BY-SA 2.5
null
2008-08-15T01:00:47.690
2010-01-18T21:29:48.753
2008-09-21T07:38:09.493
2,193
1,256
[ "c++", "inheritance", "oop", "polymorphism" ]
11,873
2
null
11,804
0
null
So it sounds like you'd be interested in a solution that adds 'starting record number' and 'final record number' parameter to your web method. (or 'page number' and 'results per page') This shouldn't be too hard if the backing store is sql server (or even mysql) as they have built in support for row numbering. Despit...
null
CC BY-SA 2.5
null
2008-08-15T01:40:05.410
2008-08-15T01:40:05.410
null
null
49
null
11,866
2
null
10,808
3
null
The including class (the thing that inherits from `ActiveRecord::Base`, which, in this case is `Iso`) define its own `after_initialize`, so any solution other than `alias_method_chain` (or other aliasing that saves the original) risks overwriting code. @Orion Edwards' solution is the best I can come up with. There a...
null
CC BY-SA 2.5
null
2008-08-15T01:28:04.920
2008-08-15T01:42:12.567
2008-08-15T01:42:12.567
1,190
1,190
null
11,874
2
null
11,857
2
null
I use SourceGear's Fortress on my home computer for personal development. Its free for a single user.
null
CC BY-SA 2.5
null
2008-08-15T01:44:11.003
2008-08-15T01:44:11.003
null
null
1,254
null
11,877
2
null
11,831
1
null
Singletons have their uses, but one must be careful in using and exposing them, because they are [way too easy to abuse](http://dotnet.kapenilattex.com/?p=35), difficult to truly unit test, and it is easy to create circular dependencies based on two singletons that accesses each other. It is helpful however, for when ...
null
CC BY-SA 2.5
null
2008-08-15T01:48:54.927
2008-08-15T01:48:54.927
null
null
372
null
11,869
2
null
11,854
0
null
@Andrew > The ideal of "acting the same" and polymorphism are absolutely unrelated. How does polymorphism make it easy to achieve? They all have, e.g., one function in common. Let's call it `addDamage()`. If you want to do something like this: ``` foreach (obj in mylist) obj.addDamage(1) ``` Then you need ei...
null
CC BY-SA 2.5
null
2008-08-15T01:29:19.193
2008-08-15T01:29:19.193
null
null
872
null
11,875
2
null
11,857
4
null
I've had a lot of success with the nice integration between SourceGear vault and FogBugz. MS Build for build automation meets my needs.
null
CC BY-SA 2.5
null
2008-08-15T01:44:36.103
2008-08-15T01:44:36.103
null
null
49
null
11,879
1
11,899
null
6
5,218
Instead of returning a common string, is there a way to return classic objects? If not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities?
Is it possible to return objects from a WebService?
CC BY-SA 2.5
null
2008-08-15T01:51:48.663
2009-01-27T12:21:09.750
2008-08-23T18:41:27.453
2,134
391
[ "web-services" ]
11,883
2
null
11,879
3
null
Yes: in .NET they call this serialization, where objects are serialized into XML and then reconstructed by the consuming service back into its original object type or a surrogate with the same data structure.
null
CC BY-SA 2.5
null
2008-08-15T01:56:31.540
2008-08-15T01:56:31.540
null
null
372
null
11,740
1
32,476
null
4
1,127
In a web application like wiki or forums or blogging software, it is often useful to store your data in a relational database. Since many hosting companies offer a single database with their hosting plans (with additional databases costing extra) it is very useful for your users when your database objects (tables, view...
Configurable Table Prefixes with a .Net OR/M?
CC BY-SA 4.0
0
2008-08-14T22:32:58.860
2021-04-01T06:39:17.587
2021-04-01T06:38:20.343
9,193,372
1,336
[ ".net", "orm" ]
11,881
2
null
11,854
5
null
I think you should be implementing interfaces to be able to enforce your relationships (am doing this in C#): ``` public interface IDamageable { void AddDamage(int i); int DamageCount {get;} } ``` You could implement this in your objects: ``` public class Person : IDamageable public class House : IDamagea...
null
CC BY-SA 2.5
null
2008-08-15T01:54:52.993
2008-08-15T01:54:52.993
null
null
372
null
11,884
2
null
11,879
5
null
If the object can be serialised to XML and can be described in WSDL then yes it is possible to return objects from a webservice.
null
CC BY-SA 2.5
null
2008-08-15T01:57:01.367
2008-08-15T01:57:01.367
null
null
419
null
11,891
2
null
11,887
3
null
Are you running your PowerShell or Command Prompt as an Administrator? I found this to be the first place to look until you get used to User Access Control or by turning User Access Control off.
null
CC BY-SA 2.5
null
2008-08-15T02:06:02.830
2008-08-15T02:06:02.830
null
null
1,117
null
11,878
1
11,932
null
8
848
I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer: 1) ORM (if so, which one?) 2) Linq2Sql 3) Stored Procedures 4) Parametrized Queries I really need a solution...
Best .NET Solution for Frequently Changed Database
CC BY-SA 2.5
0
2008-08-15T01:50:02.473
2012-03-22T00:27:07.337
2012-03-22T00:27:07.337
3
285
[ ".net", "database", "change-management" ]
11,890
2
null
11,878
0
null
You're already happy with stored procs and they might be enough to abstract away the changing schema. If ORMs aren't happy with stored procs then maybe they'd work with Views that you keep current on top of the changing schema.
null
CC BY-SA 2.5
null
2008-08-15T02:05:46.747
2008-08-15T02:05:46.747
null
null
1,042
null
11,886
2
null
11,878
1
null
[NHibernate](http://www.hibernate.org/343.html), but only if you would be amenable to having an object-first approach wherein you define your classes, and then define your desired table structure in the mapping files, and then create a database schema using NHibernate's built in schema generation classes. For doing it...
null
CC BY-SA 2.5
null
2008-08-15T02:00:55.353
2008-08-15T02:00:55.353
null
null
372
null
11,895
2
null
11,831
31
null
A singleton is just a bunch of global variables in a fancy dress. Global variables have their uses, as do singletons, but if you think you're doing something cool and useful with a singleton instead of using a yucky global variable (everyone knows globals are bad mmkay), you're unfortunately misled.
null
CC BY-SA 2.5
null
2008-08-15T02:12:11.260
2008-08-15T02:12:11.260
null
null
234
null
11,862
2
null
11,854
0
null
This question is really confusing :/ Your question in bold is very open-ended and has an answer of "it depends", but your example doesn't really give much information about the context from which you are asking. These lines confuse me; > > sets of data that should all be processed in a similar way What way? Are the ...
null
CC BY-SA 2.5
null
2008-08-15T01:17:13.803
2008-08-15T01:17:13.803
null
null
1,043
null
11,864
2
null
11,854
0
null
@Kevin > Normally when we talk about 'is a' vs 'has a' we're talking about Inheritance vs Composition.Um...damage counter would just be attribute of one of your derived classes and wouldn't really be discussed in terms of 'A person is a damage counter' with respect to your question. Having the damage counter as an attr...
null
CC BY-SA 2.5
null
2008-08-15T01:22:11.953
2008-08-15T01:22:11.953
2020-06-20T09:12:55.060
-1
872
null
11,900
2
null
11,879
1
null
.NET automatically does this with objects that are serializable. I'm pretty sure Java works the same way. Here is an article that talks about object serialization in .NET: [http://www.codeguru.com/Csharp/Csharp/cs_syntax/serialization/article.php/c7201](http://www.codeguru.com/Csharp/Csharp/cs_syntax/serialization/art...
null
CC BY-SA 2.5
null
2008-08-15T02:24:07.583
2008-08-15T02:24:07.583
null
null
357
null
11,896
2
null
10,072
0
null
[DynamicDrive has an easy favicon maker too](http://tools.dynamicdrive.com/favicon/). Different pages/directories can also call a different .ico with code similar to y0mbo's example (this is what Mint uses): ``` <link href="sc/ph645.43/images/icons/mint.ico" rel="icon" type="text/x-icon" /> ``` [This](http://peris...
null
CC BY-SA 2.5
null
2008-08-15T02:16:03.013
2008-10-17T21:00:01.277
null
null
null
null
11,902
2
null
11,879
2
null
Where possible, I transpose the objects into XML - this means that the Web Service is more portable - I can then access the service in whatever language, I just need to create the parser/object transposer in that language. Because we have WSDL files describing the service, this is almost automated in some systems. (F...
null
CC BY-SA 2.5
null
2008-08-15T02:26:02.463
2008-08-15T02:26:02.463
null
null
188
null
11,887
1
11,898
null
15
8,155
I get an Access is Denied error message when I use the strong name tool to create a new key to sign a .NET assembly. This works just fine on a Windows XP machine but it does not work on my Vista machine. ``` PS C:\users\brian\Dev\Projects\BELib\BELib> sn -k keypair.snk Microsoft (R) .NET Framework Strong Name Utilit...
sn.exe fails with Access Denied error message
CC BY-SA 3.0
0
2008-08-15T02:01:13.217
2021-08-23T19:45:30.507
2012-06-29T11:06:48.107
1,288
1,254
[ ".net", "strongname", "sn.exe" ]
11,907
2
null
11,632
5
null
This may be considered syntax, but VB.NET is case sensitive while C# is case .
null
CC BY-SA 2.5
null
2008-08-15T02:44:56.683
2008-08-15T02:44:56.683
null
null
357
null
11,898
2
null
11,887
31
null
> Yes I have tried running PS and the regular command prompt as administrator. The same error message comes up. Another possible solution could be that you need to give your user account access to the key container located at C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys
null
CC BY-SA 2.5
null
2008-08-15T02:22:18.227
2008-08-15T02:29:33.937
2008-08-15T02:29:33.937
1,117
1,117
null
11,903
1
13,820
null
10
2,882
My website will be using only OpenID for authentication. I'd like to pull user details down via attribute exchange, but attribute exchange seems to have caused a lot of grief for StackOverflow. What is the current state of play in the industry? Does any OpenID provider do a decent job of attribute exchange? Should ...
OpenID Attribute Exchange - should I use it?
CC BY-SA 2.5
0
2008-08-15T02:29:50.553
2010-04-17T08:52:02.277
2008-08-15T06:53:29.100
257
257
[ "authentication", "openid" ]
11,911
2
null
11,831
1
null
I find you have to be very careful about you're deciding to use a singleton. As others have mentioned, it's essentially the same issue as using global variables. You must be very cautious and consider what you could be doing by using one. It's very rare to use them and usually there is a better way to do things. I've...
null
CC BY-SA 2.5
null
2008-08-15T02:50:15.003
2008-08-15T02:50:15.003
null
null
392
null
11,914
2
null
11,831
5
null
I've been trying to think of a way to come to the poor singelton's rescue here, but I must admit it's hard. I've seen very few legitimate uses of them and with the current drive to do dependency injection andd unit testing they are just hard to use. They definetly are the "cargo cult" manifestation of programming wit...
null
CC BY-SA 2.5
null
2008-08-15T02:54:53.653
2008-08-15T02:54:53.653
null
null
1,327
null
11,899
2
null
11,879
7
null
As mentioned, you can do this in .net via serialization. By default all native types are serializable so this happens automagically for you. However if you have complex types, you need to mark the object with the [Serializable] attribute. The same goes with complex types as properties. So for example you need to have...
null
CC BY-SA 2.5
null
2008-08-15T02:23:16.150
2008-08-15T02:23:16.150
null
null
493
null
11,905
2
null
11,831
38
null
Google has a [Singleton Detector](http://code.google.com/p/google-singleton-detector/) for Java that I believe started out as a tool that must be run on all code produced at Google. The nutshell reason to remove Singletons: > because they can make testing difficult and hide problems with your design For a more...
null
CC BY-SA 2.5
null
2008-08-15T02:40:44.337
2008-09-15T17:19:34.103
2008-09-15T17:19:34.103
700
700
null
11,912
2
null
11,500
2
null
I wrote a [blog post](http://terrapinstation.wordpress.com/2008/06/12/aspnet-http-comression-and-reducing-response-size/) about improving ASP.NET page performance this a couple months back. Here are some quick & easy ways - - - - -
null
CC BY-SA 2.5
null
2008-08-15T02:53:37.370
2008-08-15T02:53:37.370
null
null
357
null
11,915
1
11,920
null
115
44,389
How would you reccommend handling RSS Feeds in ASP.NET MVC? Using a third party library? Using the RSS stuff in the BCL? Just making an RSS view that renders the XML? Or something completely different?
RSS Feeds in ASP.NET MVC
CC BY-SA 2.5
0
2008-08-15T02:56:41.030
2017-06-10T22:54:31.713
2012-07-13T06:27:33.550
727,208
571
[ "asp.net-mvc", "rss" ]
11,917
2
null
11,857
2
null
I use [VisualSVN Server](http://www.visualsvn.com/) for source control, [Mingle](http://studios.thoughtworks.com/mingle-project-intelligence) for project management and bug tracking, and [Team City](http://www.jetbrains.com/teamcity/) for continous integration. I'm still getting used to it, but it's working great so f...
null
CC BY-SA 2.5
null
2008-08-15T03:03:14.387
2008-08-15T03:03:14.387
null
null
571
null
11,919
1
11,924
null
10
10,014
Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scratch. PHP and MySQL are essential for ins...
How do I get PHP and MySQL working on IIS 7.0?
CC BY-SA 3.0
0
2008-08-15T03:05:13.273
2014-12-22T20:25:27.637
2014-12-22T20:25:27.637
1,438,393
1,392
[ "php", "mysql", "iis-7" ]
11,904
2
null
11,761
3
null
To echo [klughing](https://stackoverflow.com/questions/11761/persisting-data-in-net-web-service-memory#11789), if your JSON data isn't expected to change often, I think the simplest way to cache it is to use a static collection of some kind - perhaps a DataTable. First, parse your JSON data into a System.Data.DataTabl...
null
CC BY-SA 2.5
null
2008-08-15T02:36:03.660
2008-08-15T02:36:03.660
2017-05-23T12:09:38.363
-1
357
null
11,921
2
null
11,919
0
null
It's supposed to work via FastCGI. But I haven't had great success (using Vista). I can get PHP to run, but it crashes after a page loads (FastCGI does). So I'm modding you up. I'd like to see a reliable answer myself.
null
CC BY-SA 2.5
null
2008-08-15T03:20:12.293
2008-08-15T03:20:12.293
null
null
534
null
11,924
2
null
11,919
6
null
Have you taken a look at this: [http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/](http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/) MySQL should be pretty straight forward. Let us know what problems you're encountering...
null
CC BY-SA 3.0
null
2008-08-15T03:24:09.337
2013-11-24T07:34:49.403
2013-11-24T07:34:49.403
419
419
null
11,920
2
null
11,915
65
null
Here is what I recommend: 1. Create a class called RssResult that inherits off the abstract base class ActionResult. 2. Override the ExecuteResult method. 3. ExecuteResult has the ControllerContext passed to it by the caller and with this you can get the data and content type. 4. Once you change the content type to r...
null
CC BY-SA 2.5
null
2008-08-15T03:12:49.623
2008-08-15T03:18:50.173
2008-08-15T03:18:50.173
1,117
1,117
null
11,929
2
null
11,879
1
null
@Brian: I don't know how things work in Java, but in .net objects get serialized down to XML, not base64 strings. The webservice publishes a wsdl file that contains the method and object definitions required for your webservice. I would hope that nobody creates webservices that simply create a base64 string
null
CC BY-SA 2.5
null
2008-08-15T03:31:00.507
2008-08-15T03:31:00.507
null
null
493
null
11,923
2
null
11,879
2
null
It is possible to return objects from a web service using XML. But Web Services are supposed to be platform and operating system agnostic. Serializing an object simply allows you to store and retrieve an object from a byte stream, such as a file. For instance, you can serialize a Java object, convert that binary str...
null
CC BY-SA 2.5
null
2008-08-15T03:22:56.140
2008-08-15T03:22:56.140
null
null
725
null
11,930
1
12,030
null
17
32,074
How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gateway's IP? This is somewhat easy in .NET if you know your way around. But how do you do it in Java?
How can I determine the IP of my router/gateway in Java?
CC BY-SA 2.5
0
2008-08-15T03:32:28.897
2020-03-12T09:33:20.563
2014-07-09T06:09:09.890
3,302,887
338
[ "java", "sockets", "ip", "router" ]
11,936
2
null
11,887
3
null
Why not fire up sysinternals Process Monitor too see what you can see, it's the first thing I always do when I get any kind of access denied message? [http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx](http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx)
null
CC BY-SA 2.5
null
2008-08-15T03:43:15.350
2008-08-15T03:43:15.350
null
null
419
null
11,926
1
11,957
null
13
22,277
I'm new to MVC (and ASP.Net routing). I'm trying to map `*.aspx` to a controller called `PageController`. ``` routes.MapRoute( "Page", "{name}.aspx", new { controller = "Page", action = "Index", id = "" } ); ``` Wouldn't the code above map *.aspx to `PageController`? When I run this and type in any .asp...
ASP.Net MVC route mapping
CC BY-SA 4.0
0
2008-08-15T03:25:31.657
2019-03-19T12:09:06.123
2019-03-19T12:09:06.123
238,631
105
[ "c#", "asp.net", "asp.net-mvc", "routes" ]
11,935
2
null
11,854
3
null
This can be accomplished using multiple inheritance. In your specific case (C++), you can use pure virtual classes as interfaces. This allows you to have multiple inheritance without creating scope/ambiguity problems. Example: ``` class Damage { virtual void addDamage(int d) = 0; virtual int getDamage() = 0...
null
CC BY-SA 2.5
null
2008-08-15T03:41:05.930
2008-08-15T03:41:05.930
null
null
725
null
11,934
2
null
11,831
0
null
I really disagree on the idea. Singletons are really useful when used to solve the right problem. Let me give you a real example. I once developed a small piece of software to a place I worked, and some forms had to use some info about the company, its employees, services and prices. At its first version, the syst...
null
CC BY-SA 2.5
null
2008-08-15T03:40:26.870
2008-08-15T03:40:26.870
null
null
431
null
11,938
2
null
11,857
3
null
Sourcegear's suite of products are a very nice alternative. Vault + Dragnet + Fortress are nice, however if you can't afford all of those, Vault + FogBugz is a pretty decent alternative.
null
CC BY-SA 2.5
null
2008-08-15T03:44:10.153
2008-08-18T18:55:40.067
2008-08-18T18:55:40.067
905
493
null
11,932
2
null
11,878
6
null
One key thing to be aware of here is that if the database schema is changing frequently, you want to have some level of compile time type safety. I've found this to be a problem with NHibernate because it uses xml mapping files so if you change something in your database schema, you don't know until runtime that the ma...
null
CC BY-SA 2.5
null
2008-08-15T03:37:32.430
2008-08-15T03:37:32.430
null
null
493
null
11,949
2
null
11,878
5
null
I'd look at SubSonic with the build provider (Website Project) setup. That works great because it automatically regenerates the DAL objects every time you build your project, so if the database changes in a way that breaks your code, you get a build error. It worked well until the database schema got really complex an...
null
CC BY-SA 2.5
null
2008-08-15T03:57:06.273
2008-08-15T03:57:06.273
null
null
5
null
11,937
2
null
11,926
0
null
Not sure how your controller looks, the error seems to be pointing to the fact that it can't find the controller. Did you inherit off of Controller after creating the PageController class? Is the PageController located in the Controllers directory? Here is my route in the Global.asax.cs ``` routes.MapRoute( "Pa...
null
CC BY-SA 2.5
null
2008-08-15T03:43:38.110
2008-08-15T03:51:43.787
2008-08-15T03:51:43.787
1,117
1,117
null
11,954
2
null
11,632
0
null
When it gets to IL its all just bits. That case insensitivity is just a precompiler pass. But the general consensus is, vb is more verbose. If you can write c# why not save your eyes and hands and write the smaller amount of code to do the same thing.
null
CC BY-SA 2.5
null
2008-08-15T04:18:07.557
2008-08-15T04:18:07.557
null
null
1,220
null
11,946
2
null
11,926
6
null
I just answered my own question. I had the routes backwards (Default was above page). Below is the correct order. So this brings up the next question... how does the "Default" route match (I assume they use regular expressions here) the "Page" route? ``` routes.MapRoute( "Page", "{Name}.aspx...
null
CC BY-SA 2.5
null
2008-08-15T03:54:03.080
2008-08-15T03:54:03.080
null
null
105
null
11,956
2
null
888
1
null
In a production environment, I log relevant data to the server's error log with error_log().
null
CC BY-SA 2.5
null
2008-08-15T04:23:02.617
2008-08-15T04:23:02.617
null
null
null
null
11,942
2
null
9
1,104
null
This is a strange way to do it, but if you format the date to `yyyymmdd` and subtract the date of birth from the current date then drop the last 4 digits you've got the age :) I don't know C#, but I believe this will work in any language. ``` 20080814 - 19800703 = 280111 ``` Drop the last 4 digits = `28`. C# Code:...
null
CC BY-SA 4.0
null
2008-08-15T03:47:29.100
2019-12-24T08:46:01.893
2019-12-24T08:46:01.893
5,407,188
1,310
null
11,960
2
null
11,930
1
null
Try shelling out to traceroute if you have it. 'traceroute -m 1 www.amazon.com' will emit something like this: ``` traceroute to www.amazon.com (72.21.203.1), 1 hops max, 40 byte packets 1 10.0.1.1 (10.0.1.1) 0.694 ms 0.445 ms 0.398 ms ``` Parse the second line. Yes, it's ugly, but it'll get you going until s...
null
CC BY-SA 2.5
null
2008-08-15T04:25:23.160
2008-08-15T04:25:23.160
null
null
528
null
11,958
2
null
10,595
5
null
Check out [rubigen](http://rubigen.rubyforge.org). You can also view a [presentation](http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html) by dr nic.
null
CC BY-SA 2.5
null
2008-08-15T04:24:56.700
2008-08-15T04:40:41.350
2008-08-15T04:40:41.350
529
529
null
11,965
2
null
11,950
0
null
My team uses [log4net](http://logging.apache.org/log4net/index.html) from Apache. It's pretty lightweight and easy to setup. Best of all, it's completely configurable from the web.config file, so once you've got the hooks in your code setup, you can completely change the way logging is done just by changing the web.c...
null
CC BY-SA 2.5
null
2008-08-15T04:33:02.613
2008-08-15T04:33:02.613
null
null
423
null
11,967
2
null
11,950
30
null
I use [elmah](http://code.google.com/p/elmah/). It has some really nice features and here is a [CodeProject](http://www.codeproject.com/KB/aspnet/ELMAHDemo.aspx) article on it. I think the StackOverflow team uses elmah also!
null
CC BY-SA 2.5
null
2008-08-15T04:34:49.817
2008-08-15T04:34:49.817
null
null
1,117
null
11,961
2
null
11,950
0
null
We use a custom homegrown logging util we wrote. It requires you to implement logging on your own everywhere you need it. But, it also allows you to capture a lot more than just the exception. For example our code would look like this: ``` Try Dim p as New Person() p.Name = "Joe" p.Age = 30 Catch ex as Except...
null
CC BY-SA 3.0
null
2008-08-15T04:26:53.653
2017-05-30T20:15:57.020
2017-05-30T20:15:57.020
13,531
225
null
11,957
2
null
11,926
6
null
> I just answered my own question. I had the routes backwards (Default was above page). Yeah, you have to put all custom routes above the Default route. > So this brings up the next question... how does the "Default" route match (I assume they use regular expressions here) the "Page" route? The Default rou...
null
CC BY-SA 2.5
null
2008-08-15T04:24:44.190
2008-08-15T04:24:44.190
null
null
1,117
null