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
31,754
2
null
6,484
7
null
The problem with TypeMock is that it excuses bad design. Now, I know that it is often bad design that it's hiding, but permitting it into your development process can lead very easily to permitting your own bad designs. I think if you're going to use a mocking framework, you should use a traditional one (like Moq) an...
null
CC BY-SA 2.5
null
2008-08-28T07:04:19.113
2008-08-28T07:04:19.113
null
null
1,554
null
31,796
2
null
31,794
9
null
You have to reference the System.configuration assembly (note the lowercase) I don't know why this assembly is not added by default to new projects on Visual Studio, but I find myself having the same problem every time I start a new project. I always forget to add the reference.
null
CC BY-SA 2.5
null
2008-08-28T07:33:35.317
2008-08-28T07:44:10.673
2008-08-28T07:44:10.673
2,954
2,954
null
31,800
1
31,825
null
4
467
I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send an HTTP 3xx redirect to the canonical URI? Is the most appropriate redirect?...
How to respond to an alternate URI in a RESTful web service
CC BY-SA 2.5
0
2008-08-28T07:36:46.383
2008-09-19T11:27:00.110
2008-09-19T11:27:00.110
2,670
2,670
[ "language-agnostic", "http", "rest" ]
31,783
2
null
31,572
10
null
Take a look at [sctp](http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol) which has a combination of tcp and udp features. There is a windows [implementation](http://www.sctp.be/sctplib/index.htm) available.
null
CC BY-SA 2.5
null
2008-08-28T07:24:02.827
2008-08-28T07:24:02.827
null
null
842
null
31,806
2
null
31,790
1
null
@jdiaz Of course you should strive to have very different business matters in different services, but consider the case in which you want that, for example, all your services implement a GetVersion() operation. You could have a service contract just for that operation and have every service implement it, instead of ad...
null
CC BY-SA 2.5
null
2008-08-28T07:40:35.517
2008-08-28T07:40:35.517
null
null
2,954
null
31,797
2
null
29,324
23
null
You can use double-braces to set up the data. You still call add, or put, but it's less ugly: ``` private static final Hashtable<String,Integer> MYHASH = new Hashtable<String,Integer>() {{ put("foo", 1); put("bar", 256); put("data", 3); put("moredata", 27); put("hello", 32); pu...
null
CC BY-SA 2.5
null
2008-08-28T07:34:55.953
2008-08-28T07:34:55.953
null
null
974
null
31,801
2
null
31,794
0
null
You are missing the reference to System.Configuration.
null
CC BY-SA 2.5
null
2008-08-28T07:36:57.867
2008-08-28T07:36:57.867
null
null
2,374
null
31,799
1
31,810
null
4
3,334
OK, so following on from my question on [XML Serialization and Inherited Types](https://stackoverflow.com/questions/20084/xml-serialization-and-inherited-types), I began integrating that code into my application I am working on, stupidly thinking all will go well.. I ran into problems with a couple of classes I have t...
Preventing XML Serialization of IEnumerable and ICollection<T> & Inherited Types
CC BY-SA 2.5
null
2008-08-28T07:36:40.020
2009-06-26T10:45:02.843
2020-06-20T09:12:55.060
-1
832
[ "xml", "inheritance", "serialization", ".net-2.0" ]
31,808
2
null
31,790
0
null
A service can theoretically have any number of Endpoints, and each Endpoint is bound to a particular contract, or interface, so it is possible for a single conceptual (and configured) service to host multiple interfaces via multiple endpoints or alternatively for several endpoints to host the same interface. If you ar...
null
CC BY-SA 2.5
null
2008-08-28T07:43:27.710
2008-08-28T07:43:27.710
null
null
541
null
31,812
1
null
null
0
709
In MS Access 2003 (I know, I know), I'm using the OLE Object data type to persist the sate of some objects that are marked as serializable (just using a IO.BinaryFormatter to serialize to a MemoryStream, and then saving that to the db as a Byte array). Does this work pretty much like a varbinary, or a blob? Are there...
Performance issues regarding Access 2003 and the OLE Object data type
CC BY-SA 2.5
null
2008-08-28T07:47:37.777
2013-09-30T01:07:58.670
null
null
1,493
[ "ms-access", "serialization", "oledb" ]
31,809
2
null
31,790
18
null
WCF services can have multiple endpoints, each of which can implement a different service contract. For example, you could have a service declared as follows: ``` [ServiceBehavior(Namespace = "DemoService")] public class DemoService : IDemoService, IDoNothingService ``` Which would have configuration along these li...
null
CC BY-SA 2.5
null
2008-08-28T07:43:55.977
2008-08-28T07:43:55.977
null
null
2,562
null
31,813
2
null
30,318
2
null
I'm not sure whether you're asking for a shell as in bash/csh, or a shell as in ipython. If it's the later, then I'd recommend looking at [Reinteract](http://fishsoup.net/software/reinteract/). While it's still very alpha, it's already a great tool for rapid prototyping in python, and allows embedding of plots, widgets...
null
CC BY-SA 2.5
null
2008-08-28T07:47:58.743
2008-08-28T07:47:58.743
null
null
2,963
null
31,820
2
null
31,818
21
null
From TechNet: [Determining which version and edition of SQL Server Database Engine is running](https://gallery.technet.microsoft.com/Determining-which-version-af0f16f6) ``` -- SQL Server 2000/2005 SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') -- SQL Server 6.5/7...
null
CC BY-SA 3.0
null
2008-08-28T07:56:15.760
2017-07-13T17:11:05.943
2017-07-13T17:11:05.943
2,954
2,954
null
31,818
1
31,820
null
13
45,305
How can I find out which Service Pack is installed on my copy of SQL Server?
How to find out which Service Pack is installed on SQL Server?
CC BY-SA 3.0
0
2008-08-28T07:54:27.467
2017-07-13T17:11:05.943
2012-01-18T18:01:47.343
203,458
3,353
[ "sql-server" ]
31,708
1
31,710
null
17
54,407
I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView (WebForms). Simplified code: ``` Dictionary<Guid, Record> dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == "foo"); myListView.DataBind(); ``` I thought that would work but in f...
How can I convert IEnumerable<T> to List<T> in C#?
CC BY-SA 2.5
0
2008-08-28T05:21:26.943
2016-08-08T11:30:34.143
2008-08-28T05:23:24.957
1,414
202
[ "c#", "linq", "generics", "listview" ]
31,814
2
null
31,627
2
null
I don't agree with the people that say that if you don't have problems you'd better not switch. I think that SCM is some of the disciplines a good developer should know well, and frankly, even if you master VSS you are just experimenting a small fraction of the advantages a good SCM tool and SCM strategy can do for yo...
null
CC BY-SA 2.5
null
2008-08-28T07:51:25.443
2008-08-28T07:51:25.443
null
null
2,954
null
31,824
2
null
31,799
1
null
If you use these attributes: ``` [XmlArray("ProviderPatientLists")] [XmlArrayItem("File")] public ProviderPatientList Files { get { return _ProviderPatientLists; } set { _ProviderPatientLists = value; } } ``` Where ProviderPatientList inherit's `List...
null
CC BY-SA 2.5
null
2008-08-28T07:59:32.897
2008-08-28T07:59:32.897
null
null
580
null
31,810
2
null
31,799
4
null
you can get around this problem by getting hold of the System.RunTime.Serialization dll (it's a .net 3.x assembly) and referencing it from your .net 2.0 application. This works because the .net 3.0 binaries are compiled to run on the .net 2.0 CLR. By doing this, you get access to the DataContractSerliazer which I've u...
null
CC BY-SA 2.5
null
2008-08-28T07:45:11.467
2008-08-28T07:45:11.467
null
null
493
null
31,825
2
null
31,800
4
null
I'd personally plump for returning the resource rather than faffing with a redirect, although I suspect that's only because my subcoscious is telling me redirects are slower. However, if you were to decide to use a redirect I'd think a 302 or 307 might be more appropiate than a 303, although the [w3.org](http://www.w3...
null
CC BY-SA 2.5
null
2008-08-28T07:59:53.457
2008-08-28T07:59:53.457
null
null
2,562
null
31,831
2
null
1,453
6
null
Neat trick with Boolean OR operator: ``` public function createShipment($startZip, $endZip, $weight = 0){ $weight or $weight = $this->getDefaultWeight(); ... } ```
null
CC BY-SA 4.0
null
2008-08-28T08:10:48.643
2021-10-25T11:50:00.063
2021-10-25T11:50:00.063
17,169,050
2,169
null
31,828
2
null
12,905
0
null
There is no Object Model for the InfoPath designer. I believe the closest that you can get is the exposed API for the Visual Studio hosting that InfoPath supports; but I don't believe that this will give you the programatic control of the designer that you'd like. [http://msdn.microsoft.com/en-us/library/aa813327.asp...
null
CC BY-SA 2.5
null
2008-08-28T08:03:27.693
2008-08-28T08:03:27.693
null
null
211,367
null
31,827
2
null
30,931
10
null
There are two parts to this. You need to [register a new file type](http://www.freedesktop.org/wiki/Specifications/AddingMIMETutor) and then [create a desktop entry for your application](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). The desktop entry associates your application wi...
null
CC BY-SA 2.5
null
2008-08-28T08:03:04.997
2008-08-28T08:03:04.997
null
null
2,963
null
31,834
1
null
null
4
2,823
I tried finding a python script in google that will generate a random terrain when the game starts (or each time a the player advances to a new scene) but all the tools I found are for creating a terrain to render it, not for the game mode. Any idea how/where to find one? (I'm assuming that since Blender3D has game p...
Generating random terrain in Blender3D
CC BY-SA 2.5
0
2008-08-28T08:12:42.507
2014-01-10T19:48:28.933
2010-07-14T08:24:52.350
383,402
2,644
[ "blender" ]
31,833
2
null
31,581
29
null
I say this in response to a lot of questions: Don't forget that the (managed) source code to the framework is available. You can use this tool to get it all: [http://www.codeplex.com/NetMassDownloader](http://www.codeplex.com/NetMassDownloader) Unfortunately, in this specific case, a lot of the implementation is in ...
null
CC BY-SA 2.5
null
2008-08-28T08:12:24.270
2008-08-28T19:55:13.083
2008-08-28T19:55:13.083
987
987
null
31,835
2
null
31,627
2
null
At work we use subversion with TortoiseSVN - works very nicely but it is philosophically different to VSS (not really a problem if there's just you but worth being aware of). I really like the fact that the whole repository has a revision number. Given a free choice I'd've probably gone with vault but at the time I ha...
null
CC BY-SA 2.5
null
2008-08-28T08:17:23.947
2009-04-19T15:20:06.973
2009-04-19T15:20:06.973
1,070
1,070
null
31,838
2
null
31,794
1
null
If you're just trying to get a value from the app.config file, you might want to use: ``` ConfigurationSettings.AppSettings["name"]; ``` That works for me, anyways. /Jonas
null
CC BY-SA 2.5
null
2008-08-28T08:19:39.057
2008-08-28T08:19:39.057
null
null
1,090
null
31,839
2
null
29,677
1
null
The CLR cannot directly load modules that contain no manifest. So you can't make an assembly completely private unless you also want to make it unloadable ;) You can however, as Mark noted above, use obfuscation tools to hide the parts you would like to keep truly internal. It's too bad the keyword doesn't exclude ...
null
CC BY-SA 2.5
null
2008-08-28T08:20:20.163
2008-08-28T08:25:37.140
2017-05-23T12:13:33.373
-1
2,774
null
31,821
2
null
31,693
14
null
Follow-up to my previous posting. Templates are one of the main reasons why C++ fails so abysmally at intellisense, regardless of the IDE used. Because of template specialization, the IDE can never be really sure if a given member exists or not. Consider: ``` template <typename T> struct X { void foo() { } }; te...
null
CC BY-SA 2.5
null
2008-08-28T07:57:39.547
2008-09-01T09:21:04.810
2008-09-01T09:21:04.810
1,968
1,968
null
31,840
1
null
null
149
82,444
Is it still worth to add the log4j library to a Java 5 project just to log let's say some exceptions to a file with some nice rollover settings. Or will the standard util.logging facility do the job as well? What do you think?
Java Logging vs Log4J
CC BY-SA 3.0
0
2008-08-28T08:20:44.047
2020-08-06T06:34:31.737
2014-12-05T15:27:59.727
3,885,376
3,360
[ "java", "logging", "log4j", "java.util.logging" ]
31,836
2
null
30,931
54
null
Use `xdg-utils` from [freedesktop.org Portland](http://portland.freedesktop.org/wiki/). Register the icon for the MIME type: ``` xdg-icon-resource install --context mimetypes --size 48 myicon-file-type.png x-application-mytype ``` Create a configuration file ([freedesktop Shared MIME documentation](http://standards.fr...
null
CC BY-SA 4.0
null
2008-08-28T08:18:00.263
2020-12-20T11:40:20.423
2020-12-20T11:40:20.423
5,954,839
3,205
null
31,841
2
null
31,826
3
null
If I was faced with that problem and couldn't find anything on google I would probably try to do it my self. Some "back-of-an-evelope" stuff to get a feel for where it is going. But it would kinda need me to have an idea of how to do a xml parser. For non algorithmical benchmarks take a look here: - [http://www.xml....
null
CC BY-SA 2.5
null
2008-08-28T08:21:00.880
2008-08-28T08:21:00.880
null
null
86
null
31,854
1
null
null
2
12,219
Disclaimer: Near zero with marshalling concepts.. I have a struct B that contains a string + an array of structs C. I need to send this across the giant interop chasm to a COM - C++ consumer. ``` [ComVisible (true)] [StructLayout(LayoutKind.Sequential)] public struct A { public string strA public B b; } ...
How to marshal an array of structs - (.Net/C# => C++)
CC BY-SA 2.5
0
2008-08-28T08:38:04.660
2008-10-14T14:14:31.877
2008-10-14T14:14:31.877
1,816
1,695
[ ".net", "interop", "marshalling" ]
31,857
2
null
31,598
2
null
As a former Test & Commissioning manager, I would strongly argue for a test API. It does not remove the need for User Interface testing, but you will be able to add automated tests and non regression tests. If it's absolutely impossible, I would setup a test proxy, where you will be able to: - - - - If you need som...
null
CC BY-SA 2.5
null
2008-08-28T08:38:57.747
2008-08-28T08:38:57.747
null
null
341
null
31,758
2
null
31,693
61
null
C++ rarely uses the “generics” terminology. Instead, the word “templates” is used and is more accurate. Templates describes one to achieve a generic design. C++ templates is very different from what both C# and Java implement for two main reasons. The first reason is that C++ templates don't only allow compile-time t...
null
CC BY-SA 3.0
null
2008-08-28T07:11:00.550
2011-10-19T01:29:33.610
2011-10-19T01:29:33.610
485,561
1,968
null
31,858
2
null
31,847
13
null
You want `xs:choice` with occurrence constraints: ``` <xs:element name="wrapperElement"> <xs:complexType> <xs:sequence> <xs:element name="e11"/> <xs:element name="el2"/> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="el3"/> <xs:element name="el4"/> <xs...
null
CC BY-SA 3.0
null
2008-08-28T08:40:19.400
2012-01-27T03:41:01.700
2012-01-27T03:41:01.700
886,533
2,679
null
31,852
2
null
31,840
127
null
I'd say you're probably fine with util.logging for the needs you describe. For a good decision tree, have a look at [Log4j vs java.util.logging](http://web.archive.org/web/20190320144728/http://java.sys-con.com/node/48541) > Question One : Do you anticipate a need for any of the clever handlers that Log4j has that JUL ...
null
CC BY-SA 4.0
null
2008-08-28T08:37:16.053
2020-08-06T06:34:31.737
2020-08-06T06:34:31.737
797
797
null
31,859
2
null
2,933
60
null
Another system (not mentioned in the accepted answer yet) is PyInstaller, which worked for a PyQt project of mine when py2exe would not. I found it easier to use. [http://www.pyinstaller.org/](http://www.pyinstaller.org/) Pyinstaller is based on Gordon McMillan's Python Installer. Which is no longer available.
null
CC BY-SA 3.0
null
2008-08-28T08:41:45.853
2011-09-27T14:52:52.497
2011-09-27T14:52:52.497
429,533
3,363
null
31,861
2
null
31,840
3
null
I would go with log4j. The possibilites with log4j is not obsolete at all!
null
CC BY-SA 2.5
null
2008-08-28T08:43:45.163
2008-08-28T08:43:45.163
null
null
86
null
31,863
2
null
31,581
0
null
^^ as DannySmurf says : Consolidate them. Create a timer service and ask that for the timers. It will only need to keep 1 active timer (for the next due call) and a history of all the timer requests and recalculate this on AddTimer() / RemoveTimer().
null
CC BY-SA 2.5
null
2008-08-28T08:46:29.463
2008-08-28T08:46:29.463
null
null
1,143
null
31,847
1
31,858
null
9
2,785
I need to create an XML schema that looks something like this: ``` <xs:element name="wrapperElement"> <xs:complexType> <xs:sequence> <xs:element type="el1"> <xs:element type="el2"> </xs:sequence> <xs:WhatGoesHere?> <xs:element type="el3"> <xs:element type="el4"> <x...
XML Schema construct for "Any number of these elements - in any order"
CC BY-SA 2.5
0
2008-08-28T08:30:27.830
2012-01-27T03:41:01.700
null
null
2,964
[ "xml", "xsd", "schema" ]
31,846
2
null
31,800
2
null
Under W3C's [Architexture of the World Wide Web, Volume One](http://www.w3.org/TR/webarch/), there is a section on URI aliases ([Section 2.3.1](http://www.w3.org/TR/webarch/#uri-aliases)) which states the following: "When a URI alias does become common currency, the URI owner should use protocol techniques such as ser...
null
CC BY-SA 2.5
null
2008-08-28T08:26:01.710
2008-08-28T08:26:01.710
null
null
2,658
null
31,849
1
32,086
null
3
10,489
It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first. Is there a way to tell the browser or OS to let the event through? For example, on an AdvancedDataGrid I h...
Capturing Cmd-C (or Ctrl-C) keyboard event from modular Flex application in browser or AIR
CC BY-SA 2.5
0
2008-08-28T08:34:09.087
2013-01-25T15:51:53.993
2008-08-28T09:51:31.833
3,023
3,023
[ "apache-flex", "air" ]
31,860
2
null
31,097
8
null
/EDIT: I've rewritten the whole posting. Below is a pretty complete solution to the VB highlighting problem. If SO has got nothing better, use it. VB syntax highlighting is definitely wanted. I've also added a code example with some complex code literals that gets highlighted correctly. However, I haven't even tried...
null
CC BY-SA 2.5
null
2008-08-28T08:43:06.850
2016-07-08T16:29:02.983
2016-07-08T16:29:02.983
6,083,675
1,968
null
31,826
1
31,841
null
15
1,807
I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of nodes...
Algorithmic complexity of XML parsers/validators
CC BY-SA 4.0
0
2008-08-28T08:01:12.690
2019-07-12T22:25:10.377
2019-07-12T22:25:10.377
4,751,173
1,428
[ "xml", "algorithm", "performance" ]
31,864
2
null
14,545
0
null
My idea would be to query the titles like `SELECT title FROM articles` and simply check if each wikilink is in that array of strings. If it is you link to the page, if not, you link to the create page.
null
CC BY-SA 2.5
null
2008-08-28T08:49:12.187
2008-08-28T08:49:12.187
null
null
3,063
null
31,865
1
31,896
null
1
3,232
I know this might be a no-brainer, but please read on. I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context. We use Citrix for home-office, and people really like it. Now, they would like the same kind of environment at ...
Good reasons for not letting the browser launch local applications
CC BY-SA 4.0
null
2008-08-28T08:50:20.933
2018-07-12T11:48:19.337
2018-07-11T13:13:27.407
9,959,912
2,452
[ "security", "internet-explorer", "activex", "intranet" ]
31,866
2
null
31,693
6
null
Both Java and C# introduced generics after their first language release. However, there are differences in how the core libraries changed when generics was introduced. and so it was not possible to existing library classes without breaking backwards compatibility. For example, in Java the existing [Collections Fra...
null
CC BY-SA 2.5
null
2008-08-28T08:52:04.270
2008-10-30T00:50:23.437
2008-10-30T00:50:23.437
21,632
1,853
null
31,868
1
34,274
null
31
65,672
What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes? - We definitely need to use the Web Service layer as we will be making these calls from remote client applications.- The WebDAV method would work for us, but we would pre...
Upload a file to SharePoint through the built-in web services
CC BY-SA 2.5
0
2008-08-28T08:53:00.507
2014-04-28T19:00:41.043
2008-09-11T10:10:22.343
3,362
3,362
[ "sharepoint", "wss" ]
31,805
2
null
9,435
4
null
Newer phones come with WAP2 which uses HTML Mobile Profile (XHTML MP), which is quite similar to normal HTML. Older phones use Wireless Markup Language (WML). Depending on your audience I would consider making a mobile phone friendly version of the site using XHTML MP and drop WML completely. By mobile phone friendl...
null
CC BY-SA 2.5
null
2008-08-28T07:39:01.357
2008-08-28T07:39:01.357
null
null
2,953
null
31,874
2
null
1,746
32
null
`\0` will also match the entire matched expression without doing an explicit capture using parenthesis. ``` preg_replace("/[A-Z]/", "<span class=\"initial\">\\0</span>", $str) ``` As always, you can go to [php.net/preg_replace](http://php.net/preg_replace) or php.net/<whatever search term> to search the documentatio...
null
CC BY-SA 3.0
null
2008-08-28T09:02:43.480
2013-10-25T13:09:44.307
2013-10-25T13:09:44.307
1,401,975
2,774
null
31,873
2
null
31,870
126
null
You can use CDATA section ``` <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text> ``` or you can describe &nbsp in local DTD: ``` <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]> ``` or just use `&#160;` instead of `&nbsp;`
null
CC BY-SA 2.5
null
2008-08-28T09:02:13.060
2008-08-28T09:08:01.733
2008-08-28T09:08:01.733
1,196
1,196
null
31,870
1
31,873
null
67
63,965
What is the best way to include an html entity in XSLT? ``` <xsl:template match="/a/node"> <xsl:value-of select="."/> <xsl:text>&nbsp;</xsl:text> </xsl:template> ``` this one returns a
Using an HTML entity in XSLT (e.g. &nbsp;)
CC BY-SA 3.0
0
2008-08-28T08:55:34.697
2023-02-20T07:27:22.180
2017-11-27T10:20:46.510
505,893
1,532
[ "xslt" ]
31,875
1
31,887
null
520
424,037
There seem to be many ways to define [singletons](http://en.wikipedia.org/wiki/Singleton_pattern) in Python. Is there a consensus opinion on Stack Overflow?
Is there a simple, elegant way to define singletons?
CC BY-SA 3.0
0
2008-08-28T09:03:09.827
2022-02-10T18:32:33.630
2017-02-07T19:44:17.593
355,230
3,363
[ "python", "design-patterns", "singleton" ]
31,862
2
null
31,559
0
null
The pros and cons compared to what? There are a lot of alternatives out there, the most popular being nHibernate, with the new kid 'ADO.NET Entity Framework' on the block. Anyways, there are hundreds of answers depending on your situation and requirements.
null
CC BY-SA 2.5
null
2008-08-28T08:43:54.990
2008-08-28T08:43:54.990
null
null
2,658
null
31,871
1
34,373
null
54
103,019
Ok, I have a strange exception thrown from my code that's been bothering me for ages. ``` System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall at System.Net.Sockets.Socket.Accept() at System.Net.Sockets.TcpListener.AcceptTcpClient() ``` MSDN isn't terribly...
WSACancelBlockingCall exception
CC BY-SA 3.0
0
2008-08-28T08:59:07.527
2020-11-04T13:19:54.670
2020-11-04T13:19:54.670
297,823
3,263
[ "c#", "multithreading", "sockets", "socketexception" ]
31,869
2
null
17,376
1
null
If you're currently using Authenticate, then you may already have an file. If you would like to continue using that file, but switch to using FORM based authentication rather than via the Authenticate header, you can use a PHP script to use the same htpasswd file and use sessions to maintain the authentication status....
null
CC BY-SA 4.0
null
2008-08-28T08:54:09.037
2019-08-24T16:08:46.053
2019-08-24T16:08:46.053
2,774
2,774
null
31,877
2
null
31,500
4
null
Unless technology has improved in ways I can't imagine of late, the "IN" query shown will produce a result that's effectively the OR-ing of three result sets, one for each of the values in the "IN" list. The IN clause becomes an equality condition for each of the list and will use an index if appropriate. In the case o...
null
CC BY-SA 2.5
null
2008-08-28T09:04:07.127
2008-08-28T09:04:07.127
null
null
1,060
null
31,880
2
null
23,402
10
null
As the first answer says, what are your criteria? There's a number of commercial and open-source tools in the same space (but not Javaspaces-based): - [Oracle Coherence](http://coherence.oracle.com/display/COH34UG/Coherence+3.4+Home)- [Gemstone's Gemfire](http://www.gemstone.com/products/gemfire/)- [Terracotta](http:...
null
CC BY-SA 2.5
null
2008-08-28T09:06:35.420
2008-08-28T09:06:35.420
null
null
null
null
31,886
2
null
31,870
15
null
one other possibility to use html entities from within xslt is the following one: ``` <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> ```
null
CC BY-SA 2.5
null
2008-08-28T09:10:04.133
2008-08-28T09:10:04.133
null
null
1,532
null
31,884
2
null
31,875
2
null
Being relatively new to Python I'm not sure what the most common idiom is, but the simplest thing I can think of is just using a module instead of a class. What would have been instance methods on your class become just functions in the module and any data just becomes variables in the module instead of members of the ...
null
CC BY-SA 3.0
null
2008-08-28T09:09:22.073
2016-03-13T20:45:18.420
2016-03-13T20:45:18.420
63,550
2,168
null
31,867
1
32,062
null
14
1,950
While I've seen rare cases where inheritance was needed, I've never encountered a case where inheritance is needed. Does someone have an example?
Are there any examples where we *need* protected inheritance in C++?
CC BY-SA 2.5
0
2008-08-28T08:52:55.843
2012-06-06T23:17:58.480
2012-06-06T23:17:58.480
1,324,019
2,638
[ "c++", "oop", "inheritance" ]
31,878
2
null
31,870
6
null
> this one returns a Yes, and the reason for that is that `&nbsp;` is not a predefined entity in XML or XSLT as it is in HTML. You could just use the unicode character which `&nbsp;` stands for: `&#160;`
null
CC BY-SA 2.5
null
2008-08-28T09:04:39.700
2008-08-28T09:04:39.700
null
null
2,597
null
31,889
2
null
31,637
0
null
Wouldn't solutions like VMware's ThinApp (Formerly Thinstall) help a bit with protecting your code also? It comes at an extremely high price though..
null
CC BY-SA 2.5
null
2008-08-28T09:11:01.213
2008-08-28T09:11:01.213
null
null
3,308
null
31,887
2
null
31,875
420
null
I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its variables would be bound to the module, which could not be instantiated repeatedly anyway. If you do wish to use a class, there is no way of creating private classes or private constructors in Python, so...
null
CC BY-SA 3.0
null
2008-08-28T09:10:12.743
2016-03-13T20:44:16.213
2016-03-13T20:44:16.213
63,550
3,355
null
31,882
1
31,983
null
8
3,156
It seems to me obfuscation is an idea that falls somewhere in the "security by obscurity" or "false sense of protection" camp. To protect intellectual property, there's copyright; to prevent security issues from being found, there's . In short, I regard it as a technical solution to a social problem. [Those almost neve...
(Why) should I use obfuscation?
CC BY-SA 2.5
0
2008-08-28T09:08:43.730
2010-06-23T09:07:27.927
2017-05-23T12:00:17.880
-1
1,600
[ ".net", "security", "obfuscation", "protection" ]
31,879
2
null
31,637
1
null
This looks like the same question as: [How do I make the manifest of a .net assembly private?](https://stackoverflow.com/questions/29677/how-do-i-make-the-manifest-of-a-net-assembly-private) See my answer there: [How do I make the manifest of a .net assembly private?](https://stackoverflow.com/questions/29677/how-do...
null
CC BY-SA 2.5
null
2008-08-28T09:05:18.107
2008-08-28T09:05:18.107
2017-05-23T10:32:50.377
-1
986
null
31,894
2
null
31,870
6
null
XSLT only handles the five basic entities by default: `lt`, `gt`, `apos`, `quot`, and `amp`. All others need to be defined as [@Aku](https://stackoverflow.com/questions/31870/using-a-html-entity-in-xslt-eg-nbsp#31873) mentions.
null
CC BY-SA 2.5
null
2008-08-28T09:13:45.090
2008-08-28T09:13:45.090
2017-05-23T12:25:31.013
-1
1,908
null
31,898
2
null
31,882
2
null
The main reason to use obfuscation is to protect intellectual property as you have indicated. It is generally much more cost effective to a business to purchase an obfuscation product like .NET Reactor than it is to try and legally enforce your copyrights. Obfuscation can also provide other more incidental benefits s...
null
CC BY-SA 2.5
null
2008-08-28T09:17:18.500
2008-08-28T09:17:18.500
null
null
2,253
null
31,893
2
null
31,882
3
null
One potential engineering benefit is that in some cases obfuscation can create smaller executables or other artifacts -- e.g. obfuscating javascript results in smaller files (because all of the variables are named "a" and "b" instead of "descriptiveNameOne" and all the whitespace is stripped, etc). This results in fas...
null
CC BY-SA 2.5
null
2008-08-28T09:13:35.183
2008-08-28T09:13:35.183
null
null
2,168
null
31,896
2
null
31,865
4
null
> I haven't used Citrix very many times, but what's it got to do with executing local applications? I don't see how "People like Citrix" and "browser executing local applications" relate at all? If the people are accessing your Citrix server from home, and want the same experience in the office, then buy a cheap PC,...
null
CC BY-SA 4.0
null
2008-08-28T09:14:14.247
2018-07-12T11:48:19.337
2018-07-12T11:48:19.337
9,959,912
234
null
31,897
2
null
31,882
3
null
While not related to .net, I would consider obfuscation in Javascript, and possibly other interpeted languages. Javascript benefits well from obfuscation because it reduces the bandwith needed, and the tokens the parser has to read. But obfuscating compiled bytecode doesn't really seem that usefull to me. I mean what ...
null
CC BY-SA 2.5
null
2008-08-28T09:16:51.760
2008-08-28T09:16:51.760
null
null
3,355
null
31,890
2
null
31,882
4
null
If you stick to pure managed code obfuscation, you can shave off quite a bit of an assembly size, and obfuscated classes/function names (collapsed to single letters) mean smaller memory footprint. This is almost always negligible, but does have an impact (and is used) on some mobile/embedded devices (though mostly in j...
null
CC BY-SA 2.5
null
2008-08-28T09:13:09.413
2008-08-28T09:13:09.413
null
null
3,205
null
31,888
2
null
29,943
0
null
I think you should actually have a submit button or a submit image... Do you have a specific reason for using a "submit div"? If you just want custom styles I recommend `<input type="image"...`. [http://webdesign.about.com/cs/forms/a/aaformsubmit_2.htm](http://webdesign.about.com/cs/forms/a/aaformsubmit_2.htm)
null
CC BY-SA 2.5
null
2008-08-28T09:10:47.157
2008-08-28T09:10:47.157
null
null
3,063
null
31,906
1
null
null
5
293
Right now I am working on a solution to archive older data from a big working database to a separate archive database with the same schema. I move the data using SQL scripts and SQL Server Management Objects (SMO) from a .Net executable written in C#. The archived data should still be accessible and even (occassionall...
How to efficiently archive older parts of a big (multi-GB) SQL Server database?
CC BY-SA 2.5
0
2008-08-28T09:31:09.107
2008-10-03T07:22:00.297
null
null
3,353
[ "sql", "sql-server" ]
31,895
2
null
31,882
8
null
If a big team of programmers really want to get at your source code and that had the time, money and effort, then they would be successful. Obfuscation, therefore, should stop people who don't have the time, money or effort to get your source, passers by you might call them.
null
CC BY-SA 2.5
null
2008-08-28T09:14:05.370
2008-08-28T09:14:05.370
null
null
383
null
31,909
2
null
31,581
5
null
> Consolidate them. Create a timer service and ask that for the timers. It will only need to keep 1 active timer (for the next due call)... For this to be an improvement over just creating lots of Threading.Timer objects, you have to assume that it isn't exactly what Threading.Timer is already doing internally. ...
null
CC BY-SA 2.5
null
2008-08-28T09:34:14.137
2008-08-28T09:34:14.137
null
null
987
null
31,912
2
null
26,147
49
null
[http://code.google.com/p/geckofx/](http://code.google.com/p/geckofx/) This is a nice .NET-wrapped version of Gecko
null
CC BY-SA 2.5
null
2008-08-28T09:40:18.537
2008-08-28T09:40:18.537
null
null
618
null
31,885
1
31,949
null
13
13,198
I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux). Is there a way to leverage ...
Does Visual Studio Server Explorer support custom database providers?
CC BY-SA 2.5
0
2008-08-28T09:09:58.983
2011-09-21T09:30:04.700
null
null
3,205
[ "c#", "mysql", "visual-studio", "oracle", "sqlite" ]
31,914
2
null
31,840
4
null
I recommend using [Apache Commmons Logging](http://commons.apache.org/logging/) as your logging interface. That way you have the flexibility to switch logging implementations anytime you want without requiring any code changes on your end.
null
CC BY-SA 2.5
null
2008-08-28T09:40:33.747
2008-08-28T10:05:04.437
2008-08-28T10:05:04.437
2,633
2,633
null
31,902
2
null
31,882
14
null
You asked for engineering reasons, so this is not strictly speaking an answer to the question. But I think it's a valid clarification. As you say, obfuscation is intended to address a social problem. And social (or business) problems, unlike technical ones, rarely have a complete solution. There are only degrees of su...
null
CC BY-SA 2.5
null
2008-08-28T09:28:11.703
2008-08-28T09:28:11.703
null
null
3,267
null
31,903
2
null
26,515
3
null
Example 1 the $query variable from the MySQL result. The MySQL result still exists in memory, and will continue to exist and waste memory until garbage collection occurs. Example 2 the MySQL result immediately, releasing the used resources. However, since PHP pages are generally short-lived with small result-sets, ...
null
CC BY-SA 2.5
null
2008-08-28T09:29:55.973
2008-08-28T09:29:55.973
null
null
2,774
null
31,911
2
null
29,746
1
null
If you have shell access you can run the command ``` $ du -h ``` or perhaps use this, if PHP is configured to allow execution: ``` <?php $d = escapeshellcmd(dirname(__FILE__)); echo nl2br(`du -h $d`) ?> ```
null
CC BY-SA 2.5
null
2008-08-28T09:38:50.867
2008-08-28T09:38:50.867
null
null
2,774
null
31,915
2
null
31,882
1
null
Use encryption to protect information on the way. Use obfuscation to protect information while your program still has it.
null
CC BY-SA 2.5
null
2008-08-28T09:41:12.777
2008-08-28T09:41:12.777
null
null
2,695
null
31,923
2
null
25,665
52
null
[Pdftotext](http://en.wikipedia.org/wiki/Pdftotext) An open source program (part of Xpdf) which you could call from python (not what you asked for but might be useful). I've used it with no problems. I think google use it in google desktop.
null
CC BY-SA 2.5
null
2008-08-28T09:46:53.123
2008-08-28T09:46:53.123
null
null
3,363
null
31,926
2
null
28,961
3
null
If I have to expose APIs, I prefer doing it as JSON. Python has excellent support for JSON objects (JSON Objects are infact python dictionaries)
null
CC BY-SA 2.5
null
2008-08-28T09:47:57.880
2008-08-28T09:47:57.880
null
null
3,374
null
31,927
2
null
31,906
1
null
Yep, use table and index partitioning with filegroups. You don't even have to change the select statements, only if you want to get the last bit of speed out of the result. Another option can be the workload balancing with two servers and two way replication between them.
null
CC BY-SA 2.5
null
2008-08-28T09:49:41.743
2008-08-28T09:49:41.743
null
null
968
null
31,917
2
null
31,906
1
null
I think if you still want/need the data to be accessible, then partitioning some of your biggest or most-used tables could be an option.
null
CC BY-SA 2.5
null
2008-08-28T09:43:16.113
2008-08-28T09:43:16.113
null
null
3,201
null
31,919
1
null
null
6
3,446
I'm comparing it Java where you can start your application server in debug mode, then attach your IDE to the server. And you can change your code "on the fly" without restarting the server. As long as your changes don't affect any method signatures or fields you can just hit recompile for a class and the application se...
How to make the process of debugging ASP.NET Sharepoint applications less time consuming?
CC BY-SA 2.5
0
2008-08-28T09:43:42.087
2011-05-25T20:17:05.153
2008-08-28T10:24:14.187
578
578
[ "asp.net", "sharepoint", "debugging" ]
31,931
1
31,939
null
23
14,417
I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly. That is, if I have a date of 'Today', I want to get the date for 'Yesterday'. It always seems to take more code than necessary when I do this, so I'm wondering if there's any simpler way. What's the simplest way of...
What's the simplest way to decrement a date in Javascript by 1 day?
CC BY-SA 4.0
0
2008-08-28T09:50:48.370
2018-07-29T07:43:56.777
2018-07-29T07:43:56.777
9,816,472
916
[ "javascript", "browser", "date" ]
31,924
1
31,960
null
11
11,169
I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development.
What are the best practices for JSF?
CC BY-SA 2.5
0
2008-08-28T09:47:18.270
2013-10-01T18:13:51.373
2008-08-28T10:04:49.540
1,075
null
[ "java", "jsf" ]
31,935
1
32,784
null
9
25,458
I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to load with some 'Please wait' text in the UpdatePanels. Then once the page is I want to call a code-behind function to update the UpdatePanel. Any ideas as to what combination of Javascript and ...
ASP.NET AJAX: Firing an UpdatePanel after the page load is complete
CC BY-SA 2.5
0
2008-08-28T09:53:22.140
2013-11-15T13:19:34.943
2008-09-19T22:30:13.143
811
3,099
[ "asp.net", "javascript", "asp.net-ajax" ]
31,932
2
null
31,919
0
null
> And you can change your code "on the fly" without restarting the server You can accomplish this with ASP.net if you make a Web Site project (as opposed to a Web Application Project). Using a Web Site project, you can post changes to code-behinds without having to refresh anything on the server, and the server does t...
null
CC BY-SA 2.5
null
2008-08-28T09:51:23.080
2008-08-28T09:51:23.080
null
null
51
null
31,913
1
null
null
9
8,173
I'm sorry if my question is so long and technical but I think it's so important other people will be interested about it I was looking for a way to separate clearly some softwares internals from their representation in c++ I have a generic parameter class (to be later stored in a container) that can contain any kind ...
A more generic visitor pattern
CC BY-SA 3.0
0
2008-08-28T09:40:19.020
2012-06-13T17:07:39.373
2017-05-23T12:19:34.457
-1
3,373
[ "c++", "design-patterns", "visitors" ]
31,939
2
null
31,931
34
null
``` var d = new Date(); d.setDate(d.getDate() - 1); console.log(d); ```
null
CC BY-SA 3.0
null
2008-08-28T09:56:01.370
2016-12-02T08:14:54.467
2016-12-02T08:14:54.467
2,571,493
1,585
null
31,944
2
null
31,913
0
null
If I understand this correctly... We had a object that could use different hardware options. To facilitate this we used a abstract interface of Device. Device had a bunch of functions that would be fired on certain events. The use would be the same but the various implementations of the Device would either have a full...
null
CC BY-SA 2.5
null
2008-08-28T09:58:49.867
2008-08-28T09:58:49.867
null
null
342
null
31,946
2
null
29,689
39
null
The [JAutodoc](http://jautodoc.sourceforge.net/) plugin for eclipse does exactly what you need, but with a package granularity : right click on a package, select "Add javadoc for members..." and the skeleton will be added. There are numerous interesting options : templates for javadoc, adding a TODO in the header of...
null
CC BY-SA 3.0
null
2008-08-28T10:02:10.887
2012-12-01T20:05:14.820
2012-12-01T20:05:14.820
63,011
2,965
null
31,947
2
null
31,885
1
null
The Server Explorer should support any database system that provides an ODBC driver. In the case of Oracle there is a built in driver with Visual Studio. In the Add Connection Dialog click the change button on the data source you should then get a list of the providers you have drivers for.
null
CC BY-SA 2.5
null
2008-08-28T10:02:50.527
2008-08-28T10:02:50.527
null
null
2,253
null
31,938
2
null
31,931
5
null
``` var today = new Date(); var yesterday = new Date().setDate(today.getDate() -1); ```
null
CC BY-SA 2.5
null
2008-08-28T09:55:16.643
2008-08-28T09:55:16.643
null
null
2,785
null
31,943
2
null
31,931
4
null
`getDate()-1` should do the trick Quick example: ``` var day = new Date( "January 1 2008" ); day.setDate(day.getDate() -1); alert(day); ```
null
CC BY-SA 3.0
null
2008-08-28T09:58:49.647
2018-01-05T13:30:14.347
2018-01-05T13:30:14.347
92,701
1,087
null
31,952
2
null
29,689
5
null
You can configure eclipse to show warnings for things that lack javadoc, or have javadoc that does not have all the information, or has wrong information. It can also insert templates for you to fill out. Not quite the tool you asked for, but probably better because you won't end up with empty skeletons on methods tha...
null
CC BY-SA 3.0
null
2008-08-28T10:06:34.870
2014-08-02T08:32:39.740
2014-08-02T08:32:39.740
2,275,962
974
null