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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26,931 | 2 | null | 26,925 | 4 | null | One of two ways.
1. If you're already using an MSBuild file or something similar, add the action to the MSBuild file.
2. Instead of directly executing some command, create a batch file that executes that command and then deletes the directory, and have CCnet call that batch file instead.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:21:06.117 | 2008-08-25T21:21:06.117 | null | null | 1,554 | null |
26,932 | 2 | null | 26,857 | 1 | null | View the source of the page and use the WebRequest class to do the posting. No need to drive IE. Just figure out what IE is sending to the server and replicate that. Using a tool like Fiddler will make it even easier.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:21:30.203 | 2008-08-25T21:21:30.203 | null | null | 2,278 | null |
26,936 | 2 | null | 26,863 | 35 | null | Try . I think it's more aggressive than the Tools > Import and Export options suggested.
Also check and make sure there aren't any orphans there.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:22:31.743 | 2008-08-25T21:22:31.743 | null | null | 1,042 | null |
26,910 | 2 | null | 20,063 | 211 | null | `optparse``argparse``optparse`[this answer](https://stackoverflow.com/questions/3217673/why-use-argparse-rather-than-optparse)
As other people pointed out, you are better off going with optparse over getopt. getopt is pretty much a one-to-one mapping of the standard getopt(3) C library functions, and not very easy to... | null | CC BY-SA 3.0 | null | 2008-08-25T21:11:03.567 | 2013-02-07T20:26:34.670 | 2017-05-23T12:34:47.163 | -1 | 2,900 | null |
26,942 | 2 | null | 7,720 | 4 | null | I've used the free [Launch4J](http://launch4j.sourceforge.net/) to create a custom launcher for my Java programs on Windows. Combined with the free [NSIS Installer](http://nsis.sourceforge.net/Main_Page) you can build a nice package for your Windows users.
Did not see that you use SWT. Don't know if it works with SWT... | null | CC BY-SA 2.5 | null | 2008-08-25T21:27:34.087 | 2008-08-25T21:27:34.087 | null | null | 2,367 | null |
26,933 | 2 | null | 2,056 | 185 | null | MVP is necessarily a scenario where the View is in charge (see Taligent's MVP for example).
I find it unfortunate that people are still preaching this as a pattern (View in charge) as opposed to an anti-pattern as it contradicts "It's just a view" (Pragmatic Programmer). "It's just a view" states that the final view s... | null | CC BY-SA 4.0 | null | 2008-08-25T21:22:00.217 | 2020-04-02T17:05:29.603 | 2020-04-02T17:05:29.603 | 1,143 | 1,143 | null |
26,929 | 2 | null | 26,845 | 1 | null | I am a huge proponent of centralized source control for a lot of reasons, but I did try BitKeeper on a project briefly. Perhaps after years of using a centralized model in one format or another (Perforce, Subversion, CVS) I just found distributed source control difficult to use.
I am of the mindset that our tools shou... | null | CC BY-SA 2.5 | null | 2008-08-25T21:19:56.260 | 2008-08-25T21:19:56.260 | null | null | 2,213 | null |
26,914 | 2 | null | 26,897 | 11 | null | I know [jsight](https://stackoverflow.com/questions/26897/recommendations-for-javascript-editor-on-windows#26905) already mentioned this, but [Aptana Studio](http://aptana.com/) really is a great, free editor for JavaScript if you find yourself doing a lot of work with it - it has great support for most of the well-kno... | null | CC BY-SA 2.5 | null | 2008-08-25T21:13:05.747 | 2008-08-25T21:13:05.747 | 2017-05-23T12:00:17.880 | -1 | 1,790 | null |
26,945 | 2 | null | 26,863 | 12 | null | How about running the following from command line,
```
Devenv.exe /ResetSettings
```
You could also save those settings in to a file, like so,
```
Devenv.exe /ResetSettings "C:\My Files\MySettings.vssettings"
```
The /ResetSettings switch, Restores Visual Studio default settings. Optionally resets the settings to... | null | CC BY-SA 2.5 | null | 2008-08-25T21:28:17.613 | 2008-08-25T21:28:17.613 | null | null | 1,747 | null |
26,946 | 2 | null | 10,038 | 0 | null | If you aren't concerned with IE support, you could also try experimenting with the canvas element:
MOZILLA DEVELOPER NETWORK [Basic animations](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations)
| null | CC BY-SA 4.0 | null | 2008-08-25T21:28:27.033 | 2021-01-09T17:23:08.473 | 2021-01-09T17:23:08.473 | 10,607,772 | 2,749 | null |
26,947 | 1 | null | null | 61 | 81,331 | What built-in PHP functions are useful for web scraping? What are some good resources (web or print) for getting up to speed on web scraping with PHP?
| How to implement a web scraper in PHP? | CC BY-SA 2.5 | 0 | 2008-08-25T21:28:32.137 | 2017-09-10T10:58:48.257 | 2008-08-28T20:11:26.913 | 305 | 2,052 | [
"php",
"screen-scraping"
] |
26,951 | 2 | null | 26,947 | -2 | null | The curl library allows you to download web pages. You should look into regular expressions for doing the scraping.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:30:01.040 | 2008-08-25T21:30:01.040 | null | null | 1,633 | null |
26,950 | 2 | null | 4,689 | 4 | null | Back in my Mac LC days I swore by Monaco 9pt, mostly for it's slashed 0. I never quite got used to the default line-height though.
[monaco sample http://www.k8zt.com/ham_fonts/monaco.jpg](http://www.k8zt.com/ham_fonts/monaco.jpg)
It's a little hard to [track down](http://www.gringod.com/wp-upload/misc/MONACO.TTF) in ... | null | CC BY-SA 2.5 | null | 2008-08-25T21:29:44.363 | 2009-06-24T23:20:42.407 | 2009-06-24T23:20:42.407 | 459 | 459 | null |
26,917 | 2 | null | 26,860 | 1 | null | How many forms just have a * or bold to indicate to a sight user that a field is required for correct submission? What's the screen reader doing? Saying "star"?
Below is an example of code that is helpful by articulating verbally but not visually.
(note - in the example below the word "required." is spoken but not s... | null | CC BY-SA 2.5 | null | 2008-08-25T21:15:27.003 | 2008-10-18T08:47:09.960 | null | null | null | null |
26,943 | 2 | null | 26,882 | 3 | null | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | null | CC BY-SA 2.5 | null | 2008-08-25T21:27:34.743 | 2008-08-26T18:19:34.187 | 2008-08-26T18:19:34.187 | 1,790 | 1,790 | null |
26,955 | 2 | null | 26,947 | 0 | null | `file_get_contents()` can take a remote URL and give you the source. You can then use regular expressions (with the Perl-compatible functions) to grab what you need.
Out of curiosity, what are you trying to scrape?
| null | CC BY-SA 2.5 | null | 2008-08-25T21:31:03.067 | 2008-08-25T21:31:03.067 | null | null | 1,344 | null |
26,956 | 2 | null | 20,722 | 7 | null | The Silverlight control only has an [IsVersionSupported function](http://msdn.microsoft.com/en-us/library/system.windows.interop.silverlighthost.isversionsupported(VS.95).aspx), which returns true / false when you give it a version number, e.g.:
```
if(slPlugin.isVersionSupported("2.0")) {
alert("I haz some flavour ... | null | CC BY-SA 2.5 | null | 2008-08-25T21:31:54.170 | 2008-08-25T21:37:04.407 | 2008-08-25T21:37:04.407 | 5 | 5 | null |
26,958 | 2 | null | 26,925 | 0 | null | My guess is that you want to delete the working directory CruiseControl.NET gets the latest code from source control. If this is the case, then the only way to accomplish this is to write a custom source control provider for CruiseControl.NET that first deletes the working directory and then gets the latest code. Have... | null | CC BY-SA 2.5 | null | 2008-08-25T21:32:53.343 | 2008-08-25T21:32:53.343 | null | null | 2,822 | null |
26,953 | 2 | null | 26,567 | 2 | null | I believe you need to set the CanGrow property to on the Textbox. See [http://msdn.microsoft.com/en-us/library/ms159116(SQL.90).aspx](http://msdn.microsoft.com/en-us/library/ms159116(SQL.90).aspx) for some details.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:30:21.100 | 2008-08-26T11:46:57.127 | 2008-08-26T11:46:57.127 | 729 | 729 | null |
26,965 | 2 | null | 26,455 | 3 | null | If you look into STL, boost, MFC, ATL and many open source projects, you can see there are so many ASSERTION statements and that makes project going further more safely.
Design-By-Contract! It really works in real product.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:36:46.780 | 2008-08-29T06:11:57.860 | 2008-08-29T06:11:57.860 | 1,556 | 1,556 | null |
26,963 | 2 | null | 26,595 | 5 | null | @[Jason](https://stackoverflow.com/questions/26595/is-there-any-difference-between-foo-is-none-and-foo-none#26698):
> I recommend using something more along the lines of```
if foo:
#foo isn't None
else:
#foo is None
```
I don't like using "if foo:" unless foo truly represents a boolean value (i.e. 0 or 1). I... | null | CC BY-SA 2.5 | null | 2008-08-25T21:35:14.850 | 2008-08-25T21:35:14.850 | 2017-05-23T12:34:25.900 | -1 | 1,821 | null |
26,969 | 2 | null | 26,845 | 2 | null | I really love Git, especially with GitHub. It's so nice being able to commit and roll back locally. And cherry-picking merges, while not trivial, is not terribly difficult, and far more advanced than anything Svn or CVS can do.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:38:33.967 | 2008-08-25T21:38:33.967 | null | null | 1,190 | null |
26,949 | 2 | null | 12,368 | 1 | null | Sorry but the selected answer here is incorrect. As a few people have stated subsequently Dispose and implementing IDisposable has nothing to do with freeing the memory associated with a .NET class. It is mainly and traditionally used to free unmanaged resources such as file handles etc.
While your application can cal... | null | CC BY-SA 2.5 | null | 2008-08-25T21:29:10.013 | 2008-08-25T21:29:10.013 | null | null | 1,120 | null |
26,971 | 1 | 26,991 | null | 117 | 34,687 | As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
| NHibernate vs LINQ to SQL | CC BY-SA 2.5 | 0 | 2008-08-25T21:39:35.837 | 2014-03-10T14:57:12.647 | 2009-05-02T01:39:07.870 | 67 | 2,133 | [
"linq",
"nhibernate",
"linq-to-sql",
"orm"
] |
26,972 | 2 | null | 26,947 | 0 | null | I'd either use libcurl or Perl's LWP (libwww for perl). Is there a libwww for php?
| null | CC BY-SA 2.5 | null | 2008-08-25T21:39:43.730 | 2008-08-25T21:39:43.730 | null | null | 459 | null |
26,974 | 2 | null | 26,855 | 1 | null | Brendan, I should have clarified that I can't guarantee what the relative path is going to look like. It could be pretty tricky (e.g. has a slash at the front, doesn't have a slash, has "../", etc).
Peter, that's what I'm using now. Or is that faster then using the URI::URL->new($path)->abs?
| null | CC BY-SA 2.5 | null | 2008-08-25T21:40:11.280 | 2008-08-25T21:40:11.280 | null | null | 2,901 | null |
26,975 | 2 | null | 26,854 | 0 | null | My best guess based on what you've written is that you're wrapping that URL in double quotes. The position 0 in that error message probably refers to the character directly before http
| null | CC BY-SA 2.5 | null | 2008-08-25T21:40:44.103 | 2008-08-25T21:40:44.103 | null | null | 75 | null |
26,973 | 2 | null | 26,845 | 5 | null | At my workplace we switched to Git from CVS about two months ago (the majority of my experience is with Subversion). While there was a learning curve involved in becoming familiar with the distributed system, I've found Git to be superior in two key areas: flexibility of working environment and merging.
I don't have t... | null | CC BY-SA 2.5 | null | 2008-08-25T21:39:59.190 | 2008-08-25T21:39:59.190 | null | null | 512 | null |
26,982 | 2 | null | 26,369 | 0 | null | Isolated storage is primarily used for applications distributed using [ClickOnce](http://en.wikipedia.org/wiki/ClickOnce) and are run in a secure sandbox. The base path is decided for you and you won't be able infer it in your code. The path will be something like "\LocalSettings\ApplicationData\IsolatedStorage\ejwnwe.... | null | CC BY-SA 3.0 | null | 2008-08-25T21:45:05.450 | 2012-08-07T11:05:48.980 | 2017-05-23T11:33:16.877 | -1 | null | null |
26,979 | 2 | null | 14,588 | 2 | null | I use version control a lot for common files, because I have one laptop, a desktop machine at work and a home desktop on which I do a lot of work too (I work from home two days a week).
A new session at any of them starts with a script called 'start' that updates a bunch of checkouts, and ends with a script called 'st... | null | CC BY-SA 2.5 | null | 2008-08-25T21:43:54.517 | 2008-08-25T21:43:54.517 | null | null | 2,900 | null |
26,957 | 2 | null | 20,794 | 33 | null | A common Python saying is that it's easier to ask forgiveness than permission. While I'm not a fan of this statement in real life, it does apply in a lot of cases. Usually you want to avoid code that chains two system calls on the same file, because you never know what will happen to the file in between your two call... | null | CC BY-SA 3.0 | null | 2008-08-25T21:32:20.550 | 2012-10-23T13:25:16.567 | 2012-10-23T13:25:16.567 | 694,184 | 2,900 | null |
26,960 | 2 | null | 26,855 | 3 | null | The following code should work.
```
$uri = URI->new_abs( $str, $base_uri )
```
You should also take a look at [the URI page on search.cpan.org](http://search.cpan.org/dist/URI/URI.pm).
| null | CC BY-SA 2.5 | null | 2008-08-25T21:33:37.240 | 2008-08-25T21:33:37.240 | null | null | 1,633 | null |
26,990 | 2 | null | 26,971 | 2 | null | By LINQ, I'm assuming you mean LINQ to SQL because LINQ, by itself, has no database "goings on" associated with it. It's just an query language that has a boat-load of syntac sugar to make it look SQL-ish.
In the very basic of basic examples, NHibernate and LINQ to SQL seem to both be solving the same problem. Once ... | null | CC BY-SA 2.5 | null | 2008-08-25T21:49:20.650 | 2008-08-25T21:49:20.650 | null | null | 2,278 | null |
26,983 | 2 | null | 26,971 | 5 | null | Can you clarify what you mean by "LINQ"?
LINQ isn't an data access technology, it's just a language feature which supports querying as a native construct. It can query any object model which supports specific interfaces (e.g. IQueryable).
Many people refer to LINQ To SQL as LINQ, but that's not at all correct. Micros... | null | CC BY-SA 2.5 | null | 2008-08-25T21:45:57.430 | 2008-08-25T21:45:57.430 | null | null | 5 | null |
26,984 | 1 | 27,064 | null | 23 | 13,779 | I have been in both situations:
- -
In both cases the project started OK but soon became an overhead to maintain (and refactor).
So what is the best practice regarding the creation of your own Exception classes?
| What is the general rule of thumbs for creating an Exception in Java? | CC BY-SA 3.0 | 0 | 2008-08-25T21:46:43.153 | 2018-10-13T13:13:18.730 | 2011-08-07T19:01:05.623 | 870,840 | 2,644 | [
"java",
"exception"
] |
26,996 | 2 | null | 26,834 | 3 | null | As Brian said, you can create another model that marshals out the work that needs doing. There is [a great Railscast](http://railscasts.com/episodes/121-non-active-record-model) on how to do this type of thing.
HTH
| null | CC BY-SA 2.5 | null | 2008-08-25T21:53:18.987 | 2008-08-25T21:53:18.987 | null | null | 722 | null |
26,994 | 2 | null | 7,398 | 5 | null | Some notes:
- `config.h`[this other question](https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename)`config.h``config.h`- `config.h`- `config.h``config.h``config.h``config.h`
| null | CC BY-SA 3.0 | null | 2008-08-25T21:52:23.997 | 2015-10-08T01:11:46.770 | 2017-05-23T12:01:17.740 | -1 | 2,900 | null |
26,997 | 2 | null | 26,903 | 5 | null | Juan,
Unfortunately there is no way to get around this in a strongly typed language. You won't be able to ensure at compile time that the classes will be able to be instantiated by your Activator-based code.
(ed: removed an erroneous alternative solution)
The reason is that, unfortunately, it's not possible to use ... | null | CC BY-SA 2.5 | null | 2008-08-25T21:54:47.080 | 2008-08-25T22:01:13.600 | 2008-08-25T22:01:13.600 | 2,729 | 2,729 | null |
27,000 | 2 | null | 26,984 | 5 | null | Basically, each job deserves an own exception. When you catch exceptions, you don't distinguish different instances, like you would normally do with objects, therefore you need different subtypes. Using too many custom exceptions is a case which I see hardly occurring.
One advice would be to create exceptions as neede... | null | CC BY-SA 2.5 | null | 2008-08-25T21:58:37.150 | 2008-08-25T21:58:37.150 | null | null | 1,968 | null |
26,999 | 2 | null | 25,268 | 5 | null | I did attempt to use SWIG to wrap a project C++ for using in .NET a few years ago.
I didn't get very far as it was a massive giant pain to produce the configuration that SWIG required. At the time I just wanted a solution, not to learn another language/api/etc. SWIG may be easier to use these days, I couldn't tell you... | null | CC BY-SA 2.5 | null | 2008-08-25T21:57:19.960 | 2008-08-25T21:57:19.960 | null | null | 234 | null |
26,968 | 2 | null | 26,925 | 0 | null | In the ASP.NET work, for me, the easiest way I do it (which allows me to hit either MSBUild or NAnt depending upon the project) was to roll my own exe that takes an argument which I pass in with a bat file fired by CC.NET. It's not the safest thing in the world, but if you have total control over your automated build m... | null | CC BY-SA 2.5 | null | 2008-08-25T21:38:16.713 | 2008-08-25T21:38:16.713 | null | null | 2,213 | null |
27,003 | 2 | null | 6,155 | 0 | null | We check the following with our hook scripts:
- - - -
We still want to implement the following:
- - -
| null | CC BY-SA 2.5 | null | 2008-08-25T21:59:57.317 | 2008-08-25T21:59:57.317 | null | null | 2,822 | null |
27,004 | 2 | null | 2,639 | 0 | null | We've been using a combination of
- - - -
As long as there is a google search appliance pointed at these things I think it's ok to have any or many versions as long as people use them
| null | CC BY-SA 2.5 | null | 2008-08-25T22:00:27.177 | 2008-08-25T22:00:27.177 | null | null | 2,759 | null |
27,007 | 2 | null | 8,756 | 0 | null | I've been mucking around with iUI, and find it quite good, but to be honest I haven't looked at the licencing model, so I've no idea what it is. It is very simple and straight forward though, and works well with ASP.NET MVC.
| null | CC BY-SA 2.5 | null | 2008-08-25T22:03:01.133 | 2008-08-25T22:03:01.133 | null | null | 489 | null |
27,006 | 2 | null | 26,897 | 5 | null | In case you're a .Net programmer: VS 2008 has pretty great JS support including [intellisense](http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intellisense.aspx) on dynamically added methods/properties and comfortable [debugging](http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-... | null | CC BY-SA 2.5 | null | 2008-08-25T22:02:23.927 | 2008-08-25T22:02:23.927 | null | null | 2,133 | null |
26,992 | 2 | null | 26,845 | 4 | null | I personnaly use Mercurial source control system. I've been using it for a bit more than a year right now. It was actually my first experience with a VSC.
I tried Git, but never really pushed into it because I found it was too much for what I needed. Mercurial is really easy to pick up if you're a Subversion user sinc... | null | CC BY-SA 2.5 | null | 2008-08-25T21:51:39.427 | 2008-08-25T21:51:39.427 | null | null | 2,907 | null |
27,009 | 1 | 29,545 | null | 5 | 1,753 | What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?
| How does one implement FxCop / static analysis on an existing code base | CC BY-SA 2.5 | 0 | 2008-08-25T22:04:40.490 | 2012-06-27T08:04:59.080 | null | null | 2,822 | [
"static-analysis",
"fxcop",
"metrics"
] |
26,924 | 2 | null | 26,879 | 9 | null | I use
```
html { overflow-y: scroll; }
```
To standardize the scrollbar behavior in IE and FF
| null | CC BY-SA 2.5 | null | 2008-08-25T21:17:25.110 | 2008-08-25T21:17:25.110 | null | null | 1,786 | null |
27,016 | 2 | null | 27,009 | 2 | null | Rewrite your code in a passing style!
Seriously, an old code base will have hundreds of errors - but that's why we have novice/intern programmers. Correcting FxCop violations is a great way to get an overview of the code base and also learn how to write conforming .NET code.
So just bite the bullet, drink lots of caf... | null | CC BY-SA 2.5 | null | 2008-08-25T22:08:28.093 | 2008-08-25T22:08:28.093 | null | null | 338 | null |
27,013 | 2 | null | 1,936 | 8 | null | There is another way which avoids tempdata. The pattern I like involves creating 1 action for both the original render and re-render of the invalid form. It goes something like this:
```
var form = new FooForm();
if (request.UrlReferrer == request.Url)
{
// Fill form with previous request's data
}
if (Request.I... | null | CC BY-SA 2.5 | null | 2008-08-25T22:06:36.850 | 2008-08-26T19:27:04.523 | 2008-08-26T19:27:04.523 | 1,946 | 1,946 | null |
27,005 | 2 | null | 26,845 | 3 | null | Back before we switched off of Sun workstations for embedded systems development we were using Sun's [TeamWare](http://docs.sun.com/source/806-3573/TeamWareTOC.html) solution. TeamWare is a fully distribution solution using SCCS as the local repository file revision system and then wrappers that with a set of tools to ... | null | CC BY-SA 2.5 | null | 2008-08-25T22:00:33.820 | 2008-08-26T00:59:23.300 | 2008-08-26T00:59:23.300 | 1,553 | 1,553 | null |
26,991 | 2 | null | 26,971 | 113 | null | LINQ to SQL forces you to use the table-per-class pattern. The benefits of using this pattern are that it's quick and easy to implement and it takes very little effort to get your domain running based on an existing database structure. For simple applications, this is perfectly acceptable (and oftentimes even prefera... | null | CC BY-SA 3.0 | null | 2008-08-25T21:51:07.790 | 2014-03-10T14:57:12.647 | 2014-03-10T14:57:12.647 | 5,486 | 1,574 | null |
27,025 | 2 | null | 26,971 | 0 | null | Or you could use the Castle ActiveRecords project. I've been using that for a short time to ramp up some new code for a legacy project. It uses NHibernate and works on the active record pattern (surprising given its name I know). I haven't tried, but I assume that once you've used it, if you feel the need to drop to... | null | CC BY-SA 2.5 | null | 2008-08-25T22:13:14.697 | 2008-08-25T22:13:14.697 | null | null | null | null |
27,017 | 2 | null | 18,984 | 0 | null | There are several reasons why doing it this way is not a good idea. A lot of them have been mentioned, so I'll just stick with one specific point.
Command-line tools are usually not interactive at all, while GUI's are. This is a fundamental difference. This is for example painful for long-running tasks.
Your comma... | null | CC BY-SA 2.5 | null | 2008-08-25T22:08:51.447 | 2008-08-25T22:08:51.447 | null | null | 2,900 | null |
27,029 | 2 | null | 23,228 | 2 | null | I don't know why they did it, but it doesn't really matter anymore:
```
public static class StringExtension
{
public static string FormatWith(this string format, params object[] args)
{
return String.Format(format, args);
}
}
public class SomeClass
{
public string SomeMethod(string name)
{... | null | CC BY-SA 2.5 | null | 2008-08-25T22:15:14.160 | 2008-08-25T22:15:14.160 | null | null | 2,911 | null |
26,938 | 2 | null | 26,882 | 0 | null | You could populate your dropdown based on the querystring on non-postbacks, then always use the value from the dropdown. That way the user's first visit to the page will be based on the querystring and subsequent changes they make to the dropdown will change the selected report.
| null | CC BY-SA 2.5 | null | 2008-08-25T21:24:06.170 | 2008-08-25T21:24:06.170 | null | null | 1,574 | null |
27,031 | 2 | null | 26,903 | 0 | null | I would like to remind everyone that:
1. Writing attributes in .NET is easy
2. Writing static analysis tools in .NET that ensure conformance with company standards is easy
Writing a tool to grab all concrete classes that implement a certain interface/have an attribute and verifying that it has a parameterless cons... | null | CC BY-SA 2.5 | null | 2008-08-25T22:15:37.530 | 2008-08-25T22:15:37.530 | null | null | 338 | null |
27,030 | 1 | 27,212 | null | 111 | 360,481 | I want to compare 2 arrays of objects in JavaScript code. The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each and then looking at the values of the 8 properties is the ... | Comparing Arrays of Objects in JavaScript | CC BY-SA 2.5 | 0 | 2008-08-25T22:15:21.617 | 2023-02-15T21:58:25.327 | 2023-02-15T21:58:25.327 | 42,223 | 2,176 | [
"javascript",
"arrays",
"comparison",
"array-of-dict"
] |
27,033 | 2 | null | 26,845 | 30 | null | I've been using Mercurial both at work and in my own personal projects, and I am really happy with it. The advantages I see are:
1. Local version control. Sometimes I'm working on something, and I want to keep a version history on it, but I'm not ready to push it to the central repositories. With distributed VCS, I ... | null | CC BY-SA 2.5 | null | 2008-08-25T22:16:04.377 | 2009-04-10T16:05:34.553 | 2009-04-10T16:05:34.553 | 2,363 | 2,363 | null |
27,035 | 2 | null | 845 | 11 | null | A technique that works is to look at the computed style of the element. This is supported in Opera and Firefox (and I recon in safari, but haven't tested). IE (7 at least), provides a method to get a style, but it seems to be whatever was in the stylesheet, not the computed style. More details on quirksmode: [Get Style... | null | CC BY-SA 3.0 | null | 2008-08-25T22:16:21.723 | 2013-01-28T03:53:54.013 | 2013-01-28T03:53:54.013 | null | 2,906 | null |
27,039 | 2 | null | 27,034 | 2 | null | > (Incidentally, I also found this form very hard to read in comparison to the normal usage.
Not necessarily, although that was my first thought, too. A code should always emphasize its function, especially if it has side effects. If the writer's intention was to emphasize the assignment to `sharedProxiesPref.disabled... | null | CC BY-SA 2.5 | null | 2008-08-25T22:20:04.587 | 2008-08-25T22:20:04.587 | null | null | 1,968 | null |
27,027 | 1 | 32,441 | null | 6 | 1,930 | So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside.
For a version control system to handle this, it needs to:
- - - - - -
Any ideas on the best way to handle this with existing version control systems? Are any of the vers... | Best approaches to versioning Mac "bundle" files | CC BY-SA 2.5 | 0 | 2008-08-25T22:13:58.953 | 2013-11-01T14:06:19.607 | 2008-08-28T19:05:18.897 | 116 | 116 | [
"macos",
"version-control",
"bundle"
] |
27,041 | 2 | null | 26,984 | 8 | null | My rule of thumb is when the client (the caller) might reasonably want to do something different, depending on the type of exception thrown, the additional exception types are warranted. More often than not, however, the extra exception types are not needed. For instance, if the caller is writing code like
```
try {
... | null | CC BY-SA 3.0 | null | 2008-08-25T22:23:13.267 | 2011-08-07T18:47:22.507 | 2011-08-07T18:47:22.507 | 870,840 | 1,785 | null |
27,043 | 2 | null | 27,020 | 0 | null | If you select the Conditional Formatting menu option under the Format menu item, you will be given a dialog that lets you construct some logic to apply to that cell.
Your logic might not be the same as your code above, it might look more like:
Cell Value is | equal to | | and | White .... Then choose the color.
Y... | null | CC BY-SA 2.5 | null | 2008-08-25T22:26:43.027 | 2008-08-25T22:26:43.027 | null | null | 2,758 | null |
27,023 | 2 | null | 26,620 | 45 | null | If you want to use `$.getJSON()` you can add the following before the call :
```
$.ajaxSetup({
scriptCharset: "utf-8",
contentType: "application/json; charset=utf-8"
});
```
You can use the charset you want instead of `utf-8`.
The options are explained [here](http://docs.jquery.com/Ajax/jQuery.ajax#toptions... | null | CC BY-SA 3.0 | null | 2008-08-25T22:12:25.900 | 2016-08-04T21:09:08.563 | 2016-08-04T21:09:08.563 | 292,502 | 238 | null |
27,018 | 1 | 27,269 | null | 4 | 457 | When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough?
| Single responsiblity principle: granularity of the reason to change | CC BY-SA 2.5 | null | 2008-08-25T22:09:23.253 | 2008-09-21T08:29:20.323 | 2008-09-21T07:38:52.957 | 2,193 | 2,822 | [
"oop"
] |
27,047 | 2 | null | 26,903 | 6 | null | You can use [type parameter constraint](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters)
```
interface ITest<T> where T: new()
{
//...
}
class Test: ITest<Test>
{
//...
}
```
| null | CC BY-SA 4.0 | null | 2008-08-25T22:30:54.340 | 2021-01-03T15:16:17.897 | 2021-01-03T15:16:17.897 | 5,407,188 | 1,196 | null |
27,049 | 2 | null | 26,903 | 0 | null | No you can't do that. Maybe for your situation a factory interface would be helpful? Something like:
```
interface FooFactory {
Foo createInstance();
}
```
For every implementation of Foo you create an instance of FooFactory that knows how to create it.
| null | CC BY-SA 2.5 | null | 2008-08-25T22:31:33.437 | 2008-08-25T22:31:33.437 | null | null | 1,785 | null |
27,051 | 2 | null | 27,044 | 4 | null | `LANG=en_NZ` is correct. However, you must make locale files for `en_NZ`.
For Ubuntu, edit `/var/lib/locales/supported.d/local` and add `en_NZ ISO-8859-1` to the file. If your system is another distribution (including Debian), the location will be different. Look at `/usr/sbin/locale-gen` and see where it stores this ... | null | CC BY-SA 2.5 | null | 2008-08-25T22:34:52.397 | 2008-08-25T22:34:52.397 | null | null | 13 | null |
27,032 | 2 | null | 26,721 | 1 | null | You will need your controls to resize slightly to accommodate the width of the vertical scroll bar. One way to achieve this achieved through docking. Rather than just dropping controls on the form, you'll have to play a bit with panels, padding, min/max sizing and docking.
Here is example code you can place behind a b... | null | CC BY-SA 2.5 | null | 2008-08-25T22:15:50.930 | 2008-08-25T22:15:50.930 | null | null | null | null |
27,053 | 2 | null | 27,044 | 3 | null | Putty can display utf - I think it is in appearance -> translation (or something, I don't have access to it right now).
| null | CC BY-SA 2.5 | null | 2008-08-25T22:35:22.723 | 2008-08-25T22:42:43.003 | 2008-08-25T22:42:43.003 | 1,612 | 1,612 | null |
27,058 | 2 | null | 26,903 | 0 | null | You do not need a parameterless constructor for the Activator to instantiate your class. You can have a parameterized constructor and pass all the parameters from the Activator. Check out [MSDN on this](http://msdn.microsoft.com/en-us/library/4b0ww1we.aspx).
| null | CC BY-SA 2.5 | null | 2008-08-25T22:42:16.937 | 2008-08-25T22:42:16.937 | null | null | 1,796 | null |
27,020 | 1 | 27,139 | null | 11 | 41,475 | I have an Excel Spreadsheet like this
Now I want to group the data of one id by alternating the background color of the rows
Can anyone help me with a macro or some VBA code
Thanks
| Alternating coloring groups of rows in Excel | CC BY-SA 2.5 | 0 | 2008-08-25T22:11:30.770 | 2020-01-10T11:08:16.967 | 2020-01-10T11:08:16.967 | 4,240,030 | 2,798 | [
"excel",
"vba",
"colors"
] |
27,059 | 2 | null | 26,229 | 1 | null | You have to get the Visio that for users of Visual Studio. See this link: [Visio for Enterprise Architects](http://msdn.microsoft.com/en-us/library/ms182014.aspx) for more details. The code generation capabilities are fairly weak and you might end up getting Visio into an inconsistent state. I know that Visio will l... | null | CC BY-SA 2.5 | null | 2008-08-25T22:42:59.057 | 2008-08-25T22:42:59.057 | null | null | 2,655 | null |
27,044 | 1 | 27,051 | null | 2 | 6,870 | I'm accessing an Ubuntu machine using PuTTY, and using gcc.
The default `LANG` environment variable on this machine is set to `en_NZ.UTF-8`, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be.
Maybe it's my font, I don't know - it does this:
```
foo.c:1: error: expected ... | How can I set LANG to ascii? | CC BY-SA 3.0 | 0 | 2008-08-25T22:28:08.717 | 2012-06-07T02:39:51.807 | 2012-06-07T02:39:51.807 | 1,324,019 | 234 | [
"linux",
"bash",
"utf-8"
] |
27,026 | 2 | null | 26,825 | 1 | null | After checking the AutoExpand (which strangley had no visible effect) I checked the DOC Type. Sure enough. That was the culprit.
This is the correct one:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
```
Thanks Ian!
| null | CC BY-SA 2.5 | null | 2008-08-25T22:13:47.580 | 2008-08-25T22:13:47.580 | null | null | 2,894 | null |
27,048 | 2 | null | 26,877 | 2 | null | A little offtopic :
You could instantiate a delegate `(new EventHandler(MethodName))` and (if appropriate) reuse that instance.
| null | CC BY-SA 3.0 | null | 2008-08-25T22:31:30.470 | 2013-01-24T10:10:32.663 | 2013-01-24T10:10:32.663 | 1,410,342 | 1,796 | null |
27,067 | 2 | null | 26,799 | 3 | null | Virtual machines and CVS.
Desktops are rolled out with ghost and are completely vanilla.
Except they have VirtualBox.
Then developers pull the configured baseline development environment
down from CVS.
They log into the development VM image as themselves, refresh the source and libraries from CVS and they're up an... | null | CC BY-SA 2.5 | null | 2008-08-25T22:53:02.650 | 2008-08-25T22:53:02.650 | null | null | 2,789 | null |
27,075 | 2 | null | 26,809 | 1 | null | I usually write my own ConvertDBNull class that wraps the built-in Convert class. If the value is DBNull it will return null if its a reference type or the default value if its a value type.
Example:
- `ConvertDBNull.ToInt64(object obj)` returns `Convert.ToInt64(obj)` unless obj is DBNull in which case it will retu... | null | CC BY-SA 2.5 | null | 2008-08-25T22:57:23.560 | 2008-08-25T22:57:23.560 | null | null | 2,133 | null |
27,065 | 1 | 27,505 | null | 128 | 65,747 | Do any of you know of a tool that will search for .class files and then display their compiled versions?
I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some reason).
| Tool to read and display Java .class versions | CC BY-SA 2.5 | 0 | 2008-08-25T22:52:02.667 | 2023-01-28T21:33:48.607 | 2016-08-24T19:30:11.557 | 276,052 | 1,666 | [
"jvm-bytecode"
] |
27,078 | 1 | null | null | 2 | 213 | I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1).
I am also running with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL: [http://machinename/projectname](http://machinename/projectname).
I get a secur... | IE6 security login (debugging via VirtualPC) | CC BY-SA 3.0 | null | 2008-08-25T22:58:57.723 | 2015-08-17T01:21:03.707 | 2015-04-17T18:20:13.270 | 1,215,724 | 417 | [
"asp.net",
"internet-explorer",
"iis"
] |
27,077 | 1 | 28,262 | null | 4 | 4,050 | When I do:
```
$ find /
```
It searches the entire system.
How do I prevent that?
(This question comes from an "[answer](https://stackoverflow.com/questions/18836/why-doesnt-find-find-anything#26182)" to another question.)
| Is there any way to prevent find from digging down recursively into subdirectories? | CC BY-SA 3.0 | 0 | 2008-08-25T22:58:43.683 | 2015-04-17T18:11:26.450 | 2017-05-23T12:06:21.603 | -1 | 1,438 | [
"bash",
"unix",
"shell",
"ksh"
] |
27,081 | 2 | null | 26,354 | 0 | null | Ditch all API's and use a serial port API directly.
Talk the printers language and you can get decent results.
Every other approach leads to frustration.
Not so pretty, but that is the way my old factory worked.
4k print jobs per day, and none ever missed.
| null | CC BY-SA 2.5 | null | 2008-08-25T22:59:55.100 | 2008-08-25T22:59:55.100 | null | null | 2,789 | null |
27,084 | 2 | null | 27,077 | 3 | null | You might be better off using wildcards. For instance, if you want to find all ksh scripts in the current directory:
```
$ ls *.ksh
```
| null | CC BY-SA 2.5 | null | 2008-08-25T23:02:28.290 | 2008-08-25T23:02:28.290 | null | null | 1,438 | null |
27,085 | 2 | null | 26,860 | 2 | null | Recommended listening: [Hanselminutes](http://www.hanselminutes.com/default.aspx?showID=143)
It's an interview with a blind programmer.
| null | CC BY-SA 2.5 | null | 2008-08-25T23:02:32.613 | 2008-08-25T23:02:32.613 | null | null | 580 | null |
27,087 | 2 | null | 26,354 | 0 | null | [Free 3 of 9](http://www.squaregear.net/fonts/free3of9.shtml)
> This is 3 of 9 (sometimes called "code
39"), a widely used barcode standard
that includes capital letters,
numbers, and several symbols. This is
not the barcode for UPC's (universal
price codes) found on products at the
store. However, most ki... | null | CC BY-SA 2.5 | null | 2008-08-25T23:03:14.967 | 2008-08-25T23:03:14.967 | null | null | 338 | null |
27,082 | 2 | null | 26,809 | 21 | null | If you aren't using nullable types, the best thing to do is check to see if the column's value is DBNull. If it is DBNull, then set your reference to what you use for null/empty for the corresponding datatype.
```
DataRow row = ds.Tables[0].Rows[0];
string value;
if (row["fooColumn"] == DBNull.Value)
{
value = str... | null | CC BY-SA 2.5 | null | 2008-08-25T22:59:59.530 | 2008-08-26T01:53:28.723 | 2008-08-26T01:53:28.723 | 1,644 | 1,644 | null |
27,089 | 2 | null | 27,077 | 10 | null | Consider:
```
-maxdepth n
True if the depth of the current file into the tree is less than
or equal to n.
-mindepth n
True if the depth of the current file into the tree is greater
than or equal to n.
```
| null | CC BY-SA 2.5 | null | 2008-08-25T23:04:08.007 | 2008-08-25T23:04:08.007 | null | null | 2,509 | null |
27,093 | 2 | null | 26,809 | 1 | null | For some reason I've had problems with doing a check against DBNull.Value, so I've done things slightly different and leveraged a property within the DataRow object:
```
if (row.IsNull["fooColumn"])
{
value = string.Empty();
}
{
else
{
value = row["fooColumn"].ToString;
}
```
| null | CC BY-SA 2.5 | null | 2008-08-25T23:06:54.240 | 2008-08-25T23:06:54.240 | null | null | 71 | null |
27,064 | 2 | null | 26,984 | 22 | null | [The Java Specialists](http://www.javaspecialists.eu/) wrote a post about [Exceptions in Java](http://www.javaspecialists.eu/archive/Issue162.html), and in it they list a few "best practices" for creating Exceptions, summarized below:
- Don't Write Own Exceptions (there are lots of useful Exceptions that are already p... | null | CC BY-SA 2.5 | null | 2008-08-25T22:50:32.080 | 2008-08-25T22:50:32.080 | null | null | 2,030 | null |
27,090 | 2 | null | 26,158 | 3 | null | Considering this was tagged with "hacking", I suspect the "stack overflow" he's referring to is a call stack overflow, rather than a higher level stack overflow such as those referenced in most other answers here. It doesn't really apply to any managed or interpreted environments such as .NET, Java, Python, Perl, PHP, ... | null | CC BY-SA 2.5 | null | 2008-08-25T23:04:28.490 | 2008-08-25T23:04:28.490 | 2017-05-23T12:34:26.463 | -1 | 1,693 | null |
27,034 | 1 | 27,098 | null | 2 | 678 | My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled:
```
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
shareProxiesPref.disabled = proxyTypePref.value != 1;
```
Isn't it better to do an if on `proxyTypePref.value`, and then declare the var i... | Javascript: declaring a variable before the conditional result? | CC BY-SA 3.0 | null | 2008-08-25T22:16:10.227 | 2018-01-05T13:07:45.093 | 2017-07-01T15:29:28.790 | null | null | [
"javascript"
] |
27,095 | 1 | 27,552 | null | 6 | 2,528 | I did this Just for kicks (so, not exactly a question, i can see the downmodding happening already) but, in lieu of Google's newfound [inability](http://www.google.com/search?hl=en&q=1999999999999999-1999999999999995&btnG=Search) to do [math](http://www.google.com/search?hl=en&q=400000000000002-400000000000001&btnG=Sea... | The Google Calculator Glitch, could float vs. double be a possible reason? | CC BY-SA 2.5 | 0 | 2008-08-25T23:09:30.363 | 2013-04-30T13:50:34.777 | 2013-04-30T13:50:34.777 | 21,960 | 547 | [
"c",
"math",
"google-search"
] |
27,054 | 1 | null | null | 2 | 409 | I've had some discussions recently at work about switching from Subversion to a DVCS like bazaar, and I would like to get other people's opinion.
I've managed to crystallize my reluctance to do so into a simple parallel.
> Version Control can be used well or badly.
The 'light side' of version control is when you us... | How do you deal with the light side and dark side of distributed version control systems? | CC BY-SA 3.0 | 0 | 2008-08-25T22:38:02.000 | 2015-10-08T07:21:00.187 | 2015-10-08T07:21:00.187 | 67,579 | 2,900 | [
"svn",
"version-control"
] |
27,102 | 2 | null | 26,113 | 0 | null | If it's a brand new project I make it a point to test all html+css changes on all browsers I'm targeting as I make the changes. In the past I tended to focus on my favorite browser and then test with the others after I was done to find that one or more small quirks were present and it was very tedious to pin-point the ... | null | CC BY-SA 2.5 | null | 2008-08-25T23:16:03.033 | 2008-08-25T23:16:03.033 | null | null | 2,881 | null |
27,096 | 2 | null | 26,113 | 3 | null | If you guys are still coding for IE6, you're making a mistake.
I use to get IE6 to render pages like IE7. IE7 is not perfect, but at least it has some semblance of standards. Since I only have to code for IE7 and FF it makes me 33% more efficient in terms of testing against browsers, something I think makes good ... | null | CC BY-SA 2.5 | null | 2008-08-25T23:10:00.580 | 2008-08-26T00:28:47.273 | 2008-08-26T00:28:47.273 | 565 | 565 | null |
27,108 | 1 | 27,130 | null | 7 | 17,774 | I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.
| Perfmon File Analysis Tools | CC BY-SA 2.5 | 0 | 2008-08-25T23:21:43.597 | 2014-08-28T19:40:11.503 | 2008-10-02T01:15:12.307 | 277 | 2,758 | [
"performance",
"logfile-analysis"
] |
27,105 | 2 | null | 27,095 | 4 | null | For more of this kind of silliness see this nice article pertaining to Windows calculator.
[When you change the insides, nobody notices](http://blogs.msdn.com/oldnewthing/archive/2004/05/25/141253.aspx)
> The innards of Calc - the arithmetic
engine - was completely thrown away
and rewritten from scratch. The
st... | null | CC BY-SA 2.5 | null | 2008-08-25T23:19:45.287 | 2008-08-27T19:52:19.260 | 2008-08-27T19:52:19.260 | 338 | 338 | null |
27,111 | 2 | null | 27,027 | 2 | null | Mercurial in particular versions based on file, not directory structure. Therefore, your working tree, which is a fully-fledged repository, doesn't spit out .svn folders at each level.
It also means that a directory that is replaced, like an Application or other Bundle, will still find it's contents with particular f... | null | CC BY-SA 2.5 | null | 2008-08-25T23:30:19.377 | 2008-08-25T23:30:19.377 | null | null | 188 | null |
27,098 | 2 | null | 27,034 | 2 | null | It depends on the context of this code. If it's running on page load, then it would be better to put this code in an if block.
But, if this is part of a validation function, and the field switches between enabled and disabled throughout the life of the page, then this code sort of makes sense.
It's important to remem... | null | CC BY-SA 2.5 | null | 2008-08-25T23:14:03.753 | 2008-08-25T23:14:03.753 | null | null | 2,120 | null |