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
1,281
2
null
835
5
null
You can use the artifact directory variable inside the MSBuild script itself. Here's an example of how I'm running FxCop right now from my CC.Net MSBuild script (this script is what CC.Net points to - there is also a "Build" target in the script that includes an MSBuild task against the SLN to do the actual compilatio...
null
CC BY-SA 2.5
null
2008-08-04T14:40:20.360
2013-02-08T21:59:55.120
2013-02-08T21:59:55.120
35
35
null
1,275
2
null
1,241
9
null
When I needed to write an application with a client-server model where the clients could leave and enter whenever they want, (I assume that's also the case for your application as you use mobile devices) I made sure that the clients send an message to the server, indicating they were connected and ready to do whatever...
null
CC BY-SA 2.5
null
2008-08-04T14:30:12.223
2008-08-04T14:30:12.223
null
null
46
null
1,276
1
1,338
null
334
216,573
At what point does a MySQL database start to lose performance? - - - I have what I believe to be a large database, with roughly 15M records which take up almost 2GB. Based on these numbers, is there any incentive for me to clean the data out, or am I safe to allow it to continue scaling for a few more years?
How big can a MySQL database get before performance starts to degrade
CC BY-SA 3.0
0
2008-08-04T14:31:11.410
2020-07-27T16:27:23.980
2016-01-27T23:40:20.297
3,664,960
30
[ "mysql", "database", "database-performance" ]
1,292
1
1,305
null
62
34,833
I have a Queue<T> object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items. Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class?
Limit size of Queue<T> in .NET?
CC BY-SA 2.5
0
2008-08-04T14:47:10.970
2020-05-30T20:48:24.267
null
null
192
[ ".net", "collections", "queue" ]
1,284
1
null
null
24
9,210
I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of value ...
Catching SQL Injection and other Malicious Web Requests
CC BY-SA 3.0
0
2008-08-04T14:40:58.050
2017-10-18T22:01:40.770
2016-09-11T20:49:24.593
6,715,577
null
[ "sql", "xss", "sql-injection" ]
1,290
2
null
88
11
null
Wine is actually using gettimeofday() to implement QueryPerformanceCounter() and it is known to make many Windows games work on Linux and Mac. Starts [http://source.winehq.org/source/dlls/kernel32/cpu.c#L312](http://source.winehq.org/source/dlls/kernel32/cpu.c#L312) leads to [http://source.winehq.org/source/dlls/ntdl...
null
CC BY-SA 2.5
null
2008-08-04T14:44:56.950
2008-08-04T14:44:56.950
null
null
268
null
1,300
1
1,673
null
31
4,039
I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server. Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now. ...
Is nAnt still supported and suitable for .net 3.5/VS2008?
CC BY-SA 2.5
0
2008-08-04T14:55:04.433
2008-09-29T14:00:55.083
2008-08-18T09:27:37.030
905
91
[ ".net", ".net-3.5", "msbuild", "nant" ]
1,303
2
null
1,292
5
null
You should create your own class, a ringbuffer would probably fit your needs. The data structures in .NET that allows you to specify capacity, except for array, uses this to build the internal data structure used to hold the internal data. For instance, for a list, capacity is used to size an internal array. When you...
null
CC BY-SA 2.5
null
2008-08-04T14:56:49.470
2008-08-04T14:56:49.470
null
null
267
null
1,297
2
null
1,292
3
null
Why wouldn't you just use an array with a size of 2? A Queue is supposed to be able to dynamically grow and shrink. Or create a wrapper class around an instance of `Queue<T>` instance and each time one enqueues a `<T>` object, check the size of the queue. If larger than 2, dequeue the first item.
null
CC BY-SA 3.0
null
2008-08-04T14:52:40.493
2015-12-15T19:44:41.910
2015-12-15T19:44:41.910
1,016,716
25
null
1,266
2
null
564
29
null
I'll just post here since some of the other posts are slightly inaccurate in relation to C#. `int` is an alias for `System.Int32`. `float` is not an alias for `System.Float`, but for `System.Single` Basically, int is a reserved keyword in the C# programming language, and is an alias for the `System.Int32` value typ...
null
CC BY-SA 3.0
null
2008-08-04T14:11:03.557
2015-11-30T15:31:10.063
2015-11-30T15:31:10.063
4,551,041
267
null
1,304
1
1,309
null
262
229,655
Is there any way to check whether a file is locked without using a try/catch block? Right now, the only way I know of is to just open the file and catch any `System.IO.IOException`.
How to check for file lock?
CC BY-SA 3.0
0
2008-08-04T14:56:57.490
2021-09-08T18:50:47.883
2015-04-30T10:33:41.257
1,468,295
121
[ "c#", ".net", "io", "filelock" ]
1,305
2
null
1,292
44
null
I've knocked up a basic version of what I'm looking for, it's not perfect but it'll do the job until something better comes along. ``` public class LimitedQueue<T> : Queue<T> { public int Limit { get; set; } public LimitedQueue(int limit) : base(limit) { Limit = limit; } public new void E...
null
CC BY-SA 3.0
null
2008-08-04T14:57:28.767
2016-10-19T09:27:01.580
2016-10-19T09:27:01.580
2,257
192
null
1,309
2
null
1,304
132
null
No, unfortunately, and if you think about it, that information would be worthless anyway since the file could become locked the very next second (read: short timespan). Why specifically do you need to know if the file is locked anyway? Knowing that might give us some other way of giving you good advice. If your code ...
null
CC BY-SA 3.0
null
2008-08-04T14:59:24.410
2013-03-14T22:54:07.087
2013-03-14T22:54:07.087
267
267
null
1,312
2
null
898
5
null
I was just listening to a [Podcast from Scott Hanselman](http://www.hanselminutes.com/default.aspx?showID=135) this morning, where he talks about internationalization, especially the really tricky things, like Turkish (with it's four i's) and Thai. Also, Jeff Atwood had a [post](http://www.codinghorror.com/blog/archive...
null
CC BY-SA 3.0
null
2008-08-04T15:04:47.737
2013-02-07T17:33:40.590
2013-02-07T17:33:40.590
237,838
91
null
1,311
1
null
null
21
878
How do you specify a callback for `rb->pcm_play_data()`?
Rockbox audio format
CC BY-SA 2.5
null
2008-08-04T15:02:41.893
2020-03-17T20:39:54.113
2010-02-17T22:15:50.597
95,135
306
[ "c", "audio", "rockbox" ]
1,314
1
1,319
null
19
2,059
We have been using CruiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate. I'm attempting to get the solution running in CruiseControl. I've finally got the build itself to work; however, I have be...
Using MSTest with CruiseControl.NET
CC BY-SA 3.0
0
2008-08-04T15:09:07.043
2011-05-02T10:06:56.103
2011-05-02T10:06:56.103
101,371
312
[ "msbuild", "build-process", "cruisecontrol.net" ]
1,318
2
null
1,306
20
null
You might be able to get some implementation ideas from the [Ruby/ProgressBar library](http://0xcc.net/ruby-progressbar/), which generates text progress bars. I stumbled across it a couple of months back but haven't made any use of it.
null
CC BY-SA 2.5
null
2008-08-04T15:11:19.770
2008-08-04T15:11:19.770
null
null
216
null
1,319
2
null
1,314
5
null
Not sure if that helps (i found the ccnet Documentation somewhat unhelpful at times): [Using CruiseControl.NET with MSTest](http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSTest)
null
CC BY-SA 2.5
null
2008-08-04T15:12:13.917
2008-08-04T15:12:13.917
null
null
91
null
1,320
2
null
1,300
5
null
In my opinion it is more a question of personal preference. nAnt is a great framework and MSBuild is almost as capable. With the ability to easily develop custom tasks (in both frameworks) you can accomplish almost anything that you need to do. I cannot answer the "still supported" portion of your questions, but I w...
null
CC BY-SA 2.5
null
2008-08-04T15:12:37.630
2008-08-04T15:12:37.630
null
null
312
null
1,313
1
74,033
null
53
20,122
[Original Question](https://stackoverflow.com/questions/180/function-for-creating-color-wheels) I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts: 1. What color space best represents human vision? 2. What distance metric in that sp...
Followup: Finding an accurate "distance" between colors
CC BY-SA 2.5
0
2008-08-04T15:08:13.143
2016-07-15T12:55:38.843
2017-05-23T12:17:56.830
-1
2,089,740
[ "language-agnostic", "colors" ]
1,306
1
1,318
null
46
12,486
I'd like to create a progress bar to indicate the status of an a batch job in `Ruby`. I've read some [tutorials](http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/) / [libraries](http://ncurses-ruby.berlios.de/) on using , none of which were particularly helpful in explaining how to create an progress bar in the termi...
How do I use (n)curses in Ruby?
CC BY-SA 3.0
0
2008-08-04T14:57:59.547
2015-12-14T09:10:32.593
2015-12-14T09:10:32.593
1,616,697
302
[ "ruby", "unix", "curses" ]
1,317
2
null
1,284
5
null
The problem with a generic tool is that it is very difficult to come up with a set of rules that will only match against a genuine attack. SQL keywords are all English words, and don't forget that the string ``` DROP TABLE users; ``` is perfectly valid in a form field that, for example, contains an answer to a prog...
null
CC BY-SA 3.0
null
2008-08-04T15:11:16.663
2017-10-18T22:01:40.770
2017-10-18T22:01:40.770
48
48
null
1,323
1
null
null
23
2,786
[Original Question](https://stackoverflow.com/questions/180/function-for-creating-color-wheels) If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinc...
Followup: "Sorting" colors by distinctiveness
CC BY-SA 2.5
0
2008-08-04T15:14:47.517
2012-09-03T20:50:02.030
2017-05-23T12:26:00.663
-1
2,089,740
[ "algorithm", "language-agnostic", "colors" ]
1,328
2
null
1,284
3
null
One method that might work for some cases would be to take the sql string that would run if you naively used the form data and pass it to some code that counts the number of statements that would actually be executed. If it is greater than the number expected, then there is a decent chance that an injection was attemp...
null
CC BY-SA 2.5
null
2008-08-04T15:20:17.973
2008-08-04T15:20:17.973
null
null
121
null
1,322
2
null
1,313
4
null
The easiest would of course be to just consider the colors as 3d vectors originating from the same origin, and taking the distance between their end points. If you need to consider such factors that green is more prominent in judging intensity, you can weigh the values. [ImageMagic](http://www.imagemagick.org/Usage/...
null
CC BY-SA 2.5
null
2008-08-04T15:14:40.277
2008-08-04T15:14:40.277
null
null
267
null
1,333
2
null
1,284
3
null
One little thing to keep in mind: In some countries (i.e. most of Europe), people do not have static IP Addresses, so blacklisting should not be forever.
null
CC BY-SA 2.5
null
2008-08-04T15:22:04.380
2008-08-04T15:22:04.380
null
null
91
null
1,331
2
null
1,329
57
null
Use [Robocopy (Robust File Copy)](http://en.wikipedia.org/wiki/Robocopy). NOTE: In Windows Vista and Server 2008 when you type: ``` xcopy /? ``` you get: > NOTE: Xcopy is now deprecated, please use Robocopy. So start getting used to robocopy :)
null
CC BY-SA 2.5
null
2008-08-04T15:21:49.047
2008-08-04T18:16:19.553
2008-08-04T18:16:19.553
39
39
null
1,334
2
null
1,329
15
null
You can try [TeraCopy](http://www.codesector.com/teracopy.php) or [RoboCopy](http://en.wikipedia.org/wiki/Robocopy).
null
CC BY-SA 2.5
null
2008-08-04T15:23:08.620
2008-08-04T15:23:08.620
null
null
267
null
1,336
2
null
1,284
0
null
Now that I think about it, a Bayesian filter similar to the ones used to block spam might work decently too. If you got together a set of normal text for each field and a set of sql injections, you might be able to train it to flag injection attacks.
null
CC BY-SA 2.5
null
2008-08-04T15:26:05.013
2008-08-04T15:26:05.013
null
null
121
null
1,332
2
null
289
582
null
Use LINQ: ``` Dictionary<string, int> myDict = new Dictionary<string, int>(); myDict.Add("one", 1); myDict.Add("four", 4); myDict.Add("two", 2); myDict.Add("three", 3); var sortedDict = from entry in myDict orderby entry.Value ascending select entry; ``` This would also allow for great flexibility in that you can s...
null
CC BY-SA 3.0
null
2008-08-04T15:22:03.867
2017-08-31T23:02:53.540
2017-08-31T23:02:53.540
63,550
313
null
1,329
1
1,339
null
38
99,193
I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows. I don't want it to hang on a "Are you sure?", "Are you really sure?", "Even zip files?", "Surely not read-only files too!" loop as soon as I step away. I don't want it to work f...
What is a better file copy alternative than the Windows default?
CC BY-SA 2.5
0
2008-08-04T15:20:42.683
2014-05-02T12:49:16.407
2017-05-23T12:08:44.513
-1
83
[ "windows", "file", "filesystems", "utilities" ]
1,325
2
null
1,313
6
null
HSL and HSV are better for human color perception. According to [Wikipedia](http://en.wikipedia.org/wiki/HSL_and_HSV): > It is sometimes preferable in working with art materials, digitized images, or other media, to use the HSV or HSL color model over alternative models such as RGB or CMYK, because of differences in t...
null
CC BY-SA 3.0
null
2008-08-04T15:16:11.537
2012-03-04T04:34:42.993
2017-02-09T14:01:26.987
-1
39
null
1,335
2
null
1,329
3
null
It sounds like a backup-style tool may be what you're looking for. I've been using [SyncBack](http://www.2brightsparks.com/downloads.html) (one of the versions is free). You could also try out [MS SyncToy](http://en.wikipedia.org/wiki/SyncToy) which tries to make moving, copying, syncing, etc. easy. If you really do ...
null
CC BY-SA 2.5
null
2008-08-04T15:24:03.940
2008-08-04T15:24:03.940
null
null
29
null
1,337
2
null
1,329
7
null
You really need to use a file Sync tool, like [SyncBackSE](http://www.2brightsparks.com/syncback/syncback-hub.html), [MS SyncToy](http://www.microsoft.com/downloads/details.aspx?familyid=C26EFA36-98E0-4EE9-A7C5-98D0592D8C52&displaylang=en), or even something like [WinMerge](http://winmerge.org/) will do the trick. I pr...
null
CC BY-SA 2.5
null
2008-08-04T15:26:39.817
2008-08-04T15:26:39.817
null
null
194
null
1,338
2
null
1,276
221
null
The physical database size doesn't matter. The number of records don't matter. In my experience the biggest problem that you are going to run in to is not size, but the number of queries you can handle at a time. Most likely you are going to have to move to a master/slave configuration so that the read queries can r...
null
CC BY-SA 3.0
null
2008-08-04T15:26:55.807
2013-07-31T17:55:32.397
2013-07-31T17:55:32.397
61,934
17
null
1,347
2
null
1,300
1
null
Honestly it depends on what fits in to your environment better. If you are using a lot of Non-Microsoft tools, nunit, ccnet, ncover. You will probably find better support with nant. Alternatively if you are using MSTest, TFSBuild, you will probably find MSBuild a better environment. I would learn both and use which...
null
CC BY-SA 2.5
null
2008-08-04T15:37:31.197
2008-08-04T15:37:31.197
null
null
17
null
1,341
2
null
1,329
6
null
You can try [SuperCopier](http://sourceforge.net/projects/supercopier/), it replaces the standard Windows copy mechanism while loaded. It can retry failed files at the end, resume a canceled copy (even a copy canceled by Windows), accepts "All" for every answers. You can even answer the annoying questions (file alread...
null
CC BY-SA 2.5
null
2008-08-04T15:31:04.783
2008-08-04T15:31:04.783
null
null
268
null
1,340
2
null
1,323
1
null
Do you mean that from a set of N colors, you need to pick M colors, where M < N, such that M is the representation of the N colors in the M space? As a better example, reduce a true-color (24 bit color space) to a 8-bit mapped color space (GIF?). There are quantization algorithms for this, like the [Adaptive Spatial...
null
CC BY-SA 2.5
null
2008-08-04T15:29:49.793
2008-08-04T15:29:49.793
null
null
267
null
1,342
2
null
1,323
1
null
You can split them in to RGB HEX format so that you can compare the R with R's of a different color, same with the G and B. Same format as HTML ``` XX XX XX RR GG BB 00 00 00 = black ff ff ff = white ff 00 00 = red 00 ff 00 = green 00 00 ff = blue ``` So the only thing you would need to decide is how close you wa...
null
CC BY-SA 2.5
null
2008-08-04T15:31:15.500
2008-08-04T15:31:15.500
null
null
17
null
1,339
2
null
1,329
20
null
How about good old Command-Line Xcopy? With S: being the source and T: the target: ``` xcopy /K /R /E /I /S /C /H /G /X /Y s:\*.* t:\ ``` > /K Copies attributes. Normal Xcopy will reset read-only attributes./R Overwrites read-only files./E Copies directories and subdirectories, including empty ones./I If...
null
CC BY-SA 2.5
null
2008-08-04T15:28:23.527
2008-08-04T15:32:56.497
2008-08-04T15:32:56.497
91
91
null
1,353
2
null
1,329
1
null
Xcopy keeps the Date Modified, only the Date Created and Date Accessed will change. (tested on XP Pro, try it on a small folder to check if you're using Vista as I did not test it under Vista) Edit: You MAY want to redirect the Output though: ``` xcopy /K /R ....... s:\*.* t:\ >c:\xcopy.log 2>&1 ``` That way, if f...
null
CC BY-SA 2.5
null
2008-08-04T15:41:39.333
2008-08-04T15:46:25.737
2008-08-04T15:46:25.737
91
91
null
1,130
2
null
1,108
4,087
null
When data is stored on disk-based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a pointer to the location of the next node (or ...
null
CC BY-SA 4.0
null
2008-08-04T10:41:04.620
2021-08-10T09:02:44.847
2021-08-10T09:02:44.847
7,424,948
264
null
1,348
2
null
1,313
4
null
Well, as a first point of call, I'd say of the common metrics HSV (Hue, Saturation and Value) or HSL are better representative of how humans perceive colour than say RGB or CYMK. See [HSL, HSV on Wikipedia](http://en.wikipedia.org/wiki/HSL_and_HSV). I suppose naively I would plot the points in the HSL space for the t...
null
CC BY-SA 2.5
null
2008-08-04T15:37:43.367
2008-08-04T15:37:43.367
null
null
199
null
1,351
2
null
1,323
3
null
This also sounds to me like some kind of where you try to map out the path of least resistance. If you inverse the requirements, path of maximum resistance, it could perhaps be used to produce a set that from the start produces maximum difference as you go, and towards the end starts to go back to values closer to the...
null
CC BY-SA 2.5
null
2008-08-04T15:38:09.887
2008-08-04T15:43:19.220
2017-05-23T12:34:21.850
-1
267
null
1,359
2
null
1,314
1
null
The CC.Net interface is generated via an XSL transform on your XML files put together as specified in the ccnet.config file for your projects. The XSL is already written for things like FxCop - check your server's CC xsl directory for examples - shouldn't be too hard to write your own to add in the info - just remembe...
null
CC BY-SA 2.5
null
2008-08-04T15:46:42.223
2008-08-04T15:46:42.223
null
null
35
null
1,375
2
null
1,306
2
null
On windows, curses works out of the box, ncurses doesn't, and for a progress bar curses should be sufficient. So, use curses instead of ncurses. Also, both curses and ncurses are wafer-thin wrappers around the c library - that means you don't really need Ruby-specific tutorials. However, on the [site for the PickAxe]...
null
CC BY-SA 2.5
null
2008-08-04T16:03:22.720
2013-02-07T17:29:17.820
2013-02-07T17:29:17.820
237,838
136
null
1,376
1
null
null
20
6,731
I need the name of the current logged in user in my application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways.
Get the current logged in OS user in Adobe Air
CC BY-SA 4.0
0
2008-08-04T16:05:29.333
2019-12-16T11:49:24.580
2019-12-16T11:49:24.580
5,044,304
26
[ "apache-flex", "air" ]
1,364
2
null
1,300
3
null
If you've already got a bunch of custom tasks you use with nAnt, stick with it - you don't gain much with MSBuild. That said, there doesn't seem to be anything that nAnt can do that MSBuild can't at its core. Both can call external tools, both can run .Net-based custom tasks, and both have a bunch of community tasks ...
null
CC BY-SA 2.5
null
2008-08-04T15:52:42.290
2008-08-04T15:52:42.290
null
null
35
null
1,378
2
null
1,306
4
null
Personally I think curses is overkill in this case. While the curses lib is nice (and I frequently use it myself) it's a PITA to relearn every time I haven't needed it for 12 months which has to be the sign of a bad interface design. If for some reason you can't get on with [the progress bar lib Joey suggested](https...
null
CC BY-SA 3.0
null
2008-08-04T16:18:32.770
2013-02-07T17:29:36.307
2017-05-23T11:33:14.057
-1
269
null
1,380
2
null
1,376
1
null
Here is a solution that works in XP / Vista, but is definitely expandable to OSX, linux, I'd still be interested in another way. ``` public static function GetCurrentOSUser():String{ // XP & Vista only. var userDirectory:String = File.userDirectory.resolvePath("").nativePath; var startIndex:Number = userDi...
null
CC BY-SA 3.0
null
2008-08-04T16:19:45.527
2016-02-07T00:27:35.280
2016-02-07T00:27:35.280
2,921,691
26
null
1,387
1
null
null
22
962
This is an open-ended question. What approaches should I consider?
What are the current best options for parallelizing a CPU-intensive .NET app?
CC BY-SA 2.5
0
2008-08-04T16:30:46.347
2009-05-11T05:52:39.343
null
null
null
[ ".net", "parallel-processing" ]
1,381
2
null
1,329
3
null
Use [Robocopy](http://en.wikipedia.org/wiki/Robocopy), it has the ability to copy files in "restartable mode", plus it should respect the file attributes. And it comes with Vista and Server 2008, and you can download it for older OS's. Plus you can set it to retry on failed copies, to pick up files that are temporari...
null
CC BY-SA 2.5
null
2008-08-04T16:25:14.143
2008-08-04T16:25:14.143
null
null
206
null
1,383
1
1,393
null
228
51,148
I saw many questions asking 'how' to unit test in a specific language, but no question asking 'what', 'why', and 'when'. - - - - -
What is unit testing?
CC BY-SA 3.0
0
2008-08-04T16:27:39.787
2020-09-12T02:04:16.480
2020-09-12T02:04:16.480
1,595,451
314
[ "unit-testing" ]
1,356
2
null
1,284
11
null
Your almost looking at it the wrong way, no 3party tool that is not aware of your application methods/naming/data/domain is going to going to be able to perfectly protect you. Something like SQL injection prevention is something that has to be in the code, and best written by the people that wrote the SQL, because the...
null
CC BY-SA 3.0
null
2008-08-04T15:43:50.063
2013-01-27T12:22:35.760
2013-01-27T12:22:35.760
null
314
null
1,397
2
null
1,376
9
null
Also I would try: ``` File.userDirectory.name ``` But I don't have Air installed so I can't really test this...
null
CC BY-SA 2.5
null
2008-08-04T16:39:40.153
2008-08-04T16:39:40.153
null
null
40
null
1,390
1
1,394
null
27
2,159
I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional. To that end, the "Server Core" option sounds appealing, but I'm not clear about whether or not I can run SQL Server on that SKU. Several se...
Is Windows Server 2008 "Server Core" appropriate for a SQL Server instance?
CC BY-SA 2.5
null
2008-08-04T16:33:36.390
2018-05-10T16:52:32.417
2010-02-20T22:34:34.347
76,337
60
[ "sql-server", "windows-server-2008" ]
1,399
2
null
1,387
6
null
There are some parallel extensions to .NET that are currently in testing and available at Microsoft's [Parallel Computing Developer Center](http://msdn.microsoft.com/en-us/concurrency/default.aspx). They have a few interesting items that you would expect like Parallel foreach and a parallel version of LINQ called PLINQ...
null
CC BY-SA 2.5
null
2008-08-04T16:41:23.410
2008-08-04T16:41:23.410
null
null
200
null
1,405
2
null
1,401
7
null
When you're using .Net 2.0 and Ajax - you should use: ``` ScriptManager.RegisterClientScriptBlock ``` It will work better in Ajax environments then the old Page.ClientScript version
null
CC BY-SA 3.0
null
2008-08-04T16:51:03.420
2013-01-27T12:16:49.037
2013-01-27T12:16:49.037
null
225
null
1,404
2
null
9
2,385
null
An easy to understand and simple solution. ``` // Save today's date. var today = DateTime.Today; // Calculate the age. var age = today.Year - birthdate.Year; // Go back to the year in which the person was born in case of a leap year if (birthdate.Date > today.AddYears(-age)) age--; ``` However, this assumes you are ...
null
CC BY-SA 4.0
null
2008-08-04T16:50:06.170
2020-09-07T09:43:10.790
2020-09-07T09:43:10.790
12,780,337
212
null
1,409
1
27,335
null
20
2,202
I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these u...
Bandwith throttling in IIS 6 by IP Address
CC BY-SA 3.0
null
2008-08-04T16:55:31.243
2018-06-10T10:45:56.040
2013-01-09T05:44:28.237
1,471,203
26
[ "asp.net", "iis" ]
1,413
2
null
1,408
17
null
You can set Apache to serve pages from anywhere with any restrictions but it's normally distributed in a more secure form. Editing your apache files (http.conf is one of the more common names) will allow you to set any folder so it appears in your webroot. EDIT: alias myapp c:\myapp\ I've edited my answer to includ...
null
CC BY-SA 2.5
null
2008-08-04T17:00:08.067
2008-08-04T17:06:58.223
2008-08-04T17:06:58.223
269
269
null
1,394
2
null
1,390
16
null
Not sure how credible [this source is](http://www.builderau.com.au/program/windows/soa/Getting-started-with-Windows-Server-2008-Core-edition/0,339024644,339288700,00.htm), but: > The Windows Server 2008 Core edition can:- Run the file server role.- Run the Hyper-V virtualization server role.- Run the Directory Service...
null
CC BY-SA 2.5
null
2008-08-04T16:38:03.667
2008-08-27T13:02:50.273
2008-08-27T13:02:50.273
1
91
null
1,414
2
null
1,408
100
null
You can relocate it by editing the setting in XAMPP\apache\conf\httpd.conf. It should currently be: > C:/xampp/htdocs Change it to: > C:/projects/transitCalculator/trunk
null
CC BY-SA 2.5
null
2008-08-04T17:00:27.693
2008-08-04T17:00:27.693
null
null
60
null
1,393
2
null
1,383
218
null
Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: - - Note that if your test code writes to a file, opens a database connection or does something over the network, it's more appropriately categorized as an integration test. Integ...
null
CC BY-SA 3.0
null
2008-08-04T16:36:51.750
2015-03-15T06:35:20.143
2015-03-15T06:35:20.143
776,637
266
null
1,401
1
1,418
null
38
3,640
I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due. I've placed the validator code in the `ascx` file, and I have also tried using `Page.ClientScript.RegisterClientScriptBlock()` and in both cases the ...
ASP.Net Custom Client-Side Validation
CC BY-SA 4.0
null
2008-08-04T16:44:25.167
2018-11-17T04:26:32.233
2018-05-02T06:34:29.500
1,221,792
149
[ "asp.net", "javascript", "validation" ]
1,415
2
null
588
5
null
I would look into IMAP [IMAP, POP3 and NNTP](http://us3.php.net/imap)
null
CC BY-SA 3.0
null
2008-08-04T17:00:40.327
2013-01-27T11:33:41.083
2013-01-27T11:33:41.083
null
70
null
1,420
2
null
246
5
null
I'm sure you could write a small app that takes an XSD file and parses it into a SQL script. I've never seen code out there to do it though, but that's not saying it doesn't exist.
null
CC BY-SA 2.5
null
2008-08-04T17:05:37.853
2008-08-04T17:05:37.853
null
null
26
null
1,418
2
null
1,401
19
null
Try changing the argument names to `sender` and `args`. And, after you have it working, switch the call over to `ScriptManager.RegisterClientScriptBlock`, regardless of AJAX use.
null
CC BY-SA 3.0
null
2008-08-04T17:02:56.237
2016-09-27T07:32:59.907
2016-09-27T07:32:59.907
4,147,978
35
null
1,408
1
1,421
null
329
272,831
Is it possible to configure [xampp](http://www.apachefriends.org/en/xampp.html) to serve up a file outside of the `htdocs` directory? For instance, say I have a file located as follows: `C:\projects\transitCalculator\trunk\TransitCalculator.php` and my [xampp](http://www.apachefriends.org/en/xampp.html) files are no...
Make XAMPP / Apache serve file outside of htdocs folder
CC BY-SA 4.0
0
2008-08-04T16:54:49.293
2020-10-23T07:15:33.783
2020-10-23T07:15:33.783
-1
58
[ "php", "apache", "xampp", "server-configuration" ]
1,398
2
null
1,383
72
null
I don't disagree with Dan (although a better choice may just be not to answer)...but... Unit testing is the process of writing code to test the behavior and functionality of your system. Obviously tests improve the quality of your code, but that's just a superficial benefit of unit testing. The real benefits are to: ...
null
CC BY-SA 3.0
null
2008-08-04T16:41:17.560
2016-10-29T15:51:31.107
2016-10-29T15:51:31.107
52,176
34
null
1,417
1
1,425
null
54
23,736
First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected LAN, PHP web app. How can get I the HTTP authenticated user name in PHP?
How can I get the authenticated user name under Apache using plain HTTP authentication and PHP?
CC BY-SA 4.0
0
2008-08-04T17:02:31.790
2019-06-04T09:27:18.917
2019-06-04T09:27:18.917
6,556,397
287
[ "php", "apache", "authentication", "http-authentication" ]
1,425
2
null
1,417
40
null
I think that you are after this ``` $username = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW']; ```
null
CC BY-SA 2.5
null
2008-08-04T17:08:26.037
2008-08-04T17:08:26.037
null
null
1,384,652
null
1,435
2
null
427
5
null
How about running IE with the HTML favorites file as a parameter? > IExplore file://\windows\fav.htm
null
CC BY-SA 2.5
null
2008-08-04T17:28:46.590
2008-08-04T17:28:46.590
null
null
60
null
1,436
2
null
1,387
2
null
I think we could also include non-.NET-specific approaches to parallel processing if those are among the best options to consider.
null
CC BY-SA 2.5
null
2008-08-04T17:32:13.493
2008-08-04T17:32:13.493
null
null
null
null
1,437
2
null
1,104
-1
null
Or you could start throwing critical exceptions. Surely, an access violation exception will your users' attention.
null
CC BY-SA 2.5
null
2008-08-04T17:33:57.890
2008-08-04T17:33:57.890
null
null
55
null
1,447
2
null
1,387
2
null
@Larsenal If you want to branch outside of .NET there has been a lot of discussion about Intel's [Threading Building Blocks](http://www.threadingbuildingblocks.org/) which is a parallel library for C++.
null
CC BY-SA 2.5
null
2008-08-04T17:41:01.307
2008-08-04T17:41:01.307
null
null
200
null
1,456
2
null
1,453
15
null
This isn't much better: ``` public function createShipment($startZip, $endZip, $weight=null){ $weight = !$weight ? $this->getDefaultWeight() : $weight; } // or... public function createShipment($startZip, $endZip, $weight=null){ if ( !$weight ) $weight = $this->getDefaultWeight(); } ```
null
CC BY-SA 2.5
null
2008-08-04T17:53:00.410
2008-08-04T17:53:00.410
null
null
40
null
1,454
2
null
1,104
4
null
Outside the scope of your question so I debated not posting this but in Java there are actually 2 types of exceptions, checked and unchecked. The basic difference is that, much like in `c[++]`, you dont have to catch an unchecked exception. For a good reference [try this](http://java.sun.com/docs/books/tutorial/essent...
null
CC BY-SA 3.0
null
2008-08-04T17:51:33.627
2013-02-07T13:08:40.303
2013-02-07T13:08:40.303
395,659
292
null
1,457
1
1,468
null
167
74,251
I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state. How are people handling maintaining RESTfulness in AJAX apps?
Modify Address Bar URL in AJAX App to Match Current State
CC BY-SA 3.0
0
2008-08-04T17:53:32.500
2021-10-25T11:49:32.350
2013-01-09T05:43:50.980
1,471,203
331
[ "ajax", "url", "rest", "address-bar" ]
1,446
2
null
580
2
null
Using SMO/DMO, it isn't too difficult to generate a script of your schema. Data is a little more fun, but still doable. In general, I take "Script It" approach, but you might want to consider something along these lines: - - - I have used the Red Gate tools and they are tools, but if you can't afford it, building...
null
CC BY-SA 2.5
null
2008-08-04T17:38:59.753
2008-08-04T17:38:59.753
null
null
307
null
1,453
1
1,456
null
28
1,993
I'm trying to do this (which produces an unexpected T_VARIABLE error): ``` public function createShipment($startZip, $endZip, $weight = $this->getDefaultWeight()){} ``` I don't want to put a magic number in there for weight since the object I am using has a `"defaultWeight"` parameter that all new shipments get if ...
Using object property as default for method property
CC BY-SA 4.0
null
2008-08-04T17:51:13.003
2021-10-25T11:50:00.063
2019-06-04T09:27:40.817
6,556,397
58
[ "php", "parameters", "error-handling" ]
1,464
2
null
580
5
null
Like Rob Allen, I use SQL Compare / Data Compare by Redgate. I also use the Database publishing wizard by Microsoft. I also have a console app I wrote in C# that takes a sql script and runs it on a server. This way you can run large scripts with 'GO' commands in it from a command line or in a batch script. I use Micro...
null
CC BY-SA 2.5
null
2008-08-04T18:00:50.893
2008-08-27T01:10:12.953
2008-08-27T01:10:12.953
26
26
null
1,459
2
null
1,451
11
null
The way I typically go about coding permission systems is having 6 tables. - - - - - - At the beginning of a users session you would run some logic that pulls out every role they have assigned, either directory or through a group. Then you code against those roles as your security permissions. Like I said this is w...
null
CC BY-SA 2.5
null
2008-08-04T17:56:26.643
2008-08-04T17:56:26.643
null
null
200
null
1,465
2
null
1,457
11
null
This is similar to what Kevin said. You can have your client state as some javascript object, and when you want to save the state, you serialize the object (using JSON and base64 encoding). You can then set the fragment of the href to this string. ``` var encodedState = base64(json(state)); var newLocation = oldLoca...
null
CC BY-SA 2.5
null
2008-08-04T18:02:03.933
2008-08-04T18:06:37.713
2008-08-04T18:06:37.713
null
null
null
1,451
1
1,477
null
25
4,202
I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000. I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific person acces...
What is the best way to handle multiple permission types?
CC BY-SA 4.0
0
2008-08-04T17:46:28.207
2021-10-25T11:50:34.877
2020-08-13T10:47:22.800
13,536,893
106
[ "sql", "permissions" ]
1,466
2
null
1,451
0
null
An approach I've used in various applications is to have a generic PermissionToken class which has a changeable Value property. Then you query the requested application, it tells you which PermissionTokens are needed in order to use it. For example, the Shipping application might tell you it needs: ``` new Permissio...
null
CC BY-SA 2.5
null
2008-08-04T18:03:57.190
2008-08-04T18:03:57.190
null
null
192
null
1,474
2
null
1,104
0
null
> Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function? I find it rather funny, that the Java crowd - [including myself](http://dlinsin.blogspot.com/2008/01/wonderful-checked-exceptions.html) - is trying to avoid checked Exceptions. They are trying to...
null
CC BY-SA 2.5
null
2008-08-04T18:14:20.493
2008-08-04T18:14:20.493
null
null
198
null
1,478
2
null
1,476
-2
null
As far as I can tell Python, up through 2.5, only supports hexadecimal & octal literals. I did find some discussions about adding binary to future versions but nothing definite.
null
CC BY-SA 2.5
null
2008-08-04T18:26:13.777
2008-08-04T18:26:13.777
null
null
305
null
1,479
2
null
1,476
-3
null
I am pretty sure this is one of the things due to change in Python 3.0 with perhaps bin() to go with hex() and oct(). EDIT: lbrandy's answer is correct in all cases.
null
CC BY-SA 2.5
null
2008-08-04T18:27:26.627
2009-12-13T16:46:39.240
2009-12-13T16:46:39.240
63,550
269
null
1,484
2
null
1,476
83
null
``` >>> print int('01010101111',2) 687 >>> print int('11111111',2) 255 ``` Another way.
null
CC BY-SA 3.0
null
2008-08-04T18:34:45.520
2012-01-22T17:47:30.370
2012-01-22T17:47:30.370
86,622
2,089,740
null
1,488
2
null
1,451
2
null
In addition to John Downey and jdecuyper's solutions, I've also added an "Explicit Deny" bit at the end/beginning of the bitfield, so that you can perform additive permissions by group, role membership, and then subtract permissions based upon explicit deny entries, much like NTFS works, permission-wise.
null
CC BY-SA 2.5
null
2008-08-04T18:39:56.120
2008-08-04T18:39:56.120
null
null
35
null
1,468
2
null
1,457
117
null
The way to do this is to manipulate `location.hash` when AJAX updates result in a state change that you'd like to have a discrete URL. For example, if your page's url is: > [http://example.com/](http://example.com/) If a client side function executed this code: ``` // AJAX code to display the "foo" state goes here....
null
CC BY-SA 4.0
null
2008-08-04T18:04:48.547
2020-04-24T12:58:05.243
2020-04-24T12:58:05.243
2,573,061
60
null
1,477
2
null
1,451
14
null
I agree with John Downey. Personally, I sometimes use a flagged enumeration of permissions. This way you can use AND, OR, NOT and XOR bitwise operations on the enumeration's items. ``` "[Flags] public enum Permission { VIEWUSERS = 1, // 2^0 // 0000 0001 EDITUSERS = 2, // 2^1 // 0000 0010 VIEWPRODUCTS = 4, /...
null
CC BY-SA 4.0
null
2008-08-04T18:23:40.537
2021-10-25T11:50:34.877
2021-10-25T11:50:34.877
17,169,050
296
null
1,495
2
null
761
4
null
I have to agree with the OP 'wrong' dates really jar with my DD/MM/YYYY upbringing and I find ISO 8601 dates and times extremely easy to work with. For once the standard got it right and [engtech](https://stackoverflow.com/questions/761/#770) has the obvious answer that doesn't require localisation. I was going to re...
null
CC BY-SA 2.5
null
2008-08-04T18:50:34.100
2008-08-04T18:50:34.100
2017-05-23T11:33:14.057
-1
269
null
1,421
2
null
1,408
382
null
Ok, per [pix0r](https://stackoverflow.com/questions/1408/#2471)'s, [Sparks](https://stackoverflow.com/questions/1408/#1413)' and [Dave](https://stackoverflow.com/questions/1408/#1414)'s answers it looks like there are three ways to do this: --- ## Virtual Hosts 1. Open C:\xampp\apache\conf\extra\httpd-vhosts....
null
CC BY-SA 4.0
null
2008-08-04T17:05:48.680
2019-02-28T14:24:54.127
2019-02-28T14:24:54.127
888,472
58
null
1,504
2
null
1,276
9
null
Also watch out for complex joins. Transaction complexity can be a big factor in addition to transaction volume. Refactoring heavy queries sometimes offers a big performance boost.
null
CC BY-SA 2.5
null
2008-08-04T19:01:23.860
2008-08-04T19:01:23.860
null
null
59
null
1,503
1
1,514
null
20
4,332
I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net.
Integrating Visual Studio Test Project with Cruise Control
CC BY-SA 2.5
0
2008-08-04T19:01:14.157
2013-01-27T12:14:44.200
2008-08-23T20:04:46.207
2,134
27
[ "visual-studio", "unit-testing", "continuous-integration", "cruisecontrol.net" ]
1,490
2
null
1,276
108
null
In general this is a very subtle issue and not trivial whatsoever. I encourage you to read [mysqlperformanceblog.com](http://mysqlperformanceblog.com) and [High Performance MySQL](https://rads.stackoverflow.com/amzn/click/com/0596101716). I really think there is no general answer for this. I'm working on a project whi...
null
CC BY-SA 3.0
null
2008-08-04T18:44:15.690
2017-05-12T04:23:30.967
2017-05-12T04:23:30.967
745,188
198
null
1,476
1
13,107
null
394
315,598
How do you express an integer as a binary number with Python literals? I was easily able to find the answer for hex: ``` >>> 0x12AF 4783 >>> 0x100 256 ``` and octal: ``` >>> 01267 695 >>> 0100 64 ``` --- - `int('01010101111',2)`- - `0b1100111``0B1100111`- `0o27``0O27`- `027`
How do you express binary literals in Python?
CC BY-SA 3.0
0
2008-08-04T18:20:36.487
2020-11-29T04:40:27.877
2017-03-13T13:47:17.753
4,952,130
92
[ "python", "syntax", "binary", "integer", "literals" ]
1,505
1
null
null
31
8,748
How do I set the icon that appears proper on the `iPhone` for the websites I have created?
How do I give my websites an icon for iPhone?
CC BY-SA 4.0
0
2008-08-04T19:02:36.777
2021-11-18T20:34:49.467
2020-09-09T09:53:42.277
14,152,908
83
[ "html", "ios", "iphone", "favicon", "apple-touch-icon" ]