Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
1,034
2
null
1,033
11
null
Here's a nice free service with a public API: [http://www.hostip.info/use.html](http://www.hostip.info/use.html)
null
CC BY-SA 2.5
null
2008-08-04T05:21:59.660
2008-08-04T05:21:59.660
null
null
116
null
1,033
1
1,056
null
61
19,058
Does anyone know any simple way to retrieve the country from a given IP Address, preferably in ISO_3166-1 format?
How to get the Country according to a certain IP?
CC BY-SA 4.0
0
2008-08-04T05:15:35.773
2020-12-05T22:06:47.407
2020-07-14T06:49:23.287
10,325,630
87
[ "ip", "lookup", "country" ]
1,025
2
null
947
1
null
Well, based on the [documentation](http://msdn.microsoft.com/en-us/library/ms682411(VS.85).aspx) it looks like: 1. Security attributes (can pass null) 2. Whether it's initially owned (can pass false) 3. The name of it HTH
null
CC BY-SA 3.0
null
2008-08-04T04:48:40.697
2014-12-15T11:38:40.307
2014-12-15T11:38:40.307
4,095,830
77
null
1,026
2
null
1,024
9
null
This was caused by a change in rails 2.1 which prevents rails from loading views from any arbitrary path for security reasons. There is now an updated version of the plugin on github, so the solution is to use that. --- The old solution here for posterity To work around it, edit `init.rb` under your `vendor/plug...
null
CC BY-SA 2.5
null
2008-08-04T04:50:44.437
2008-10-07T20:15:02.867
2008-10-07T20:15:02.867
234
234
null
1,024
1
171,170
null
24
1,257
After upgrading a rails 1.2 website to 2.1, the [ExceptionNotifier plugin](http://agilewebdevelopment.com/plugins/exception_notifier) no longer works, complaining about this error: > ActionView::TemplateFinder::InvalidViewPath: Unprocessed view path found: "/path/to/appname/vendor/plugins/exception_notification/l...
How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1?
CC BY-SA 3.0
null
2008-08-04T04:48:38.013
2016-12-21T04:20:18.427
2016-12-21T04:20:18.427
2,912,665
234
[ "ruby-on-rails", "ruby", "exception", "plugins" ]
1,037
1
1,039
null
40
37,316
What is the best way to display `Flash` content in a WinForms application? I would like to create a user control (similar to the current `PictureBox`) that will be able to display images and flash content. It would be great to be able to load the flash content from a of sorts rather than a file on disk.
Displaying Flash content in a C# WinForms application
CC BY-SA 3.0
0
2008-08-04T05:35:52.240
2019-02-28T19:34:47.230
2013-03-22T09:28:21.557
725,306
231
[ "c#", "winforms", "flash", "adobe", "macromedia" ]
1,028
2
null
947
8
null
The VB code looks something like this: ``` hMutex = CreateMutex(ByVal 0&, 1, ByVal 0&) ``` The first parameter is a pointer to an `SECURITY_ATTRIBUTES` structure. If you don't know what it is, you don't need it. Pass NULL (0). The second parameter is `TRUE` (non-zero, or 1) if the calling thread should take ownersh...
null
CC BY-SA 3.0
null
2008-08-04T04:58:40.300
2013-02-07T13:22:14.680
2013-02-07T13:22:14.680
395,659
null
null
1,040
1
1,044
null
58
54,642
I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although I'm not sure how to do this in C#) then close that process before being able to complete the file delete using `File....
How do I delete a file which is locked by another process in C#?
CC BY-SA 2.5
0
2008-08-04T05:45:22.080
2023-01-06T19:40:55.153
2011-08-20T23:34:44.577
140,328
254
[ "c#", "file-locking" ]
1,041
1
17,198,991
null
29
2,659
I'm looking for a robust, easy-to-use, regular expression evaluator for native C++, either platform-independent or Windows-specific. Requirements: - - The main requirement is that it should be standalone and open.
Easy-to-Use Regular Expression Support in C++?
CC BY-SA 3.0
0
2008-08-04T05:50:00.337
2018-03-31T23:16:21.967
2011-12-02T18:01:27.820
396,458
null
[ "c++", "regex" ]
1,023
2
null
835
6
null
The CCNetArtifactDirectory is passed to the MSBuild by default, so you dont need to worry about it. MSBuild will place the build output in the "bin location" relevant to the working directory that you have specified. ``` <executable>c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable> <workingDirectory>C:\...
null
CC BY-SA 3.0
null
2008-08-04T04:45:12.497
2012-11-09T07:41:11.077
2012-11-09T07:41:11.077
1,741,868
231
null
1,042
1
1,061
null
26
9,244
For instance, my query is like the following using SQL Server 2005: ``` SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') ``` I have a full text index defined to use the column SearchField which returns results when using: ``` SELECT * FROM Table WHERE SearchField LIKE '%c#%' ``` I believe # is a special lett...
Why doesn't SQL Full Text Indexing return results for words containing #?
CC BY-SA 2.5
0
2008-08-04T05:51:56.683
2014-11-25T20:40:10.517
2014-11-25T20:40:10.517
2,641,576
2
[ "sql", "sql-server", "sql-server-2005", "indexing", "full-text-search" ]
1,044
2
null
1,040
37
null
Killing other processes is not a healthy thing to do. If your scenario involves something like uninstallation, you could use the [MoveFileEx API function](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa) to mark the file for deletion upon next reboot. If it appears that you really ne...
null
CC BY-SA 4.0
null
2008-08-04T06:01:52.873
2019-12-18T11:36:15.993
2019-12-18T11:36:15.993
5,407,188
227
null
1,049
2
null
1,040
8
null
If you want to do it programmatically. I'm not sure... and I'd really recommend against it. If you're just troubleshooting stuff on your own machine, [SysInternals Process Explorer](https://learn.microsoft.com/en-gb/sysinternals/downloads/process-explorer) can help you Run it, use the Find Handle command (I think it's...
null
CC BY-SA 4.0
null
2008-08-04T06:12:11.447
2019-12-18T11:53:43.903
2019-12-18T11:53:43.903
806,202
234
null
1,050
2
null
1,040
3
null
Oh, one big hack I employed years ago, is that Windows won't let you files, but it does let you them. Pseudo-sort-of-code: ``` mv %WINDIR%\System32\mfc42.dll %WINDIR\System32\mfc42.dll.old Install new mfc42.dll Tell user to save work and restart applications ``` When the applications restarted (note we didn't nee...
null
CC BY-SA 2.5
null
2008-08-04T06:14:42.690
2010-09-20T20:52:11.073
2010-09-20T20:52:11.073
234
234
null
1,039
2
null
1,037
34
null
While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the tab to get a list in which you can find the Once added to the toolbox, simply use the control as ...
null
CC BY-SA 2.5
null
2008-08-04T05:44:45.887
2008-08-04T06:59:42.397
2008-08-04T06:59:42.397
46
46
null
1,055
2
null
1,041
12
null
try [libpcre](http://www.pcre.org/) If you're stuck on windows they have a windows port which should work. I know [e-texteditor](http://e-texteditor.com) uses it, so at least that's proof it works :-)
null
CC BY-SA 2.5
null
2008-08-04T06:23:51.847
2008-09-20T07:27:23.973
null
null
234
null
1,056
2
null
1,033
38
null
A lot of people (including my company) seem to use MaxMind GeoIP. They have a free version [GeoLite](http://dev.maxmind.com/geoip/geoip2/geolite2/) which is not as accurate as the paid version, but if you're just after something simple, it may be good enough.
null
CC BY-SA 3.0
null
2008-08-04T06:26:22.370
2014-10-08T00:17:40.193
2014-10-08T00:17:40.193
234
234
null
1,047
2
null
1,042
1
null
Quoting a much-replicated help page about Indexing Service query language: > To use specially treated characters such as &, |, ^, #, @, $, (, ), in a query, enclose your query in quotation marks (“). As far as I know, full text search in `MSSQL` is also done by the Indexing Service, so this might help.
null
CC BY-SA 3.0
null
2008-08-04T06:10:16.600
2013-02-07T13:16:49.563
2013-02-07T13:16:49.563
395,659
227
null
1,062
2
null
1,041
7
null
The GNU C Library supports [regular expressions](http://www.gnu.org/software/libtool/manual/libc/Regular-Expressions.html). It's open, and the RE code seems to be easily extractable.
null
CC BY-SA 2.5
null
2008-08-04T06:41:29.547
2008-09-20T07:27:23.973
null
null
116
null
1,051
2
null
1,040
16
null
The typical method is as follows. You've said you want to do this in C# so here goes... 1. If you don't know which process has the file locked, you'll need to examine each process's handle list, and query each handle to determine if it identifies the locked file. Doing this in C# will likely require P/Invoke or an in...
null
CC BY-SA 3.0
null
2008-08-04T06:15:30.363
2017-08-31T22:41:04.987
2017-08-31T22:41:04.987
63,550
null
null
1,061
2
null
1,042
14
null
The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists. Tested it locally after doing that and rebuilding the indexes and I get results! Looking at using a different word breaker language on the indexed column, so that those special c...
null
CC BY-SA 2.5
null
2008-08-04T06:39:40.003
2008-08-04T07:06:45.380
2008-08-04T07:06:45.393
1
3
null
1,064
1
1,096
null
19
1,873
I'd like to display 100 floating cubes using `DirectX` or `OpenGL`. I'm looking for either some sample source code, or a description of the technique. I have trouble getting more one cube to display correctly. I've combed the net for a good series of tutorials and although they talk about how to do `3D` primitives, ...
Displaying 100 Floating Cubes Using DirectX OR OpenGL
CC BY-SA 3.0
null
2008-08-04T06:51:20.323
2022-08-18T22:23:22.073
2018-04-04T19:18:48.127
1,753,960
null
[ "language-agnostic", "opengl", "3d", "directx" ]
1,065
2
null
1,005
35
null
In general, you can't change the effective user id of the vi process, but you can do this: ``` :w !sudo tee myfile ```
null
CC BY-SA 2.5
null
2008-08-04T06:52:32.270
2008-08-04T06:52:32.270
null
null
116
null
1,053
1
394,225
null
22
2,141
Most mathematicians agree that: > e + 1 = 0 However, most floating point implementations disagree. How well can we settle this dispute? I'm keen to hear about different languages and implementations, and various methods to make the result as close to zero as possible. Be creative!
A little diversion into floating point (im)precision, part 1
CC BY-SA 3.0
0
2008-08-04T06:21:38.293
2017-05-06T03:07:58.910
2013-02-07T13:16:17.757
395,659
13
[ "math", "language-agnostic", "floating-point" ]
1,070
1
1,773
null
28
21,808
What is the correct way to get the process size on `Solaris, HP-UX` and `AIX`? Should we use `top` or `ps -o vsz` or something else?
Process size on UNIX
CC BY-SA 3.0
0
2008-08-04T07:34:44.137
2018-02-09T15:19:06.037
2013-02-07T13:11:32.953
395,659
236
[ "unix", "size" ]
1,043
2
null
1,040
5
null
You can use this program, [Handle](https://learn.microsoft.com/en-gb/sysinternals/downloads/handle), to find which process has the lock on your file. It's a command-line tool, so I guess you use the output from that. I'm not sure about finding it programmatically. If deleting the file can wait, you could specify it fo...
null
CC BY-SA 4.0
null
2008-08-04T05:59:53.000
2019-12-18T11:55:00.000
2019-12-18T11:55:00.000
806,202
55
null
1,066
2
null
1,037
8
null
[Sven](https://stackoverflow.com/users/46/sven), you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The [F-IN-BOX](https://www.f-in-box.com/dotnet/), although just a...
null
CC BY-SA 4.0
null
2008-08-04T07:12:57.237
2019-02-28T19:34:47.230
2019-02-28T19:34:47.230
1,480,104
231
null
1,057
2
null
1,053
7
null
Is it possible to settle this dispute? My first thought is to look to a symbolic language, like [Maple](http://en.wikipedia.org/wiki/Maple_(software)). I don't think that counts as floating point though. In fact, how does one represent (or for the engineers) in a conventional programming language? Perhaps a better...
null
CC BY-SA 2.5
null
2008-08-04T06:29:03.910
2010-01-05T14:00:22.227
2010-01-05T14:00:22.227
13
55
null
1,072
2
null
1,069
1
null
You tried old builds, but is there a reason you can't keep going further back in the repository history and seeing exactly when the bug was introduced? Otherwise, I would suggest adding simple logging of some kind to help track down the problem, though I am at a loss of what specifically you might want to log. If you...
null
CC BY-SA 2.5
null
2008-08-04T07:48:51.440
2008-08-04T07:48:51.440
null
null
122
null
1,071
2
null
264
3
null
What I did when working against a database of unknown performance was to measure turnaround time on my queries. I kept upping the thread count until turn-around time dropped, and dropping the thread count until turn-around time improved (well, it was processes in my environment, but whatever). There were moving ave...
null
CC BY-SA 3.0
null
2008-08-04T07:45:38.717
2011-09-09T09:53:02.267
2011-09-09T09:53:02.267
213,550
257
null
1,073
2
null
1,069
29
null
My first choice would be a dedicated heap tool such as [pageheap.exe](https://support.microsoft.com/en-us/kb/286470). Rewriting new and delete might be useful, but that doesn't catch the allocs committed by lower-level code. If this is what you want, better to Detour the `low-level alloc API`s using Microsoft Detours....
null
CC BY-SA 3.0
null
2008-08-04T07:51:02.997
2015-09-01T17:32:32.120
2015-09-01T17:32:32.120
45,459
null
null
1,082
2
null
1,070
4
null
Yes, you are right to lock at the VSZ. `ps u` will give you the VSZ and RSS, which are the virtual memory size and resident set size. The RSS is how much physical memory has been allocated to the process, and the VSZ is the virtual memory size of the process. If you have several copies of a program running, a lot of...
null
CC BY-SA 3.0
null
2008-08-04T08:21:07.570
2016-06-15T07:59:03.733
2016-06-15T07:59:03.733
126,039
116
null
1,083
1
42,406
null
29
3,981
I was wondering if there is any good and clean object-oriented programming (OOP) implementation of Bayesian filtering for spam and text classification? This is just for learning purposes.
Object Oriented Bayesian Spam Filtering?
CC BY-SA 3.0
0
2008-08-04T08:21:42.043
2019-04-10T21:36:19.703
2019-04-10T21:36:19.703
570,918
260
[ "oop", "artificial-intelligence", "naivebayes", "email-spam" ]
1,074
2
null
1,010
13
null
Rex, I suspect a good place to start looking is solutions that -- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be. - [Scott Hanselman on ViewState Compression](http://www.hanselman.com/blog/CommentView,guid,febce059-7e7c-439e-af3d-c53d2...
null
CC BY-SA 2.5
null
2008-08-04T08:04:41.737
2008-08-04T08:04:41.737
null
null
1
null
1,077
2
null
761
2
null
The trouble with international standards is that pretty much noone uses them. I try where I can, but I am forced to use dd/mm/yyyy almost everywhere in real life, which means I am so used to it it's always a conscious process to use ISO-8601. For the majority of people who don't even try to use ISO-8601 it's even worse...
null
CC BY-SA 2.5
null
2008-08-04T08:14:56.973
2008-08-04T08:14:56.973
null
null
214
null
1,086
2
null
1,069
1
null
My first action would be as follows: 1. Build the binaries in "Release" version but creating debug info file (you will find this possibility in project settings). 2. Use Dr Watson as a defualt debugger (DrWtsn32 -I) on a machine on which you want to reproduce the problem. 3. Repdroduce the problem. Dr Watson will pro...
null
CC BY-SA 2.5
null
2008-08-04T08:26:55.967
2008-08-04T08:26:55.967
null
null
2,090,742
null
1,090
2
null
1,083
5
null
Maybe [https://ci-bayes.dev.java.net/](https://ci-bayes.dev.java.net/) or [http://www.cs.cmu.edu/~javabayes/Home/node2.html](http://www.cs.cmu.edu/~javabayes/Home/node2.html)? I never played with it either.
null
CC BY-SA 3.0
null
2008-08-04T08:54:16.393
2013-02-07T13:10:37.743
2013-02-07T13:10:37.743
395,659
86
null
1,092
2
null
1,064
7
null
Just use glTranslatef (or the DirectX equivalent) to draw a cube using the same code, but moving the relative point where you draw it. Maybe there's a better way to do it though, I'm fairly new to OpenGL. Be sure to set your viewpoint so you can see them all.
null
CC BY-SA 2.5
null
2008-08-04T09:04:01.867
2008-09-20T07:28:52.020
null
null
61
null
1,095
2
null
1,083
3
null
Here is an implementation of Bayesian filtering in C#: [A Naive Bayesian Spam Filter for C#](http://www.codeproject.com/KB/recipes/BayesianCS.aspx) (hosted on CodeProject).
null
CC BY-SA 2.5
null
2008-08-04T09:08:32.217
2008-08-04T09:08:32.217
null
null
51
null
1,093
2
null
1,010
4
null
See this [blog post](http://aspguy.wordpress.com/2008/07/09/reducing-the-page-size-by-storing-viewstate-on-server/) where the author describes a method for overriding the default behavior for generating the ViewState and instead shows how to save it on the server Session object. > In ASP.NET 2.0, ViewState is saved by...
null
CC BY-SA 2.5
null
2008-08-04T09:04:17.997
2008-08-04T09:04:17.997
null
null
51
null
1,104
1
1,109
null
31
2,927
Exceptions in C++ don't need to be caught (no compile time errors) by the calling function. So it's up to developer's judgment whether to catch them using try/catch (unlike in Java). Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?
Ensuring that Exceptions are always caught
CC BY-SA 4.0
0
2008-08-04T10:01:37.927
2018-07-29T18:55:14.757
2018-07-29T18:55:14.757
1,033,581
236
[ "c++", "exception", "try-catch" ]
1,108
1
1,130
null
2,846
1,081,705
Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level? For information on queries to index a field, check out [How do I index a database column](https://stackoverflow.com/questions/1156/).
How does database indexing work?
CC BY-SA 4.0
0
2008-08-04T10:07:12.673
2022-03-08T15:42:31.467
2018-07-24T11:59:17.647
209,139
264
[ "sql", "database", "performance", "indexing", "database-indexes" ]
1,109
2
null
1,104
26
null
No. See [A Pragmatic Look at Exception Specifications](http://www.gotw.ca/publications/mill22.htm) for reasons why not. The only way you can "help" this is to document the exceptions your function can throw, say as a comment in the header file declaring it. This is not enforced by the compiler or anything. Use code ...
null
CC BY-SA 3.0
null
2008-08-04T10:10:15.727
2013-02-07T13:07:37.790
2013-02-07T13:07:37.790
395,659
13
null
1,096
2
null
1,064
8
null
You say you have enough trouble getting one cube to display... so I am not sure if you have got one to display or not. Basically... put your code for writing a cube in one function, then just call that function 100 times. ``` void DrawCube() { //code to draw the cube } void DisplayCubes() { for(int i = 0; i ...
null
CC BY-SA 2.5
null
2008-08-04T09:12:37.543
2008-09-20T07:28:52.020
2008-08-05T11:54:57.573
41
41
null
1,114
2
null
944
5
null
is an , not a global exception handler. This means, by the time it is raised, your application is already on its way down the drain, and there is nothing you can do about it, except for doing cleanup and error logging. What happened behind the scenes is this: The framework detected the exception, walked up the call s...
null
CC BY-SA 4.0
null
2008-08-04T10:20:01.260
2020-03-18T11:22:54.777
2020-03-18T11:22:54.777
1,442,180
227
null
1,123
2
null
855
4
null
Follow [this simple 5 step article](http://saftsack.fs.uni-bayreuth.de/~dun3/archives/integrate-xml-code-comments-into-visual-studio-20052008-using-sandcastle-and-html-help-20/150.html) and you are pretty much done. As a bonus you can use [H2Viewer](http://www.helpware.net/mshelp2/h2viewer.htm) to view Html Help 2.x fi...
null
CC BY-SA 2.5
null
2008-08-04T10:31:33.220
2008-08-04T10:31:33.220
null
null
39
null
1,120
2
null
855
5
null
I've just set up Sandcastle again. Try installing it (the May 2008 release) and search for SandcastleGui.exe or something similar (it's in the examples folder or so). Click Add Assembly and add your Assembly or Assemblies, add any .xml Documentation files (the ones generated by the compiler if you enabled that option)...
null
CC BY-SA 2.5
null
2008-08-04T10:27:05.270
2013-02-07T17:31:19.500
2013-02-07T17:31:19.500
237,838
91
null
1,135
2
null
1,131
14
null
HTML would be the next best choice, ONLY IF you would serve them from a public web server. If you tried to bundle it with your app, all the files (and images (and stylesheets (and ...) ) ) would make CHM look like a gift from gods. That said, when actually bundled in the installation package, (instead of being served ...
null
CC BY-SA 2.5
null
2008-08-04T10:51:39.560
2008-08-04T10:51:39.560
null
null
227
null
1,136
2
null
1,131
3
null
Is the question how to generate your own help files, or what is the best help file format? Personally, I find CHM to be excellent. One of the first things I do when setting up a machine is to download the PHP Manual in CHM format ([http://www.php.net/download-docs.php](http://www.php.net/download-docs.php)) and add a...
null
CC BY-SA 2.5
null
2008-08-04T10:52:26.173
2008-12-25T01:16:43.563
null
null
40
null
1,131
1
1,135
null
39
5,032
Back in the old days, Help was not trivial but possible: generate some funky .rtf file with special tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well. Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they actually ax...
Windows Help files - what are the options?
CC BY-SA 3.0
0
2008-08-04T10:43:05.707
2014-01-16T17:01:50.547
2013-01-09T05:45:27.583
1,471,203
91
[ "windows", "language-agnostic", "chm", "winhelp" ]
1,142
2
null
1,083
1
null
In French, but you should be able to find the download link :) [PHP Naive Bayesian Filter](http://xhtml.net/scripts/PHPNaiveBayesianFilter)
null
CC BY-SA 2.5
null
2008-08-04T11:03:51.437
2008-08-04T11:03:51.437
null
null
268
null
1,141
2
null
1,131
3
null
Our software is both distributed locally to the clients and served from a network share. We opted for generating both a CHM file and a set of HTML files for serving from the network. Users starting the program locally use the CHM file, and users getting their program served from a network share has to use the HTML file...
null
CC BY-SA 2.5
null
2008-08-04T11:02:12.097
2008-08-04T11:07:08.153
2008-08-04T11:07:08.153
267
267
null
1,054
2
null
1,053
10
null
Here's a short list of implementations and languages I've tried. It's sorted by closeness to zero: - `(+ 1 (make-polar 1 (atan 0 -1)))`- `0.0+1.2246063538223773e-16i`- `0.0+1.22460635382238e-16i`- `0.0+1.22464679914735e-16i``numbers`- `0.0+1.2246467991473532e-16i`- `0.0+1.2246467991473533e-16i`- `(1+ (exp (complex 0 p...
null
CC BY-SA 2.5
null
2008-08-04T06:22:18.713
2008-08-25T00:36:45.890
2008-08-25T00:36:45.890
13
13
null
1,149
2
null
1,145
6
null
Just a shot in the dark because I haven't tried it yet but when you realloc it returns the pointer much like malloc. Because realloc can move the pointer if needed you are most likely operating on an invalid pointer if you don't do the following: ``` input = realloc(input, strlen(input) + delta); ```
null
CC BY-SA 2.5
null
2008-08-04T11:14:48.827
2008-08-04T11:14:48.827
null
null
200
null
1,069
1
1,073
null
64
38,457
I'm working on a C++ application that is corrupting the heap. The usual tools to locate this corruption seem to be inapplicable. Old builds (18 months old) of the source code exhibit the same behaviour as the most recent release, so this has been around for a long time and just wasn't noticed; on the downside, sourc...
Heap corruption under Win32; how to locate?
CC BY-SA 3.0
0
2008-08-04T07:30:01.727
2015-09-01T17:32:32.120
2012-09-16T10:09:41.643
1,561,378
257
[ "c++", "windows", "multithreading", "debugging", "memory" ]
1,155
2
null
1,145
0
null
My quick hints. Instead of: `void strrep(char *input, char *search, char *replace)` try: `void strrep(char *&input, char *search, char *replace)` and than in the body: `input = realloc(input, strlen(input) + delta);` Generally read about passing function arguments as values/reference and realloc() description :).
null
CC BY-SA 2.5
null
2008-08-04T11:20:58.657
2008-08-04T11:20:58.657
null
null
2,090,742
null
1,157
2
null
1,156
70
null
The following is SQL92 standard so should be supported by the majority of RDMBS that use SQL: ``` CREATE INDEX [index name] ON [table name] ( [column name] ) ```
null
CC BY-SA 2.5
null
2008-08-04T11:25:14.017
2008-08-04T12:34:51.723
2008-08-04T12:34:51.723
200
200
null
1,156
1
1,157
null
66
49,023
Hopefully, I can get answers for each database server. For an outline of how indexing works check out: [How does database indexing work?](https://stackoverflow.com/questions/1108/how-does-database-indexing-work)
How do I index a database column
CC BY-SA 3.0
0
2008-08-04T11:21:26.567
2019-08-07T19:09:29.887
2017-05-23T11:55:03.917
-1
264
[ "sql", "database", "indexing" ]
1,154
2
null
1,145
15
null
As a general rule, you should do a free or realloc on a user provided buffer. You don't know where the user allocated the space (in your module, in another DLL) so you cannot use any of the allocation functions on a user buffer. Provided that you now cannot do any reallocation within your function, you should change ...
null
CC BY-SA 3.0
null
2008-08-04T11:19:54.447
2016-11-22T20:52:00.350
2016-11-22T20:52:00.350
4,332,828
268
null
1,164
2
null
1,160
3
null
I am currently "manually" doing it through a prebuild-exec Task, using my [cmdnetsvnrev](http://www.stum.de/various-tools/cmdtools/) tool, but if someone knows a better ccnet-integrated way of doing it, i'd be happy to hear :-)
null
CC BY-SA 2.5
null
2008-08-04T11:41:37.133
2008-08-04T11:41:37.133
null
null
91
null
1,160
1
975,299
null
42
18,935
I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code. I would like to use the latest revision number to generate `AssemblyInfo.cs` while compiling. How can I retrieve the latest revision from subversion ...
Use SVN Revision to label build in CCNET
CC BY-SA 3.0
0
2008-08-04T11:37:24.863
2017-12-22T18:59:19.380
2017-12-22T18:59:19.380
2,384,186
120
[ "svn", "msbuild", "cruisecontrol.net" ]
1,153
2
null
1,145
4
null
Well, though it has been a while since I used C/C++, realloc that grows only reuses the memory pointer value if there is room in memory after your original block. For instance, consider this: (xxxxxxxxxx..........) If your pointer points to the first x, and . means free memory location, and you grow the memory siz...
null
CC BY-SA 2.5
null
2008-08-04T11:17:32.330
2008-08-04T11:17:32.330
null
null
267
null
1,168
2
null
1,160
4
null
I found [this](http://code.google.com/p/svnrevisionlabeller) project on google code. This is `CCNET` plugin to generate the label in `CCNET`. The `DLL` is tested with `CCNET 1.3` but it works with `CCNET 1.4` for me. I'm successfully using this plugin to label my build. Now onto passing it to `MSBuild`...
null
CC BY-SA 3.0
null
2008-08-04T11:51:59.297
2013-04-25T12:49:09.833
2013-04-25T12:49:09.833
960,778
120
null
1,172
2
null
1,160
4
null
If you prefer doing it on the `MSBuild` side over the `CCNet` config, looks like the `MSBuild` Community Tasks extension's [SvnVersion](http://msbuildtasks.tigris.org/) task might do the trick.
null
CC BY-SA 3.0
null
2008-08-04T12:03:03.487
2013-04-25T13:00:54.587
2013-04-25T13:00:54.587
960,778
266
null
1,163
2
null
1,145
3
null
This seems to work; ``` char *strrep(char *string, const char *search, const char *replace) { char *p = strstr(string, search); if (p) { int occurrence = p - string; int stringlength = strlen(string); int searchlength = strlen(search); int replacelength = strlen(replace); ...
null
CC BY-SA 2.5
null
2008-08-04T11:39:47.853
2008-08-04T11:45:15.457
2008-08-04T11:45:15.457
263
263
null
1,145
1
1,154
null
19
8,800
I've tried to write a string replace function in C, which works on a `char *`, which has been allocated using `malloc()`. It's a little different in that it will find and replace strings, rather than characters in the starting string. It's trivial to do if the search and replace strings are the same length (or the re...
Why am I getting a double free or corruption error with realloc()?
CC BY-SA 4.0
0
2008-08-04T11:06:00.560
2020-01-24T05:46:37.173
2020-01-24T05:46:37.173
null
188
[ "c", "malloc" ]
1,175
2
null
1,131
2
null
If you are doing "just extract and run", you are going to run in security issues. This is especially true if you are users are running Vista (or later). is there a reason why you wanted to avoid packaging your applications inside an installer? Using an installer would alleviate the "external source" problem. You wo...
null
CC BY-SA 2.5
null
2008-08-04T12:11:47.900
2008-08-04T12:11:47.900
null
null
206
null
1,185
2
null
1,180
2
null
The trick to that is to use URL rewriting so that transparently maps to something like on your server. Once you start down that path, it's fairly trivial to implement.
null
CC BY-SA 2.5
null
2008-08-04T12:28:03.467
2008-08-04T12:28:03.467
null
null
60
null
1,171
1
28,705
null
73
30,966
I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of , way of doing this? A dict of dicts is more flexible and simpler to implement, but I intuitively expect a list of lists to...
What is the most efficient graph data structure in Python?
CC BY-SA 3.0
0
2008-08-04T12:00:57.297
2017-03-22T17:42:28.463
2017-03-22T17:42:28.463
1,571,709
280
[ "python", "performance", "data-structures", "graph-theory" ]
1,180
1
1,232
null
25
5,805
I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is `customusername.seework.com`. What is required on the `DNS` end to allow these to be created dynamically and be available instantly. And how do you recommend dealing with this in the logic of the site? `Hta...
How to make subdomain user accounts in a webapp
CC BY-SA 3.0
0
2008-08-04T12:22:07.910
2017-12-28T05:40:57.633
2015-04-17T22:27:31.760
1,571,407
281
[ "web-applications", "dns", "subdomain", "account" ]
1,169
2
null
1,160
14
null
You have basically two options. Either you write a simple script that will start and parse output from to obtain revision number (then generating AssemblyInfo.cs is pretty much straight forward) or just use plugin for CCNET. Here it is: > is a plugin for CruiseControl.NET that allows you to generate CruiseCont...
null
CC BY-SA 3.0
null
2008-08-04T11:56:42.533
2016-02-07T00:39:57.380
2016-02-07T00:39:57.380
2,921,691
275
null
1,183
2
null
1,041
5
null
The GNU C library regular expressions facility (regcomp(), regexec() and friends) is broken. Use libetre instead; the function signatures match the ones provided by glibc. [http://laurikari.net/tre/](http://laurikari.net/tre/)
null
CC BY-SA 2.5
null
2008-08-04T12:23:35.067
2008-09-20T07:27:23.973
null
null
null
null
1,174
2
null
1,171
4
null
A dictionary may also contain overhead, depending on the actual implementation. A hashtable usually contain some prime number of available nodes to begin with, even though you might only use a couple of the nodes. Judging by your example, "Property", would you be better of with a class approach for the final level and...
null
CC BY-SA 2.5
null
2008-08-04T12:09:55.830
2008-08-04T12:09:55.830
null
null
267
null
1,191
2
null
1,171
2
null
Making a class-based structure would probably have more overhead than the dict-based structure, since in python classes actually use dicts when they are implemented.
null
CC BY-SA 2.5
null
2008-08-04T12:41:15.767
2008-08-04T12:41:15.767
null
null
188
null
1,189
1
1,190
null
16
3,353
One of the sites I maintain relies heavily on the use of `ViewState` (it isn't my code). However, on certain pages where the `ViewState` is extra-bloated, Safari throws a `"Validation of viewstate MAC failed"` error. This appears to only happen in Safari. Firefox, IE and Opera all load successfully in the same scenari...
ViewState invalid only in Safari
CC BY-SA 4.0
null
2008-08-04T12:38:21.263
2019-01-20T13:45:08.197
2019-01-20T13:45:08.197
567,854
258
[ "c#", ".net", "safari", "viewstate" ]
1,190
2
null
1,189
2
null
I've been doing a little research into this and whilst I'm not entirely sure its the cause I believe it is because Safari is not returning the full result set (hence cropping it). I have been in dicussion with another developer and found the following post on Channel 9 as well which recommends making use of the SQL St...
null
CC BY-SA 2.5
null
2008-08-04T12:40:49.137
2008-08-04T12:40:49.137
null
null
258
null
1,187
2
null
1,180
9
null
Your DNS record will be static, something like: ``` *.YOURDOMAIN.COM A 123.123.123.123 ``` Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains (current and future ones) into the same HTTP...
null
CC BY-SA 2.5
null
2008-08-04T12:32:24.143
2008-08-04T13:34:55.860
2008-08-04T13:34:55.860
275
275
null
1,229
1
null
null
17
29,600
I want to link to a specific slide in an online PowerPoint file, (e.g. `http://www.example.com/hello.ppt`) but what I want is that when people click on my link, it goes straight to the nth slide. Is this possible?
How do I hyperlink to a specific slide of a .ppt file?
CC BY-SA 3.0
0
2008-08-04T13:38:18.677
2019-11-06T12:29:00.257
2014-05-15T14:46:04.547
3,589,392
null
[ "hyperlink", "powerpoint" ]
1,216
2
null
1,160
3
null
> [http://www.codeproject.com/KB/dotnet/Customizing_csproj_files.aspx](http://www.codeproject.com/KB/dotnet/Customizing_csproj_files.aspx)Every time we create a new C# project, Visual Studio puts there the AssemblyInfo.cs file for us. The file defines the assembly meta-data like its version, configuration, o...
null
CC BY-SA 2.5
null
2008-08-04T13:22:31.640
2008-08-04T13:22:31.640
null
null
120
null
1,202
2
null
1,189
3
null
My first port of call would be to go through the elements on the page and see which controls: 1. Will still work when I switch ViewState off 2. Can be moved out of the page and into an AJAX call to be loaded when required Failing that, and here's the disclaimer - I've never used this solution on a web-facing site ...
null
CC BY-SA 2.5
null
2008-08-04T13:00:32.043
2008-08-04T13:00:32.043
null
null
192
null
1,226
2
null
336
8
null
C and C++ compilers will generate a warning when you compare signed and unsigned types; in your example code, you couldn't make your loop variable unsigned and have the compiler generate code without warnings (assuming said warnings were turned on). Naturally, you're compiling with warnings turned all the way up, righ...
null
CC BY-SA 2.5
null
2008-08-04T13:35:41.273
2008-08-04T13:35:41.273
null
null
257
null
1,232
2
null
1,180
15
null
The way we do this is to have a 'catch all' for our domain name registered in DNS so that anything.ourdomain.com will point to our server. With Apache you can set up a similar catch-all for your vhosts. The ServerName must be a single static name but the ServerAlias directive can contain a pattern. ``` Servername ww...
null
CC BY-SA 3.0
null
2008-08-04T13:39:39.423
2016-02-07T00:39:09.847
2016-02-07T00:39:09.847
2,921,691
48
null
1,240
2
null
1,237
63
null
``` \[start\](.*?)\[end\] ``` Zhich'll put the text in the middle within a capture.
null
CC BY-SA 3.0
null
2008-08-04T13:52:06.043
2017-09-18T13:36:20.380
2017-09-18T13:36:20.380
5,558,072
34
null
1,236
2
null
1,189
5
null
While I second the Channel 9 solution, also be aware that in some hosted environments Safari is not considered an up-level browser. You may need to add it to your application's browscap in order to make use of some ASP.Net features. That was the root cause of some headaches we had for a client's site that used the AS...
null
CC BY-SA 2.5
null
2008-08-04T13:44:49.473
2008-08-04T18:46:15.170
2008-08-04T18:46:15.170
149
149
null
1,238
2
null
1,131
3
null
If you don't want to use an installer and you don't want the user to perform any extra steps to allow CHM files over the network, why not fall back to WinHelp? Vista does not include WinHlp32.exe out of the box, but it is [freely available as a download](http://support.microsoft.com/kb/917607) for both Vista and Serve...
null
CC BY-SA 2.5
null
2008-08-04T13:48:02.993
2008-08-04T13:48:02.993
null
null
206
null
1,237
1
1,243
null
48
86,420
I have a file in the following format: I'd like to grab the `Data I want` from between the `[Start]` and `[End]` tags using a Regex. Can anyone show me how this might be done?
Regex: To pull out a sub-string between two tags in a string
CC BY-SA 3.0
0
2008-08-04T13:47:10.547
2017-09-18T13:36:20.380
2017-09-14T07:01:09.220
4,003,227
230
[ "regex", "parsing" ]
1,242
2
null
1,229
16
null
Link to [http://www.whatever.com/hello.ppt](http://www.whatever.com/hello.ppt) for slide 4 to be opened initially. Take a look at this site: [http://www.tinyempire.com/shortnotes/files/specific_slide_in_ppt.htm](http://www.tinyempire.com/shortnotes/files/specific_slide_in_ppt.htm)
null
CC BY-SA 3.0
null
2008-08-04T13:54:01.687
2017-05-30T18:19:39.890
2017-05-30T18:19:39.890
7,128,034
39
null
1,243
2
null
1,237
23
null
``` \[start\]\s*(((?!\[start\]|\[end\]).)+)\s*\[end\] ``` This should hopefully drop the `[start]` and `[end]` markers as well.
null
CC BY-SA 3.0
null
2008-08-04T13:55:05.647
2017-09-18T13:35:58.960
2017-09-18T13:35:58.960
5,558,072
264
null
1,235
2
null
1,160
4
null
I have written a NAnt build file that handles parsing SVN information and creating properties. I then use those property values for a variety of build tasks, including setting the label on the build. I use this target combined with the SVN Revision Labeller mentioned by lubos hasko with great results. ``` <target name...
null
CC BY-SA 2.5
null
2008-08-04T13:43:54.530
2008-08-04T13:43:54.530
null
null
173
null
1,252
2
null
1,237
1
null
With Perl you can surround the data you want with ()'s and pull it out later, perhaps other languages have a similar feature. ``` if ($s_output =~ /(data data data data START(data data data)END (data data)/) { $dataAllOfIt = $1; # 1 full string $dataInMiddle = $2; # 2 Middle Data $dataAtEnd = $3;...
null
CC BY-SA 2.5
null
2008-08-04T14:00:04.373
2008-10-12T12:21:25.257
2008-10-12T12:21:25.257
2,766,176
30
null
1,241
1
1,275
null
27
2,882
I have a client-server app where the client is on a Windows Mobile 6 device, written in C++ and the server is on full Windows and written in C#. Originally, I only needed it to send messages from the client to the server, with the server only ever sending back an acknowledgement that it received the message. Now, I ...
Asynchronous multi-direction server-client communication over the same open socket?
CC BY-SA 4.0
null
2008-08-04T13:52:25.090
2019-01-20T13:44:54.173
2019-01-20T13:44:54.173
567,854
194
[ "c#", "c++", "sockets" ]
1,263
2
null
104
8
null
All memory leaks are resolved by program termination. Leak enough memory and the Operating System may decide to resolve the problem on your behalf.
null
CC BY-SA 2.5
null
2008-08-04T14:09:47.117
2008-08-04T14:09:47.117
null
null
257
null
1,248
2
null
11
1,070
null
Jeff, [your code](https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time/12#12) is nice but could be clearer with constants (as suggested in Code Complete). ``` const int SECOND = 1; const int MINUTE = 60 * SECOND; const int HOUR = 60 * MINUTE; const int DAY = 24 * HOUR; const int MONTH = 30 * DAY; v...
null
CC BY-SA 3.0
null
2008-08-04T13:57:26.097
2016-03-20T02:29:12.153
2017-05-23T12:10:45.147
-1
268
null
1,260
2
null
1,229
1
null
I found the answer. all you have to do is add #n after .ppt. For example, [http://www.whatever.com/hello.ppt#4](http://www.whatever.com/hello.ppt#4) will take you straight to the 4th slide.
null
CC BY-SA 3.0
null
2008-08-04T14:06:02.863
2016-12-20T08:38:48.867
2016-12-20T08:38:48.867
1,221,571
null
null
1,257
2
null
1,033
6
null
I don't know how accurate [http://hostip.info](http://hostip.info) site is. I just visited that site, and it reported that my country is Canada. I'm in the US and the ISP that my office uses only operates from the US. It does allow you to correct its guess, but if you are using this service to track web site visitors...
null
CC BY-SA 4.0
null
2008-08-04T14:02:14.493
2020-07-14T05:30:20.933
2020-07-14T05:30:20.933
10,325,630
206
null
1,261
1
1,272
null
66
41,875
My company is using CVS as our de-facto standard for source control. However, I've heard a lot of people say that SVN is better. I know SVN is newer, but other than that, I'm unfamiliar with its benefits. What I'm looking for is a good, succinct comparison of the two systems, noting any advantages or disadvantages of...
What are the advantages of using SVN over CVS?
CC BY-SA 3.0
0
2008-08-04T14:06:48.540
2020-10-08T18:07:11.757
2013-04-11T20:22:47.693
1,454,806
292
[ "svn", "version-control", "cvs" ]
1,269
2
null
1,261
7
null
The Subversion book has [an appendix](http://svnbook.red-bean.com/en/1.4/svn.forcvs.html) that details important differences from CVS, which may help you make your decision. The two approaches are more or less the same idea but SVN was specifically designed to fix long standing flaws in CVS so, in theory at least, SVN...
null
CC BY-SA 2.5
null
2008-08-04T14:14:14.877
2008-08-04T14:14:14.877
null
null
48
null
1,278
2
null
1,261
15
null
SVN has 3 main advantages over CVS - - -
null
CC BY-SA 2.5
null
2008-08-04T14:35:12.277
2008-08-04T14:35:12.277
null
null
275
null
1,264
2
null
1,261
19
null
One of the many comparisons: [http://wiki.scummvm.org/index.php/CVS_vs_SVN](http://wiki.scummvm.org/index.php/CVS_vs_SVN) Now this is very specific to that project, but a lot of stuff apllies in general. Pro Subversion: > - - - - - - - - - -
null
CC BY-SA 2.5
null
2008-08-04T14:09:54.993
2008-08-04T14:09:54.993
null
null
91
null
1,272
2
null
1,261
66
null
CVS only tracks modification on a file-by-file basis, while SVN tracks a whole commit as a new revision, which means that it is easier to follow the history of your project. Add the fact that all modern source control software use the concept of revision so it is far easier to migrate from SVN than it is from CVS. Ther...
null
CC BY-SA 4.0
null
2008-08-04T14:17:59.080
2020-10-08T18:07:11.757
2020-10-08T18:07:11.757
268
268
null