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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,686 | 2 | null | 10,680 | 15 | null | According to [this link](http://www.delorie.com/gnu/docs/glibc/libc_560.html) I found, it seems there are a few differences. `on_exit` will let you pass in an argument that is passed in to the `on_exit` function when it is called... which might let you set up some pointers to do some cleanup work on when it is time to... | null | CC BY-SA 2.5 | null | 2008-08-14T05:03:17.707 | 2008-08-14T05:03:17.707 | null | null | 122 | null |
10,689 | 2 | null | 10,532 | 2 | null | Using Zend Db:
```
require_once 'Zend/Db.php';
$DB_ADAPTER = 'Pdo_Pgsql';
$DB_CONFIG = array(
'username' => 'app_db_user',
'password' => 'xxxxxxxxx',
'host' => 'localhost',
'port' => 5432,
'dbname' => 'mydb'
);
$db = Zend_Db::factory($DB_ADAPTER, $DB_CONFIG);
```
| null | CC BY-SA 2.5 | null | 2008-08-14T05:11:13.930 | 2008-08-14T05:11:13.930 | null | null | 486 | null |
10,698 | 2 | null | 8,970 | 9 | null | You should check out the [QTKit Capture documentation](http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004574-CH1-DontLinkElementID_41).
On Leopard, you can get at all of it over the RubyCocoa bridge:
```
require ... | null | CC BY-SA 2.5 | null | 2008-08-14T05:28:59.683 | 2008-08-14T05:28:59.683 | null | null | 528 | null |
10,700 | 2 | null | 10,532 | 0 | null | Depending on the scale of your application, you might wish to consider the number of connections going to the backend. The consensus seem to be that PHP persistent connections and PostgreSQL don't work well together, so something like [pgpool-||](http://pgpool.projects.postgresql.org/) should be used as an intermediary... | null | CC BY-SA 2.5 | null | 2008-08-14T05:31:03.327 | 2008-08-14T05:31:03.327 | null | null | 1,265 | null |
10,714 | 2 | null | 10,670 | 0 | null | The idea behind using the ThreadPool is that through it you can control the amount of synchronous threads, and if those get too many, then the thread pool automatically manages the waiting of newer threads.
The Asp.Net worked thread (AFAIK) doesn't come from the Thread Pool and shouldn't get affected by your call to t... | null | CC BY-SA 2.5 | null | 2008-08-14T05:53:40.397 | 2008-08-14T05:53:40.397 | null | null | 380 | null |
10,713 | 2 | null | 10,586 | 3 | null | StAX works pretty well and is very fast. I used it in a project to parse XML files which are up to 20MB. I don't have a thorough analysis, but it was definitely faster than SAX.
As for your question: The difference between streaming and event-handling, AFAIK is control. With the streaming API you can walk through you... | null | CC BY-SA 2.5 | null | 2008-08-14T05:52:27.730 | 2008-08-14T05:52:27.730 | null | null | 198 | null |
10,564 | 1 | 773,973 | null | 642 | 399,757 | I'm trying out . I got to the point of trying "git commit" and I got this error:
> Terminal is dumb but no VISUAL nor
EDITOR defined. Please supply the
message using either -m or -F option.
So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad. That worked... | How can I set up an editor to work with Git on Windows? | CC BY-SA 2.5 | 0 | 2008-08-14T01:43:04.270 | 2022-08-17T11:57:36.867 | 2016-12-24T17:26:04.737 | 1,002,260 | 437 | [
"windows",
"git",
"cygwin",
"editor"
] |
10,718 | 2 | null | 10,486 | 1 | null | Data Point -- Python Regression Tests
Here are the numbers on my laptop for running "make test" for Python 2.5.2:
- - -
| null | CC BY-SA 2.5 | null | 2008-08-14T05:59:27.343 | 2008-08-14T05:59:27.343 | null | null | 116 | null |
10,726 | 2 | null | 10,634 | 1 | null | I think they're relatively comparable both in features and ease of use. Just from being C# based I find msbuild easier to work with than nants, though that's hardly a compelling reason to switch.
What exactly is nant not doing for you? Or are you just hoping there's some cool feature you may be missing out on? :)
One... | null | CC BY-SA 2.5 | null | 2008-08-14T06:07:42.770 | 2008-08-14T06:07:42.770 | null | null | 1,043 | null |
10,727 | 1 | 10,818 | null | 3 | 687 | In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours?
and on which database?
| What is a "reasonable" length of time to keep a SQL cursor open? | CC BY-SA 2.5 | null | 2008-08-14T06:07:53.347 | 2009-02-13T00:54:40.213 | 2008-09-09T21:13:53.247 | -1 | 116 | [
"sql",
"cursors"
] |
10,729 | 2 | null | 10,658 | 0 | null | iCal can be complicated, so I recommend using a library. DDay is a good free solution. Last I checked it didn't have full support for recurring events, but other than that it looks really nice. Definitely test the calendars with several clients.
| null | CC BY-SA 2.5 | null | 2008-08-14T06:10:00.863 | 2008-08-14T06:10:00.863 | null | null | 571 | null |
10,730 | 2 | null | 10,727 | 5 | null | transactions: minutes.
Cursors: 0seconds maximum, if you use a cursor we fire you.
| null | CC BY-SA 2.5 | null | 2008-08-14T06:10:22.983 | 2008-08-15T17:43:52.820 | 2008-08-15T17:43:52.820 | 1,220 | 1,220 | null |
10,734 | 2 | null | 10,731 | 1 | null | plain text? If they're on your server, I would hope the server is secure enough not to allow unauthorised access. If people can access your config files on the server, something has gone wrong much earlier.
| null | CC BY-SA 2.5 | null | 2008-08-14T06:12:31.013 | 2008-08-14T06:12:31.013 | null | null | 493 | null |
10,731 | 1 | 10,820 | null | 8 | 5,718 | So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time.
What's the best way to store the name/password for these applications, in terms of
- -
both windows and linux solutions appreciated!
| Best way to store a database password in a startup script / config file? | CC BY-SA 2.5 | 0 | 2008-08-14T06:10:25.013 | 2010-11-04T05:57:28.910 | 2010-11-04T05:57:28.910 | 13,302 | 116 | [
"sql-server",
"security",
"passwords"
] |
10,732 | 2 | null | 10,727 | 8 | null | I'm probably going to get flamed for this, but you really should try and avoid using cursors as they incur a serious performance hit. If you must use it, you should keep it open the absolute minimum amount of time possible so that you free up the resources being blocked by the cursor ASAP.
| null | CC BY-SA 2.5 | null | 2008-08-14T06:10:46.197 | 2008-08-14T06:10:46.197 | null | null | 493 | null |
10,705 | 2 | null | 11 | 99 | null | ```
public static string RelativeDate(DateTime theDate)
{
Dictionary<long, string> thresholds = new Dictionary<long, string>();
int minute = 60;
int hour = 60 * minute;
int day = 24 * hour;
thresholds.Add(60, "{0} seconds ago");
thresholds.Add(minute * 2, "a minute ago");
thresholds.Add(45 *... | null | CC BY-SA 3.0 | null | 2008-08-14T05:43:45.330 | 2018-02-22T16:30:42.393 | 2018-02-22T16:30:42.393 | 305,953 | 1,220 | null |
10,745 | 2 | null | 10,731 | 1 | null | clarification: in terms of security, maintainability (e.g. if the login needs to change, can I find it later, etc)
@lomax: perhaps I might not want everyone with access to the physical server (e.g. sysadmins) to see the password.
Thanks!
| null | CC BY-SA 2.5 | null | 2008-08-14T06:20:30.187 | 2008-08-14T06:20:30.187 | null | null | 116 | null |
10,747 | 2 | null | 3,385 | 74 | null | I concur with all the previous answers that it would be a privacy/security vulnerability if you would be able to do this directly from Javascript. There are two things I can think of:
- -
| null | CC BY-SA 2.5 | null | 2008-08-14T06:21:12.150 | 2008-08-14T06:21:12.150 | null | null | 1,265 | null |
10,737 | 2 | null | 10,634 | 31 | null | I like MSBuild. One reason is that .csproj files are msbuild files, and building in VS is just like building at the command line. Another reason is the good support from TeamCity which is the CI server I've been using. If you start using MSBuild, and you want to do more custom things in your build process, get the [... | null | CC BY-SA 2.5 | null | 2008-08-14T06:14:26.970 | 2009-08-14T21:25:38.370 | 2009-08-14T21:25:38.370 | 571 | 571 | null |
10,748 | 2 | null | 2,658 | 8 | null | I've used RCS, CVS, SCCS, SourceSafe, Vault, perforce, subversion, and git.
I've evaluated BitKeeper, Dimensions, arch, bazaar, svk, ClearCase, PVCS, and Synergy.
If I had to start a new repository today, I'd choose . Hands down.
It's free, fast, and under active development.
And you can use it as a client of any ... | null | CC BY-SA 2.5 | null | 2008-08-14T06:21:33.197 | 2008-08-14T06:21:33.197 | null | null | 528 | null |
10,756 | 2 | null | 10,752 | 15 | null | using Single responsibility design, its black and white. More than 1 responsibility, its an integration test.
By the duck test (looks, quacks, waddles, its a duck), its just a unit test with more than 1 newed object in it.
When you get into mvc and testing it, controller tests are always integration, because the con... | null | CC BY-SA 2.5 | null | 2008-08-14T06:32:30.317 | 2008-08-14T06:36:29.063 | 2008-08-14T06:36:29.063 | 1,220 | 1,220 | null |
10,760 | 2 | null | 10,752 | 3 | null | Unit testing is testing against a unit of work or a block of code if you like. Usually performed by a single developer.
Integration testing refers to the test that is performed, preferably on an integration server, when a developer commits their code to a source control repository. Integration testing might be perform... | null | CC BY-SA 2.5 | null | 2008-08-14T06:36:58.140 | 2008-08-14T06:36:58.140 | null | null | 202 | null |
10,758 | 2 | null | 10,752 | 18 | null | I think when you start thinking about integration tests, you are speaking more of a cross between physical layers rather than logical layers.
For example, if your tests concern itself with generating content, it's a unit test: if your test concerns itself with just writing to disk, it's still a unit test, but once you... | null | CC BY-SA 2.5 | null | 2008-08-14T06:34:05.853 | 2008-08-14T06:34:05.853 | null | null | 372 | null |
10,761 | 2 | null | 10,752 | 4 | null | I think I would still call a couple of interacting classes a unit test provided that the unit tests for class1 are testing class1's features, and the unit tests for class2 are testing its features, and also that they are not hitting the database.
I call a test an integration test when it runs through most of my stack ... | null | CC BY-SA 2.5 | null | 2008-08-14T06:37:17.407 | 2008-08-14T06:37:17.407 | null | null | 571 | null |
10,752 | 1 | null | null | 347 | 61,436 | I know the so-called textbook definition of unit tests and integration tests. What I am curious about is when it is time to write unit tests... I will write them to cover as many sets of classes as possible.
For example, if I have a `Word` class, I will write some unit tests for the `Word` class. Then, I begin writi... | What is the difference between integration and unit tests? | CC BY-SA 4.0 | 0 | 2008-08-14T06:27:57.207 | 2023-02-10T12:28:38.103 | 2019-09-09T16:05:25.957 | 2,756,409 | 122 | [
"unit-testing",
"integration-testing"
] |
10,762 | 2 | null | 10,752 | 1 | null | A little bit academic this question, isn't it? ;-)
My point of view:
For me an integration test is the test of the whole part, not if two parts out of ten are going together.
Our integration test shows, if the master build (containing 40 projects) will succeed.
For the projects we have tons of unit tests.
The most impo... | null | CC BY-SA 2.5 | null | 2008-08-14T06:37:59.870 | 2008-08-14T06:37:59.870 | null | null | 1,069 | null |
10,766 | 2 | null | 10,731 | 3 | null | I agree with lomaxx: if somebody is already on the server or has wide ranging access to it (like a sysadmin), the game is pretty much over. So the idea would be to use a server you trust that it is secure to the degree you want it to be. Specifically:
- -
Beyond that, environment variables seem to be a popular choic... | null | CC BY-SA 2.5 | null | 2008-08-14T06:41:12.330 | 2008-08-14T06:41:12.330 | null | null | 1,265 | null |
10,769 | 2 | null | 10,752 | 4 | null | I do the same - I call them all unit tests, but at some point I have a "unit test" that covers so much I often rename it to "..IntegrationTest" - just a name change only, nothing else changes.
I think there is a continuation from "atomic tests" (testing one tiny class, or a method) to unit tests (class level) and int... | null | CC BY-SA 2.5 | null | 2008-08-14T06:47:54.093 | 2008-08-14T06:47:54.093 | null | null | 699 | null |
10,764 | 2 | null | 10,731 | 0 | null | You can bake a symmetric encryption key into your binary, and have that binary read an encrypted username/password from a file on disk when it starts up.
However, this is not really much more than obfuscation, since your code is likely to be stored in some source repository somewhere.
I would suggest that you wou... | null | CC BY-SA 2.5 | null | 2008-08-14T06:39:42.627 | 2008-08-14T06:39:42.627 | null | null | 528 | null |
10,770 | 2 | null | 10,680 | 0 | null | @Nathan
First, see if there is another API call to determine exit status... a quick glance and I don't see one, but I am not well versed in the standard C API.
An easy alternative is to have a global variable that stores the exit status... the default being an unknown error cause (for if the program terminates abnorm... | null | CC BY-SA 2.5 | null | 2008-08-14T06:51:23.337 | 2008-08-14T06:51:23.337 | null | null | 122 | null |
10,780 | 2 | null | 1,644 | 1 | null | My list is pretty similar to the rest -
TWIT, MBW, .NET Rocks, Hanselminutes, Polymorphic Podcast and specifically for Mac developers the [Mac developer network](http://www.mac-developer-network.com/) has some a couple of good podcasts
| null | CC BY-SA 2.5 | null | 2008-08-14T07:15:24.600 | 2008-08-14T07:15:24.600 | null | null | 1,075 | null |
10,782 | 1 | 10,786 | null | 2 | 8,276 | What steps I need to perform in order to convert asp.net 2 application from IIS7 classic to integrated mode?
| Convert an asp.net application to IIS7 integrated mode | CC BY-SA 2.5 | 0 | 2008-08-14T07:21:12.653 | 2008-11-19T18:17:03.773 | 2008-11-19T18:17:03.773 | 2,548 | 481 | [
"asp.net",
"iis-7",
".net-2.0"
] |
10,775 | 2 | null | 1,644 | 0 | null | Over this summer I've enjoyed:
- - -
I echo the sentiment about the difference between tech gossip (TWiT, Diggnation, etc) and software development podcasts; while the former can sometimes be entertaining, I've found they tend towards the audio equivalent of Digg rather than Hacker News, programming.reddit, or, hope... | null | CC BY-SA 2.5 | null | 2008-08-14T07:03:07.277 | 2008-08-14T07:03:07.277 | null | null | 1,266 | null |
10,779 | 2 | null | 10,731 | 1 | null | In most cases, I believe it is sufficient to obfuscate the password in a plain text file (eg. with base64). You cannot completely protect a stored password against a determined sysadmin with root access, so there's not really any need to try. Simple obfuscation, however, protects against accidentally revealing the pass... | null | CC BY-SA 2.5 | null | 2008-08-14T07:13:19.597 | 2008-08-14T07:13:19.597 | null | null | 893 | null |
10,774 | 2 | null | 2,658 | 5 | null | > @superjoe30What about using source control on your own computer, if you're the sole programmer? Is this good practice? Are there related tips or tricks?
I find git is actually easier for this as you don't need a server or worry about entering URL's and so on. Your version-control stuff just lives in the `.git` direc... | null | CC BY-SA 2.5 | null | 2008-08-14T07:00:50.370 | 2008-08-14T07:00:50.370 | null | null | 234 | null |
10,783 | 2 | null | 10,604 | 1 | null | Take a look at this chapter Jeff Atwood and I wrote about performance optimizations for websites. We cover a lot of stuff, but there's a lot of stuff about database tracing and optimization:
[Speed Up Your Site: 8 ASP.NET Performance Tips](http://www.sitepoint.com/article/aspnet-performance-tips)
| null | CC BY-SA 2.5 | null | 2008-08-14T07:23:00.933 | 2008-08-14T07:23:00.933 | null | null | 5 | null |
10,786 | 2 | null | 10,782 | 5 | null | Here is a process:
[Rick Strahl's blog](http://www.west-wind.com/WebLog/posts/6075.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-14T07:34:47.073 | 2008-08-14T07:34:47.073 | null | null | 481 | null |
10,581 | 2 | null | 10,580 | 6 | null | Taken directly from [http://word.mvps.org/fAQs/InterDev/EarlyvsLateBinding.htm](http://word.mvps.org/fAQs/InterDev/EarlyvsLateBinding.htm)
> There are two ways to use Automation (or OLE Automation) to
programmatically control another application.Late binding uses CreateObject to create and instance of the
applicat... | null | CC BY-SA 3.0 | null | 2008-08-14T02:16:32.660 | 2012-08-07T02:34:28.503 | 2012-08-07T02:34:28.503 | 390,278 | 1,053 | null |
10,785 | 2 | null | 10,727 | 2 | null | Generally I agree with the other answers: Avoid cursors when possible (in most cases) and close them as fast as possible.
However: It all depends on the environment you're working in.
- -
| null | CC BY-SA 2.5 | null | 2008-08-14T07:34:12.470 | 2008-08-14T07:34:12.470 | null | null | 999 | null |
10,788 | 2 | null | 2,658 | 13 | null | If you are new to versioncontrol read this:
[Source Control HOWTO](http://www.ericsink.com/scm/source_control.html)
| null | CC BY-SA 3.0 | null | 2008-08-14T07:42:38.540 | 2013-01-27T12:21:12.967 | 2013-01-27T12:21:12.967 | null | 1,069 | null |
10,789 | 2 | null | 10,644 | 0 | null | I found the [.NET Memory Profiler](http://memprofiler.com/) yesterday, and I must say that I'm very impressed by it.
I'm going to order my license today.
| null | CC BY-SA 2.5 | null | 2008-08-14T07:50:47.743 | 2008-08-14T07:50:47.743 | null | null | 936 | null |
10,796 | 2 | null | 10,680 | 1 | null | @Nathan, I can't find any function that will return the exit code for the current running process. I expect that it isn't set yet at the point when `atexit()` is called, anyway. By this I mean that the runtime knows what it is, but probably hasn't reported it to the OS. This is pretty much just conjecture, though.
... | null | CC BY-SA 2.5 | null | 2008-08-14T08:09:47.563 | 2008-08-14T08:09:47.563 | null | null | 872 | null |
10,798 | 1 | 10,802 | null | 20 | 5,375 | When creating a new ASP.NET project in Visual Studio should I chose create: website or project?
I understand that web application project was the way to do it back in the day with VS 2003 but is it still applicable today? What are some of the caveats using one over the other?
| ASP.NET Web Site or Web Project | CC BY-SA 4.0 | 0 | 2008-08-14T08:14:15.293 | 2019-12-23T13:28:08.430 | 2019-12-23T13:28:08.430 | 3,002,139 | 831 | [
"asp.net",
"visual-studio",
"web-site-project",
"web-application-project"
] |
10,802 | 2 | null | 10,798 | 26 | null | There's a [pretty good comparison chart on MSDN](http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5).
Website projects are simple, in that all files added to the project folders are automatically compiled and included, which was supposedly added to make it more palatable to classic ASP and PHP de... | null | CC BY-SA 2.5 | null | 2008-08-14T08:18:23.177 | 2008-08-14T08:24:38.533 | 2008-08-14T08:24:38.533 | 5 | 5 | null |
10,805 | 2 | null | 8,624 | 0 | null | I think I over-emphasized it was for the users.
I know by using in trace in the web.config I can get accurate information on page render times along with times for accessing the database.
We have in the past had problems with applications running too slowly over the network although it's now fixed I'm adding the labe... | null | CC BY-SA 3.0 | null | 2008-08-14T08:25:42.773 | 2013-01-22T10:19:59.760 | 2013-01-22T10:19:59.760 | 1,410,342 | 982 | null |
10,809 | 2 | null | 10,260 | 1 | null | As others have said, there's a good list at [www.asp.net/learn](http://www.asp.net/learn/3.5-videos/). I think the biggest ASP.NET specific changes are:
- - - -
Note that ASP.NET MVC is not released yet, and was definitely not included with ASP.NET 3.5.
| null | CC BY-SA 2.5 | null | 2008-08-14T08:35:30.553 | 2008-08-14T08:35:30.553 | null | null | 5 | null |
10,812 | 2 | null | 10,793 | 0 | null | How about adding a new sub-class of UserControl that error-handles its render and load methods (so that they hide as you wish) and then inheriting from that for your user controls?
| null | CC BY-SA 2.5 | null | 2008-08-14T08:42:16.733 | 2008-08-14T08:42:16.733 | null | null | 905 | null |
10,810 | 1 | 12,106 | null | 4 | 2,974 | I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and am receiving the the following error:
> Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Pract... | Why do I get the error "Unable to update the password" when calling AzMan? | CC BY-SA 3.0 | 0 | 2008-08-14T08:38:24.760 | 2014-12-13T07:40:56.867 | 2014-12-13T07:40:56.867 | 1,810,429 | 966 | [
"c#",
"winforms",
"authorization",
"adam",
"azman"
] |
10,814 | 2 | null | 10,599 | 0 | null | There are a couple of date widgets available out in the aether. Then you can allow only valid input.
| null | CC BY-SA 2.5 | null | 2008-08-14T08:48:50.027 | 2008-08-14T08:48:50.027 | null | null | 188 | null |
10,811 | 2 | null | 10,260 | 8 | null | For ASP.NET, you have a lot of improvements:
- - - -
Anyway most of the useful stuff are really in the meat of the language, and for .NET 3.5 the new language features for C# 3.0 will be (and yes, I find ALL of them useful)
- - - - - - - -
I might have forgotten a few, but I think this is about most of the new co... | null | CC BY-SA 2.5 | null | 2008-08-14T08:39:11.060 | 2008-08-14T08:54:24.230 | 2008-08-14T08:54:24.230 | 372 | 372 | null |
10,808 | 1 | 3,867,490 | null | 35 | 30,526 | Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it.
So far, so good. Looks like it'... | Ruby mixins and calling super methods | CC BY-SA 2.5 | 0 | 2008-08-14T08:30:27.570 | 2010-10-05T20:34:17.547 | null | null | 841 | [
"ruby-on-rails",
"ruby"
] |
10,815 | 2 | null | 10,793 | 4 | null | This is an interesting problem.. I am still pretty fresh when it comes to custom controls etc, but here are my thoughts (feel free to comment/correct people!).. (I am kinda thinking/writing out loud here!)
- - - -
Just my thoughts, flame away! :D ;)
| null | CC BY-SA 2.5 | null | 2008-08-14T08:51:47.853 | 2008-08-14T08:51:47.853 | null | null | 832 | null |
10,818 | 2 | null | 10,727 | 3 | null | @lomaxx, @ChanChan: to the best of my knowledge cursors are only a problem on SQL Server and Sybase (T-SQL variants). If your database of choice is Oracle, then cursors are your friend. I've seen a number of cases where the use of cursors has actually improved performance. Cursors are an incredibly useful mechanism and... | null | CC BY-SA 2.5 | null | 2008-08-14T08:59:38.023 | 2008-08-14T08:59:38.023 | null | null | 1,030 | null |
10,817 | 2 | null | 10,752 | 47 | null | My 10 bits :D
I was always told that is the testing of an - which should be exercised to its fullest. Now, this tends to have many levels, since most components are made of smaller parts. For me, a is a functional part of the system. So it has to provide something of value (i.e. not a method for string parsing, but... | null | CC BY-SA 2.5 | null | 2008-08-14T08:59:28.557 | 2008-08-14T08:59:28.557 | null | null | 832 | null |
10,819 | 1 | 2,663,232 | null | 64 | 24,389 | For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query.
What is the optimal way to create such a function?
| SQL, Auxiliary table of numbers | CC BY-SA 2.5 | 0 | 2008-08-14T09:01:37.663 | 2022-05-25T21:01:17.117 | 2013-06-25T20:04:16.677 | 426,671 | 224 | [
"sql",
"sql-server"
] |
10,822 | 1 | 10,824 | null | 5 | 1,138 | What would be a very fast way to determine if your connectionstring lets you connect to a database?
Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway.
| Fast database access test from .NET | CC BY-SA 3.0 | null | 2008-08-14T09:09:52.607 | 2015-03-26T14:05:30.720 | 2015-03-26T14:04:54.347 | 63,550 | 1,271 | [
".net",
"database",
"connection",
"connection-string"
] |
10,820 | 2 | null | 10,731 | 10 | null | The best way to secure your password is to stop using one. Use a trusted connection:
[How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0](http://msdn.microsoft.com/en-us/library/ms998292.aspx).
Then you have nothing to hide - publish your web.config and source to the world, they still can't hit ... | null | CC BY-SA 2.5 | null | 2008-08-14T09:03:47.627 | 2008-08-14T09:07:56.463 | 2008-08-14T09:07:56.463 | 5 | 5 | null |
10,823 | 2 | null | 10,822 | 2 | null | Shorten the timeout on the connection string and execute something trivial.
The wait should be about the same as the timeout.
You would still need a second or two though.
| null | CC BY-SA 2.5 | null | 2008-08-14T09:13:44.143 | 2008-08-14T09:13:44.143 | null | null | 905 | null |
10,828 | 2 | null | 10,825 | 1 | null | ```
SELECT *
FROM table1
WHERE CONVERT(varchar(10),columnDatetime,121) =
CONVERT(varchar(10),CONVERT('14 AUG 2008' ,smalldatetime),121)
```
This will convert the datatime and the string into varchars of the format "YYYY-MM-DD".
This is very ugly, but should work
| null | CC BY-SA 2.5 | null | 2008-08-14T09:18:37.783 | 2008-08-14T09:28:02.897 | 2008-08-14T09:28:02.897 | 960 | 960 | null |
10,826 | 2 | null | 10,825 | 39 | null | Technique 1:
```
DECLARE @p_date DATETIME
SET @p_date = CONVERT( DATETIME, '14 AUG 2008', 106 )
SELECT *
FROM table1
WHERE column_datetime >= @p_date
AND column_datetime < DATEADD(d, 1, @p_date)
```
The advantage of this is that it will use any index on 'column_datetime' if it exists.
| null | CC BY-SA 3.0 | null | 2008-08-14T09:16:03.530 | 2012-08-13T22:13:50.193 | 2012-08-13T22:13:50.193 | 1,380 | 993 | null |
10,824 | 2 | null | 10,822 | 11 | null | You haven't mentioned what database you are connecting to, however. In [SQL Server 2005](http://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2005), from .NET, you can specify a connection timeout in your connection string like so:
```
server=<server>;database=<database>;uid=<user>;password=<password>;Connect ... | null | CC BY-SA 3.0 | null | 2008-08-14T09:13:45.797 | 2015-03-26T14:05:30.720 | 2015-03-26T14:05:30.720 | 63,550 | 383 | null |
10,830 | 2 | null | 10,825 | 4 | null | Technique 2:
```
DECLARE @p_date DATETIME
SET @p_date = CONVERT( DATETIME, '14 AUG 2008', 106 )
SELECT *
FROM table1
WHERE DATEDIFF( d, column_datetime, @p_date ) = 0
```
If the column_datetime field is not indexed, and is unlikely to be (or the index is unlikely to be used) then using DATEDIFF() is short... | null | CC BY-SA 2.5 | null | 2008-08-14T09:19:16.067 | 2008-08-14T09:27:44.660 | 2008-08-14T09:27:44.660 | 993 | 993 | null |
10,832 | 2 | null | 10,825 | 8 | null | Just compare the year, month and day values.
```
Declare @DateToSearch DateTime
Set @DateToSearch = '14 AUG 2008'
SELECT *
FROM table1
WHERE Year(column_datetime) = Year(@DateToSearch)
AND Month(column_datetime) = Month(@DateToSearch)
AND Day(column_datetime) = Day(@DateToSearch)
```
| null | CC BY-SA 2.5 | null | 2008-08-14T09:19:55.190 | 2008-08-14T09:19:55.190 | null | null | 51 | null |
10,833 | 2 | null | 10,825 | 3 | null | This function returns a datetime datatype with the time portion removed and could be used as so.
```
Select
*
Table1
Where
Cast(Floor(Cast(Column_DateTime As Float)) As DateTime) = '14-AUG-2008'
```
or
```
DECLARE @p_date DATETIME
SET @p_date = Cast('14 AUG 2008' as DateTime)
SELECT *
FROM table1
WHER... | null | CC BY-SA 2.5 | null | 2008-08-14T09:20:36.843 | 2008-08-14T09:27:56.220 | 2008-08-14T09:27:56.220 | 383 | 383 | null |
10,825 | 1 | 10,826 | null | 52 | 261,132 | In SQL Server I have a `DATETIME` column which includes a time element.
Example:
```
'14 AUG 2008 14:23:019'
```
What is the method to only select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
```
DECLARE @p_date DATETIM... | Compare a date string to datetime in SQL Server? | CC BY-SA 3.0 | 0 | 2008-08-14T09:14:07.683 | 2016-03-08T20:37:04.190 | 2014-08-27T10:59:32.350 | 2,357,766 | 993 | [
"sql-server",
"database",
"tsql",
"datetime"
] |
10,834 | 2 | null | 10,825 | 1 | null | I know this isn't exactly how you want to do this, but it could be a start:
```
SELECT *
FROM (SELECT *, DATEPART(yy, column_dateTime) as Year,
DATEPART(mm, column_dateTime) as Month,
DATEPART(dd, column_dateTime) as Day
FROM table1)
WHERE Year = '2008'
AND Month = '8'
AND Day = '14'
```
| null | CC BY-SA 2.5 | null | 2008-08-14T09:22:54.547 | 2008-08-14T09:22:54.547 | null | null | 372 | null |
10,838 | 2 | null | 6,369 | 4 | null | If you're using Sybase 12.5 or earlier then you can't use functions. A workaround might be to populate a temporary table with the values and read them from there.
| null | CC BY-SA 3.0 | null | 2008-08-14T09:27:30.793 | 2014-03-23T20:23:24.110 | 2014-03-23T20:23:24.110 | 267,702 | null | null |
10,835 | 2 | null | 10,825 | 4 | null | Something like this?
```
SELECT *
FROM table1
WHERE convert(varchar, column_datetime, 111) = '2008/08/14'
```
| null | CC BY-SA 2.5 | null | 2008-08-14T09:23:23.390 | 2008-08-14T09:23:23.390 | null | null | 1,178 | null |
10,845 | 2 | null | 8,948 | 38 | null | I've used [mutagen](https://github.com/quodlibet/mutagen) to edit tags in media files before. The nice thing about mutagen is that it can handle other formats, such as mp4, FLAC etc. I've written several scripts with a lot of success using this API.
| null | CC BY-SA 3.0 | null | 2008-08-14T09:46:21.270 | 2018-04-03T11:40:19.223 | 2018-04-03T11:40:19.223 | 9,481,500 | 912 | null |
10,844 | 2 | null | 10,825 | 20 | null | In SQL Server 2008, you could use the new DATE datatype
```
DECLARE @pDate DATE='2008-08-14'
SELECT colA, colB
FROM table1
WHERE convert(date, colDateTime) = @pDate
```
@Guy. I think you will find that this solution scales just fine. Have a look at the [query execution plan](http://cid-936d87e62ae20947.skydrive.l... | null | CC BY-SA 2.5 | null | 2008-08-14T09:42:14.537 | 2008-08-15T13:04:58.873 | 2008-08-15T13:04:58.873 | 224 | 224 | null |
10,846 | 2 | null | 8,692 | 9 | null | The latest version of [elementtree](http://effbot.org/zone/element-xpath.htm) supports XPath pretty well. Not being an XPath expert I can't say for sure if the implementation is full but it has satisfied most of my needs when working in Python. I've also use lxml and PyXML and I find etree nice because it's a standar... | null | CC BY-SA 2.5 | null | 2008-08-14T09:48:59.547 | 2009-01-12T22:57:39.417 | 2009-01-12T22:57:39.417 | 912 | 912 | null |
10,848 | 1 | null | null | 541 | 304,565 | Does anybody know if it's possible, and how, to programmatically send a from the `iPhone`, with the official SDK / Cocoa Touch?
| How to programmatically send SMS on the iPhone? | CC BY-SA 3.0 | 0 | 2008-08-14T09:51:06.207 | 2019-12-29T11:26:47.200 | 2015-12-17T12:08:55.033 | 1,280,373 | null | [
"ios",
"objective-c",
"cocoa-touch",
"sms"
] |
10,851 | 2 | null | 10,260 | 1 | null | Here's a brief list of my favourites:
- - -
And I don't actually use ASP.NET, but ASP.NET AJAX is now included in 3.5 too and ASP.NET MVC is included in 3.5 SP1.
| null | CC BY-SA 2.5 | null | 2008-08-14T09:57:18.830 | 2008-08-14T09:57:18.830 | null | null | 986 | null |
10,854 | 2 | null | 10,644 | 7 | null | It's interesting that no-one mentions that there's one in the higher-end versions of Visual Studio - I've always found that to be good enough for execution profiling. For memory profiling I use Memory Profiler which has already been mentioned, but what I would generally describe as 'a profiler'.
What kind of profil... | null | CC BY-SA 2.5 | null | 2008-08-14T10:03:47.380 | 2008-08-14T10:03:47.380 | null | null | 987 | null |
10,856 | 2 | null | 10,855 | 75 | null | It's not that they were deliberately not allowed on DataTables, it's just that DataTables pre-date the IQueryable and generic IEnumerable constructs on which Linq queries can be performed.
Both interfaces require some sort type-safety validation. DataTables are not strongly typed. This is the same reason why people c... | null | CC BY-SA 2.5 | null | 2008-08-14T10:10:55.917 | 2008-08-14T10:10:55.917 | null | null | 372 | null |
10,855 | 1 | 11,593 | null | 1,133 | 1,096,278 | I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example:
```
var results = from myRow in myDataTable
where results.Field("RowNo") == 1
select results;
```
This is not allowed. How do I get something like this w... | LINQ query on a DataTable | CC BY-SA 3.0 | 0 | 2008-08-14T10:08:27.123 | 2022-09-29T08:26:32.003 | 2014-07-04T20:44:08.617 | 63,550 | 445 | [
"c#",
".net",
"linq",
"datatable",
".net-3.5"
] |
10,857 | 2 | null | 10,855 | 17 | null | You can use LINQ to objects on the Rows collection, like so:
```
var results = from myRow in myDataTable.Rows where myRow.Field("RowNo") == 1 select myRow;
```
| null | CC BY-SA 2.5 | null | 2008-08-14T10:11:08.787 | 2008-08-14T10:11:08.787 | null | null | 489 | null |
10,860 | 1 | 10,875 | null | 9 | 3,462 | I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application.
One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object natively.
The opposing viewpoint is tha... | Data Layer Best Practices | CC BY-SA 2.5 | 0 | 2008-08-14T10:23:05.657 | 2008-10-11T13:24:06.270 | null | null | 377 | [
".net",
"n-tier-architecture"
] |
10,861 | 2 | null | 10,752 | 5 | null | [Unit Testing](http://en.wikipedia.org/wiki/Unit_testing) is a method of testing that verifies the individual units of source code are working properly.
[Integration Testing](http://en.wikipedia.org/wiki/Integration_testing) is the phase of software testing in which individual software modules are combined and tested ... | null | CC BY-SA 2.5 | null | 2008-08-14T10:26:18.613 | 2008-08-14T10:26:18.613 | null | null | 486 | null |
10,862 | 2 | null | 10,860 | 1 | null | An excellent book I have, which covers this topic, is [Data Access Patterns](https://rads.stackoverflow.com/amzn/click/com/0131401572), by Clifton Nock. It has got many good explanations and good ideas on how to decouple your business layer from the persistence layer. You really should give it a try. It's one of my ... | null | CC BY-SA 2.5 | null | 2008-08-14T10:27:50.500 | 2008-08-14T10:27:50.500 | null | null | 431 | null |
10,864 | 2 | null | 10,860 | 0 | null | Check out Linq to SQL, if I were creating a new application right now I would consider relying on an entirely Linq based data layer.
Other than that I think it's good practise to de-couple data and logic as much as possible, but that isn't always practical. A pure separation between logic and data access makes joins ... | null | CC BY-SA 2.5 | null | 2008-08-14T10:28:20.810 | 2008-08-14T10:28:20.810 | null | null | 905 | null |
10,793 | 1 | 12,055 | null | 5 | 4,845 | I'm dynamically loading user controls adding them to the Controls collection of the web form.
I'd like to hide user controls if they cause a unhandled exception while rendering.
So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as it does for Page... | Catching unhandled exceptions in ASP.NET UserControls | CC BY-SA 2.5 | 0 | 2008-08-14T08:06:59.457 | 2012-06-08T18:32:52.790 | null | null | 1,269 | [
"asp.net",
"exception",
"user-controls"
] |
10,866 | 2 | null | 10,860 | 3 | null | You can have both. Let data layer not know of your bussiness objects and make it capable of working with more than one type of data sources. If you supply a common interface (or an abstract class) for interacting with data, you can have different implementations for each type of data source. Factory pattern goes well h... | null | CC BY-SA 2.5 | null | 2008-08-14T10:28:43.070 | 2008-08-14T10:28:43.070 | null | null | 31,505 | null |
10,869 | 2 | null | 10,860 | 0 | null | In applications wherein we use NHibernate, the answer becomes "somewhere in between", in that, while the XML mapping definitions (they specify which table belongs to which object and which columns belong to which field, etc) are clearly in the business object tier.
They are passed to a generic data session manager wh... | null | CC BY-SA 2.5 | null | 2008-08-14T10:30:51.773 | 2008-08-14T10:30:51.773 | null | null | 372 | null |
10,863 | 2 | null | 10,860 | 0 | null | One trick I've found handy is to have my data layer be "collection agnostic". That is, whenever I want to return a list of objects from my data layer, I get the caller to pass in the list. So instead of this:
```
public IList<Foo> GetFoosById(int id) { ... }
```
I do this:
```
public void GetFoosById(IList<Foo> foo... | null | CC BY-SA 2.5 | null | 2008-08-14T10:28:08.673 | 2008-08-14T10:28:08.673 | null | null | 615 | null |
10,873 | 2 | null | 10,872 | 3 | null | Programming is one of the ways to be the richest person in the world. So far, we do not know any other.
| null | CC BY-SA 2.5 | null | 2008-08-14T10:36:04.350 | 2008-08-14T10:36:04.350 | null | null | 31,505 | null |
10,875 | 2 | null | 10,860 | 5 | null | It really depends on your view of the world - I used to be in the uncoupled camp. The DAL was only there to supply data to the BAL - end of story.
With emerging technologies such as Linq to SQL and Entity Framework becoming a bit more popular, then the line between DAL and BAL have been blurred a bit. In L2S especiall... | null | CC BY-SA 2.5 | null | 2008-08-14T10:38:04.677 | 2008-08-14T10:38:04.677 | null | null | 1,075 | null |
10,876 | 2 | null | 10,872 | 1 | null | - - -
| null | CC BY-SA 2.5 | null | 2008-08-14T10:42:16.460 | 2008-08-14T10:47:37.370 | 2008-08-14T10:47:37.370 | 1,075 | 1,075 | null |
10,878 | 2 | null | 10,872 | 6 | null | Jetpacks.
Programming is Technology and the more time we spend with technology the closer we get to having Jetpacks.
| null | CC BY-SA 3.0 | null | 2008-08-14T10:42:36.227 | 2015-04-17T10:24:23.127 | 2015-04-17T10:24:23.127 | 155,077 | 1,143 | null |
10,877 | 1 | 486,662 | null | 127 | 132,430 | How can I left-align the numbers in an ordered list?
```
1. an item
// skip some items for brevity
9. another item
10. notice the 1 is under the 9, and the item contents also line up
```
Change the character after the number in an ordered list?
```
1) an item
```
Also is there a CSS solution to change from num... | How can you customize the numbers in an ordered list? | CC BY-SA 2.5 | 0 | 2008-08-14T10:42:32.013 | 2022-01-27T18:30:25.333 | 2011-06-09T10:27:42.970 | 468,793 | 486 | [
"html",
"css",
"html-lists",
"roman-numerals"
] |
10,880 | 1 | 10,890 | null | 39 | 23,066 | I'm looking for a good article on using emacs as C/C++ IDE.
Something like Steve Yegge's ["Effective emacs"](http://steve.yegge.googlepages.com/effective-emacs).
| Any good advice on using emacs for C++ project? | CC BY-SA 2.5 | 0 | 2008-08-14T10:42:59.627 | 2016-06-09T00:30:34.420 | null | null | 1,007 | [
"c++",
"emacs"
] |
10,870 | 1 | null | null | 5 | 5,145 | Once I've called `DragManager.acceptDrag` is there any way to "unaccept" the drag? Say that I have a view which can accept drag and drop, but only in certain areas. Once the user drags over one of these areas I call `DragManager.acceptDrag(this)` (from a `DragEvent.DRAG_OVER` handler), but if the user then moves out of... | How can I "unaccept" a drag in Flex? | CC BY-SA 3.0 | 0 | 2008-08-14T10:32:52.610 | 2015-09-09T10:16:58.597 | 2017-05-23T12:15:57.563 | -1 | 1,109 | [
"actionscript-3",
"apache-flex",
"drag-and-drop"
] |
10,676 | 2 | null | 10,668 | 12 | null | Matasano Chargen had a good post a while back on porting some debugging code to OS X, which included learning how to read and write memory in another process (among other things).
[It has to work, otherwise GDB wouldn't](http://replay.web.archive.org/20090627062246/http://www.matasano.com/log/1100/what-ive-been-doing-... | null | CC BY-SA 3.0 | null | 2008-08-14T04:46:37.850 | 2016-11-25T00:15:05.313 | 2016-11-25T00:15:05.313 | 3,478,852 | 872 | null |
10,886 | 2 | null | 9,033 | 11 | null | I love the fact that I can use LINQ to objects on plain old .NET 2.0 (i.e. without requiring .NET 3.5 to be installed everywhere). All you need is an implementation of all the query operator Extension methods - see [LINQBridge](http://www.albahari.com/nutshell/linqbridge.html)
| null | CC BY-SA 2.5 | null | 2008-08-14T10:59:21.430 | 2008-08-14T10:59:21.430 | null | null | 1,278 | null |
10,872 | 1 | 10,882 | null | 3 | 1,135 | I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention?
I'll add to the list below as people reply, I apologise if I duplicate any entries.
1. Minimal money ... | How to encourage someone to learn programming? | CC BY-SA 2.5 | 0 | 2008-08-14T10:34:05.073 | 2015-04-17T10:25:31.590 | 2008-08-14T15:49:02.313 | 1,384,652 | 1,384,652 | [
"language-agnostic"
] |
10,882 | 2 | null | 10,872 | 8 | null |
## I do it for the ladies :D
Seriously though, for me
### Pro's
- - - - -
### Cons (some of these can easily be Pro's too)
- - - -
| null | CC BY-SA 2.5 | null | 2008-08-14T10:50:21.420 | 2008-08-14T11:01:01.690 | 2020-06-20T09:12:55.060 | -1 | 832 | null |
10,884 | 2 | null | 7,212 | 3 | null | @Theo: How would you explain the following working in 3.0.0.477 with the default flex-config.xml (<strict>true</strict>) and even a -compiler.strict parameter passed to mxmlc?
Foo.as:
```
package
{
public class Foo
{
public var foo:String;
public function Foo()
{
foo = "fo... | null | CC BY-SA 2.5 | null | 2008-08-14T10:55:50.283 | 2008-08-14T10:55:50.283 | null | null | 1,088 | null |
10,889 | 2 | null | 10,877 | 1 | null | There is the [Type attribute](http://www.htmlcodetutorial.com/_OL_TYPE.html) which allows you to change the numbering style, however, you cannot change the full stop after the number/letter.
```
<ol type="a">
<li>Turn left on Maple Street</li>
<li>Turn right on Clover Court</li>
</ol>
```
| null | CC BY-SA 2.5 | null | 2008-08-14T11:03:49.830 | 2009-01-28T10:53:54.950 | 2009-01-28T10:53:54.963 | 383 | 383 | null |
10,891 | 1 | 10,914 | null | 4 | 3,770 | Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to `C#`.
I'm a little rusty with MFC so writing some code so I can try and spark my memory.
Anyway, was wondering the best way to connect to a SS2005 database with MFC. Back in the day CDatabase via ODBC was... | Best way to connect To Sql Server with MFC | CC BY-SA 3.0 | null | 2008-08-14T11:05:21.743 | 2013-07-04T12:20:21.100 | 2013-07-04T12:20:21.100 | 1,584,286 | 1,075 | [
"sql-server",
"mfc"
] |
10,888 | 2 | null | 9,570 | 1 | null | How I solved it:
1. link with "/FORCE:MULTIPLE /verbose" (that links ok) and set the output aside.
2. link with "/NODEFAULTIB /verbose" and trace all unresolveds in the output of the previous step and add the libraries 1 by 1.
3. This resulted in doubles: "AAA.lib: XXX already defined in BBB.lib"
4. Then I finally g... | null | CC BY-SA 2.5 | null | 2008-08-14T11:01:33.623 | 2008-08-14T11:01:33.623 | null | null | 1,163 | null |