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
12,145
2
null
12,141
6
null
A junior DBA meant to do: ``` delete from [table] where [condition] ``` Instead they typed: ``` delete [table] where [condition] ``` Which is valid T-Sql but basically ignores the where [condition] bit completely (at least it did back then on MSSQL 2000/97 - I forget which) and wipes the entire table. That was f...
null
CC BY-SA 2.5
null
2008-08-15T11:20:21.573
2008-08-15T11:37:54.080
2008-08-15T11:37:54.080
905
905
null
12,161
2
null
12,140
0
null
Usually this is handled by an ini file or XML configuration file. Then you just have a class that reads the setting when neeed. .NET has this built in with the ConfigurationManager classes, but it's quite easy to implement, just read text files, or load XML into DOM or parse them by hand in code. Having config files ...
null
CC BY-SA 2.5
null
2008-08-15T11:44:52.217
2008-08-15T11:44:52.217
null
null
1,075
null
12,159
1
null
null
789
203,622
I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield. I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when tw...
How should I unit test multithreaded code?
CC BY-SA 4.0
0
2008-08-15T11:44:33.280
2022-11-25T14:39:43.727
2020-12-21T18:22:50.973
2,357,112
912
[ "multithreading", "unit-testing" ]
12,152
2
null
9,033
33
null
My favourite is the ``` global:: ``` keyword to escape namespace hell with some of our 3rd party code providers... Example: ``` global::System.Collections.Generic.List<global::System.String> myList = new global::System.Collections.Generic.List<global::System.String>(); ```
null
CC BY-SA 3.0
null
2008-08-15T11:34:02.497
2011-06-07T17:44:40.453
2011-06-07T17:44:40.453
22,364
1,276
null
12,144
1
12,256
null
42
22,573
OK, so I don't want to start a holy-war here, but we're in the process of trying to consolidate the way we handle our application configuration files and we're struggling to make a decision on the best approach to take. At the moment, every application we distribute is using it's own ad-hoc configuration files, whether...
Application configuration files
CC BY-SA 3.0
0
2008-08-15T11:19:51.137
2015-12-14T10:59:23.073
2015-12-14T10:59:23.073
1,030
1,030
[ "java", "xml", "json", "cross-platform", "configuration-files" ]
12,167
2
null
2,933
4
null
I'm not sure that this is the best way to do it, but when I'm deploying Ruby GUI apps (not Python, but has the same "problem" as far as .exe's are concerned) on Windows, I just write a short launcher in C# that calls on my main script. It compiles to an executable, and I then have an application executable.
null
CC BY-SA 2.5
null
2008-08-15T12:00:37.193
2008-08-15T12:00:37.193
null
null
1,344
null
12,160
2
null
12,135
2
null
I'm guessing now. but: 1. The system might be generating a serializer for the whole of mscorlib, which could be very slow. 2. You could probably avoid this by wrapping the system type in your own type and serialising that instead - then you'd get a serializer for your own assembly. 3. You might be able to build the s...
null
CC BY-SA 2.5
null
2008-08-15T11:44:33.513
2008-08-15T11:44:33.513
null
null
987
null
12,169
2
null
12,144
0
null
As far as I know, the Windows registry is no longer the preferred way of storing configuration if you are using .NET - most applications now make use of System.Configuration [1, 2]. Since this is also XML based it seems to be that everything is moving in the direction of using XML for configuration. If you want to sta...
null
CC BY-SA 2.5
null
2008-08-15T12:04:00.743
2008-08-15T12:04:00.743
null
null
1,185
null
12,183
2
null
12,140
0
null
I did this: ``` public class MySettings { public static double Setting1 { get { return SettingsCache.Instance.GetDouble("Setting1"); } } public static string Setting2 { get { return SettingsCache.Instance.GetString("Setting2"); } } } ``` I put this in a separate infrastructure module to remo...
null
CC BY-SA 3.0
null
2008-08-15T12:20:26.450
2013-01-22T10:22:58.130
2013-01-22T10:22:58.130
1,410,342
960
null
12,166
2
null
2,933
15
null
An alternative tool to py2exe is [bbfreeze](http://pypi.python.org/pypi/bbfreeze/) which generates executables for windows and linux. It's newer than py2exe and handles eggs quite well. I've found it magically works better without configuration for a wide variety of applications.
null
CC BY-SA 2.5
null
2008-08-15T11:56:02.663
2008-08-15T11:56:02.663
null
null
995
null
12,176
1
12,189
null
26
11,312
Is there any way to include the SVN repository revision number in the version string of a .NET assembly? Something like Major.Minor.SVNRev I've seen mention of doing this with something like CC.NET (although on ASP.NET actually), but is there any way to do it without any extra software? I've done similar things in C...
SVN Revision Version in .NET Assembly w/ out CC.NET
CC BY-SA 2.5
0
2008-08-15T12:15:31.250
2017-09-22T11:02:49.837
2008-08-18T18:34:39.533
1,220
194
[ ".net", "svn", "versioning" ]
12,189
2
null
12,176
6
null
Have a look at SubWCRev - [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev.html](http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev.html) The assembly version numbers are usually in assemblyinfo.cs
null
CC BY-SA 2.5
null
2008-08-15T12:29:04.327
2008-08-15T12:29:04.327
null
null
987
null
12,194
2
null
12,144
2
null
We are using ini style config files. We use the [Nini](http://nini.sourceforge.net/) library to manage them. Nini makes it very easy to use. Nini was orignally for .NET but it has been ported to other platforms using Mono.
null
CC BY-SA 2.5
null
2008-08-15T12:41:32.337
2008-08-15T12:41:32.337
null
null
1,340
null
12,185
2
null
12,140
1
null
You could use Martin Fowlers ServiceLocator pattern. In php it could look like this: ``` class ServiceLocator { private static $soleInstance; private $globalSettings; public static function load($locator) { self::$soleInstance = $locator; } public static function globalSettings() { if (!isset(self:...
null
CC BY-SA 2.5
null
2008-08-15T12:25:19.483
2008-08-15T12:25:19.483
null
null
1,123
null
12,192
2
null
12,144
0
null
We are using properties files, simply because Java supports them natively. A couple of months ago I saw that SpringSource Application Platform uses JSON to configure their server and it looks very interesting. I [compared various configuration notations](http://dlinsin.blogspot.com/2008/07/configuration-notations.html)...
null
CC BY-SA 2.5
null
2008-08-15T12:32:36.317
2008-08-15T12:32:36.317
null
null
198
null
12,206
2
null
9,666
12
null
Hang about -- the question that is in the title is definitely not the real question that Rory is asking. The titular question has the simple answer of "No" -- but this is no help at all, when you see the real question -- which i don't think anyone has given a simple answer to. The real question Rory asks is presented...
null
CC BY-SA 2.5
null
2008-08-15T12:53:51.250
2008-08-15T14:17:07.353
2008-08-15T14:17:07.353
49
49
null
12,223
2
null
12,159
2
null
I have had the unfortunate task of testing threaded code and they are definitely the hardest tests I have ever written. When writing my tests, I used a combination of delegates and events. Basically it is all about using `PropertyNotifyChanged` events with a `WaitCallback` or some kind of `ConditionalWaiter` that pol...
null
CC BY-SA 3.0
null
2008-08-15T13:15:47.697
2016-06-19T22:22:52.560
2016-06-19T22:22:52.560
2,883,245
1,117
null
12,207
2
null
12,075
4
null
@Rob Cooper > Having had some discussions with my manager at work, he said he doesn't obfuscate, but does NGEN on install, apparantly that should be enough to stop Reflector working on your assemblies, but I have no idea if this is true and to what extent, so please don't take it as gospel :) This doesn...
null
CC BY-SA 2.5
null
2008-08-15T12:54:55.680
2008-08-15T12:54:55.680
null
null
1,254
null
12,210
2
null
12,140
1
null
I like to model my configuration access off of the Service Locator pattern. This gives me a single point to get any configuration value that I need and by putting it outside the application in a separate library, it allows reuse and testability. Here is some sample code, I am not sure what language you are using, but...
null
CC BY-SA 2.5
null
2008-08-15T12:57:22.337
2008-08-15T12:57:22.337
null
null
1,117
null
12,225
1
16,718
null
2
3,006
I have a database that contains a date and we are using the MaskedEditExtender (MEE) and MaskedEditValidator to make sure the dates are appropriate. However, we want the Admins to be able to go in and change the data (specifically the date) if necessary. How can I have the MEE field pre-populate with the database v...
Problem databinding an ASP.Net AJAX toolkit MaskedEditExtender
CC BY-SA 2.5
null
2008-08-15T13:16:25.263
2012-09-06T16:05:40.213
2008-09-19T22:36:26.607
811
730
[ "asp.net", "validation", "asp.net-ajax" ]
12,231
2
null
11,689
1
null
@Gaius ``` foreign key (thing_id, thing_type) -> problems.id or solutions.id ``` Be careful with these kinds of "multidirectional" foreign keys. My experience has shown that query performance suffers dramatically when your join condition has to check the type before figuring out which table to join on. It doesn't ...
null
CC BY-SA 2.5
null
2008-08-15T13:22:01.477
2008-08-15T13:25:05.183
2008-08-15T13:25:05.183
1,219
1,219
null
12,237
2
null
12,159
74
null
Tough one indeed! In my (C++) unit tests, I've broken this down into several categories along the lines of the concurrency pattern used: 1. Unit tests for classes that operate in a single thread and aren't thread aware -- easy, test as usual. 2. Unit tests for Monitor objects (those that execute synchronized methods ...
null
CC BY-SA 4.0
null
2008-08-15T13:26:26.537
2021-03-08T15:37:02.360
2021-03-08T15:37:02.360
201,787
1,146
null
12,233
2
null
12,141
1
null
The worst thing that happened to me was that a Production server consume all the space in the HD. I was using SQL Server so I see the database files and see that the log was about 10 Gb so I decide to do what I always do when I want to trunc a Log file. I did a Detach the delete the log file and then attach again. Wel...
null
CC BY-SA 2.5
null
2008-08-15T13:23:23.267
2008-08-15T13:23:23.267
null
null
1,154
null
12,227
2
null
12,141
8
null
I work for a small e-commerce company, there's 2 developers and a DBA, me being one of the developers. I'm normally not in the habit of updating production data on the fly, if we have stored procedures we've changed we put them through source control and have an officially deployment routine setup. Well anyways a user...
null
CC BY-SA 3.0
null
2008-08-15T13:17:26.040
2015-08-20T22:23:22.757
2015-08-20T22:23:22.757
7,226
1,302
null
12,247
2
null
12,243
12
null
There's a million ways to skin a cat. However, the simplest one is always the best. Which way is the simplest for you? Depends on your requirements. But there are some general rules of thumb I follow. First, reduce the overall number of projects as much as possible. When you compile twenty times a day, that extra...
null
CC BY-SA 2.5
null
2008-08-15T13:39:01.987
2008-08-15T13:39:01.987
null
null
null
null
12,202
2
null
234
63
null
This is something that annoys me about MSSQL ([rant on my blog](http://bizvprog.blogspot.com/2008/04/annoying-fundamental-flaw-with-sql.html)). I wish MSSQL supported `upsert`. @Dillie-O's code is a good way in older SQL versions (+1 vote), but it still is basically two IO operations (the `exists` and then the `updat...
null
CC BY-SA 3.0
null
2008-08-15T12:50:22.350
2013-11-21T08:29:36.703
2017-05-23T12:09:56.457
-1
905
null
12,241
2
null
12,159
271
null
Look, there's no easy way to do this. I'm working on a project that is inherently multithreaded. Events come in from the operating system and I have to process them concurrently. The simplest way to deal with testing complex, multithreaded application code is this: If it's too complex to test, you're doing it wrong....
null
CC BY-SA 4.0
null
2008-08-15T13:29:01.523
2020-10-27T06:26:01.603
2020-10-27T06:26:01.603
1,402,846
null
null
12,229
2
null
12,144
0
null
Re: epatel's comment I think the original question was asking about application configuration that an admin would be doing, not just storing user preferences. The suggestions you gave seem more for user prefs than application config, and aren't usually something that the user would ever deal with directly (the app sh...
null
CC BY-SA 2.5
null
2008-08-15T13:18:51.170
2008-08-15T13:18:51.170
null
null
1,409
null
12,243
1
12,247
null
10
2,497
I apologize for asking such a generalized question, but it's something that can prove challenging for me. My team is about to embark on a large project that will hopefully drag together all of the random one-off codebases that have evolved through the years. Given that this project will cover standardizing logical enti...
Namespace/solution structure
CC BY-SA 3.0
null
2008-08-15T13:30:42.690
2011-12-05T01:57:50.630
2011-12-05T01:57:50.630
449,652
1,212
[ "architecture", "module", "namespaces", "legacy" ]
12,248
2
null
12,243
4
null
I recently experienced the exact same at work. Lots of ad-hoc code that needed to be structured and organised. Its real hard at first, since there is so much. I think the best advice I could give is to just on the wind down on a Friday afternoon, for a couple of weeks I would just pick an app/chunk of code, examine w...
null
CC BY-SA 2.5
null
2008-08-15T13:39:06.730
2008-08-15T13:39:06.730
null
null
832
null
12,249
2
null
12,243
0
null
Large solutions with lots of projects can be quite slow to compile, but are easier to manage together. I often have Unit test assemblies in the same solution as the ones they're testing, as you tend to make changes to them together.
null
CC BY-SA 2.5
null
2008-08-15T13:40:31.297
2008-08-15T13:40:31.297
null
null
905
null
12,095
1
12,119
null
4
1,588
Our team is creating a new recruitment workflow system to replace an old one. I have been tasked with migrating the old data into the new schema. I have decided to do this by creating a small Windows Forms project as the schema are radically different and straight TSQL scripts are not an adequate solution. The main se...
Windows Forms Threading and Events - ListBox updates promptly but progressbar experiences huge delay
CC BY-SA 2.5
0
2008-08-15T09:19:04.050
2008-10-15T21:46:51.760
2008-10-15T21:46:51.760
6,899
2,083,160
[ "windows", "multithreading", "events", "forms", "delegates" ]
12,256
2
null
12,144
11
null
XML XML XML XML. We're talking . There is no "angle bracket tax" if you're not serializing objects in a performance-intense situation. Config files must be human readable and human understandable, in addition to machine readable. XML is a good compromise between the two. If your shop has people that are afraid o...
null
CC BY-SA 2.5
null
2008-08-15T13:45:26.670
2009-06-22T11:41:07.107
2009-06-22T11:41:07.107
null
null
null
12,257
2
null
12,225
0
null
Are you referring to the asp.Net Ajax toolkit extensions at: [http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx](http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx) If so have you checked that your data is coming back in the correct format? It will have to match ...
null
CC BY-SA 2.5
null
2008-08-15T13:45:53.580
2008-08-15T13:45:53.580
null
null
905
null
12,258
2
null
12,243
3
null
For large projects the approach I like to take is to have one Domain namespace for my business objects and then use Data Transfer Objects (DTO's) in my layers where storage and retrieval of the business object is needed. A DTO is a simple object that doesn't contain any business logic. Here is a link that explains a ...
null
CC BY-SA 2.5
null
2008-08-15T13:46:10.413
2008-08-15T13:46:10.413
null
null
1,117
null
12,261
2
null
12,176
2
null
svn info, tells you the version you are on, you can make a "pre-build" event in VS on your project to generate the assemblyinfo.cs by running svn info and parsing its results with a home grown command line app. I have done this before, but quickly switched to just having ccnet pass it as a variable to nant.
null
CC BY-SA 2.5
null
2008-08-15T13:51:52.243
2008-08-15T13:51:52.243
null
null
1,220
null
12,267
2
null
12,243
7
null
My advice, having embarked on a similar undertaking, is to not agonize over the name spaces.. Just start developing with a few important loose guidelines, because however you start out, your project is organic, and you end up reorganizing the name spaces and classes over time. Don't waste time talking too much about...
null
CC BY-SA 2.5
null
2008-08-15T14:01:08.433
2008-08-15T14:01:08.433
null
null
357
null
12,268
1
12,274
null
2
1,852
Lutz Roeder's Reflector, that is. Its obfuscated. ![enter image description here](https://i.stack.imgur.com/GHoWj.png) I still don't understand this. Can somebody please explain?
Have you ever reflected Reflector?
CC BY-SA 3.0
0
2008-08-15T14:01:15.030
2012-04-01T09:58:02.790
2012-04-01T09:58:02.790
1,219,121
null
[ ".net", "reflector" ]
12,272
2
null
12,268
2
null
What needs explaining, Reflector isn't open source, Lutz decided to obfuscate to protect his IP. Fair game.
null
CC BY-SA 2.5
null
2008-08-15T14:04:06.180
2008-08-15T14:04:06.180
null
null
419
null
12,274
2
null
12,268
9
null
It would have been kind of ironic if it weren't ;-)
null
CC BY-SA 2.5
null
2008-08-15T14:07:58.543
2008-08-15T14:07:58.543
null
null
905
null
12,264
2
null
12,144
1
null
@Herms What I really meant was to stick to the recommended way software should store configuration values for any given platform. What you often get then is also the recommended ways these should/can be modified. Like a configuration menu in a program or a configuration panel in a "system prefs" application (for sys...
null
CC BY-SA 2.5
null
2008-08-15T13:58:27.190
2008-08-15T14:09:04.390
2008-08-15T14:09:04.390
842
842
null
12,253
2
null
12,243
4
null
We name the assemblies in .NET the following way Company.Project.XXXX.YYYY where XXXX is Project and YYYYY is subproject, for example: - - - We take this from a book call [Framework Design Guidelines](https://rads.stackoverflow.com/amzn/click/com/0321545613) by Krzysztof Cwalina (Author), Brad Abrams (Author)
null
CC BY-SA 2.5
null
2008-08-15T13:43:38.373
2008-08-15T14:00:40.803
2008-08-15T14:00:40.803
1,154
1,154
null
12,271
1
12,491
null
3
291
I have created a template for Visual Studio 2008 and it currently shows up under File->New Project->Visual C#. However, it is only really specific to Visual C#/Windows but I can't work out how to get it to show up under the "Windows" category and not the more general "Visual C#".
Creating Visual Studio templates under the "Windows" category.
CC BY-SA 3.0
null
2008-08-15T14:04:01.017
2012-09-21T00:03:05.457
2012-09-21T00:03:05.457
null
214
[ "visual-studio", "templates" ]
12,266
2
null
11,665
1
null
You will have to create a custom header renderer, add a button to it and position it manually. Try something like this: ``` <mx:Accordion> <mx:headerRenderer> <mx:Component> <AccordionHeader xmlns="mx.containers.accordionClasses.*"> <mx:Script> <![CDATA[ ...
null
CC BY-SA 2.5
null
2008-08-15T14:00:53.270
2008-08-15T14:00:53.270
null
null
1,109
null
12,278
2
null
11,689
0
null
I suppose there's ## Option 4: the hybrid Move the common Thing attributes into a single-inheritance table, then add an `custom_attributes` table. This makes foreign-keys simpler, reduces duplication, and allows flexibility. It doesn't solve the problems of type-safety for the additional attributes. It also add...
null
CC BY-SA 2.5
null
2008-08-15T14:19:17.320
2008-08-15T14:19:17.320
null
null
1,190
null
12,280
2
null
12,141
3
null
``` update Customers set ModifyUser = 'Terrapin' ``` I forgot the where clause - pretty innocent, but on a table with 5000+ customers, my name will be on every record for a while... Lesson learned: use transaction commit and rollback!
null
CC BY-SA 2.5
null
2008-08-15T14:20:12.917
2008-08-15T14:20:12.917
null
null
357
null
12,284
2
null
11,903
1
null
While Attribute Exchange has it's problems (I'm sure someone from SO can tell you more), it does have [a lot of benefits](http://blogs.gnome.org/jamesh/2007/11/26/openid-ax/). To some extent it depends on whether you really need it or not. Simple Registration seems to do that job, and it might make sense to just ask th...
null
CC BY-SA 2.5
null
2008-08-15T14:23:14.597
2008-08-15T14:23:14.597
null
null
1,035
null
12,277
2
null
12,144
29
null
YAML, for the simple reason that it makes for very readable configuration files compared to XML. XML: ``` <user id="babooey" on="cpu1"> <firstname>Bob</firstname> <lastname>Abooey</lastname> <department>adv</department> <cell>555-1212</cell> <address password="xxxx">ahunter@example1.com</address> ...
null
CC BY-SA 2.5
null
2008-08-15T14:17:33.890
2008-08-15T14:17:33.890
null
null
175
null
12,285
2
null
12,268
6
null
I'm curious what product he uses to obfuscate Reflector. Or maybe it's his custom solution - he obviously knows tons about IL.
null
CC BY-SA 2.5
null
2008-08-15T14:24:13.143
2008-08-15T14:24:13.143
null
null
1,065
null
12,282
2
null
6,812
0
null
I used Gizmo Daemon for my PowerMate under Debian - it supports fancy keyboard keys as well (although I haven't tried it for those keys). Hacking on gizmod to get it to do what I wanted was pretty easy. [Gizmo Daemon](http://gizmod.sourceforge.net/)
null
CC BY-SA 2.5
null
2008-08-15T14:21:01.840
2008-08-15T14:21:01.840
null
null
1,322
null
12,283
2
null
8,439
11
null
Place two rectangles, one inside the other. Place your table inside the inner rectangle and set it to always be visible. Set the inner rectangle's Page Break to Insert After Rectangle. Set the outer rectangle's visibility to use your conditional expression. The page break and the conditional visibility are now separat...
null
CC BY-SA 2.5
null
2008-08-15T14:22:26.470
2008-08-18T17:21:18.370
2008-08-18T17:21:18.370
1,373
1,373
null
12,279
2
null
11
12
null
@Jeff > ``` var ts = new TimeSpan(DateTime.UtcNow.Ticks - dt.Ticks); ``` Doing a subtraction on `DateTime` returns a `TimeSpan` anyway. So you can just do ``` (DateTime.UtcNow - dt).TotalSeconds ``` I'm also surprised to see the constants multiplied-out by hand and then comments added with the multiplications i...
null
CC BY-SA 4.0
null
2008-08-15T14:20:04.133
2018-10-05T02:38:18.890
2018-10-05T02:38:18.890
8,828,658
987
null
12,287
2
null
12,144
2
null
XML, JSON, INI. They all have their strengths and weaknesses. In an application context, I feel that the abstraction layer is the important thing. If you can choose a way to structure the data that is a good middle ground between human readability and how you want to access/abstract the data in code, you're golden. ...
null
CC BY-SA 2.5
null
2008-08-15T14:26:55.807
2008-08-15T14:26:55.807
null
null
960
null
12,292
2
null
12,271
0
null
Categorization of templates depends on settings (for example, if you choose "C#" settings, all of a sudden all other languages move to an "other languages" tree). What folder is your template in?
null
CC BY-SA 2.5
null
2008-08-15T14:31:21.867
2008-08-15T14:31:21.867
null
null
414
null
12,290
1
15,488
null
6
3,155
Hy, does anyone worked with N2 Content Management System([http://www.codeplex.com/n2](http://www.codeplex.com/n2)). If yes, how does it perform, performance wise(under heavy load)? It seems pretty simple and easy to use. Adrian
Considering N2 CMS but worried about performance. Is this justified?
CC BY-SA 3.0
0
2008-08-15T14:29:20.887
2011-07-04T12:49:14.917
2011-06-04T22:56:59.763
89,989
2,099,426
[ "asp.net", "performance", ".net-3.5", "content-management-system", "n2" ]
12,293
2
null
7,864
0
null
The problem with ActiveRecord is that the queries it automatically generates for you can cause performance problems. You end up doing some unintuitive tricks to optimize the queries that leave you wondering if it would have been more time effective to write the query by hand in the first place.
null
CC BY-SA 2.5
null
2008-08-15T14:32:24.233
2008-08-15T14:32:24.233
null
null
175
null
12,294
1
12,295
null
8
5,340
I need to create a historical timeline starting from 1600's to the present day. I also need to have some way of showing events on the timeline so that they do not appear cluttered when many events are close together. I have tried using Visio 2007 as well as Excel 2007 Radar Charts, but I could not get the results I wa...
Any good tools for creating timelines?
CC BY-SA 2.5
0
2008-08-15T14:32:52.003
2012-03-31T21:09:38.883
2008-08-15T15:31:39.343
1,311
1,311
[ "charts", "timeline" ]
12,299
2
null
12,141
4
null
I once managed to write an updating cursor that never exited. On a 2M+ row table. The locks just escalated and escalated until this 16-core, 8GB RAM (in 2002!) box actually ground to a halt (of the blue screen variety).
null
CC BY-SA 2.5
null
2008-08-15T14:39:26.547
2008-08-15T14:39:26.547
null
null
414
null
12,298
2
null
10,634
12
null
The most compelling reason to use MSBuild (at least in .NET 3.5 and beyond) - the build engine can build concurrently. This means a huge speed up in your builds in you have multiple cores/processors. Previous to 3.5, MSBuild didnt do parallel builds.
null
CC BY-SA 2.5
null
2008-08-15T14:39:02.070
2008-08-15T14:39:02.070
null
null
1,341
null
12,295
2
null
12,294
6
null
SIMILIE Timeline would probably suit your needs. [http://simile.mit.edu/timeline/](http://simile.mit.edu/timeline/) Timeline .NET: [http://www.codeplex.com/timelinenet](http://www.codeplex.com/timelinenet) Oh, i guess i should ask... for personal use or for display to end users? that might change what i would suggest...
null
CC BY-SA 2.5
null
2008-08-15T14:33:25.123
2008-08-15T14:38:44.003
2008-08-15T14:38:44.003
77
77
null
12,297
1
12,373
null
1
4,016
I've got a Repeater that lists all the `web.sitemap` child pages on an ASP.NET page. Its `DataSource` is a `SiteMapNodeCollection`. But, I don't want my registration form page to show up there. ``` Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes 'remove registration page from collection For E...
How can I remove nodes from a SiteMapNodeCollection?
CC BY-SA 3.0
0
2008-08-15T14:38:18.920
2013-04-28T03:06:43.580
2013-04-28T02:59:40.567
1,012,641
83
[ "asp.net", ".net", "vb.net", "repeater", "sitemap" ]
12,302
2
null
12,294
5
null
[Lifehacker](http://lifehacker.com/) has a good [overview and tutorial](http://lifehacker.com/software/memory/geek-to-live--roll-your-own-timeline-207426.php) of [SIMILIE Timeline](http://simile.mit.edu/timeline/). They seem to like it quite a bit.
null
CC BY-SA 2.5
null
2008-08-15T14:44:32.730
2008-08-15T15:22:22.713
2008-08-15T15:22:22.713
1,318
1,318
null
12,309
2
null
12,294
1
null
If you need a timeline from RSS Feeeds give xTimeline a try. I just used it [http://lifehacker.com/software/rss/create-a-timeline-from-rss-feeds-with-xtimeline-283098.php](http://lifehacker.com/software/rss/create-a-timeline-from-rss-feeds-with-xtimeline-283098.php)
null
CC BY-SA 2.5
null
2008-08-15T14:47:39.367
2008-08-15T14:47:39.367
null
null
805
null
12,303
2
null
12,297
1
null
Using Linq and .Net 3.5: ``` //this will now be an enumeration, rather than a read only collection Dim children = SiteMap.CurrentNode.ChildNodes.Where( _ Function (x) x.Url <> "/Registration.aspx" ) RepeaterSubordinatePages.DataSource = children ``` Without Linq, but using .Net 2: ``` Function IsShown( n as Si...
null
CC BY-SA 2.5
null
2008-08-15T14:44:45.380
2008-08-15T15:26:26.543
2008-08-15T15:26:26.543
905
905
null
12,310
2
null
11,665
2
null
Thanks, I got it working using [FlexLib](http://code.google.com/p/flexlib/)'s CanvasButtonAccordionHeader.
null
CC BY-SA 2.5
null
2008-08-15T14:47:51.863
2008-08-15T14:47:51.863
null
null
26
null
12,301
2
null
2,785
38
null
Another reason to avoid setting objects to null when you are done with them is that it can actually keep them alive for longer. e.g. ``` void foo() { var someType = new SomeType(); someType.DoSomething(); // someType is now eligible for garbage collection // ... rest of method not using 'so...
null
CC BY-SA 2.5
null
2008-08-15T14:43:34.930
2008-08-15T14:43:34.930
null
null
1,367
null
12,306
1
12,342
null
60
72,926
I'm trying to serialize a Type object in the following way: ``` Type myType = typeof (StringBuilder); var serializer = new XmlSerializer(typeof(Type)); TextWriter writer = new StringWriter(); serializer.Serialize(writer, myType); ``` When I do this, the call to Serialize throws the following exception: > "The typ...
Can I serialize a C# Type object?
CC BY-SA 3.0
0
2008-08-15T14:46:07.687
2019-02-25T18:44:28.513
2013-04-11T08:13:15.997
815,073
767
[ "c#", "serialization" ]
12,313
2
null
10,634
27
null
My advice is just the opposite - Avoid MSBuild like the plague. NANT is far far easier to set up your build to do automatic testing, deploy to multiple production environments, integrate with cruisecontrol for an entry environment, integrate with source control. We've gone through so much pain with TFS/MSBuild (Using...
null
CC BY-SA 2.5
null
2008-08-15T14:49:46.790
2008-08-15T14:49:46.790
null
null
1,208
null
12,304
1
null
null
0
1,054
This is a problem I have seen other people besides myself having, and I haven't found a good explanation. Let's say you have a maintenance plan with a task to check the database, something like this: ``` USE [MyDb] GO DBCC CHECKDB with no_infomsgs, all_errormsgs ``` If you go look in your logs after the task execut...
Why do Sql Server 2005 maintenance plans use the wrong database for dbcc checkdb?
CC BY-SA 2.5
null
2008-08-15T14:45:33.070
2014-11-25T16:52:11.517
2014-11-25T16:52:11.517
2,641,576
1,219
[ "sql-server", "sql-server-2005" ]
12,316
2
null
9,033
13
null
I didn't start to really appreciate the "using" blocks until recently. They make things so much more tidy :)
null
CC BY-SA 2.5
null
2008-08-15T14:51:42.590
2008-08-15T14:51:42.590
null
null
794
null
12,315
2
null
12,306
2
null
According to the MSDN documentation of System.Type [1] you should be able to serialize the System.Type object. However, as the error is explicitly referring to System.Text.StringBuilder, that is likely the class that is causing the serialization error. [1] Type Class (System) - [http://msdn.microsoft.com/en-us/library...
null
CC BY-SA 2.5
null
2008-08-15T14:50:59.097
2008-08-15T14:50:59.097
null
null
1,185
null
12,314
2
null
12,306
1
null
Just looked at its definition, it is not marked as Serializable. If you really need this data to be serialize, then you may have to convert it to a custom class that is marked as such. ``` public abstract class Type : System.Reflection.MemberInfo Member of System Summary: Represents type declarations: class types...
null
CC BY-SA 2.5
null
2008-08-15T14:50:09.520
2008-08-15T14:50:09.520
null
null
805
null
12,320
2
null
12,304
1
null
For starters, always remember that `GO` is not a SQL keyword; it is merely a batch separator that is (generally) implemented/recognized by the client, not the server. So, depending on context and client, there really is no guarantee that the current database is preserved between batches.
null
CC BY-SA 3.0
null
2008-08-15T15:00:16.380
2014-01-20T18:14:29.837
2014-01-20T18:14:29.837
414
414
null
12,325
2
null
12,268
0
null
Are you allowed to reflect it according to the EULA (if any) ? I would guess not, and not surprised that you can't.
null
CC BY-SA 2.5
null
2008-08-15T15:03:04.500
2008-08-15T15:03:04.500
null
null
1,192
null
12,317
2
null
10,634
1
null
The main reason I still use nAnt over msbuild for my automated builds is that I have more granular control on my builds. Due to msbuild using the csproj has it's build file, all the source in that project is compiled into one assembly. Which causes me to have a lot of projects in my solution for large projects where ...
null
CC BY-SA 2.5
null
2008-08-15T14:51:51.293
2008-08-15T14:55:25.560
2008-08-15T14:55:25.560
1,117
1,117
null
12,319
1
265,407
null
18
10,571
I'm looking to the equivalent of Windows [_wfopen()](http://msdn.microsoft.com/fr-fr/library/yeby3zcb.aspx) under Mac OS X. Any idea? I need this in order to port a Windows library that uses `wchar*` for its File interface. As this is intended to be a cross-platform library, I am unable to rely on how the client appli...
_wfopen equivalent under Mac OS X
CC BY-SA 2.5
0
2008-08-15T14:59:11.653
2013-12-27T11:46:16.403
2008-10-02T12:42:08.927
268
268
[ "c++", "winapi", "macos", "porting", "fopen" ]
12,330
1
12,381
null
7
8,412
Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :) P.S. Great site.
Programmatically list WMI classes and their properties
CC BY-SA 2.5
0
2008-08-15T15:06:31.873
2009-05-18T12:19:48.473
2009-05-18T09:40:53.490
2,361
null
[ "vbscript", "wmi" ]
12,321
2
null
9,882
3
null
Thanks for all the great suggestions. Chris, is right. I am looking for a generic solution for normalizing any kind of text. The solution of the problem boils down to dynmamically finding patterns in two or more similar strings. Almost like predicting the next element in a set, based on the previous two: 1: Everest i...
null
CC BY-SA 2.5
null
2008-08-15T15:00:43.553
2008-08-15T15:00:43.553
null
null
null
null
12,332
1
12,408
null
19
3,958
I am looking for a more technical explanation than the OS calls the function. Is there a website or book?
In a C/C++ program, how does the system (Windows, Linux, and Mac OS X) call the main() function?
CC BY-SA 4.0
0
2008-08-15T15:08:48.560
2022-06-27T21:38:25.447
2022-06-27T21:01:59.750
63,550
null
[ "c++", "c", "program-entry-point" ]
12,350
2
null
12,348
5
null
A tip is to use the [WAMP-installer](http://www.wampserver.com/en/). Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;) EDIT: I saw that you found the solution so I voted it up. +1
null
CC BY-SA 2.5
null
2008-08-15T15:18:58.667
2008-08-15T15:18:58.667
null
null
936
null
12,342
2
null
12,306
100
null
I wasn't aware that a Type object could be created with only a string containing the fully-qualified name. To get the fully qualified name, you can use the following: ``` string typeName = typeof (StringBuilder).FullName; ``` You can then persist this string however needed, then reconstruct the type like this: ```...
null
CC BY-SA 2.5
null
2008-08-15T15:12:43.373
2008-08-15T15:12:43.373
null
null
767
null
12,358
2
null
12,144
0
null
Maybe a bit of a tangent here but my opinion is that the config file should be read into a key value dictionary/hash table when the app first starts up and always accessed via this object from then on for speed. Typically the key/value table starts off as string to string but helper functions in the object do things su...
null
CC BY-SA 2.5
null
2008-08-15T15:23:52.463
2008-08-15T15:23:52.463
null
null
null
null
12,348
1
12,349
null
30
37,051
I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my file, I have this line: > extension_dir ="F:\PHP\ext" And later, I have: > extension=php_curl.dll The file exists, but when I try to run any PHP script, I get this in the error log: > PHP Warning: PHP Startup: Una...
PHP / cURL on Windows install: "The specified module could not be found."
CC BY-SA 3.0
0
2008-08-15T15:17:30.073
2022-09-04T19:47:50.887
2012-04-25T16:41:03.067
1,332,690
1,418
[ "php", "windows", "curl" ]
12,361
2
null
11,857
3
null
[Trac](http://trac.edgewall.org) It seems targeted for Open Source / Community type projects but it's working just find as an internal Developer intranet. It integrates a Wiki, Bug tracker and SVN Source browser into one nice package and it's very easy to configure.
null
CC BY-SA 2.5
null
2008-08-15T15:24:57.390
2008-08-15T15:24:57.390
null
null
758
null
12,184
2
null
12,144
10
null
Without starting a new holy war, the sentiments of the 'angle bracket tax' post is one area where I with Jeff. There's nothing wrong with XML, it's reasonably human readable (as much as YAML or JSON or INI files are) but remember its intent is to be read by machines. Most language/framework combos come with an XML par...
null
CC BY-SA 2.5
null
2008-08-15T12:24:13.713
2008-08-15T12:24:13.713
null
null
419
null
12,367
2
null
12,319
0
null
If you're using Cocoa it's fairly easy with NSString. Just load the UTF16 data in using -initWithBytes:length:encoding: (or perhaps -initWithCString:encoding:) and then get a UTF8 version by calling UTF8String on the result. Then, just call fopen with your new UTF8 string as the param. You can definitely call fopen w...
null
CC BY-SA 2.5
null
2008-08-15T15:26:26.920
2008-08-15T15:38:05.583
2008-08-15T15:38:05.583
35
35
null
12,349
2
null
12,348
35
null
Problem solved! Although the error message said , this is a little misleading -- it's not that it couldn't find `php_curl.dll`, but rather it couldn't find a module that `php_curl.dll` required. The 2 DLLs it requires are `libeay32.dll` and `SSLeay32.dll`. So, you have to put those 2 DLLs somewhere in your PATH (e.g...
null
CC BY-SA 3.0
null
2008-08-15T15:18:53.063
2016-03-09T16:23:13.137
2016-03-09T16:23:13.137
1,418
1,418
null
12,364
2
null
12,294
0
null
@Pascal this page? [http://tools.mscorlib.com/timeline/Default.aspx](http://tools.mscorlib.com/timeline/Default.aspx). If it's looking like ascii maybe look for a js error, but that renders on my system fine. If all else fails, it's a decent js library by the MIT team as it is, so you could wire up your own implementat...
null
CC BY-SA 2.5
null
2008-08-15T15:25:44.503
2008-08-15T15:25:44.503
null
null
77
null
12,353
2
null
12,332
8
null
`main()` is part of the C library and is not a system function. I don't know for OS X or Linux, but Windows usually starts a program with `WinMainCRTStartup()`. This symbol init your process, extract command line arguments and environment (`argc, argv, end`) and calls `main()`. It is also responsible of calling any cod...
null
CC BY-SA 2.5
null
2008-08-15T15:19:16.713
2008-08-15T15:19:16.713
null
null
268
null
12,368
1
12,394
null
44
84,695
The .NET garbage collector will eventually free up memory, but what if you want that memory back immediately? What code do you need to use in a class `MyClass` to call ``` MyClass.Dispose() ``` and free up all the used space by variables and objects in `MyClass`?
How to dispose a class in .net?
CC BY-SA 3.0
0
2008-08-15T15:26:41.987
2016-06-22T15:16:51.927
2016-06-22T15:16:51.927
119,527
1,271
[ ".net", "memory", "dispose" ]
12,369
1
null
null
5
2,435
I'm using VS2008 SP1 - don't know if this would have happened before I applied SP1 as I never tried it before yesterday. I attempted to debug a fairly simple XSLT file using VS2008 SP1 and got this crash from VS2008 SP1: --- ## Microsoft Visual Studio Unexpected error encountered. It is recommended that you re...
VS2008 SP1 crashes when debugging an XSLT file
CC BY-SA 2.5
0
2008-08-15T15:27:16.700
2010-10-08T09:10:14.043
2010-10-08T09:10:14.043
24,472
null
[ "visual-studio-2008", "xslt", "visual-sourcesafe-plugin" ]
12,373
2
null
12,297
1
null
Your shouldn't need CType ``` Dim children = _ From n In SiteMap.CurrentNode.ChildNodes.Cast(Of SiteMapNode)() _ Where n.Url <> "/Registration.aspx" _ Select n ```
null
CC BY-SA 2.5
null
2008-08-15T15:28:40.987
2008-08-15T15:28:40.987
null
null
905
null
12,362
2
null
12,297
0
null
I got it to work with code below: ``` Dim children = From n In SiteMap.CurrentNode.ChildNodes _ Where CType(n, SiteMapNode).Url <> "/Registration.aspx" _ Select n RepeaterSubordinatePages.DataSource = children ``` Is there a better way where I don't have to use the `CType()`? Also, thi...
null
CC BY-SA 3.0
null
2008-08-15T15:25:15.547
2013-04-28T03:06:43.580
2013-04-28T03:06:43.580
1,012,641
83
null
12,377
2
null
12,368
3
null
``` public class MyClass : IDisposable { public void Dispose() { // cleanup here } } ``` then you can do something like this ``` MyClass todispose = new MyClass(); todispose.Dispose(); // instance is disposed right here ``` or ``` using (MyClass instance = new MyClass()) { } // instance will b...
null
CC BY-SA 2.5
null
2008-08-15T15:32:02.413
2008-08-15T15:32:02.413
null
null
77
null
11,994
2
null
10,314
15
null
Most Cocoa projects use underbar as a non-`IBOutlet` instance variable prefix, and use no prefix for `IBOutlet` instance variables. The reason I don't use underbars for `IBOutlet` instance variables is that when a nib file is loaded, if you have a setter method for a connected outlet, that setter will be called. thi...
null
CC BY-SA 2.5
null
2008-08-15T05:32:40.293
2008-08-15T05:32:40.293
null
null
714
null
12,383
2
null
12,368
0
null
If you don't want to (or can't) implement IDisposable on your class, you can force garbage collection like this (but it's slow) - ``` GC.Collect(); ```
null
CC BY-SA 2.5
null
2008-08-15T15:33:55.373
2008-08-15T15:33:55.373
null
null
357
null
12,381
2
null
12,330
5
null
I believe this is what you want. [WMI Code Creator](http://www.microsoft.com/downloads/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en) A part of this nifty utility allows you to browse namespaces/classes/properties on the local and remote PCs, not to mention generating WMI code in VBScript/...
null
CC BY-SA 2.5
null
2008-08-15T15:33:42.847
2008-08-15T16:07:07.570
2008-08-15T16:07:07.570
1,424
1,424
null
12,380
2
null
12,368
0
null
If MyClass implements IDisposable you can do just that. ``` MyClass.Dispose(); ``` Best practice in C# is: ``` using( MyClass x = new MyClass() ) { //do stuff } ``` As that wraps up the dispose in a try-finally and makes sure that it's never missed.
null
CC BY-SA 2.5
null
2008-08-15T15:32:40.337
2008-08-15T15:32:40.337
null
null
905
null
12,376
2
null
12,368
1
null
[This article](http://www.codeguru.com/csharp/.net/net_general/tipstricks/article.php/c7047/) has a pretty straightforward walkthrough. However, to call the GC instead of letting it take its natural course is generally a sign of bad design/memory management, if no limited resources are being consumed (connections, h...
null
CC BY-SA 2.5
null
2008-08-15T15:30:57.393
2008-08-15T15:34:43.890
2008-08-15T15:34:43.890
35
35
null
12,379
2
null
9,882
1
null
I don't know of any specific tool to do that. What I did when I had a similar problem to solve was trying to guess regular expressions to match lines. I then processed the files and displayed only the unmatched lines. If a line is unmatched, it means that the pattern is wrong and should be tweaked or another pattern s...
null
CC BY-SA 2.5
null
2008-08-15T15:32:17.873
2008-08-15T15:32:17.873
null
null
268
null