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
41,396
2
null
38,766
1
null
I didn't actually understand your question completely but I store my connection settings in a configuration files usually one for each environment like dev, production etc. The packages read the connection settings from the config files when they are run.
null
CC BY-SA 2.5
null
2008-09-03T10:07:15.447
2008-09-03T10:07:15.447
null
null
1,688,440
null
41,399
2
null
41,039
10
null
If you install TFS 2008 PowerTools you will get a "Find in Source Control" action in the Team Explorer right click menu. [TFS2008 Power Tools](http://www.microsoft.com/en-us/download/details.aspx?id=15836)
null
CC BY-SA 3.0
null
2008-09-03T10:11:35.577
2012-09-26T20:46:59.427
2012-09-26T20:46:59.427
1,027,808
1,269
null
41,385
2
null
41,330
1
null
Using the [DirectX SDK](https://www.microsoft.com/en-in/download/details.aspx?id=6812), you can call DirectSoundCaptureEnumerate, which will call your DSEnumCallback function for each DirectSoundCapture device on the system. The first parameter passed to your DSEnumCallback is an LPGUID, which is the "Address of the G...
null
CC BY-SA 3.0
null
2008-09-03T09:55:52.790
2017-09-13T07:35:21.530
2017-09-13T07:35:21.530
6,761,181
3,950
null
41,386
2
null
41,367
1
null
One good idea is to determine how much work each additional task creates. This can depend on how the algorithm is structured. For example, imagine you have some virtual cars in a city. At any moment, you want each car to have a map showing where all the cars are. One way to approach this would be: This seems strai...
null
CC BY-SA 3.0
null
2008-09-03T09:56:07.500
2011-08-03T13:05:56.980
2011-08-03T13:05:56.980
4,376
4,376
null
41,370
2
null
41,300
58
null
I use [EmacsW32](http://www.emacswiki.org/emacs/EmacsW32), it works great. See its [EmacsWiki page](http://www.emacswiki.org/cgi-bin/wiki/EmacsW32) for details. To me, the biggest advantage is that: - - - And concerning XEmacs, according to [this post](http://steve-yegge.blogspot.com/2008/04/xemacs-is-dead-long-l...
null
CC BY-SA 3.0
null
2008-09-03T09:34:10.237
2015-10-22T20:37:37.960
2015-10-22T20:37:37.960
150
2,797
null
41,404
2
null
41,397
-1
null
I think seeing as all exceptions should have a parameterless constructor, and have the `Message` property, so the following should work: ``` static ExType TestException<ExType>(string message) where ExType:Exception { ExType ex = new ExType(); ex.Message = message; return ex; } ``` Edit: OK, Message is r...
null
CC BY-SA 2.5
null
2008-09-03T10:13:11.297
2008-09-03T10:13:11.297
null
null
1,908
null
41,402
2
null
41,397
0
null
Have you tried, instead: ``` static T TestException<Exception>(string message) {} ``` because I have a feeling that putting in the generic constraint is not necessary as all throwable exceptions inherit from System.Exception anyway. Remember that generics do accept inherited types.
null
CC BY-SA 2.5
null
2008-09-03T10:12:41.703
2008-09-03T10:12:41.703
null
null
372
null
41,379
2
null
39,562
12
null
Warning: I'm not a java hacker, so YMMV but... The problem with using a list of "properties" is that you need a lot of discipline. Every time you add a string that should be output to the user you will need to open your properties file, look to see if that string (or something roughly equivalent to it) is already in t...
null
CC BY-SA 2.5
null
2008-09-03T09:50:03.723
2008-09-03T09:50:03.723
null
null
2,745
null
41,397
1
41,408
null
11
7,291
Right, I know I am totally going to look an idiot with this one, but my brain is just kicking in to gear this morning. I want to have a method where I can say "if it goes bad, come back with this type of Exception", right? For example, something like (): ``` static ExType TestException<ExType>(string message) where Ex...
Asking a Generic Method to Throw Specific Exception Type on FAIL
CC BY-SA 2.5
0
2008-09-03T10:08:11.527
2012-02-02T14:25:31.037
2020-06-20T09:12:55.060
-1
832
[ "c#", "generics", "exception" ]
41,405
1
41,418
null
3
3,793
At the company I work for we have a "Utility" project that is referenced by pretty much ever application we build. It's got lots of things like NullHelpers, ConfigSettingHelpers, Common ExtensionMethods etc. The way we work is that when we want to make a new project, we get the latest version of the project from sourc...
Working with Common/Utility Libraries
CC BY-SA 2.5
0
2008-09-03T10:13:30.203
2016-02-02T11:36:06.563
null
null
493
[ "c#", "visual-studio", "api" ]
41,410
2
null
41,406
3
null
You can look at the [eval](http://php.net/eval) function in PHP. It allows you to run arbitrary PHP code. It can be a huge security risk, though, and is best avoided.
null
CC BY-SA 2.5
null
2008-09-03T10:17:14.487
2008-09-03T10:17:14.487
null
null
1,606
null
41,400
1
41,794
null
50
31,972
I am looking to do this in C/C++. I came across [Variable Length Arguments](http://www.swig.org/Doc1.3/Varargs.html), but this suggests a solution with Python and C using [libffi](http://sourceware.org/libffi/). Now, if I want to wrap the `printf` function with `myprintf`. I do it like below: ``` void myprintf(char* fm...
How can I wrap a function with variable length arguments?
CC BY-SA 4.0
0
2008-09-03T10:12:27.743
2022-06-28T21:43:00.353
2022-06-28T21:41:14.110
63,550
123
[ "c++", "c", "variadic-functions" ]
41,412
2
null
41,407
0
null
You need to pass the `RegexOptions`. Singleline flag in to the regular expression, so that "." matches all characters, not just all characters except new lines (which is the default).
null
CC BY-SA 3.0
null
2008-09-03T10:19:00.923
2017-07-04T08:41:32.393
2017-07-04T08:41:32.393
5,423,108
1,908
null
41,411
2
null
41,406
33
null
You can use the [eval](http://php.net/manual/en/function.eval.php) command for this. Debugging is hard(er), it implies some security risks (bad content in the DB gets executed, uh oh). See [When is eval evil in php?](https://stackoverflow.com/questions/951373/when-is-eval-evil-in-php) for instance. Google for Eval is...
null
CC BY-SA 3.0
null
2008-09-03T10:18:01.660
2016-08-29T19:19:57.320
2017-05-23T10:31:25.977
-1
909
null
41,406
1
41,411
null
34
40,099
I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load. How could I go about doing this?
How do I execute PHP that is stored in a MySQL database?
CC BY-SA 2.5
0
2008-09-03T10:14:26.067
2016-08-29T19:23:50.847
null
null
3,654
[ "php", "mysql" ]
41,408
2
null
41,397
23
null
You can almost do it like this: ``` static void TestException<E>(string message) where E : Exception, new() { var e = new E(); e.Message = message; throw e; } ``` However, that doesn't compile because Exception.Message is read only. It can only be assigned by passing it to the constructor, and there's no...
null
CC BY-SA 2.5
null
2008-09-03T10:15:34.863
2008-09-03T10:15:34.863
null
null
615
null
41,413
2
null
41,400
0
null
How do you mean a pure C/C++ solution? The rest parameter (...) is supported cross platform in the C runtime. [va_arg, va_copy, va_end, va_start](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/va-arg-va-copy-va-end-va-start)
null
CC BY-SA 4.0
null
2008-09-03T10:19:33.903
2022-06-28T21:29:24.980
2022-06-28T21:29:24.980
63,550
986
null
41,409
2
null
36,014
1
null
I believe Steve Steiner is correct. When researching Steve's suggestions, I came across [this thread](http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-net-ide/4729/Disabling-Just-my-code-changes-Debug-Exceptions-dialog) talking about the "Enable Just My Code" option in Tools|Options|Debugger|General. It is suggested th...
null
CC BY-SA 2.5
null
2008-09-03T10:17:12.927
2008-09-03T10:17:12.927
null
null
3,347
null
41,419
1
41,462
null
12
2,821
What do search engine bots use as a starting point? Is it DNS look-up or do they start with some fixed list of well-know sites? Any guesses or suggestions?
Where do search engines start crawling?
CC BY-SA 2.5
0
2008-09-03T10:30:52.753
2017-09-13T04:55:11.523
null
null
45,603
[ "search-engine" ]
41,415
2
null
41,207
1
null
[This post](http://ejohn.org/blog/javascript-engine-speeds/) by John Resig says that there are shells for [Tamarin (Firefox 4?)](http://www.mozilla.org/projects/tamarin/) and [JavaScriptCore (Safari 3)](http://webkit.org/projects/javascript/index.html). I'm not sure if they have auto completion though.
null
CC BY-SA 2.5
null
2008-09-03T10:21:35.583
2008-09-03T10:21:35.583
null
null
2,541
null
41,423
2
null
41,407
1
null
The problem you have is that you need to terminate the RegEx pattern so it knows when one message ends and then next starts. When you were running in default mode the newline was working as an implicit terminator. The problem is if you go into multiline mode there's no terminator so the pattern will gobble up the who...
null
CC BY-SA 2.5
null
2008-09-03T10:34:08.063
2008-09-03T10:34:08.063
null
null
3,171
null
41,418
2
null
41,405
5
null
That's exactly what we're doing. We have a Utility project which has some non project specific useful functions. We increase the version manually (minor), build the project in Release version, sign it and put it to a shared location. People then use the specific version of the . If some useful methods are implemented...
null
CC BY-SA 3.0
null
2008-09-03T10:23:51.660
2016-02-02T11:36:06.563
2016-02-02T11:36:06.563
1,018,966
1,269
null
41,428
2
null
41,407
3
null
This will only work if the log message doesn't contain a date at the beginning of the line, but you could try adding a negative look-ahead assertion for a date in the "message" group: ``` (?<date>\d{2}/\d{2}/\d{2})\s(?<time>\d{2}:\d{2}:\d{2},\d{3})\s(?<message>(.(?!^\d{2}/\d{2}/ \d{2}))+) ``` Note that this requires...
null
CC BY-SA 2.5
null
2008-09-03T10:37:36.340
2008-09-03T10:37:36.340
null
null
3,950
null
41,427
2
null
41,244
5
null
You could add it: ``` public static IEnumerable<T> OrderBy( this IEnumerable<T> input, string queryString) { //parse the string into property names //Use reflection to get and sort by properties //something like foreach( string propname in queryString.Split(',')) input.OrderBy( x => GetPropert...
null
CC BY-SA 2.5
null
2008-09-03T10:37:31.193
2008-10-24T11:10:21.930
2017-05-23T12:34:37.587
-1
905
null
41,422
2
null
41,400
8
null
I am also unsure what you mean by pure. In C++ we use: ``` #include <cstdarg> #include <cstdio> class Foo { void Write(const char* pMsg, ...); }; void Foo::Write( const char* pMsg, ...) { char buffer[4096]; std::va_list arg; va_start(arg, pMsg); std::vsnprintf(buffer, 4096, pMsg, arg); va_e...
null
CC BY-SA 4.0
null
2008-09-03T10:33:49.017
2022-06-28T21:30:13.800
2022-06-28T21:30:13.800
63,550
259
null
41,429
1
41,442
null
5
4,454
I am trying to set a ViewState-variable when a button is pressed, but it only works the second time I click the button. Here is the code-behind: ``` protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { lblInfo.InnerText = String.Format("Hello {0} at {1}!", YourName, DateTime.No...
Setting viewstate on postback
CC BY-SA 3.0
0
2008-09-03T10:37:43.080
2017-12-13T12:54:49.113
2017-12-13T12:54:49.113
1,773,603
2,257
[ "asp.net", "postback", "viewstate" ]
41,414
2
null
41,400
1
null
Are you using C or C++? The next C++ version, C++0x, will support [variadic templates](http://en.wikipedia.org/wiki/Varargs#Variadic_functions_in_C.2C_Objective-C_and_C.2B.2B) which provide a solution to that problem. Another workaround can be achieved by clever operator overloading to achieve a syntax like this: ```...
null
CC BY-SA 2.5
null
2008-09-03T10:20:06.397
2008-09-03T10:20:06.397
null
null
1,968
null
41,431
2
null
41,424
6
null
I would suggest looking at [SOUNDEX](http://en.wikipedia.org/wiki/Soundex) to find similar words in your database. You can also access google own dictionary by using the [Google API spelling suggestion request](http://code.google.com/apis/soapsearch/reference.html#1_3).
null
CC BY-SA 2.5
null
2008-09-03T10:39:05.650
2008-09-03T10:46:06.460
2008-09-03T10:46:06.460
2,257
2,257
null
41,430
2
null
38,280
1
null
Although I realize this may not be an option yet, [Google Chrome](http://www.google.com/chrome) seems to have some features that have been added specifically to allow that. Again, maybe not usable, yet, but certainly very interesting! (See also [the Chrome presentation](http://www.youtube.com/watch?v=1d1_ool4r7s&featu...
null
CC BY-SA 2.5
null
2008-09-03T10:38:23.420
2008-09-03T10:38:23.420
null
null
1,037
null
41,407
1
41,428
null
2
5,409
I'm currently working on a parser for our internal log files (generated by log4php, log4net and log4j). So far I have a nice regular expression to parse the logs, except for one annoying bit: Some log messages span multiple lines, which I can't get to match properly. The regex I have now is this: ``` (?<date>\d{2}/\d{...
Parsing a log file with regular expressions
CC BY-SA 3.0
null
2008-09-03T10:15:11.247
2017-12-16T22:56:05.397
2017-12-16T22:56:05.397
858,913
909
[ "c#", "regex" ]
41,424
1
41,448
null
116
30,924
> [How does the Google “Did you mean?” Algorithm work?](https://stackoverflow.com/questions/307291/how-does-the-google-did-you-mean-algorithm-work) Suppose you have a search system already in your website. How can you implement the "Did you mean:`<spell_checked_word>`" like Google does in some [search queries](...
How do you implement a "Did you mean"?
CC BY-SA 3.0
0
2008-09-03T10:36:13.270
2012-11-19T05:57:06.303
2017-05-23T12:09:52.140
-1
2,644
[ "nlp" ]
41,438
2
null
41,424
0
null
Soundex and "Porter stemming" (soundex is trivial, not sure about porter stemming).
null
CC BY-SA 2.5
null
2008-09-03T10:46:57.533
2008-09-03T10:46:57.533
null
null
699
null
41,433
2
null
41,424
0
null
Soundex is good for phonetic matches, but works best with peoples' names (it was originally developed for census data) Also check out Full-Text-Indexing, the syntax is different from Google logic, but it's very quick and can deal with similar language elements.
null
CC BY-SA 2.5
null
2008-09-03T10:41:35.520
2008-09-03T10:41:35.520
null
null
905
null
41,425
2
null
41,407
2
null
You obviously need that "messages lines" can be distinguished from "log lines"; if you allow the message part to start with date/time after a new line, then there is simply no way to determine what is part of a message and what not. So, instead of using the dot, you need an expression that allows anything that does not...
null
CC BY-SA 2.5
null
2008-09-03T10:37:02.630
2008-09-03T10:37:02.630
null
null
4,285
null
41,440
2
null
41,406
5
null
`eval()` function was covered in other responses here. I agree you should limit use of `eval` unless it is absolutely needed. Instead of having PHP code in db you could have just a class name that has method called, say, `execute()`. Whenever you need to run your custom PHP code just instantiate the class of name you j...
null
CC BY-SA 2.5
null
2008-09-03T10:47:21.933
2008-09-03T10:47:21.933
null
null
2,169
null
41,441
2
null
41,405
1
null
I've had the same issue! I used to use project references, but it all seems to go bad, when as you say, you have many projects referencing it. I now compile to a DLL, and set the CopyLocal property for the DLL reference to false after the first build (otherwise I find it can override sub projects and just become a m...
null
CC BY-SA 2.5
null
2008-09-03T10:47:47.423
2008-09-03T10:47:47.423
null
null
832
null
41,439
2
null
39,910
0
null
Hm. Works fine on mine, so let's see if we can work out how your setup is different... It looks as though it's having trouble populating the control; my first guess would be that this is because the code makes so many assumptions about the lists it's talking to. Can you check that you've got a plain vanilla Team site,...
null
CC BY-SA 2.5
null
2008-09-03T10:47:11.030
2008-09-03T10:47:11.030
null
null
4,301
null
41,443
2
null
41,424
12
null
Check [this](http://en.wikipedia.org/wiki/Levenshtein_distance) article on wikipedia about the Levenshtein distance. Make sure you take a good look at Possible improvements.
null
CC BY-SA 2.5
null
2008-09-03T10:49:29.137
2008-09-03T10:49:29.137
null
null
null
null
41,451
2
null
41,449
120
null
I've found the solution. I've recently upgraded my machine to Windows 2008 Server 64-bit. The SqlServer.Replication namespace was written for 32-bit platforms. All I needed to do to get it running again was to set the Target Platform in the Project Build Properties to X86.
null
CC BY-SA 2.5
null
2008-09-03T10:57:53.560
2008-09-03T10:57:53.560
null
null
2,012
null
41,450
2
null
41,397
11
null
The only issue with the solution is that it is possible to create a subclass of Exception which does not implement a constructor with a single string parameter, so the MethodMissingException might be thrown. ``` static void TestException<E>(string message) where E : Exception, new() { try { return Activ...
null
CC BY-SA 2.5
null
2008-09-03T10:56:24.733
2008-09-03T10:56:24.733
null
null
1,908
null
41,449
1
41,451
null
323
275,712
The exact error is as follows > Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format. I've recently started working on this project again a...
I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project
CC BY-SA 3.0
0
2008-09-03T10:55:53.113
2018-04-09T14:59:12.283
2012-09-06T23:53:37.893
112,196
2,012
[ "c#", "sql-server", "replication" ]
41,446
1
42,491
null
15
21,934
I'm looking for a tool to generate a JavaScript stub from a WSDL. Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP. I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I d...
Generating JavaScript stubs from WSDL
CC BY-SA 2.5
0
2008-09-03T10:54:28.983
2010-11-22T10:02:20.623
2009-11-25T16:07:08.620
268
268
[ "javascript", "soap", "wsdl" ]
41,455
2
null
41,424
4
null
[http://en.wikipedia.org/wiki/N-gram#Google_use_of_N-gram](http://en.wikipedia.org/wiki/N-gram#Google_use_of_N-gram)
null
CC BY-SA 2.5
null
2008-09-03T11:00:42.977
2008-09-03T11:00:42.977
null
null
190
null
41,459
2
null
41,453
59
null
And I would love a pony, but ponies aren't free. :-p [http://en.wikibooks.org/wiki/C%2B%2B_Programming/RTTI](http://en.wikibooks.org/wiki/C%2B%2B_Programming/RTTI) is what you're going to get. Reflection like you're thinking about -- fully descriptive metadata available at runtime -- just doesn't exist for C++ by defa...
null
CC BY-SA 2.5
null
2008-09-03T11:04:56.540
2008-09-03T11:04:56.540
null
null
1,554
null
41,447
2
null
41,419
4
null
You can submit your site to search engines using their [site submission forms](http://www.google.com/addurl/) - this will get you into their system. When you actually get crawled after that is impossible to say - from experience it's usually about a week or so for an initial crawl (homepage, couple of other pages 1-lin...
null
CC BY-SA 2.5
null
2008-09-03T10:55:09.230
2008-09-03T10:55:09.230
null
null
2,287
null
41,453
1
34,551,440
null
317
270,304
I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?
How can I add reflection to a C++ application?
CC BY-SA 2.5
0
2008-09-03T10:59:05.883
2022-07-12T21:11:41.930
2010-06-21T04:10:55.483
113,124
3,233
[ "c++", "reflection", "templates", "sfinae" ]
41,460
1
44,701
null
207
85,627
In simple terms, what are the reasons for, and what are the differences between the GPL v2 and GPL v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.
What are the differences between GPL v2 and GPL v3 licenses?
CC BY-SA 2.5
0
2008-09-03T11:05:11.203
2021-04-08T16:25:04.027
2008-09-03T11:20:19.450
3,233
3,233
[ "licensing" ]
41,456
2
null
41,419
2
null
In principle they start with nothing. Only when somebody explicitly tells them to include their website they can start crawling this site and use the links on that site to search more. However, in practice the creator(s) of a search engine will put in some arbitrary sites they can think of. For example, their own blog...
null
CC BY-SA 2.5
null
2008-09-03T11:00:49.670
2008-09-03T11:00:49.670
null
null
4,285
null
41,464
2
null
41,460
7
null
In (not entirely) cynical terms, the reason for the v3 license was Microsoft's patent deal with Novell. In reality, you should always consult a lawyer when dealing with legal issues.
null
CC BY-SA 2.5
null
2008-09-03T11:07:58.233
2008-09-03T11:07:58.233
null
null
1,554
null
41,442
2
null
41,429
12
null
`Page_Load` fires before `btnSubmit_Click`. If you want to do something after your postback events have fired use `Page_PreRender`. ``` //this will work because YourName has now been set by the click event protected void Page_PreRender(object sender, EventArgs e) { if (Page.IsPostBack) lblInfo.InnerText =...
null
CC BY-SA 2.5
null
2008-09-03T10:48:15.817
2008-09-03T10:48:15.817
null
null
905
null
41,469
1
151,593
null
33
46,677
I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality: The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database. Although I am mainly inter...
How to fetch a Book Title from an ISBN number?
CC BY-SA 2.5
0
2008-09-03T11:20:26.813
2018-09-07T16:20:59.930
2013-03-26T10:34:30.930
null
2,644
[ "php", "language-agnostic" ]
41,463
2
null
31,394
5
null
The commonly available system properties are documented in the [System.getProperties()](http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties%28%29) method. As Chris said `"user.name"` is the property to get the user running your app.
null
CC BY-SA 2.5
null
2008-09-03T11:07:41.603
2016-05-12T01:24:45.190
2016-05-12T01:24:45.190
1,402,846
3,535
null
41,474
2
null
41,469
1
null
To obtain data for given ISBN number you need to interact with some online service like [isbndb](http://isbndb.com). One of the best sources for bibliographic information is Amazon web service. It provides you with all bibliographic info + book cover.
null
CC BY-SA 2.5
null
2008-09-03T11:25:57.923
2008-09-03T11:25:57.923
null
null
1,196
null
41,457
2
null
39,639
0
null
Is this as simple as spelling? or are there just typos in the question? Sometimes you write `rebuildThumbnail` and sometimes you write `rebildThumbnail` The methods you are trying to override with advice are not final methods in the MVC framework, so whilst bpapas answer is useful, my understanding is that this is not...
null
CC BY-SA 4.0
null
2008-09-03T11:01:34.567
2018-12-20T13:01:23.720
2018-12-20T13:01:23.720
1,997,093
1,820
null
41,454
2
null
40,471
784
null
Note, that a lot of the answers state that Hashtable is synchronized. The synchronization is on the accessor/mutator methods will stop two threads adding or removing from the map concurrently, but in the real world, you will often need additional synchronization. A very common idiom is to "check then put" — i.e. loo...
null
CC BY-SA 4.0
null
2008-09-03T11:00:41.213
2021-05-15T11:22:30.583
2021-05-15T11:22:30.583
5,485,215
1,853
null
41,465
2
null
38,280
1
null
Some other reasons to choose Firefox: - [Firebug](http://getfirebug.com/)- [Web Developer](https://addons.mozilla.org/en-US/firefox/addon/60)- [Tamper Data](https://addons.mozilla.org/en-US/firefox/addon/966) These addons make it a lot easier to develop web application for.
null
CC BY-SA 2.5
null
2008-09-03T11:08:04.147
2008-09-03T11:08:04.147
null
null
486
null
41,475
2
null
41,469
14
null
Check out [ISBN DB API](http://isbndb.com/api/v2/docs). It's a simple REST-based web service. Haven't tried it myself, but a friend has had successful experiences with it. It'll give you book title, author information, and depending on the book, number of other details you can use.
null
CC BY-SA 3.0
null
2008-09-03T11:26:37.890
2015-04-22T08:26:36.953
2015-04-22T08:26:36.953
4,333
4,333
null
41,479
1
41,505
null
405
146,212
After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var? For example I rather lazily used var in questionable circumstances, e.g.:- ``` foreach(var item in someList) { // ... } // Type of 'item' not clear....
Use of var keyword in C#
CC BY-SA 3.0
0
2008-09-03T11:29:57.650
2015-02-03T03:25:00.327
2015-02-03T03:25:00.327
102,937
3,394
[ "c#", "type-inference", "var" ]
41,482
2
null
41,469
1
null
You might want to look into [LibraryThing](http://www.librarything.com/), it has an [API](http://www.librarything.com/services/) that would [do what you want](http://www.librarything.com/services/librarything.ck.getwork.php) and they handle things like mapping multiple ISBNs for different editions of a single "work".
null
CC BY-SA 2.5
null
2008-09-03T11:32:29.187
2008-09-03T11:32:29.187
null
null
3,715
null
41,487
2
null
41,479
1
null
In our office, our CTO has categorically banned the use of the var keyword, for the same reasons that you have stated. Personally I find the use of var only valid in new object declarations, since the type of the object is obvious in the statement itself. For LINQ queries, you can resolve results to: ``` IEnumerable...
null
CC BY-SA 2.5
null
2008-09-03T11:35:49.320
2008-09-03T11:35:49.320
null
null
372
null
41,462
2
null
41,419
8
null
Your question can be interpreted in two ways: Are you asking where search engines start their crawl from in general, or where they start to crawl a particular site? I don't know how the big players work; but if you were to make your own search engine you'd probably seed it with popular portal sites. [DMOZ.org](https...
null
CC BY-SA 3.0
null
2008-09-03T11:07:26.487
2017-09-12T21:30:25.203
2017-09-12T21:30:25.203
6,761,181
4,050
null
41,448
2
null
41,424
87
null
Actually what Google does is very much non-trivial and also at first counter-intuitive. They don't do anything like check against a dictionary, but rather they make use of statistics to identify "similar" queries that returned more results than your query, the exact algorithm is of course not known. There are differen...
null
CC BY-SA 2.5
null
2008-09-03T10:55:12.740
2008-09-03T10:55:12.740
null
null
1,996
null
41,483
2
null
41,453
13
null
What are you trying to do with reflection? You can use the Boost [type traits](http://www.boost.org/doc/libs/1_36_0/libs/type_traits/doc/html/index.html) and [typeof](http://www.boost.org/doc/libs/1_36_0/doc/html/typeof.html) libraries as a limited form of compile-time reflection. That is, you can inspect and modify t...
null
CC BY-SA 2.5
null
2008-09-03T11:33:05.863
2008-09-03T11:33:05.863
null
null
4,086
null
41,492
1
2,478,693
null
1
818
Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default! Without having source to the object itself
ActiveX control default property discovery
CC BY-SA 2.5
null
2008-09-03T11:40:15.660
2010-03-19T15:55:49.423
2008-09-05T15:08:10.540
1,111
1,111
[ "vb6", "activex" ]
41,480
2
null
39,639
1
null
The basic setup looks ok. The syntax can be simplified slightly by not defining an in-place pointcut and just specifying the method to which the after-advice should be applied. (The named pointcuts for methods are automatically created for you.) e.g. ``` @After( "com.example.bg.web.controllers.assets.AssetAddControl...
null
CC BY-SA 2.5
null
2008-09-03T11:31:19.830
2008-09-05T10:02:35.330
2008-09-05T10:02:35.330
1,820
1,820
null
41,488
2
null
41,479
3
null
I had the same concern when I started to use keyword. However I got used to it over time and not going to go back to explicit variable types. Visual Studio's compiler\intellisense are doing a very good job on making work with implicitly typed variables much easier. I think that following proper naming conventions c...
null
CC BY-SA 2.5
null
2008-09-03T11:36:00.927
2008-09-03T11:41:08.840
2008-09-03T11:41:08.840
1,196
1,196
null
41,486
2
null
41,479
53
null
I think the use of var should be coupled with wisely-chosen variable names. I have no problem using var in a foreach statement, provided it's not like this: ``` foreach (var c in list) { ... } ``` If it were more like this: ``` foreach (var customer in list) { ... } ``` ... then someone reading the code would be...
null
CC BY-SA 2.5
null
2008-09-03T11:35:13.987
2008-09-03T11:42:45.387
2008-09-03T11:42:45.387
615
615
null
41,494
2
null
41,469
0
null
As an alternative to isbndb (which seems like the perfect answer) I had the impression that you could pass an ISBN into an Amazon product URL to go straight to the Amazon page for the book. While this doesn't programmatically return the book title, it might have been a useful extra feature in case you wanted to link to...
null
CC BY-SA 2.5
null
2008-09-03T11:42:15.203
2008-10-05T12:47:33.113
2008-10-05T12:47:33.113
3,267
3,267
null
41,498
1
null
null
5
890
We recently lost a database and I want to recover the data from de Production.log. Every request is logged like this: Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionar...
Rails - recovering database from Production.log
CC BY-SA 2.5
0
2008-09-03T11:45:32.900
2011-10-24T06:42:15.503
null
null
4,384
[ "ruby-on-rails", "session" ]
41,497
2
null
27,405
3
null
Bit shifts are usually very fast: ``` y = 0xFF3B * (int32_t) x >> 16; ``` This is probably better written as: ``` y = (0.997 * 0x10000) * (int32_t)x >> 16; ``` A good compiler will generate equivalent output. If your integers are signed, the constants should be changed to 0x8000 and 15.
null
CC BY-SA 2.5
null
2008-09-03T11:45:05.303
2008-09-03T11:45:05.303
null
null
1,077
null
41,473
2
null
41,469
7
null
I haven't tried it, but take a look at [isbndb](http://isbndb.com/docs/api/10-intro.html) > API Description: IntroductionISBNdb.com's remote access application programming interface (API) is designed to allow other websites and standalone applications use the vast collection of data collected by ISBNdb.com since 2003....
null
CC BY-SA 2.5
null
2008-09-03T11:25:53.633
2008-09-03T11:25:53.633
null
null
4,050
null
41,504
1
5,519,523
null
82
96,991
Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?
Timezone lookup from latitude longitude
CC BY-SA 2.5
0
2008-09-03T11:52:41.807
2019-04-30T11:28:31.957
null
null
797
[ "web-services", "api", "timezone", "geocoding" ]
41,503
2
null
41,479
17
null
One specific case where var is difficult: offline code reviews, especially the ones done on paper. You can't rely on mouse-overs for that.
null
CC BY-SA 2.5
null
2008-09-03T11:51:16.537
2008-09-03T11:51:16.537
null
null
372
null
41,502
2
null
31,826
1
null
Rob Walker is right: the problem isn't specified in enough detail. Considering just parsers (and ignoring the question of whether they perform validation), there are two main flavors: tree-based—think DOM—and streaming/event-based—think [SAX](http://en.wikipedia.org/wiki/SAX) (push) and [StAX](http://en.wikipedia.org/w...
null
CC BY-SA 2.5
null
2008-09-03T11:47:52.880
2008-09-03T11:47:52.880
null
null
4,203
null
41,496
2
null
41,479
3
null
Someone doesn't like criticism of var.. All answers downmodded.. oh well.. @Jon Limjap: I know. :) What I meant was that the readability is degraded like it is in VB6. I don't like to rely on Intellisense to figure out what type a given variable is. I want to be able to figure it out using the source alone. Naming co...
null
CC BY-SA 2.5
null
2008-09-03T11:45:04.040
2008-09-03T11:45:04.040
null
null
4,192
null
41,507
2
null
41,479
1
null
@erlando, out of curiosity, why do you need to know the variable's type looking at the source code? In my practice I found that variable type is matter for me only at the time I'm using it in the code. If I'm trying to do some inappropriate operation on compiler gladly gives me an error\warning. I really don't c...
null
CC BY-SA 2.5
null
2008-09-03T11:55:57.167
2008-09-03T11:55:57.167
null
null
1,196
null
41,510
2
null
36,347
4
null
Java (and C#) generics seem to be a simple run-time type substitution mechanism. C++ templates are a compile-time construct which give you a way to modify the language to suit your needs. They are actually a purely-functional language that the compiler executes during a compile.
null
CC BY-SA 2.5
null
2008-09-03T12:00:04.380
2008-09-03T12:00:04.380
null
null
4,086
null
41,501
2
null
41,479
10
null
I think the key thing with VAR is to only use it where appropriate i.e. when doing things in Linq that it facilitates (and probably in other cases). If you've a type for something in the then you should use it - not to do so is simple laziness (as opposed to creative laziness which is generally to be encouraged - go...
null
CC BY-SA 2.5
null
2008-09-03T11:47:35.453
2008-09-03T11:47:35.453
null
null
1,070
null
41,513
1
null
null
15
11,055
I am going to be using Subversion for source control on a new J2EE web application. What directory structure will you recommend for organizing code, tests and documentation?
Recommended Source Control Directory Structure?
CC BY-SA 2.5
0
2008-09-03T12:00:40.570
2012-08-11T19:54:47.983
2012-08-11T19:54:47.983
841,064
null
[ "java", "svn", "jakarta-ee", "version-control", "code-organization" ]
41,505
2
null
41,479
292
null
I still think `var` can make code more readable in some cases. If I have a Customer class with an Orders property, and I want to assign that to a variable, I will just do this: ``` var orders = cust.Orders; ``` I don't care if Customer.Orders is `IEnumerable<Order>`, `ObservableCollection<Order>` or `BindingList<Ord...
null
CC BY-SA 3.0
null
2008-09-03T11:53:07.377
2012-06-19T12:35:38.170
2012-06-19T12:35:38.170
995,246
615
null
41,512
2
null
41,504
4
null
These look pretty promising- Archive link: [https://web.archive.org/web/20150503145203/http://www.earthtools.org/webservices.htm](https://web.archive.org/web/20150503145203/http://www.earthtools.org/webservices.htm)
null
CC BY-SA 4.0
null
2008-09-03T12:00:30.867
2019-04-30T11:28:31.957
2019-04-30T11:28:31.957
6,205,782
4,325
null
41,516
2
null
41,479
8
null
@aku: One example is code reviews. Another example is refactoring scenarios. Basically I don't want to go type-hunting with my mouse. It might not be available.
null
CC BY-SA 2.5
null
2008-09-03T12:02:03.080
2008-09-03T12:02:03.080
null
null
4,192
null
41,520
2
null
41,479
0
null
@erlando, Talking about refactoring it seems to be much easier to change variable type by assigning instance of new type to one variable rather then changing it in multiple places, isn't it ? As for code review I see no big issues with keyword. During code review I prefer to check code logic rather variable types. O...
null
CC BY-SA 2.5
null
2008-09-03T12:07:46.967
2008-09-03T12:16:58.753
2008-09-03T12:16:58.753
1,196
1,196
null
41,517
2
null
41,256
0
null
Based on what D2VIANT referenced > Full Article: [http://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.aspx](http://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.aspx) I was able to find additional resources which list the changes in .NET SP1 some of the types added/affecte...
null
CC BY-SA 2.5
null
2008-09-03T12:02:39.070
2008-09-03T12:02:39.070
null
null
3,359
null
41,519
2
null
41,479
17
null
I don't see what the big deal is.. ``` var something = someMethod(); // Type of 'something' not clear <-- not to the compiler! ``` You still have full intellisense on 'something', and for any ambiguous case you have your unit tests, right? ( do you? ) It's not varchar, it's not dim, and it's certainly not dynamic o...
null
CC BY-SA 2.5
null
2008-09-03T12:04:57.923
2008-09-03T12:04:57.923
null
null
3,024
null
41,499
1
42,674
null
8
3,676
In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, `static int MYINT = 3;` causes the serialVersionUID to change. In this example, it makes sense because different versions of the class woul...
Java serialization with static initialization
CC BY-SA 2.5
null
2008-09-03T11:46:34.630
2015-10-15T13:03:25.693
2008-09-03T12:15:19.523
3,150
3,150
[ "java", "serialization" ]
41,524
2
null
41,513
14
null
I usually have In work with Visual Studio, I'm not sure if this works the same in the java world. But i usually put stuff in different project folders in src. For each source project there's a separate test project. Build files go in the main project directory. I usually put a README there too documenting how to set...
null
CC BY-SA 3.0
null
2008-09-03T12:11:07.973
2012-05-15T13:01:04.650
2012-05-15T13:01:04.650
5,017
3,320
null
41,523
2
null
41,479
8
null
It's a matter of taste. All this fussing about the of a variable disappears when you get used to dynamically typed languages. That is, you ever start to like them (I'm not sure if everybody can, but I do). C#'s `var` is pretty cool in that it like dynamic typing, but actually is typing - the compiler enforces corr...
null
CC BY-SA 2.5
null
2008-09-03T12:10:53.463
2008-09-03T12:10:53.463
null
null
2,260
null
41,527
2
null
41,499
0
null
I updated the question to be more clear. I understand why initialization with a literal changes the `serialVersionUID` but not why dynamic initialization changes it. If you initialize with a method, the value, of course, may always be different. Setting the `serialVersionUID` explicitly is fine in a subsequent versi...
null
CC BY-SA 3.0
null
2008-09-03T12:13:09.107
2015-10-15T13:03:25.693
2015-10-15T13:03:25.693
678,093
3,150
null
41,511
1
null
null
4
2,270
Is there any way to use this kind of format in .Net (C#)? I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background. Any ideas? Thanks for your time.
How to use 32bit alpha-blended BMP in .Net
CC BY-SA 2.5
0
2008-09-03T12:00:26.203
2012-01-01T06:27:07.020
null
null
4,386
[ "c#", ".net", "alpha", "blending" ]
41,521
2
null
41,089
2
null
I believe the following will work: ``` Dim b As CommandButton Set b = ocx.GetButton("btnPrint") b = True ``` `CommandButton`s actually have two functions. One is the usual click button and the other is a toggle button that acts similar to a `CheckBox`. The default property of the `CommandButton` is actually the `Val...
null
CC BY-SA 3.0
null
2008-09-03T12:08:30.553
2017-08-20T23:05:52.920
2017-08-20T23:05:52.920
3,641,067
1,111
null
41,529
2
null
41,525
0
null
which ones? I use `gvim` on Windows and `MacVim` on the mac. Seem similar enough to be the same to me...
null
CC BY-SA 2.5
null
2008-09-03T12:13:23.240
2008-09-03T12:13:23.240
null
null
2,260
null
41,532
2
null
41,479
5
null
I split var all over the places, the only questionable places for me are internal short types, e.g. I prefer `int i = 3;` over `var i = 3;`
null
CC BY-SA 2.5
null
2008-09-03T12:13:43.380
2008-09-03T12:13:43.380
null
null
4,388
null
41,525
1
41,549
null
1
591
If not, what are the significant differences? --- Daren Thomas asks: > which ones?I use gvim on Windows and MacVim on the mac. Seem similar enough to be the same to me... By which ones, I'm guessing that you mean a specific implementation of vi and emacs for Windows. I'm not sure as I thought there were only on...
Do the vi and emacs implementations for Windows behave like their Unix counterparts?
CC BY-SA 3.0
null
2008-09-03T12:11:37.503
2012-05-26T00:56:11.330
2012-05-26T00:56:11.330
324,105
572
[ "windows", "emacs", "vi" ]
41,515
2
null
41,499
0
null
If I read the spec correctly the automatic `serialVersionUID` shouldn't change if you change the value of a static of transient field. Take a look at [Chapter 5.6](http://java.sun.com/javase/6/docs/platform/serialization/spec/version.html#6678) of the Spec. , if you think about this a bit - you start by serializing an...
null
CC BY-SA 2.5
null
2008-09-03T12:01:30.663
2008-09-03T12:01:30.663
null
null
3,379
null
41,536
2
null
41,513
3
null
I found some old questions here on SO that might be interesting for you: - [Whats a good standard code layout for a php application](https://stackoverflow.com/questions/5214/whats-a-good-standard-code-layout-for-a-php-application)- [Scalable and Flexible Directory Structure for Web Applications](http://phpimpact.wordp...
null
CC BY-SA 2.5
null
2008-09-03T12:16:24.853
2008-09-03T12:16:24.853
2017-05-23T10:29:27.657
-1
1,037
null
41,540
2
null
41,504
4
null
How much accuracy do you need? Dividing the longitude by 15 would almost be right :p
null
CC BY-SA 2.5
null
2008-09-03T12:18:26.347
2008-09-03T12:18:26.347
null
null
3,715
null
41,533
2
null
41,504
28
null
Take a look at [Geonames.org](http://www.geonames.org/) It's a free webservice that allow you to get a lot of informations from a long/lat [They also provide a free (and open source) Java Client for GeoNames Webservices library (library for other language also provided: ruby, python, perl, lisp...)](http://www.geonam...
null
CC BY-SA 2.5
null
2008-09-03T12:15:17.837
2008-09-03T13:04:55.457
2008-09-03T13:04:55.470
383
4,064
null
41,531
2
null
41,479
7
null
In your comparison between `IEnumerable<int>` and `IEnumerable<double>` you don't need to worry - if you pass the wrong type your code won't compile anyway. There's no concern about type-safety, as `var` is dynamic. It's just compiler magic and any type unsafe calls you make will get caught. `Var` is absolutely nee...
null
CC BY-SA 2.5
null
2008-09-03T12:13:33.020
2008-09-07T17:54:02.840
2008-09-07T17:54:02.840
905
905
null
41,539
2
null
41,513
0
null
I use Eclipse for creating J2EE web applications and this will create the following project structure: ``` WebAppName\ \lib \src \tests etc... ``` I would then create an SVN folder on our trunk called WebAppNameProject. Within this folder I would create folders called WebAppNameSource, Documentation ...
null
CC BY-SA 2.5
null
2008-09-03T12:17:31.780
2008-09-03T12:17:31.780
null
null
2,454
null