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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,620 | 2 | null | 6,607 | 45 | null |
1. Easy to do. Don't need to know any Windows API calls. You just need to know the file I/O interface of your programming language.
2. Portable. If you port your application to another OS, you don't need to change your settings format.
3. User-editable. The user can edit the config file outside of the program exec... | null | CC BY-SA 2.5 | null | 2008-08-09T04:51:59.773 | 2011-02-25T13:13:38.733 | 2011-02-25T13:13:38.733 | 8,418 | null | null |
6,622 | 2 | null | 6,607 | 4 | null | According to the documentation for [GetPrivateProfileString](http://msdn.microsoft.com/en-us/library/ms724353.aspx), you should use the registry for storing initialisation information.
However, in so saying, if you still want to use .ini files, and use the standard profile APIs (`GetPrivateProfileString`, `WritePrivat... | null | CC BY-SA 2.5 | null | 2008-08-09T04:54:24.090 | 2008-08-09T04:54:24.090 | null | null | 13 | null |
6,627 | 2 | null | 6,613 | 2 | null | I have a bit of experience with both Haley Expert Rules and Haley Office Rules. Both nice systems, but I'd need to know a bit more abut what you want to use them for to answer definitively (See [http://www.haley.com](http://www.haley.com))
They both support C# and Java (and I think also a web service api).
The differ... | null | CC BY-SA 2.5 | null | 2008-08-09T05:01:10.910 | 2008-08-09T05:01:10.910 | null | null | 797 | null |
6,630 | 2 | null | 4,689 | 3 | null | Lucida Sans Typewriter
| null | CC BY-SA 2.5 | null | 2008-08-09T05:11:00.360 | 2008-08-09T05:11:00.360 | null | null | 795 | null |
6,638 | 2 | null | 4,689 | 1 | null | I just tried Consolas and Envy - Envy seems "too narrow" to my eyes, but Consolas looks great (I am on a mac). Thanks for the tips !
| null | CC BY-SA 2.5 | null | 2008-08-09T05:33:15.027 | 2008-08-09T05:33:15.027 | null | null | 699 | null |
6,639 | 1 | null | null | 72 | 169,763 | How should I load files into my Java application?
| How should I load files into my Java application? | CC BY-SA 2.5 | 0 | 2008-08-09T05:33:22.967 | 2021-06-15T15:59:19.570 | 2014-01-30T07:11:29.327 | 1,737,819 | 816 | [
"java",
"file",
"loading"
] |
6,628 | 1 | 6,649 | null | 34 | 86,749 | What is the difference, if any, between these methods of indexing into a PHP array:
```
$array[$index]
$array["$index"]
$array["{$index}"]
```
I'm interested in both the performance and functional differences.
### Update:
(In response to @Jeremy) I'm not sure that's right. I ran this code:
```
$array = array(100, 2... | PHP array indexing: $array[$index] vs $array["$index"] vs $array["{$index}"] | CC BY-SA 3.0 | 0 | 2008-08-09T05:01:38.867 | 2022-09-20T22:15:22.050 | 2020-06-20T09:12:55.060 | -1 | 103 | [
"php",
"syntax"
] |
6,636 | 2 | null | 5,473 | 509 | null | What you want to do is to specify the sha1 of the commit you want to restore to. You can get the sha1 by examining the reflog (`git reflog`) and then doing
```
git reset --hard <sha1 of desired commit>
```
But don't wait too long... after a few weeks git will eventually see that commit as unreferenced and delete all ... | null | CC BY-SA 4.0 | null | 2008-08-09T05:30:13.707 | 2021-03-24T21:53:09.803 | 2021-03-24T21:53:09.803 | 46,914 | 825 | null |
6,623 | 1 | 27,317 | null | 17 | 26,981 | After changing the output directory of a visual studio project it started to fail to build with an error very much like:
```
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\sgen.exe /assembly:C:\p4root\Zantaz\trunk\EASDiscovery\EASDiscoveryCaseManagement\obj\Release\EASDiscoveryCaseManagement.dll /proxytype... | sgen.exe fails during build | CC BY-SA 4.0 | 0 | 2008-08-09T04:57:00.577 | 2019-01-20T13:57:49.267 | 2019-01-20T13:57:49.267 | 567,854 | 361 | [
"c#",
"visual-studio",
"msbuild"
] |
6,633 | 1 | 6,694 | null | 13 | 2,301 | I have inherited some legacy PHP code what was written back when it was standard practice to use [register_globals](http://php.net/register_globals) (As of PHP 4.2.0, this directive defaults to off, released 22. Apr 2002).
We know now that it is bad for security to have it enabled. The problem is how do I find all the... | Making code work with register_globals turned off | CC BY-SA 4.0 | 0 | 2008-08-09T05:13:55.877 | 2019-01-18T10:35:22.930 | 2019-01-18T10:35:22.930 | 567,854 | 796 | [
"php",
"register-globals"
] |
6,642 | 1 | 6,645 | null | 9 | 4,219 | I was trying to add a favicon to a website earlier and looked for a better way to implement this than to dump a `favicon.ico` file in the root of the website.
I found this nice little guide: [How to Add a Favicon](http://www.w3.org/2005/10/howto-favicon). However, the preferred method did not work in IE (7) and the se... | Preferred way to use favicons? | CC BY-SA 2.5 | 0 | 2008-08-09T05:41:40.830 | 2019-10-19T04:26:32.723 | 2009-06-02T01:17:23.500 | 810 | 810 | [
"browser",
"compatibility"
] |
6,643 | 2 | null | 6,642 | 0 | null | This is how they're doing it right here on Stack Overflow:
```
<link rel="shortcut icon" href="/favicon.ico" />
```
| null | CC BY-SA 2.5 | null | 2008-08-09T05:44:56.983 | 2008-08-09T05:44:56.983 | null | null | 423 | null |
6,644 | 2 | null | 6,642 | 0 | null | Well, the file is in the root so it does not show whether the tag works or if the browser just got the icon from the usual location (the root).
I'll try it and see if it works.
Using both tags make it work even for any file name as long as the file is an icon for IE7: I tried using `.png` files and it only worked w... | null | CC BY-SA 2.5 | null | 2008-08-09T05:46:52.003 | 2008-08-09T11:53:27.880 | 2008-08-09T11:53:27.880 | 810 | 810 | null |
6,645 | 2 | null | 6,642 | 15 | null | This is what I always use:
```
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
```
The second one is for IE. The first one is for other browsers.
| null | CC BY-SA 2.5 | null | 2008-08-09T05:48:15.433 | 2008-08-09T06:25:17.263 | 2008-08-09T06:25:17.263 | 92 | 464 | null |
6,614 | 2 | null | 6,578 | 149 | null | Let's start with `retain` and `release`; `autorelease` is really just a special case once you understand the basic concepts.
In Cocoa, each object keeps track of how many times it is being referenced (specifically, the `NSObject` base class implements this). By calling `retain` on an object, you are telling it that... | null | CC BY-SA 3.0 | null | 2008-08-09T04:40:49.250 | 2012-05-30T20:41:22.537 | 2012-05-30T20:41:22.537 | 863 | 863 | null |
6,648 | 2 | null | 6,612 | 0 | null | I used JFreeChart ([http://www.jfree.org/jfreechart/](http://www.jfree.org/jfreechart/)) on a previous project. It has some very good built-in capabilities, and the design was WAY extensible so you could always roll your own extension later if you needed some custom chart annotation or wanted an axis to render differe... | null | CC BY-SA 2.5 | null | 2008-08-09T05:52:00.340 | 2008-08-09T05:52:00.340 | null | null | 404 | null |
6,651 | 2 | null | 4,670 | 4 | null | There's a nice comparison between git, hg and bzr in [this InfoQ article](http://www.infoq.com/articles/dvcs-guide). They all have their strengths and weaknesses. You'll have to think about your project and your workflows and choose the best fit. The good news is that they're all fairly good.
| null | CC BY-SA 2.5 | null | 2008-08-09T06:14:12.917 | 2008-08-09T06:14:12.917 | null | null | 825 | null |
6,646 | 2 | null | 6,628 | 1 | null |
### Response to the Update:
Oh, you're right, I guess PHP must convert array index strings to numbers if they contain only digits. I tried this code:
```
$array = array('1' => 100, '2' => 200, 1 => 300, 2 => 400);
print_r($array);
```
And the output was:
```
Array([1] => 300 [2] => 400)
```
I've done some more tes... | null | CC BY-SA 3.0 | null | 2008-08-09T05:48:21.487 | 2016-02-07T18:01:42.423 | 2020-06-20T09:12:55.060 | -1 | 813 | null |
6,649 | 2 | null | 6,628 | 34 | null | see @svec and @jeremy above. All array indices are of type 'int' first, then type 'string', and will be cast to that as PHP sees fit.
Performance wise, $index should be faster than "$index" and "{$index}" (which are the same).
Once you start a double-quote string, PHP will go into interpolation mode and treat it a... | null | CC BY-SA 2.5 | null | 2008-08-09T05:55:24.187 | 2008-08-09T05:58:42.603 | 2008-08-09T05:58:42.603 | null | null | null |
6,655 | 2 | null | 6,612 | 18 | null | I've had success using [JFreeChart](http://www.jfree.org/jfreechart/) on multiple projects. It is configurable. JFreeChart is open source, but they charge for the [developer guide](http://www.jfree.org/jfreechart/devguide.html). If you're doing something simple, the sample code is probably good enough. Otherwise, $50 ... | null | CC BY-SA 2.5 | null | 2008-08-09T06:23:19.140 | 2008-08-09T20:46:36.900 | 2008-08-09T20:46:36.900 | 816 | 816 | null |
6,658 | 1 | 6,671 | null | 126 | 40,557 | At work we are currently still using JUnit 3 to run our tests. We have been considering switching over to JUnit 4 for tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either JUnit 4 or TestNG, and which seems to work better for very large numbers of t... | JUnit vs TestNG | CC BY-SA 3.0 | 0 | 2008-08-09T06:31:25.283 | 2019-10-12T04:33:44.487 | 2016-06-09T22:21:36.917 | 2,446,208 | 782 | [
"java",
"testing",
"junit",
"testng"
] |
6,659 | 2 | null | 6,658 | 20 | null | First I would say, don't rewrite all your tests just to suit the latest fad. Junit3 works perfectly well, and the introduction of annotations in 4 doesn't buy you very much (in my opinion). It is much more important that you guys tests, and it sounds like you do.
Use whatever seems most natural and helps you get ... | null | CC BY-SA 2.5 | null | 2008-08-09T06:33:50.787 | 2008-09-10T22:46:22.533 | 2008-09-10T22:46:22.533 | 92 | 92 | null |
6,661 | 1 | 6,662 | null | 24 | 2,886 | I'm aware of things like `onchange`, `onmousedown` and `onmouseup` but is there a good reference somewhere that lists all of them complete with possibly a list of the elements that they cover?
| Reference that lists available JavaScript events? | CC BY-SA 3.0 | 0 | 2008-08-09T06:40:52.987 | 2015-12-20T01:58:44.407 | 2015-12-20T01:58:44.407 | 2,035,354 | 1,384,652 | [
"javascript",
"browser",
"client-side"
] |
6,657 | 2 | null | 6,628 | 6 | null | > When will the different indexing methods resolve to different indices?
According to [http://php.net/types.array](http://php.net/types.array), an array index can only be an integer or a string. If you try to use a float as an index, it will truncate it to integer. So if `$index` is a float with the value 3.14, then `... | null | CC BY-SA 3.0 | null | 2008-08-09T06:30:12.010 | 2016-02-07T18:01:34.563 | 2016-02-07T18:01:34.563 | 2,921,691 | 813 | null |
6,660 | 2 | null | 5,251 | 0 | null | If you're looking for client-side check out [flotr](http://solutoire.com/flotr/) which is based on prototype javascript library or [flot](http://code.google.com/p/flot/) which is based on jQuery. Both work well, though flot seems like its got a bigger backing.
| null | CC BY-SA 2.5 | null | 2008-08-09T06:37:00.203 | 2008-08-09T06:37:00.203 | null | null | 831 | null |
6,662 | 2 | null | 6,661 | 11 | null | W3Schools seems to have a good Javascript events reference: [HTML DOM Events](http://www.w3schools.com/jsref/dom_obj_event.asp)
| null | CC BY-SA 3.0 | null | 2008-08-09T06:42:20.003 | 2013-01-27T13:30:26.560 | 2013-01-27T13:30:26.560 | null | 813 | null |
6,650 | 2 | null | 6,628 | 29 | null | I timed the 3 ways of using an index like this:
```
for ($ii = 0; $ii < 1000000; $ii++) {
// TEST 1
$array[$idx] = $ii;
// TEST 2
$array["$idx"] = $ii;
// TEST 3
$array["{$idx}"] = $ii;
}
```
The first set of tests used `$idx=0`, the second set used `$idx="0"`, and the third set used `$idx="blah"`.... | null | CC BY-SA 3.0 | null | 2008-08-09T06:10:22.237 | 2016-02-07T18:01:22.567 | 2016-02-07T18:01:22.567 | 2,921,691 | 103 | null |
6,666 | 1 | 7,005 | null | 34 | 11,717 | I am working on a new project. Is there any benefit with going with a WCF web service over a regular old fashion web service?
Visual Studio offers templates for both. What are the differences? Pros and cons?
| Web Services -- WCF vs. ASMX ("Standard") | CC BY-SA 3.0 | 0 | 2008-08-09T06:50:22.703 | 2013-10-13T20:57:08.747 | 2013-10-13T20:57:08.747 | 76,337 | 831 | [
".net",
"wcf",
"web-services",
"visual-studio",
"asmx"
] |
6,637 | 2 | null | 6,628 | -6 | null | I believe from a performance perspective that $array["$index"] is faster than $array[$index] See [Best practices to optimize PHP code performance](http://www.chazzuka.com/blog/?p=163)
Another variation that I use sometimes when I have an array inside a string is:
```
$str = "this is my string {$array["$index"]}";
```... | null | CC BY-SA 2.5 | null | 2008-08-09T05:30:38.450 | 2008-08-09T19:08:33.243 | 2008-08-09T19:08:33.243 | 796 | 796 | null |
6,672 | 2 | null | 6,661 | 4 | null | Here is a pretty good JavaScript event reference with the elements they are for:
[JavaScript Tutorial >> JavaScript Events](http://www.globalguideline.com/JavaScript_Guide/Java_Script_Events.php)
| null | CC BY-SA 3.0 | null | 2008-08-09T07:00:44.163 | 2013-01-27T13:25:02.710 | 2013-01-27T13:25:02.710 | null | 464 | null |
6,669 | 2 | null | 3,088 | 0 | null | First off, I think there has already been some great answers, so I will try not to dupe too much.
- -
I think one of the biggest points I would ensure is that they understand the core concepts of a framework. I know you are working in Python (which I have no clue about) but for example, with ASP.NET getting people t... | null | CC BY-SA 2.5 | null | 2008-08-09T06:52:29.203 | 2008-08-09T06:52:29.203 | null | null | 832 | null |
6,671 | 2 | null | 6,658 | 67 | null | I've used both, but I have to agree with Justin Standard that you shouldn't really consider rewriting your existing tests to any new format. Regardless of the decision, it is pretty trivial to run both. TestNG strives to be much more configurable than JUnit, but in the end they both work equally well.
TestNG has a n... | null | CC BY-SA 2.5 | null | 2008-08-09T07:00:34.087 | 2008-08-09T07:00:34.087 | null | null | 122 | null |
6,665 | 2 | null | 6,547 | 1 | null | Drop the first marble from the 3rd floor. If it breaks, you know it's floor 1 or 2, so drop the other marble from floor 2. If it doesn't break you've found that floor 2 is the highest. If it does break, you've found that floor 1 is the highest. 2 drops.
If dropping from the 3rd floor does not break the marble, dro... | null | CC BY-SA 2.5 | null | 2008-08-09T06:50:10.300 | 2008-08-09T09:44:03.040 | 2008-08-09T09:44:03.040 | 571 | 571 | null |
6,674 | 2 | null | 3,284 | 21 | null | Another respondent (McDowell) said that polymorphism only works for object instances. That should be qualified; there are languages that do treat classes as instances of a "Class" or "Metaclass" type. These languages do support polymorphism for both instance and class (static) methods.
C#, like Java and C++ before i... | null | CC BY-SA 2.5 | null | 2008-08-09T07:01:57.000 | 2008-08-09T07:01:57.000 | null | null | 714 | null |
6,673 | 2 | null | 6,633 | 0 | null | I know that there's a way to set php.ini values for that script with a certain command, I thus went looking and found this too - [Goto last post on page](http://forums.macosxhints.com/archive/index.php/t-8538.html)
I also found the following post which may be of use - [Goto last post on the page](http://www.webmasterw... | null | CC BY-SA 2.5 | null | 2008-08-09T07:01:06.503 | 2008-08-09T07:01:06.503 | null | null | 1,384,652 | null |
6,677 | 2 | null | 6,628 | 7 | null | > I believe from a performance
perspective that $array["$index"] is
faster than $array[$index] See Best
practices to optimize PHP code
performance
Don't believe everything you read so blindly... I think you misinterpreted that. The article says $array['index'] is faster than $array[index] where index is a , n... | null | CC BY-SA 2.5 | null | 2008-08-09T07:05:44.483 | 2008-08-09T07:05:44.483 | null | null | 795 | null |
6,687 | 2 | null | 5,855 | 5 | null | I haven't done this before, but I found [this site](http://i-proving.com/space/RCP+and+Java+Web+Start) on the web giving an explanation.
| null | CC BY-SA 3.0 | null | 2008-08-09T07:50:31.647 | 2012-05-30T21:23:23.267 | 2012-05-30T21:23:23.267 | 23,354 | 198 | null |
6,689 | 2 | null | 4,689 | 1 | null | Courier New for me as well, it's well spaced.
| null | CC BY-SA 2.5 | null | 2008-08-09T07:53:27.367 | 2008-08-09T07:53:27.367 | null | null | 835 | null |
6,679 | 2 | null | 6,639 | 10 | null | getResource is fine, but using relative paths will work just as well too, as long as you can control where your working directory is (which you usually can).
Furthermore the platform dependence regarding the separator character can be gotten around using [File.separator](http://java.sun.com/j2se/1.5.0/docs/api/java/io... | null | CC BY-SA 2.5 | null | 2008-08-09T07:18:04.550 | 2008-08-09T07:18:04.550 | null | null | 122 | null |
6,693 | 2 | null | 6,642 | 1 | null | I think the most reliable method is the simply added the file to the root of your website.
I don't think there is any need for a meta tag unless you want to manually override the default favicon, but I was unable to find any research to support my argument.
| null | CC BY-SA 2.5 | null | 2008-08-09T08:06:50.147 | 2008-08-09T08:06:50.147 | null | null | 383 | null |
6,683 | 2 | null | 6,612 | 0 | null | I've used [JFreeChart](http://www.jfree.org/jfreechart/) in a rather complex application that needed to visualize data streams and calculations based on the data. We implemented the ability to visually edit the data plots by mouse and had a very large set of data points. JFreeChart handled it very well.
Unfortunately ... | null | CC BY-SA 2.5 | null | 2008-08-09T07:41:29.310 | 2009-01-19T20:36:26.253 | 2009-01-19T20:36:26.253 | 1,288 | 834 | null |
6,686 | 2 | null | 6,661 | 4 | null | This [Javascript Cheat Sheet](http://www.addedbytes.com/cheat-sheets/javascript-cheat-sheet/) has a complete list of of event handlers. Nearly all of them can be used on any html element except for one or two.
If you want to use a lightweight javascript library, [DOMAssistant](http://www.domassistant.com/) is very lig... | null | CC BY-SA 2.5 | null | 2008-08-09T07:49:41.023 | 2008-08-09T07:49:41.023 | null | null | 383 | null |
6,694 | 2 | null | 6,633 | 6 | null | If you set error reporting to E_ALL, it warns in the error log about undefined variables complete with filename and line number (assuming you are logging to a file). However, it will warn only if when it comes across an undefined variable, so I think you will have to test each code path. Running php from the command li... | null | CC BY-SA 2.5 | null | 2008-08-09T08:11:55.487 | 2008-08-09T08:11:55.487 | null | null | 719 | null |
6,699 | 2 | null | 6,661 | 11 | null | Quirksmode has a nice [event-compatibility table](http://quirksmode.org/dom/events/index.html) and an [introduction](http://quirksmode.org/js/introevents.html).
| null | CC BY-SA 2.5 | null | 2008-08-09T08:29:10.880 | 2008-08-09T08:29:10.880 | null | null | 56 | null |
6,696 | 2 | null | 3,088 | 1 | null | I would recommend also watching some screencasts - they are generally created in context of a specific technology not a language, though if there's Python code displayed, that'll do :). The point is - they're created by some good programmers and watching how good programmers program is a good thing. You and your brothe... | null | CC BY-SA 2.5 | null | 2008-08-09T08:17:05.883 | 2008-08-09T08:17:05.883 | null | null | 837 | null |
6,703 | 1 | 6,748 | null | 29 | 17,578 | Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better, or not all problems should be modeled as objects. From your personal programming adventures, when do you think a problem is better solved by OOP?
| When is OOP better suited for? | CC BY-SA 2.5 | 0 | 2008-08-09T08:51:27.107 | 2018-07-06T06:19:42.137 | 2010-11-06T13:43:10.177 | 107,004 | 718 | [
"oop"
] |
6,681 | 1 | 6,704 | null | 12 | 4,939 | I'm still new to the ASP.NET world, so I could be way off base here, but so far this is to the best of my (limited) knowledge!
Let's say I have a standard business object "Contact" in the namespace. I write a Web Service to retrieve a Contact's info from a database and return it. I then write a client application to ... | ASP.NET Web Service Results, Proxy Classes and Type Conversion | CC BY-SA 4.0 | 0 | 2008-08-09T07:34:01.523 | 2019-01-20T13:57:31.373 | 2019-01-20T13:57:31.373 | 567,854 | 832 | [
"c#",
"asp.net",
"web-services"
] |
6,701 | 2 | null | 6,666 | 9 | null | The Pros of doing all by yourself is:
- -
The Pros of WCF are:
- -
A disadvantage of WCF: some static property names [can be pretty lengthy](http://codebetter.com/blogs/james.kovacs/archive/2008/08/08/why-developers-are-interested-in-rest.aspx)...
To summarize: WCF lets you focus on programming, but you need to ... | null | CC BY-SA 2.5 | null | 2008-08-09T08:35:18.077 | 2008-08-09T12:14:17.463 | 2008-08-09T12:14:17.463 | 56 | 56 | null |
6,702 | 2 | null | 6,530 | 1 | null | I would suggest putting the log file onto a seperate disk, though should give you a little performance gain so that your not trying to both read and write to the same disk as the website. If you cannot put the log file on a seperate disk, then I would simply choose a folder of your choice.
In any case, you will have t... | null | CC BY-SA 2.5 | null | 2008-08-09T08:47:31.670 | 2008-08-10T22:42:25.183 | 2008-08-10T22:42:25.183 | 383 | 383 | null |
6,704 | 2 | null | 6,681 | 5 | null | You are on the right track. To get the data from the proxy object back into one of your own objects, you have to do left-hand-right-hand code. i.e. copy property values. I'll bet you that there is already a generic method out there that uses reflection.
Some people will use something other than a web service (.net ... | null | CC BY-SA 2.5 | null | 2008-08-09T08:58:24.707 | 2008-08-09T08:58:24.707 | null | null | 571 | null |
6,705 | 2 | null | 6,703 | 6 | null | I think it fits best when you are modeling something cohesive with state and associated actions on those states. I guess that's kind of vague, but I'm not sure there is a perfect answer here.
The thing about OOP is that it lets you encapsulate and abstract data and information away, which is a real boon in building a... | null | CC BY-SA 2.5 | null | 2008-08-09T09:07:27.653 | 2008-08-09T09:07:27.653 | null | null | 122 | null |
6,713 | 2 | null | 6,658 | 18 | null | About a year ago, we had the same problem. I spent sometime considering which move was better, and eventually we realized that TestNG has no 'killer features'. It's nice, and has some features JUnit 4 doesn't have, but we don't need them.
We didn't want people to feel uncomfortable writing tests while getting to know T... | null | CC BY-SA 2.5 | null | 2008-08-09T09:33:28.257 | 2010-09-28T07:30:46.077 | 2010-09-28T07:30:46.077 | 573 | 573 | null |
6,716 | 2 | null | 6,484 | 14 | null | My general rule of thumb is that objects that I need to mock should have a common interface too. I think this is right design-wise and makes tests a lot easier (and is usually what you get if you do TDD). More about this can be read in the Google Testing Blog [latest post](http://googletesting.blogspot.com/2008/08/by-m... | null | CC BY-SA 2.5 | null | 2008-08-09T09:40:37.727 | 2008-08-09T09:40:37.727 | null | null | 573 | null |
6,720 | 2 | null | 6,719 | 6 | null | I'm pretty sure I've only used master pages in the context of ASP.NET MVC so I'm not sure if it differs from web forms but in my experience they are not only excellent but I couldn't imagine not using them. Master pages are code inheritance to web pages.
| null | CC BY-SA 2.5 | null | 2008-08-09T09:55:02.660 | 2008-08-09T09:55:02.660 | null | null | 364 | null |
6,723 | 2 | null | 1,644 | 1 | null | Not a technology podcast, but I really have to mention [FreelanceRadio](http://freelanceswitch.com/podcasts/). A really great and sometimes hilarious resource. I'm listening to them in the morning, on the way to work. And sometimes feel really stupid just giggling by myself :P
| null | CC BY-SA 2.5 | null | 2008-08-09T10:34:06.527 | 2008-08-09T10:34:06.527 | null | null | 706 | null |
6,719 | 1 | 6,720 | null | 5 | 1,303 | I've just been learning about master pages in ASP.NET 2.0.
They sound great, but how well do they work in practice?
Does anybody have experience of using them for a large web site?
| Master Pages for large web sites | CC BY-SA 3.0 | 0 | 2008-08-09T09:51:37.533 | 2012-09-11T00:01:18.127 | 2012-09-11T00:01:18.127 | 1,270,384 | 133 | [
"asp.net",
".net",
"master-pages",
"asp.net-2.0"
] |
6,708 | 2 | null | 6,639 | 3 | null | I haven't had a problem just using Unix-style path separators, even on Windows (though it is good practice to check [File.separatorChar](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html#separatorChar)).
The technique of using [ClassLoader.getResource()](https://docs.oracle.com/en/java/java... | null | CC BY-SA 4.0 | null | 2008-08-09T09:16:10.023 | 2020-12-14T11:05:22.887 | 2020-12-14T11:05:22.887 | 775,954 | 304 | null |
6,725 | 2 | null | 5,892 | 1 | null | @Curt: I think you came the closest. I haven't tested this but I think I sort of gave the answer in my original question.
[GetMessage](http://msdn.microsoft.com/en-us/library/ms644936.aspx) is a define in Windows.h wrapped in a ifndef block to switch between Ansi (GetMessageA) and Unicode (GetMessageW).
| null | CC BY-SA 2.5 | null | 2008-08-09T10:50:00.880 | 2008-08-09T10:50:00.880 | null | null | 342 | null |
6,728 | 2 | null | 2,785 | 7 | null | In general, there's no need to null objects after use, but in some cases I find it's a good practice.
If an object implements IDisposable and is stored in a field, I think it's good to null it, just to avoid using the disposed object. The bugs of the following sort can be painful:
```
this.myField.Dispose();
// ... a... | null | CC BY-SA 2.5 | null | 2008-08-09T11:16:04.837 | 2008-08-09T11:16:04.837 | null | null | 838 | null |
6,731 | 2 | null | 6,729 | 2 | null | We have an in-house designer that does ours, although we also use freelance designers, too.
You could try starting a design competition on [99 Designs](http://www.99designs.com)?
There are also some free icon sets available, [like these](http://www.famfamfam.com/lab/icons/).
If you google around, you'll also find qu... | null | CC BY-SA 2.5 | null | 2008-08-09T11:27:21.833 | 2008-08-09T11:27:21.833 | null | null | 475 | null |
6,729 | 1 | 6,738 | null | 60 | 5,859 | I probably spend far too much time trying to make my visual interfaces look good, and while I'm pretty adept at finding the right match between usability and style one area I am hopeless at is making nice looking icons.
How do you people overcome this (I'm sure common) problem? I'm thinking of things like images on b... | Icons: How does a developer with no design skill make his/her application icons look pretty? | CC BY-SA 2.5 | 0 | 2008-08-09T11:18:58.527 | 2013-04-05T10:49:05.940 | 2010-09-28T07:41:08.130 | 770 | 770 | [
"user-interface",
"icons"
] |
6,732 | 1 | 6,766 | null | 1 | 3,837 | I have a website that I've just uploaded onto the Internet. When I browse to the site using Firefox 3.0.1 on Ubuntu I don't see the favicon; Firefox 3.0.1 on WinXP does display it.
isn't the favicon displaying under Ubuntu? It's a favicon.ico file in the root directory, not referenced in the meta tags; would it wo... | Why doesn't my favicon display for my web site? | CC BY-SA 3.0 | null | 2008-08-09T11:30:09.520 | 2015-07-17T00:27:22.537 | 2015-07-17T00:27:22.537 | 257 | 257 | [
"firefox",
"ubuntu",
"favicon"
] |
6,733 | 2 | null | 6,732 | 5 | null | Try taking a look at this [previous Question](https://stackoverflow.com/questions/6642/perfect-way-to-use-favicons), which shows you must put two meta tags in your html in order for it to work across all browsers and operating systems.
| null | CC BY-SA 2.5 | null | 2008-08-09T11:33:35.393 | 2008-08-09T11:56:28.903 | 2017-05-23T10:27:50.457 | -1 | 383 | null |
6,735 | 2 | null | 6,719 | 1 | null | They are extremely useful, especially in a CMS environment and for large sites, and as MattMitchell says it's inconceivable that you would build a large site without them.
Select template, each template has different editable areas, job done. Master pages can also be inherited, so you can have a Style.Master, derive ... | null | CC BY-SA 3.0 | null | 2008-08-09T11:41:25.470 | 2012-07-22T13:01:02.407 | 2012-07-22T13:01:02.407 | 364 | 192 | null |
6,724 | 2 | null | 4,432 | 9 | null | Your code not really compliant with [full CSV format](http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm). If you are just generating CSV from data that has no commas, leading/trailing spaces, tabs, newlines or quotes, it should be fine. However, in most real-world data-exchange scenarios, you do need the full imleme... | null | CC BY-SA 3.0 | null | 2008-08-09T10:47:26.860 | 2016-02-07T14:32:47.260 | 2016-02-07T14:32:47.260 | 2,921,691 | 838 | null |
6,737 | 2 | null | 6,729 | 4 | null | If you have money, definitely go with a professional designer. At first if you don't have too many projects requiring a designer, just hire one on a contract basis. If you start feeling the need for a full-time designer then it's going to be beneficial to hire one.
Good looking free icon sets are available, but you sh... | null | CC BY-SA 2.5 | null | 2008-08-09T12:03:33.007 | 2008-08-09T12:03:33.007 | null | null | 810 | null |
6,741 | 2 | null | 6,719 | 0 | null | Master Pages have made building template-able websites easy.
I think the trickiest part in building a website using master pages is knowing when to put things into the master page and when to put things into the ContentPlaceHolder on the child page. Generally, dynamic stuff goes into the placeholder while static items... | null | CC BY-SA 2.5 | null | 2008-08-09T12:13:13.597 | 2008-08-09T12:13:13.597 | null | null | 417 | null |
6,726 | 2 | null | 123 | 30 | null | I know you asked for Java, but this strikes me as a task well suited to a scripting language. Here is a quick (very simple) solution written in Groovy.
```
string,float1,float2,integer
hello world,1.0,3.3,4
goodbye world,1e9,-3.3,45
hello again,-1,23.33,456
hello world 3,1.40,34.83,4999
hello 2 world,9981.05,43.33,4... | null | CC BY-SA 3.0 | null | 2008-08-09T11:06:58.973 | 2013-02-07T10:37:12.147 | 2013-02-07T10:37:12.147 | 395,659 | 488 | null |
6,700 | 2 | null | 5,223 | 3,281 | null |
## Updated answer
[widespread deployment of ES5](http://kangax.github.io/compat-table/es5/) For IE9+ and all other modern ES5+ capable browsers, you can use [Object.keys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) so the above code just becomes:
```
var size = Ob... | null | CC BY-SA 4.0 | null | 2008-08-09T08:31:04.577 | 2021-11-25T12:13:16.077 | 2021-11-25T12:13:16.077 | 123,671 | null | null |
6,745 | 2 | null | 6,703 | 6 | null | I am sold to OOP.
Anytime you can define a concept for a problem, it can probably be wrapped in an object.
The problem with OOP is that some people overused it and made their code even more difficult to understand. If you are careful about what you put in objects and what you put in services (static classes) you will... | null | CC BY-SA 2.5 | null | 2008-08-09T12:34:42.913 | 2008-08-09T12:34:42.913 | null | null | 810 | null |
6,746 | 2 | null | 6,467 | 3 | null | Looking into it further, I think you can simply use date.
I've tried the following on OpenBSD: I took the date of Feb. 29th 2008 and a random hour (in the form of 080229301535) and added +1 to the day part, like so:
```
$ date -j 0802301535
Sat Mar 1 15:35:00 EST 2008
```
As you can see, date formatted the time cor... | null | CC BY-SA 2.5 | null | 2008-08-09T12:37:19.243 | 2008-08-09T12:37:19.243 | null | null | 573 | null |
6,640 | 2 | null | 6,639 | 56 | null |
Use one of these two methods:
- [Class.getResource(String)](http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang.String))- [Class.getResourceAsStream(String)](http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String))
For example:
```
InputStream i... | null | CC BY-SA 3.0 | null | 2008-08-09T05:35:50.623 | 2016-02-07T18:00:58.917 | 2016-02-07T18:00:58.917 | 2,921,691 | 816 | null |
6,739 | 2 | null | 2,785 | 7 | null | Chances are that your code is not structured tightly enough if you feel the need to `null` variables.
There are a number of ways to limit the scope of a variable:
As mentioned by
```
using(SomeObject object = new SomeObject())
{
// do stuff with the object
}
// the object will be disposed of
```
Similarly, you... | null | CC BY-SA 2.5 | null | 2008-08-09T12:13:12.553 | 2008-08-09T12:13:12.553 | null | null | 810 | null |
6,750 | 2 | null | 6,719 | 0 | null | In practise I don't often find sites developed not using MasterPages. They allow simple and easy manipulation of site look and feel and also makes navigation elements and shared content pieces a breeze.
ASP.Net 3.5 even allows multiple contentpages and manipulation of header sections across a single master pages.
I r... | null | CC BY-SA 2.5 | null | 2008-08-09T12:50:32.413 | 2008-08-09T12:50:32.413 | null | null | 146,270 | null |
6,738 | 2 | null | 6,729 | 47 | null | Good icons are hard to design. I have tried to design my own, and have used in-house graphics designers as well. However, building a good icon set takes a lot of work, even for the graphic designer.
I believe your best solution is to buy/find a set of icons for use in your projects.
The silk icon set is a good, free ... | null | CC BY-SA 2.5 | null | 2008-08-09T12:04:18.780 | 2008-08-09T12:04:18.780 | null | null | 417 | null |
6,755 | 2 | null | 6,440 | 1 | null | For the record, .Net Framework 3.5 SP1 is required for Microsoft SQL Server 2008 to install and RTM'd around the same time as the release this week. Still a hefty install but you can extract the client profile from it. Just not to sure how.
| null | CC BY-SA 2.5 | null | 2008-08-09T13:03:16.100 | 2008-08-09T13:03:16.100 | null | null | 146,270 | null |
6,744 | 2 | null | 6,719 | 5 | null | They are a must if you want to maintain the look of your application throughout all the pages in the application.
They are fairly easy to use:
First of all, design your master page and define where you want the content to be placed:
```
<%@ Master ... %>
<%-- HTML code --%>
<asp:ContentPlaceHolder id="plhMainConten... | null | CC BY-SA 2.5 | null | 2008-08-09T12:25:55.380 | 2008-12-12T14:38:00.933 | 2008-12-12T14:38:00.933 | 810 | 810 | null |
6,749 | 2 | null | 6,729 | 1 | null | I came across IconBuffet when registering my copy of Visual Studio Express. They have some awesome icons that you could use in your applications.
For application development I have also started playing with WPF interfaces in .Net, soon to be available on Mono as well. With the ability to use web images and pictures in... | null | CC BY-SA 2.5 | null | 2008-08-09T12:47:14.120 | 2008-08-09T12:47:14.120 | null | null | 146,270 | null |
6,748 | 2 | null | 6,703 | 30 | null | There is no hard and fast rule. A problem is better solved with OOP when you are better at solving problems and thinking in an OO mentality. Object Orientation is just another tool which has come along through trying to make computing a better tool for solving problems.
However, it can allow for better code reuse,... | null | CC BY-SA 4.0 | null | 2008-08-09T12:44:59.070 | 2018-07-06T06:19:42.137 | 2018-07-06T06:19:42.137 | 4,538,204 | 274 | null |
6,751 | 2 | null | 705 | 9 | null | You can use the firebird embeded, it's just a dll that you will need to ship with you app.
About things being undocumented, that's not really true, the firebird .NET driver implements the ADO Interfaces, so if you know ADO you can work with Firebird, basically instead of SQLConnection you will use FBConnection and so ... | null | CC BY-SA 2.5 | null | 2008-08-09T12:51:41.973 | 2008-08-09T12:51:41.973 | null | null | 727 | null |
6,758 | 2 | null | 6,729 | 1 | null | I recommend IconFactory, too. Or to be exact: [http://stockicons.com/](http://stockicons.com/) There are a lot of icon sets for an affordable price and I think buying a professional set is the best choice you have if you're not a graphics designer yourself.
If you only need a single icon, it's probably worth to hire a... | null | CC BY-SA 2.5 | null | 2008-08-09T13:14:24.520 | 2008-08-09T13:14:24.520 | null | null | 834 | null |
6,754 | 2 | null | 6,607 | 4 | null | There's a similar question [here](http://bytes.com/forum/thread48133.html) that covers some of the pros and cons.
I would suggest not using the registry unless your application absolutely needs it. From my understanding, Microsoft is trying to discourage the use of the registry due to the flexibility of settings files... | null | CC BY-SA 2.5 | null | 2008-08-09T13:03:06.803 | 2008-08-09T13:03:06.803 | null | null | 108 | null |
6,770 | 2 | null | 6,729 | 6 | null | Don't forget either that unless you have lots of toolbar buttons or other such objects to fill, its possible to get by with very icons beyond your own unique application icon and system icons. (Remember to call them from existing libraries on the user's machine, not repackage them, keep the lawyers happy.)
Having too... | null | CC BY-SA 2.5 | null | 2008-08-09T13:32:54.747 | 2008-08-09T13:32:54.747 | null | null | 483 | null |
6,766 | 2 | null | 6,732 | 8 | null | Previously, there was no favicon. The browser cached the lack of favicon. [Clear the Firefox cache](http://pcsupport.about.com/od/maintenance/ht/clearcacheff.htm), and all is well.
| null | CC BY-SA 2.5 | null | 2008-08-09T13:24:01.067 | 2008-08-09T13:24:01.067 | null | null | 257 | null |
6,776 | 2 | null | 6,578 | 5 | null | > [Matt Dillard wrote](https://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-objective-c#6614):return [[s autorelease] release];
Autorelease does retain the object. Autorelease simply puts it in queue to be released later. You do not want to have a release statement there.
| null | CC BY-SA 2.5 | null | 2008-08-09T13:48:50.283 | 2008-08-09T21:42:57.270 | 2020-06-20T09:12:55.060 | -1 | 457 | null |
6,765 | 1 | 6,902 | null | 12 | 2,976 | I'm going to start a new project - rewriting an existing system (PHP + SQL Server) from scratch because of some very serious limitations by design.
We have some quite good knowledge of SQL Server (currently we're using SQL Server 2000 in existing system) and we would like to employ its newer version (2008 I guess) in ... | Java + SQL Server - a viable solution? | CC BY-SA 2.5 | null | 2008-08-09T13:23:40.617 | 2016-07-29T17:21:30.777 | 2010-11-04T07:17:05.780 | 13,302 | 837 | [
"java",
"sql-server"
] |
6,779 | 2 | null | 6,765 | 1 | null | I don't know about Java and 2008... but you shouldn't have too much trouble with Java and SQL2000. As lubos suggested, you'd be doing yourself a favour to look at c# but if you're much more comfortable with Java then there shouldn't be any real limitations as the JDBC connector [is supported by Microsoft](http://msdn.m... | null | CC BY-SA 2.5 | null | 2008-08-09T13:58:38.453 | 2008-08-09T13:58:38.453 | null | null | 493 | null |
6,757 | 2 | null | 6,607 | 3 | null | I agree with Daniel. If it's a large application I think I'd do things in the registry. If it's a small application and you want to have aspects of it user-configurable without making a configuration form, go for a quick INI file.
I usually do the parsing like this (if the format in the .ini file is option = value, 1 ... | null | CC BY-SA 3.0 | null | 2008-08-09T13:13:39.623 | 2016-02-07T18:03:02.127 | 2016-02-07T18:03:02.127 | 2,921,691 | 614 | null |
6,777 | 2 | null | 4,533 | 19 | null | As long as it changes whenever the resource representation changes, how you produce it is completely up to you.
You should try to produce it in a way that additionally:
1. doesn't require you to re-compute it on each conditional GET, and
2. doesn't change if the resource content hasn't changed
Using hashes of con... | null | CC BY-SA 2.5 | null | 2008-08-09T13:50:17.863 | 2008-08-09T13:50:17.863 | null | null | 11,944 | null |
6,783 | 2 | null | 6,703 | 1 | null | I find it helps to think of a given problem in terms of 'things'.
If the problem can be thought of as having one or more 'things', where each 'thing' has a number of attributes or pieces of information that refer to its state, and a number of operations that can be performed on it - then OOP is probably the way to go!... | null | CC BY-SA 2.5 | null | 2008-08-09T14:17:22.817 | 2008-08-09T14:17:22.817 | null | null | 475 | null |
6,778 | 1 | 26,040 | null | 4 | 4,156 | This page from Adobe says to add a "wmode" parameter and set its value to "transparent": [http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_1420](http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201)
This works flawlessly in IE. The background renders correctly in Firefox and Safari, however ... | How to make a Flash movie with a transparent background | CC BY-SA 2.5 | null | 2008-08-09T13:54:29.837 | 2009-11-06T05:31:32.747 | null | null | 247 | [
"flash",
"firefox",
"safari"
] |
6,768 | 2 | null | 4,506 | 4 | null | A 304 Not Modified response can result from a GET or HEAD request with either an If-Modified-Since ("IMS") or an If-Not-Match ("INM") header.
In order to decide what to do when you receive these headers, imagine that you are handling the GET request without these conditional headers. Determine what the values of your... | null | CC BY-SA 2.5 | null | 2008-08-09T13:27:59.343 | 2008-08-09T13:27:59.343 | null | null | 11,944 | null |
6,781 | 2 | null | 6,703 | 1 | null | Some places where OO isn't so good are where you're dealing with "Sets" of data like in SQL. OO tends to make set based operations more difficult because it isn't really designed to optimally take the intersection of two sets or the superset of two sets.
Also, there are times when a functional approach would make more... | null | CC BY-SA 2.5 | null | 2008-08-09T14:11:47.743 | 2008-08-09T14:11:47.743 | null | null | 493 | null |
6,784 | 2 | null | 6,778 | 0 | null | Enabling windowless mode (wmode=) makes embedded flash act and render just like other elements. Without that, it's rendered in a seperate step and just overlaid on the browser's window.
Could the flash element be losing focus? Sounds like input focus is moved to the scollbar, then you have to move it back.
Also you w... | null | CC BY-SA 2.5 | null | 2008-08-09T14:19:43.420 | 2008-08-09T14:19:43.420 | null | null | 758 | null |
6,786 | 2 | null | 6,785 | -1 | null | I would suggest not, since String.Format was not designed for concatenation, it was design for formatting the output of various inputs such as a date.
```
String s = String.Format("Today is {0:dd-MMM-yyyy}.", DateTime.Today);
```
| null | CC BY-SA 3.0 | null | 2008-08-09T14:28:47.550 | 2014-09-16T07:19:40.507 | 2014-09-16T07:19:40.507 | 426,834 | 383 | null |
6,788 | 2 | null | 6,785 | 0 | null | It really depends. For small strings with few concatenations, it's actually faster just to append the strings.
```
String s = "String A" + "String B";
```
But for larger string (very very large strings), it's then more efficient to use StringBuilder.
| null | CC BY-SA 2.5 | null | 2008-08-09T14:31:51.117 | 2008-08-09T14:31:51.117 | null | null | 507 | null |
6,792 | 2 | null | 6,785 | 8 | null | I think in most cases like this clarity, and not efficiency, should be your biggest concern. Unless you're crushing together tons of strings, or building something for a lower powered mobile device, this probably won't make much of a dent in your run speed.
I've found that, in cases where I'm building strings in a fa... | null | CC BY-SA 2.5 | null | 2008-08-09T14:40:00.650 | 2008-08-09T14:40:00.650 | null | null | 111 | null |
6,787 | 2 | null | 6,378 | 0 | null | I use iCal in [Lightning](http://www.mozilla.org/projects/calendar/) (Thunderbird) and [Rainlendar](http://www.rainlendar.net/cms/index.php).
I have used Calendaring software for years (decades) and have never had a need for repeating events within the same day. It is simple to add additional daily repeating events i... | null | CC BY-SA 2.5 | null | 2008-08-09T14:29:08.610 | 2008-08-09T14:29:08.610 | null | null | 791 | null |
6,789 | 2 | null | 6,785 | 45 | null | From the [MSDN documentation](http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx):
> The performance of a concatenation operation for a String or StringBuilder object depends on how often a memory allocation occurs. A String concatenation operation always allocates memory, whereas a StringBuilder c... | null | CC BY-SA 2.5 | null | 2008-08-09T14:36:45.290 | 2008-08-09T14:36:45.290 | null | null | 108 | null |
6,793 | 2 | null | 6,729 | 0 | null | You can always go on [Elance](http://www.elance.com/p/landing/buyer.html) and hire someone to make any icons/logos for you. I've done it several times and it's pretty cheap for what you're getting. There is so much competition on that site that someone will eventually come in at your price point. I've always believed t... | null | CC BY-SA 2.5 | null | 2008-08-09T14:40:32.690 | 2008-08-09T14:40:32.690 | null | null | 447 | null |