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
8,447
1
8,480
null
1,701
601,953
From time to time I see an enum like the following: ``` [Flags] public enum Options { None = 0, Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8 } ``` I don't understand what exactly the `[Flags]` attribute does. Anyone have a good explanation or example they could post?
What does the [Flags] Enum Attribute mean in C#?
CC BY-SA 4.0
0
2008-08-12T04:09:16.083
2023-01-04T15:27:49.983
2020-04-06T09:18:20.707
5,519,709
580
[ "c#", "enums", "flags" ]
8,439
1
12,283
null
19
24,721
I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around. I have a table that has a conditional visibility expression, and I need a page break at the end of the table. - - - Any other ideas on what to try? I'm almost at the point where I n...
Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services
CC BY-SA 2.5
0
2008-08-12T03:46:11.043
2013-06-21T06:30:23.013
2008-11-17T21:53:29.640
3,743
233
[ "sql-server-2005", "reporting-services" ]
8,448
1
8,468
null
20
6,953
Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept?
F# curried function
CC BY-SA 2.5
0
2008-08-12T04:11:15.800
2014-07-06T16:46:19.137
2008-10-02T15:52:02.060
1,737
580
[ "f#", "functional-programming", "currying" ]
8,450
2
null
8,435
22
null
Another option is to use a tool such as [ResourceHacker](http://www.angusj.com/resourcehacker/). It handles way more than just icons as well. Cheers!
null
CC BY-SA 2.5
null
2008-08-12T04:17:42.120
2008-08-12T04:17:42.120
null
null
611
null
8,455
2
null
8,447
15
null
Flags allow you to use bitmasking inside your enumeration. This allows you to combine enumeration values, while retaining which ones are specified. ``` [Flags] public enum DashboardItemPresentationProperties : long { None = 0, HideCollapse = 1, HideDelete = 2, HideEdit = 4, HideOpenInNewWindow = 8...
null
CC BY-SA 3.0
null
2008-08-12T04:24:36.240
2016-02-07T18:21:45.703
2016-02-07T18:21:45.703
2,921,691
733
null
8,452
1
8,471
null
37
9,299
I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands?
Custom WPF command pattern example
CC BY-SA 3.0
0
2008-08-12T04:18:30.853
2016-03-02T07:29:44.843
2016-03-02T07:29:44.843
2,385,538
580
[ "wpf", "design-patterns", "command" ]
8,461
2
null
7,758
2
null
The ElementName property on a Binding is not supported in Silverlight. You will notice, if you go into the code behind or inspect the Binding object in class explorer, it doesn't have a property named ElementName.
null
CC BY-SA 2.5
null
2008-08-12T04:33:00.357
2008-08-12T04:33:00.357
null
null
580
null
8,441
1
8,454
null
13
6,473
I'm using `.htaccess` and `mod_rewrite` to point to files that reside behind the DocumentRoot. My folder structure looks like this: ``` home/ webroot/ other_files/ ``` I have a `.htaccess` file in webroot with the following content: If I try to access [http://example.com/file.html](http://example.com/file...
Mod-Rewrite loading files behind the DocumentRoot
CC BY-SA 3.0
0
2008-08-12T03:58:21.910
2020-12-12T01:12:30.603
2014-09-10T20:07:02.303
2,974,754
57
[ ".htaccess", "mod-rewrite" ]
8,463
2
null
8,214
2
null
If you make use of WPF commands, each custom command could then log the Action taken. You can also log the way the command was initiated.
null
CC BY-SA 2.5
null
2008-08-12T04:38:19.957
2008-08-12T04:38:19.957
null
null
580
null
8,457
2
null
8,448
3
null
It's a fairly simple process. Take a function, bind one of its arguments and return a new function. For example: ``` let concatStrings left right = left + right let makeCommandPrompt= appendString "c:\> " ``` Now by currying the simple concatStrings function, you can easily add a DOS style command prompt to the fron...
null
CC BY-SA 2.5
null
2008-08-12T04:26:41.523
2008-08-12T04:26:41.523
null
null
429
null
8,454
2
null
8,441
13
null
I believe you need to add a section with ``` <Directory "/home/other_files"> (options) </Directory> ``` to your server configuration before apache will be able to serve anything from it. For an example, my DocumentRoot is /var/www but there is this section in the default available site: ``` Alias /doc/ "/usr/sh...
null
CC BY-SA 2.5
null
2008-08-12T04:21:54.857
2008-08-12T04:21:54.857
null
null
75
null
8,451
1
8,486
null
15
9,137
I want to create an allocator which provides memory with the following attributes: - - The idea is that this will contain sensitive information (like licence information) which should be inaccessible to the user. I have done the usual research online and asked a few other people about this, but I cannot find a good ...
Secure Memory Allocator in C++
CC BY-SA 3.0
0
2008-08-12T04:18:09.873
2018-03-13T17:18:41.913
2018-03-13T17:18:41.913
1,936,366
716
[ "c++", "security", "memory", "ram-scraping" ]
8,460
2
null
8,447
53
null
Please see the following for an example which shows the declaration and potential usage: ``` namespace Flags { class Program { [Flags] public enum MyFlags : short { Foo = 0x1, Bar = 0x2, Baz = 0x4 } static void Main(string[] args) ...
null
CC BY-SA 3.0
null
2008-08-12T04:32:30.360
2016-08-14T02:23:29.430
2016-08-14T02:23:29.430
480,700
611
null
8,462
2
null
8,447
875
null
You can also do this ``` [Flags] public enum MyEnum { None = 0, First = 1 << 0, Second = 1 << 1, Third = 1 << 2, Fourth = 1 << 3 } ``` I find the bit-shifting easier than typing 4,8,16,32 and so on. It has no impact on your code because it's all done at compile time
null
CC BY-SA 3.0
null
2008-08-12T04:37:52.203
2014-06-18T02:45:27.820
2014-06-18T02:45:27.820
234
234
null
8,476
2
null
8,451
2
null
What you are asking for is handled at the OS level. Once the data is in your program, it is liable to be paged out. For accessing the memory, a motivated individual can attach a hardware debugger.
null
CC BY-SA 2.5
null
2008-08-12T05:07:08.837
2008-08-12T05:07:08.837
null
null
116
null
8,470
2
null
8,443
-1
null
I haven't used MSVC6 in years, but I remember the debugger basically being a flaky piece of crap. Things like this would regularly happen for no apparent reason because it just didn't like your code that day. In addition to the debugger being a flaky piece of crap, the rest of it was too. It's STL implementation isn'...
null
CC BY-SA 2.5
null
2008-08-12T04:48:40.200
2008-08-12T04:48:40.200
null
null
234
null
8,478
2
null
8,472
26
null
Be sure it isn't something [Google can answer](http://www.google.com/search?q=what+is+7+minus+3+times+2%3F) though. Which also shows an issue with that --order of operations!
null
CC BY-SA 2.5
null
2008-08-12T05:09:51.360
2010-04-19T16:26:26.953
2010-04-19T16:26:26.953
63,550
157
null
8,468
2
null
8,448
21
null
> (Edit: a small [Ocaml FP Koan](http://web.archive.org/web/20041012103936/http%3A//www.bagley.org/~doug/ocaml/Notes/okoans.shtml) to start things off)> > A student came to Jacques Garrigue and said, "I do not understand what currying is good for." Jacques replied, "Tell me your favorite meal and your favorite dessert"...
null
CC BY-SA 3.0
null
2008-08-12T04:46:33.480
2014-07-06T16:46:19.137
2017-05-23T12:33:26.220
-1
157
null
8,474
2
null
8,472
3
null
Someone also suggest the Raphael JavaScript library, which apparently let you draw on the client in all popular browsers: [http://dmitry.baranovskiy.com/raphael/](http://dmitry.baranovskiy.com/raphael/) .. but that wouldn't exactly work with my `<noscript>` case, now would it ? :)
null
CC BY-SA 2.5
null
2008-08-12T05:02:49.453
2010-04-19T16:27:29.543
2010-04-19T16:27:29.543
63,550
1
null
8,483
2
null
5,511
2
null
You can also try using data validation if users commit data before you use it. Doing that I found was fairly simple and cleaner than fiddling about with keys. Otherwise, you could always disable Paste too!
null
CC BY-SA 2.5
null
2008-08-12T05:14:52.347
2008-08-12T05:14:52.347
null
null
483
null
8,481
2
null
8,472
15
null
Although we all know basic maths, the math puzzle could cause some confusion. In your example I'm sure some people would answer with "8" instead of "1". Would a simple string of text with random characters highlighted in bold or italics be suitable? The user just needs to enter the bold/italic letters as the CAPTCHA....
null
CC BY-SA 2.5
null
2008-08-12T05:11:39.733
2010-04-19T16:25:44.477
2010-04-19T16:25:44.477
63,550
1,061
null
8,484
2
null
8,472
42
null
> The advantage of this approach is that, for most people, I like this idea, is there not any way we can just hook into the rep system? I mean, anyone with say +100 rep is likely to be a human. So if they have rep, you need not even bother doing ANYTHING in terms of CAPTCHA. Then, if they are not, then send it, I'm ...
null
CC BY-SA 2.5
null
2008-08-12T05:15:04.000
2008-08-12T05:15:04.000
null
null
832
null
8,472
1
8,637
null
317
82,711
It looks like we'll be adding [CAPTCHA](http://en.wikipedia.org/wiki/Captcha) support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a first line of defense: [...
Practical non-image based CAPTCHA approaches?
CC BY-SA 3.0
0
2008-08-12T04:59:35.017
2012-06-29T13:37:52.210
2012-04-01T09:23:31.653
1,219,121
1
[ "security", "language-agnostic", "captcha" ]
8,471
2
null
8,452
38
null
Ah ha! A question I can answer! Firstly, I should mention that I have personally found it easier to define and hook up commands in code rather than in XAML. It allows me to hook up the handlers for the commands a little more flexibly than an all XAML approach does. You should work out what commands you want to have an...
null
CC BY-SA 2.5
null
2008-08-12T04:58:38.620
2009-03-03T09:45:23.287
2009-03-03T09:45:23.287
24,874
483
null
8,482
2
null
8,451
5
null
Let's take this a bit at a time: > I want to create an allocator which provides memory with the following attributes: That's fair enough. > ``` * cannot be paged to disk. ``` That's going to be hard. As far as I am aware, you cannot disable Virtual Paging as it is handled by the OS. If there is a way, then you...
null
CC BY-SA 3.0
null
2008-08-12T05:13:00.637
2013-10-30T01:43:12.330
2013-10-30T01:43:12.330
184,741
342
null
8,486
2
null
8,451
19
null
You can't really protect against memory access. You can probably prevent paging if you are running as an admin or as the system, but you cannot prevent the admin or system from reading your memory. Even if you could somehow completely block other processes from reading your memory (which you can't), another process c...
null
CC BY-SA 2.5
null
2008-08-12T05:17:09.473
2008-08-12T05:17:09.473
null
null
872
null
8,490
2
null
8,451
1
null
@graham > You could run it through PGP and store it encrypted in memory and unencrypt it as needed. Massive performance hit. Then you'd have to hold the key in memory. That would make it a little harder, but definitely not impossible. Anyone motivated will still manage to get the data from memory.
null
CC BY-SA 2.5
null
2008-08-12T05:21:33.053
2008-08-12T05:21:33.053
null
null
872
null
8,489
2
null
8,472
37
null
What about a [honeypot captcha](http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx)?
null
CC BY-SA 2.5
null
2008-08-12T05:20:05.893
2008-08-12T05:20:05.893
null
null
493
null
8,492
2
null
8,443
1
null
Stop beating on VC6. It's old. The STL was updated in 1996 from HP code written in 1994. C++ was ratified in 1998. What is the code doing when you are breaking? Can you reduce the situation into a simple test. When I try that I usually find the cause. If you can do that so it still happens then I'll take a look at it ...
null
CC BY-SA 2.5
null
2008-08-12T05:22:11.147
2008-08-12T05:22:11.147
null
null
342
null
8,495
2
null
8,485
3
null
In your route, get rid of the {paramName} part of the URL. It should be: TestController.mvc/TestAction As that is the URL you want the request to route to. Your form will then post to that URL. Posted form values are mapped to parameters of an action method automatically, so don't worry about not having that data pa...
null
CC BY-SA 2.5
null
2008-08-12T05:24:55.353
2008-08-12T05:24:55.353
null
null
598
null
8,496
1
49,629,412
null
59
41,258
I've moved from TFS to SVN (TortoiseSVN) with my current company. I really miss the "Shelve" feature of TFS. I've read various articles on how to "Shelve" with SVN, but I've read nothing that gives a very simple experience to "shelve" work. Ideally, I'd like extra items added to the TortoiseSVN context menu - "Shelve"...
Shelve in TortoiseSVN?
CC BY-SA 3.0
0
2008-08-12T05:25:21.297
2022-03-17T12:12:49.873
2014-04-11T12:26:03.143
391,531
708
[ "svn", "tortoisesvn" ]
8,514
2
null
8,472
1
null
@pc1oad1etter I also noticed that after doing my post. However, it's just an idea and not the actual implementation. Varying the font or using different colours instead of bold/italics would easily address usability issues.
null
CC BY-SA 2.5
null
2008-08-12T05:47:15.543
2008-08-12T05:47:15.543
null
null
1,061
null
8,485
1
49,184
null
12
3,553
I'm using ASP.NET MVC Preview 4 and would like to know how to use the routing engine for form submissions. For example, I have a route like this: ``` routes.MapRoute( "TestController-TestAction", "TestController.mvc/TestAction/{paramName}", new { controller = "TestController", acti...
Use the routing engine for form submissions in ASP.NET MVC Preview 4
CC BY-SA 3.0
null
2008-08-12T05:16:01.427
2016-03-04T15:49:44.597
2016-03-04T15:49:44.597
996,815
364
[ "asp.net-mvc", "forms", "asp.net-mvc-routing" ]
8,493
1
15,363
null
6
1,178
Are there any handy general items you put in your .procmailrc file?
What's in your .procmailrc
CC BY-SA 2.5
null
2008-08-12T05:24:36.307
2015-12-28T08:33:46.870
2015-12-28T08:33:46.870
874,188
459
[ "email", "unix", "procmail" ]
8,508
1
8,515
null
6
613
By looking at our `DB's` error log, we found that there was a constant stream of almost successful SQL injection attacks. Some quick coding avoided that, but how could I have setup a monitor for both the DB and Web server (including POST requests) to check for this? By this I mean if there are off the shelf tools for ...
How should I monitor potential threats to my site?
CC BY-SA 3.0
null
2008-08-12T05:40:49.847
2013-10-01T20:37:10.753
2013-07-04T12:09:49.810
1,584,286
459
[ "monitor", "alert" ]
8,501
2
null
8,496
32
null
I don't believe that SVN has this feature built into the server product. I also don't believe anything like this emulated in any clients that I have used, including TortoiseSVN. To get around this problem, I have resorted to using a DVCS such as [Git](http://git.or.cz/) or [Mercurial](http://www.selenic.com/mercurial/...
null
CC BY-SA 4.0
null
2008-08-12T05:30:34.047
2018-07-02T08:47:50.320
2018-07-02T08:47:50.320
452,775
611
null
8,517
1
36,791
null
4
2,808
I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches "new" or "london" I want the list of prefix matches ordered by population, and I have that working with a prefix search and an sort by field ...
Lucene exact ordering
CC BY-SA 2.5
null
2008-08-12T05:51:01.947
2012-04-01T09:30:45.367
2008-08-22T16:56:04.280
459
459
[ "lucene" ]
8,515
2
null
8,508
5
null
Funnily enough, Scott Hanselman had a [post on UrlScan](http://www.hanselman.com/blog/HackedAndIDidntLikeItURLScanIsStepZero.aspx) today which is one thing you could do to help monitor and minimize potential threats. It's a pretty interesting read.
null
CC BY-SA 2.5
null
2008-08-12T05:47:15.777
2008-08-12T05:47:15.777
null
null
493
null
8,526
2
null
8,447
18
null
To add `Mode.Write`: ``` Mode = Mode | Mode.Write; ```
null
CC BY-SA 3.0
null
2008-08-12T05:59:38.343
2016-04-14T05:46:00.093
2016-04-14T05:46:00.093
4,519,059
489
null
8,530
2
null
8,451
-1
null
@Derek: Oh, but with trusted computing, you can use [memory curtaining](http://en.wikipedia.org/wiki/Trusted_Computing#Memory_curtaining)! :-P</devils-advocate>
null
CC BY-SA 2.5
null
2008-08-12T06:03:16.773
2008-08-12T06:03:16.773
null
null
13
null
8,522
2
null
8,517
0
null
My current solution is to create an exact searcher and a prefix searcher, both sorted by reverse population, and then copy out all my hits starting from the exact hits, moving to the prefix hits. It makes paging my results slightly more annoying than I think it should be. Also I used a hash to eliminate duplicates bu...
null
CC BY-SA 3.0
null
2008-08-12T05:55:04.920
2012-04-01T09:30:45.367
2017-05-23T12:21:43.363
-1
459
null
8,543
2
null
8,472
3
null
Who says you have to all the images on the server with each request? Maybe you could have a static list of images or pull them from flickr. I like the "click on the kitten" captcha idea. [http://www.thepcspy.com/kittenauth](http://www.thepcspy.com/kittenauth)
null
CC BY-SA 2.5
null
2008-08-12T06:15:25.893
2008-08-12T06:15:25.893
null
null
571
null
8,480
2
null
8,447
2,453
null
The `[Flags]` attribute should be used whenever the enumerable represents a collection of possible values, rather than a single value. Such collections are often used with bitwise operators, for example: ``` var allowedColors = MyColor.Red | MyColor.Green | MyColor.Blue; ``` Note that the `[Flags]` attribute enable...
null
CC BY-SA 4.0
null
2008-08-12T05:10:46.427
2019-02-08T03:29:08.990
2019-02-08T03:29:08.990
251,200
446
null
8,544
2
null
8,451
-1
null
@Chris > Oh, but with trusted computing, you can use memory curtaining! :-P But then you have to actually be willing to pay for a computer someone else owns. :p
null
CC BY-SA 2.5
null
2008-08-12T06:15:27.640
2008-08-12T06:15:27.640
null
null
872
null
8,532
1
9,085
null
8
6,818
I've had an app doing prefix searches for a while. Recently the index size was increased and it turned out that some prefixes were too darned numerous for lucene to handle. It kept throwing me a [Too Many Clauses](http://web.archive.org/web/20080901205009/http://lucene.apache.org:80/java/2_3_2/api/core/org/apache/luce...
With Lucene: Why do I get a Too Many Clauses error if I do a prefix search?
CC BY-SA 4.0
0
2008-08-12T06:04:48.940
2020-06-29T18:09:27.367
2020-06-29T17:46:53.970
9,780,149
459
[ "exception", "lucene" ]
8,549
1
8,580
null
7
6,636
Is there any Visual Studio Add-In that can do the remove method refactoring? Suppose you have the following method: ``` Result DoSomething(parameters) { return ComputeResult(parameters); } ``` Or the variant where Result is void. The purpose of the refactoring is to replace all the calls to DoSomething ...
Visual Studio refactoring: Remove method
CC BY-SA 2.5
0
2008-08-12T06:22:06.377
2012-08-11T15:34:24.627
null
null
1,065
[ "visual-studio", "refactoring", "methods" ]
8,545
1
8,559
null
1
639
As a programmer I need a place to store my stuff. I've been running a server in my parents closet for a long time, but I recently came across a decent 2U server. I have no experience dealing with hosting companies, beyond the very cheap stuff, and I'm wondering what I should look for in a colo or if I should just keep ...
Closet server versus Colo?
CC BY-SA 3.0
null
2008-08-12T06:18:08.680
2013-07-04T12:04:16.297
2013-07-04T12:04:16.297
1,584,286
1,063
[ "hardware", "storage" ]
8,548
2
null
8,472
1
null
@lance > Who says you have to create all the images on the server with each request? Maybe you could have a static list of images or pull them from Flickr. I like the "click on the kitten" CAPTCHA idea. [http://www.thepcspy.com/kittenauth](http://www.thepcspy.com/kittenauth). If you pull from a static list of images,...
null
CC BY-SA 2.5
null
2008-08-12T06:21:48.267
2010-04-19T16:23:36.463
2010-04-19T16:23:36.463
63,550
872
null
8,546
1
8,553
null
73
31,504
I need to try to lock on an object, and if its already locked just continue (after time out, or without it). The C# lock statement is blocking.
Is there a "try to lock, skip if timed out" operation in C#?
CC BY-SA 3.0
0
2008-08-12T06:19:38.550
2022-04-11T14:20:39.787
2014-09-07T19:51:41.833
2,246,344
195
[ "c#", "multithreading", "locking" ]
8,551
2
null
8,549
1
null
When it comes to refactoring like that, try out [ReSharper](http://www.jetbrains.com/resharper/index.html). Just right click on the method name, click "Find usages", and refactor until it cannot find any references. And as dlamblin mentioned, the newest version of ReSharper has the possibility to inline a method. T...
null
CC BY-SA 2.5
null
2008-08-12T06:25:27.307
2008-08-12T07:49:12.473
2008-08-12T07:49:12.473
960
960
null
8,556
2
null
8,472
2
null
I had a load of spam issues on a phpBB 2.0 site I was running a while back (the site is now upgraded). I installed a custom captcha mod I found on the pbpBB forums that worked well for a period of time. I found the real solution was combining this with additional 'required' fields [on the account creation page]. I add...
null
CC BY-SA 2.5
null
2008-08-12T06:33:06.403
2008-08-12T06:33:06.403
null
null
713
null
8,558
2
null
8,545
1
null
If it were my source control server, I would not want to a) pay the added cost, or b)have to drive to the colo because I can't connect to my repository.
null
CC BY-SA 2.5
null
2008-08-12T06:47:50.007
2008-08-12T06:47:50.007
null
null
1,053
null
8,553
2
null
8,546
44
null
I believe that you can use [Monitor.TryEnter()](http://msdn.microsoft.com/en-us/library/system.threading.monitor.tryenter%28VS.71%29.aspx). The lock statement just translates to a `Monitor.Enter()` call and a `try catch` block.
null
CC BY-SA 3.0
null
2008-08-12T06:29:24.070
2013-01-22T10:25:53.013
2013-01-22T10:25:53.013
238,902
1,053
null
8,554
2
null
8,472
1
null
@rob > > What about a honeypot captcha? Wow, so simple! Looks good! Although they have highlighted the accessibility issue.. Do you think that this would be a problem at SO? I personally find it hard to imagine developers/programmers that have difficulty reading the screen to the point where they need a screen rea...
null
CC BY-SA 2.5
null
2008-08-12T06:29:47.890
2008-08-12T06:29:47.890
null
null
872
null
8,563
2
null
8,549
0
null
You can also right click the method name and click "Find all References" in Visual Studio. I personally would just do a + + to `Find & Replace`
null
CC BY-SA 3.0
null
2008-08-12T07:19:05.250
2012-08-11T15:34:24.627
2012-08-11T15:34:24.627
1,477,076
832
null
8,557
2
null
8,546
112
null
Ed's got the right function for you. Just don't forget to call `Monitor.Exit()`. You should use a `try-finally` block to guarantee proper cleanup. ``` if (Monitor.TryEnter(someObject)) { try { // use object } finally { Monitor.Exit(someObject); } } ```
null
CC BY-SA 2.5
null
2008-08-12T06:37:34.053
2008-08-12T06:37:34.053
null
null
872
null
8,567
2
null
8,566
20
null
I personally would recommend doing it... If it's responding to some sort of action and it needs to change its appearance, I would prefer raising an event and letting it sort itself out... This kind of coupling between forms always makes me nervous. I always try to keep the UI as light and as possible.. I hope this ...
null
CC BY-SA 3.0
null
2008-08-12T07:35:33.000
2014-08-06T11:42:23.793
2014-08-06T11:42:23.793
63,550
832
null
8,564
2
null
8,042
10
null
Extension methods should be used as just that: extensions. Any crucial structure/design related code or non-trivial operation should be put in an object that is composed into/inherited from a class or interface. Once another object tries to use the extended one, they won't see the extensions and might have to reimple...
null
CC BY-SA 2.5
null
2008-08-12T07:23:55.130
2008-08-12T07:23:55.130
null
null
372
null
8,561
2
null
8,549
1
null
I would do it the simpliest way: 1. rename ComputeResult method to ComputeResultX 2. rename DoSomething method to ComputeResult 3. remove DoSomething method (which is now ComputeResult) 4. rename ComputeResultX method back to ComputeResult Maybe VS will show some conflict because of the last rename, but ignore it....
null
CC BY-SA 2.5
null
2008-08-12T07:04:26.417
2008-08-12T07:04:26.417
null
null
968
null
8,559
2
null
8,545
3
null
There are three major factors here. 1. Cost. The colo will obviously be more expensive than sticking a server in your parents' closet. 2. Quality. The colo should be a lot more reliable than the server in your parents' closet. They aren't as likely to go down when there's a power surge. They should provide some suppo...
null
CC BY-SA 2.5
null
2008-08-12T06:48:26.340
2008-08-12T06:48:26.340
null
null
872
null
8,571
2
null
8,569
2
null
Whilst its been years since I have used spring, and I can't say I am a fan of it, I know that the App Fuse tool ([https://java.net/projects/appfuse/](https://java.net/projects/appfuse/)) has been helpful to help people bootstrap in terms of generating all the artifacts you need to get going.
null
CC BY-SA 3.0
null
2008-08-12T07:40:19.293
2013-11-26T03:58:58.803
2013-11-26T03:58:58.803
1,845,869
699
null
8,569
1
13,367
null
32
11,679
I'm currently trying to get into the Java EE development with the Spring framework. As I'm new to Spring, it is hard to imaging how a good running project should start off. Do you have any , tipps or major for a starter? How did you start with Spring - big project or small tutorial-like applications? Which technology...
What's your "best practice" for the first Java EE Spring project?
CC BY-SA 2.5
0
2008-08-12T07:36:14.107
2013-11-26T03:59:25.720
2008-08-12T07:55:11.243
834
834
[ "java", "spring", "jakarta-ee", "aop" ]
8,565
2
null
8,472
1
null
Answering the original question: - - - I've seen pictures of animals [what is it?]. Votes for comics use a picture of a character with their name written somewhere in the image [type in name]. Impossible to parse, not ok for blind people. You could have an audio fallback reading alphanumerics (the same letters and...
null
CC BY-SA 2.5
null
2008-08-12T07:29:45.307
2008-08-22T15:02:30.013
2008-08-22T15:02:30.013
341
341
null
8,570
2
null
8,042
1
null
Ouch. Please don't extend Interfaces. An interface is a clean contract that a class should implement, and your usage of said classes be restricted to what is in the core Interface for this to work correctly. That is why you always declare the interface as the type instead of the actual class. ``` IInterface variable...
null
CC BY-SA 2.5
null
2008-08-12T07:38:23.650
2008-08-12T07:38:23.650
null
null
960
null
8,568
2
null
8,549
0
null
[ReSharper](http://www.jetbrains.com/resharper/features/code_refactoring.html) is definitely the VS 2008 plug in to have for refactoring. However it does not do this form of refactoring in one step; you will have to Refactor->rename DoSomething to ComputeResult and ignore the conflict with the real ComputeResult. Then ...
null
CC BY-SA 2.5
null
2008-08-12T07:35:35.030
2008-08-12T07:35:35.030
null
null
459
null
8,572
2
null
8,566
2
null
I would handle this in the parent form. You can notify the other form that it needs to modify itself through an event.
null
CC BY-SA 2.5
null
2008-08-12T07:40:55.690
2008-08-12T08:13:21.410
2008-08-12T08:13:21.410
1,053
1,053
null
8,573
2
null
8,566
38
null
Instead of making the control public, you can create a property that controls its visibility: ``` public bool ControlIsVisible { get { return control.Visible; } set { control.Visible = value; } } ``` This creates a proper accessor to that control that won't expose the control's whole set of properties.
null
CC BY-SA 3.0
null
2008-08-12T07:41:07.093
2014-12-22T21:21:01.010
2014-12-22T21:21:01.010
372
372
null
8,579
2
null
8,566
5
null
After reading the additional details, I agree with [robcthegeek](https://stackoverflow.com/questions/8566/best-way-to-access-a-control-on-another-form-in-c?sort=Newest#8567): raise an event. Create a custom EventArgs and pass the neccessary parameters through it.
null
CC BY-SA 2.5
null
2008-08-12T07:48:18.200
2008-08-12T07:48:18.200
2017-05-23T11:54:50.000
-1
968
null
8,584
2
null
8,223
1
null
With the advent of ADO.Net and the newer version of SQL connection pooling is handled on two layers, first through ADO.Net itself and secondly by SQL Server 2005/2008 directly, eliminating the need for custom connection pooling. I have been informed that similar support are being planned or have been implemented in O...
null
CC BY-SA 2.5
null
2008-08-12T07:52:33.153
2008-08-12T07:52:33.153
null
null
146,270
null
8,576
2
null
8,569
14
null
Focus first on the heart of Spring: Dependency Injection. Once you see all the ways that DI can be used, then start thinking about the more interesting pieces like AOP, Remoting, JDBC Templates etc. So my best bit of advice is let your use of Spring grow out from the core. Best practice? If you're using the standard X...
null
CC BY-SA 2.5
null
2008-08-12T07:43:24.153
2008-08-12T07:43:24.153
null
null
1,035
null
8,577
2
null
8,549
1
null
There are a few products available to add extra refactoring options to Visual Studio 2005 & 2008, a few of the better ones are [Refactor! Pro](http://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring/) and [Resharper](http://www.jetbrains.com/resharper/). As far as remove method, there is a description in t...
null
CC BY-SA 2.5
null
2008-08-12T07:44:42.403
2008-08-12T07:44:42.403
null
null
332
null
8,590
2
null
8,566
0
null
Do your child forms really need to be Forms? Could they be user controls instead? This way, they could easily raise events for the main form to handle and you could better encapsulate their logic into a single class (at least, logically, they are after all classes already). @Lars: You are right here. This was some...
null
CC BY-SA 2.5
null
2008-08-12T07:55:55.207
2008-08-12T08:12:50.647
2008-08-12T08:12:50.647
1,053
1,053
null
8,585
1
8,593
null
5
567
Is there a way to watch for changes in the ip-address much the same as it is possible to watch for changes to files using the FileSystemWatcher? I'm connecting to a machine via tcp/ip but it takes a while until it gives me an ip-address. I would like to dim out the connect button until I have a valid ip-address.
Watch for change in ip address status
CC BY-SA 2.5
null
2008-08-12T07:53:40.857
2015-09-01T09:54:49.980
2015-09-01T09:54:49.980
4,374,739
143
[ ".net", "windows" ]
8,588
2
null
8,546
3
null
You'll probably find this out for yourself now that the others have pointed you in the right direction, but TryEnter can also take a timeout parameter. Jeff Richter's "CLR Via C#" is an excellent book on details of CLR innards if you're getting into more complicated stuff.
null
CC BY-SA 2.5
null
2008-08-12T07:54:39.607
2008-08-12T07:54:39.607
null
null
987
null
8,586
2
null
8,569
3
null
I actually quite liked Spring.. It was a fresh breeze of air in your average J2EE Java Beans.. I recommend implementing the example Spring provides: [http://static.springframework.org/docs/Spring-MVC-step-by-step/](http://static.springframework.org/docs/Spring-MVC-step-by-step/) Also, I decided to go full monty and...
null
CC BY-SA 2.5
null
2008-08-12T07:54:25.023
2008-08-12T07:54:25.023
null
null
900
null
8,574
2
null
8,566
8
null
The first is not working of course. The controls on a form are private, visible only for that form by design. To make it all public is also not the best way. If I would like to expose something to the outer world (which also can mean an another form), I make a public property for it. ``` public Boolean nameOfControl...
null
CC BY-SA 2.5
null
2008-08-12T07:42:57.603
2008-08-12T07:42:57.603
null
null
968
null
8,580
2
null
8,549
6
null
If I understand the question, then Resharper calls this 'inline method' - - +
null
CC BY-SA 3.0
null
2008-08-12T07:48:33.443
2012-08-11T15:33:40.897
2012-08-11T15:33:40.897
1,477,076
987
null
8,593
2
null
8,585
6
null
Check [NetworkChange](http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkchange.aspx) class. It raises an event when a network address changes.
null
CC BY-SA 3.0
null
2008-08-12T07:59:54.573
2013-03-08T09:05:29.767
2013-03-08T09:05:29.767
395,659
968
null
8,592
2
null
8,566
0
null
@Lars, good call on the passing around of Form references, seen it as well myself. Nasty. Never seen them passed them down to the BLL layer though! That doesn't even make sense! That could have seriously impacted performance right? If somewhere in the BLL the reference was kept, the form would stay in memory right? Yo...
null
CC BY-SA 2.5
null
2008-08-12T07:57:25.453
2008-08-12T07:57:25.453
null
null
832
null
8,591
2
null
8,452
3
null
The thing about XAML is that it is fine for 'simple' programs, but sadly, it doesn't work well when you want to do things like share functions. Say you have several classes and UI's all of which had commands that were never disabled, you'd have to write a 'CanAlwaysExecute' method for each Window or UserControl! That's...
null
CC BY-SA 2.5
null
2008-08-12T07:57:11.723
2008-08-12T07:57:11.723
null
null
483
null
8,540
2
null
8,451
-1
null
@roo > I was really hoping that is was possible, and that I just hadn't found it yet. Your example just made me realise that that is exactly what we are trying to do - only allow access to files in the context of our program and so preserve the IP.I guess I have to accept that there is no truly secure way to store some...
null
CC BY-SA 2.5
null
2008-08-12T06:12:44.027
2008-08-12T06:12:44.027
2020-06-20T09:12:55.060
-1
872
null
8,594
2
null
7,596
12
null
I'm a huge fan of organized sources, so I always create the following directory structure: ``` /src - for your packages & classes /test - for unit tests /docs - for documentation, generated and manually edited /lib - 3rd party libraries /etc - unrelated stuff /bin (or /classes) - compiled classes, output of your compi...
null
CC BY-SA 2.5
null
2008-08-12T08:00:18.707
2008-08-12T08:00:18.707
null
null
834
null
8,599
1
8,655
null
10
1,660
Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device. And it goes without saying that it needs to be smaller than XML, and faster to parse. --- The data ...
Best binary XML format for JavaME
CC BY-SA 3.0
0
2008-08-12T08:08:11.327
2020-05-30T00:07:34.520
2012-04-12T11:14:22.717
1,288
974
[ "java", "xml", "java-me", "mobile" ]
8,598
2
null
7,720
7
null
Maybe you should take a look at [IzPack](http://izpack.org/). I created a very nice installer some years ago and I'd bet that they are still improving it. It allows the installation of docs, binaries and a clickable link to start the application .
null
CC BY-SA 2.5
null
2008-08-12T08:05:53.500
2008-08-12T08:05:53.500
null
null
834
null
8,596
2
null
8,545
0
null
I'd absolutely go for the server that's located under my roof, as long as I don't need it to be connected to the internet with a static IP. Why: - - - - -
null
CC BY-SA 2.5
null
2008-08-12T08:03:47.547
2008-08-12T08:03:47.547
null
null
999
null
8,600
2
null
8,451
-1
null
@Derek Park He only said harder, not impossible. PGP would make it harder, not impossible.
null
CC BY-SA 2.5
null
2008-08-12T08:10:27.393
2008-08-12T08:10:27.393
null
null
342
null
8,606
2
null
4,582
4
null
I learned everything I know about the DCT from [The Data Compression Book](https://rads.stackoverflow.com/amzn/click/com/1558514341). In addition to being a great introduction to the field of data compression, it has a chapter near the end on lossy image compression which introduces JPEG and the DCT.
null
CC BY-SA 2.5
null
2008-08-12T08:28:06.513
2008-08-12T08:28:06.513
null
null
893
null
8,610
2
null
8,604
2
null
I also needed a WYSIWYG editor for a Windows Forms project that I was working on. I wrote about the items that I found [here](http://ellisweb.net/2007/03/wysiwyg-editing-of-html-in-a-windows-forms-control/). Eventually, I ended up using something that I found on CodeProject: [A Windows Forms based text editor with HTML...
null
CC BY-SA 4.0
null
2008-08-12T08:42:03.600
2019-10-18T09:48:48.343
2019-10-18T09:48:48.343
5,582,190
51
null
8,615
2
null
8,612
0
null
Are you sure there are no precompile directives that, say, ignores some really important code in Release mode but allows them in Debug? Also, have you implemented any logging that might point out to the precise assembly that's throwing the error?
null
CC BY-SA 2.5
null
2008-08-12T08:48:45.380
2008-08-12T08:48:45.380
null
null
372
null
8,602
2
null
7,720
3
null
Have you considered writing a small program in C/C++ that just calls [CreateProcess](http://msdn.microsoft.com/en-us/library/ms682425.aspx) to start up the java VM with the jar (or class) file? You could get [Visual C++ Express](http://www.microsoft.com/express/vc/) and put together the startup program pretty easily. ...
null
CC BY-SA 2.5
null
2008-08-12T08:15:51.093
2008-08-12T08:21:36.993
2008-08-12T08:21:36.993
872
872
null
8,617
2
null
8,612
1
null
Could be a concurrency problem of two threads. The DEBUG configuration slows the execution down, so the problem does not occur. But, only a guess.
null
CC BY-SA 2.5
null
2008-08-12T08:51:20.990
2008-08-12T08:51:20.990
null
null
1,069
null
8,616
2
null
8,612
2
null
It's hard to say what the problem might be without carefully inspecting the code. However... One of the differences between debug and release builds is how the function call stack frame is set up. There are certain classes of bad things you can do (like calling a function with the wrong number of arguments) that are n...
null
CC BY-SA 2.5
null
2008-08-12T08:51:01.053
2008-08-12T08:51:01.053
null
null
893
null
8,604
1
null
null
21
45,075
We are looking for a WYSIWYG editor control for our windows application (vb.net or c#) so that users can design HTML emails (to send using the SMTP objects in the dot net framework) before sending. Currently all the available editors we can find have one of the following issues: 1. They rely on mshtml.dll or the web...
HTML Editor in a Windows Forms Application
CC BY-SA 4.0
0
2008-08-12T08:20:15.173
2019-12-01T06:28:32.967
2019-12-01T06:28:32.967
1,636,173
33
[ "c#", ".net", "vb.net", "winforms", "controls" ]
8,618
2
null
8,612
1
null
Interesting problem.. Are you sure you have no conditional compilation code lurking around that is not being compiled in release mode? i.e: ``` #if (DEBUG) // Debug Code here #else // Release Code here #endif ``` Thats the only thing I can really think of.. Never experienced anything like this myself..
null
CC BY-SA 2.5
null
2008-08-12T08:51:52.627
2008-08-12T08:51:52.627
null
null
832
null
8,612
1
8,616
null
2
1,473
I have a workspace for running an H.263 Video Encoder in a loop for 31 times i.e. the main is executed 31 times to generate 31 different encoded bit streams. This MS Visual Studio 2005 Workspace has all C source files. When i create a "DEBUG" configuration for the workspace and build and execute it, it runs fine, i.e. ...
Code crash in MS Visual Studio 2005 in RELEASE configuration
CC BY-SA 2.5
null
2008-08-12T08:44:09.600
2014-08-02T13:35:03.163
2014-08-02T13:35:03.163
96,982
2,759,376
[ "visual-studio-2005" ]
8,620
2
null
7,720
0
null
Another option I was considering: rather than writing a native launcher from scratch, Eclipse comes with the source code for its own launcher, and this could perhaps be repurposed for my app. It's a shame that Sun never included anything similar in the JDK.
null
CC BY-SA 2.5
null
2008-08-12T08:55:33.150
2008-08-12T08:55:33.150
null
null
998
null
8,626
1
4,068,900
null
2
1,149
Is there anyplace where one can download a virtual machine containing a working install of some Linux distro with Globus Toolkit and some development tools (Java) for testing purposes? A real deployment of a grid is more complicated but I just need something portable, for development.
Globus Toolkit virtual machine
CC BY-SA 2.5
0
2008-08-12T09:13:40.773
2010-11-01T12:36:12.553
2008-08-18T00:08:36.800
380
1,065
[ "linux", "virtual-machine", "globus-toolkit" ]
8,627
2
null
8,624
1
null
Rather than relying on your users to look at the page footer and to let you know if the value exceeds some patience threshold, it might be a better idea to log the page render times in a log file on the server. Once you have all that raw data, you can look for particular pages that tend to take longer than normal to re...
null
CC BY-SA 2.5
null
2008-08-12T09:13:53.520
2008-08-12T09:13:53.520
null
null
893
null
8,631
2
null
8,624
2
null
"Rendered instantly" sounds way better than "Rendered in less than a second".
null
CC BY-SA 2.5
null
2008-08-12T09:22:53.860
2008-08-12T09:22:53.860
null
null
1,065
null
8,629
2
null
8,493
5
null
Just simple things - move messages to appropriate folders, forward some stuff to an email2sms address, move spam to spam folder. One thing I'm kind of proud of is how to mark your spam as "read" (this is for Courier IMAP and Maildir, where "read" means "move to different folder and change the filename"): ``` :0 ...
null
CC BY-SA 2.5
null
2008-08-12T09:21:20.463
2008-08-12T09:21:20.463
null
null
719
null