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
36,109
1
42,005
null
3
5,235
The following shell script takes a list of arguments, turns Unix paths into WINE/Windows paths and invokes the given executable under WINE. ``` #! /bin/sh if [ "${1+set}" != "set" ] then echo "Usage; winewrap EXEC [ARGS...]" exit 1 fi EXEC="$1" shift ARGS="" for p in "$@"; do if [ -e "$p" ] then p=$(w...
Quoting command-line arguments in shell scripts
CC BY-SA 2.5
null
2008-08-30T16:39:42.913
2008-09-21T23:35:25.963
2008-09-03T16:26:13.147
1,412
1,412
[ "unix", "shell", "wine" ]
36,116
2
null
31,173
3
null
I wrote this a few days ago: [](http://www.appidx.com/ubiq/stackoverflow.html)[http://www.appidx.com/ubiq/stackoverflow.html](http://www.appidx.com/ubiq/stackoverflow.html) The execute portion refuses to run with POST data. The code is the right code, and I've tried with the native code of the function with the XUL c...
null
CC BY-SA 2.5
null
2008-08-30T16:44:20.737
2008-08-30T16:44:20.737
null
null
3,288
null
36,126
2
null
36,058
0
null
The popup window can be closed using the onClick html event as follows: ``` <%= submit_tag "Go!", {:onClick => "window.close()"} %> ```
null
CC BY-SA 2.5
null
2008-08-30T16:49:52.173
2008-08-30T16:49:52.173
null
null
3,764
null
36,124
2
null
35,017
1
null
I have been using Access for some time and in a variety of situations, including on-line. I have found that Access works well if it is properly set up according to the [guidelines](http://msdn.microsoft.com/en-us/library/aa167840.aspx). One advantage of Access is that it includes everything in one package: Forms, Query...
null
CC BY-SA 2.5
null
2008-08-30T16:47:01.463
2008-09-02T08:26:09.067
2008-09-02T08:26:09.067
2,548
2,548
null
36,128
2
null
36,122
2
null
Your question is a little ambiguous - are you looking to keep track of the first instances of every letter? If so, an array of length 26 might be the best option. Whenever you insert text into a string at a position lower than the index you have, just compute the offset based on the length of the inserted string.
null
CC BY-SA 2.5
null
2008-08-30T16:51:04.573
2008-08-30T16:51:04.573
null
null
658
null
36,138
2
null
36,127
1
null
You could trying using the MS-DOS [subst](http://www.computerhope.com/substhlp.htm) command to assign your source code directory to the D: drive.
null
CC BY-SA 2.5
null
2008-08-30T17:02:35.183
2008-08-30T17:02:35.183
null
null
863
null
36,133
2
null
36,114
1
null
I'm not sure I understand your question. In C any data that's not overwritten is carried over into the next iteration of the loop, and imagine that C++ works much the same way.
null
CC BY-SA 2.5
null
2008-08-30T16:59:39.967
2008-08-30T16:59:39.967
null
null
658
null
36,122
1
177,740
null
2
390
Take the following string as an example: "The quick brown fox" Right now the q in quick is at index 4 of the string (starting at 0) and the f in fox is at index 16. Now lets say the user enters some more text into this string. "The very quick dark brown fox" Now the q is at index 9 and the f is at index 26. Wh...
What is the most efficient way to keep track of a specific character's index in a string?
CC BY-SA 2.5
null
2008-08-30T16:45:44.633
2009-07-14T22:22:01.540
2009-07-14T22:22:01.540
23,354
3,677
[ "algorithm", "string", "optimization" ]
36,139
1
36,156
null
477
656,365
What is the best way of creating an alphabetically sorted list in Python?
How to sort a list of strings?
CC BY-SA 3.0
0
2008-08-30T17:03:09.350
2020-10-13T13:44:56.353
2017-04-25T19:27:47.903
355,230
3,205
[ "python", "string", "sorting" ]
36,143
2
null
36,139
40
null
``` list.sort() ``` It really is that simple :)
null
CC BY-SA 2.5
null
2008-08-30T17:04:40.093
2008-08-30T17:04:40.093
null
null
2,474
null
36,141
2
null
33,459
0
null
As an addition to dlamblin's answer it is often best to use the clickTAG technique to open URLS from a flash movie. More information can be found here: [http://www.adobe.com/resources/richmedia/tracking/designers_guide/](http://www.adobe.com/resources/richmedia/tracking/designers_guide/) The advantage of using the c...
null
CC BY-SA 2.5
null
2008-08-30T17:03:26.523
2008-08-30T17:03:26.523
null
null
1,970
null
36,152
1
36,165
null
2
836
I can't seem to find details on how to unsubscribe from ubiquity commands. The command list page only seems to have information about the installed commands and there are no links to deleting them. Am I missing something?
How do you unsubscribe from a ubiquity command
CC BY-SA 2.5
0
2008-08-30T17:09:16.823
2009-02-19T04:55:29.290
null
null
3,288
[ "ubiquity" ]
36,131
2
null
36,101
5
null
You have to use JavaScript for this: ``` <script type="text/javascript"> window.name = "MyWindow"; </script> ``` Of course you could easily package this up into a Rails helper method. For example, in `app/helpers/application_helper.rb` add a new method: ``` def window_name(name) content_for(:window_name) do ...
null
CC BY-SA 2.5
null
2008-08-30T16:55:17.993
2008-08-30T16:55:17.993
null
null
1,450
null
36,135
2
null
36,077
7
null
There's an excellent book written by John Robbins which tackles many difficult debugging questions. The book is called [Debugging Applications for Microsoft .NET and Microsoft Windows](https://rads.stackoverflow.com/amzn/click/com/0735615365). Despite the title, the book contains a host of information about debugging...
null
CC BY-SA 2.5
null
2008-08-30T17:00:19.590
2008-08-30T17:00:19.590
null
null
863
null
36,155
2
null
36,114
2
null
I'm not clear exactly what you're asking, but variables will maintain their value for each iteration of a loop, as long as they're declared outside of the loop itself. For example: ``` int a = 0; while(a < 10) { int b = 0; cout << "a: " << a << " b: " << b << "\n"; a++; b++; } ``` In the above, th...
null
CC BY-SA 2.5
null
2008-08-30T17:10:08.037
2008-08-30T17:10:08.037
null
null
1,739
null
36,165
2
null
36,152
2
null
Go to about:ubiquity in Firefox. Under the section "subscribed feeds" there should be an option to unsubscribe to command feeds you no longer desire. Also, if you clear your entire browser history, it will delete all command feeds (this will be fixed by 0.2)
null
CC BY-SA 2.5
null
2008-08-30T17:16:39.083
2008-08-30T17:16:39.083
null
null
2,933
null
36,144
1
null
null
6
5,303
I'm trying to open a new browser tab with the results of a POST request. I'm trying to do so using a function containing the following code: ``` var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interface s.nsIWindowMediator); var browserWindow = windowManage...
How do you make a post request into a new browser tab using JavaScript / XUL?
CC BY-SA 3.0
0
2008-08-30T17:05:14.710
2015-11-20T11:37:13.920
2015-11-20T11:37:13.920
3,218,692
3,288
[ "javascript", "firefox", "xul", "ubiquity" ]
36,166
2
null
36,152
2
null
The way to delete commands is to find them in the Subscribed Feeds section of the main help page: 1. ubiq help | about:ubiquity 2. Scroll down to "Subscribed Feeds" in the right hand column 3. Click '[unsubscribe]' for the one you want to delete. 4. Profit!
null
CC BY-SA 2.5
null
2008-08-30T17:16:56.197
2008-08-30T17:16:56.197
null
null
3,288
null
36,164
2
null
36,028
1
null
Have you tried using an HTML control instead of the server control? Does it also cause a compilation error? ``` <input type="text" id="TextBox4" runat="server" value="<%=TextFromString%>" /> ```
null
CC BY-SA 2.5
null
2008-08-30T17:15:11.723
2008-08-30T17:15:11.723
null
null
2,701
null
36,173
2
null
35,974
1
null
You could try to encode the image as base64 and reference it directly in an img tag within the email ( `<img src="data:image/png;base64[your encoded image here...]` ) but i think most email clients correlate this technique with spam. I think you're better off referencing hosted images or simply attaching it to the emai...
null
CC BY-SA 2.5
null
2008-08-30T17:21:35.840
2008-08-30T17:21:35.840
null
null
3,769
null
36,171
2
null
36,093
1
null
I have used Subversion for this exact thing, and Theo is right, you have to remember to lock your files. I am on CS2 and so have not used Version Cue, but I have not been able to find a whole lot online about other folks using it either, for some reason. The other problem I had using Subversion related to disk space. S...
null
CC BY-SA 2.5
null
2008-08-30T17:20:02.273
2009-03-06T17:29:56.423
2009-03-06T17:29:56.423
3,114
3,114
null
36,167
2
null
36,129
3
null
An ah-ha moment for me for the observer pattern was to realize how closely associated it is with events. Consider a Windows program that needs to acheive loosely communications between two forms. That can easily be accomplished with the observer pattern. The code below shows how Form2 fires an event and any other clas...
null
CC BY-SA 2.5
null
2008-08-30T17:17:25.913
2008-08-30T17:17:25.913
null
null
2,536
null
36,156
2
null
36,139
568
null
Basic answer: ``` mylist = ["b", "C", "A"] mylist.sort() ``` This modifies your original list (i.e. sorts in-place). To get a sorted copy of the list, without changing the original, use the [sorted()](http://docs.python.org/library/functions.html#sorted) function: ``` for x in sorted(mylist): print x ``` Howe...
null
CC BY-SA 3.0
null
2008-08-30T17:10:12.687
2011-10-21T13:24:56.687
2011-10-21T13:24:56.687
3,205
1,694
null
36,175
2
null
36,077
0
null
In case anyone is interested, a co-worker replied to this question to me via email: Artem wrote: There is a flag to MiniDumpWriteDump() that can do better crash dumps that will allow seeing full program state, with all global variables, etc. As for call stacks, I doubt they can be better because of optimizations... ...
null
CC BY-SA 2.5
null
2008-08-30T17:23:45.803
2008-08-30T17:23:45.803
null
null
3,153
null
36,181
2
null
36,122
1
null
It would also help if you had a target language in mind as not all data structures and interactions are equally efficient and effective in all languages.
null
CC BY-SA 2.5
null
2008-08-30T17:25:14.910
2008-08-30T17:25:14.910
null
null
2,902
null
36,179
2
null
30,903
9
null
A few months back, Dustin Sallings wrote a [fork](http://github.com/dustin/gitnub/wikis) of GitNub that uses Mercurial. It's Leopard-only, but lovely. On Tiger, the "view" exension mentioned in the other comments works okay, as does [hgview](http://www.logilab.org/project/hgview).
null
CC BY-SA 2.5
null
2008-08-30T17:25:01.293
2008-08-30T17:25:01.293
null
null
3,462
null
36,178
2
null
36,127
0
null
In case anyone is interested, a co-worker replied to this question to me via email: Artem wrote: > There is a flag to MiniDumpWriteDump() that can do better crash dumps that will allow seeing full program state, with all global variables, etc. As for call stacks, I doubt they can be better because of optim...
null
CC BY-SA 2.5
null
2008-08-30T17:24:48.733
2008-08-30T17:24:48.733
null
null
3,153
null
36,184
2
null
36,108
25
null
Well, I figured it out myself, right after posting, which is the most embarassing way. :) It seems every member of a StackPanel will simply fill its minimum requested size. In the DockPanel, I had docked things in the wrong order. If the TextBox or ListBox is the only docked item without an alignment, or if they are ...
null
CC BY-SA 3.0
null
2008-08-30T17:28:01.893
2016-04-15T12:43:17.667
2016-04-15T12:43:17.667
28,411
2,122
null
36,186
1
619,713
null
10
18,620
I previously asked about Version Cue 3 vs Subversion. I think this is a better question and someone suggested [http://www.gridironsoftware.com/Flow/](http://www.gridironsoftware.com/Flow/) I hope this question will allow others to join in and suggest other tools or give specific recommendation to using Version Que vers...
Best Versioning Tools to use for Photoshop/Illustrator and related binary files?
CC BY-SA 2.5
0
2008-08-30T17:31:20.030
2018-05-26T01:41:57.537
null
null
3,747
[ "versioning", "photoshop" ]
36,129
1
36,167
null
7
21,326
I'm reading through head first design patterns at the moment and while the book is excellent I also would like to see how these are actually used in the real world. If you know of a good example of design pattern usage (preferably in a OSS program so we can have a look :) then please list it below.
What are some real life examples of Design Patterns used in software
CC BY-SA 2.5
0
2008-08-30T16:51:19.220
2016-01-19T22:12:00.597
2008-08-30T17:15:56.307
832
1,603
[ "design-patterns" ]
36,182
1
36,397
null
1
963
In postgis, is the `ST_GeomFromText` call very expensive? I ask mostly because I have a frequently called query that attempts to find the point that is nearest another point that matches some criteria, and which is also within a certain distance of that other point, and the way I currently wrote it, it's doing the sam...
How expensive is ST_GeomFromText
CC BY-SA 3.0
null
2008-08-30T17:25:40.870
2016-07-13T10:54:37.153
2016-07-13T10:54:37.153
5,520,058
3,333
[ "gis", "postgis" ]
36,190
2
null
36,109
0
null
replace the last line from $CMD to just wine '$EXEC' $ARGS You'll note that the error is ''/home/chris/.wine/drive_c/Program' and not '/home/chris/.wine/drive_c/Program' The single quotes are not being interpolated properly, and the string is being split by spaces.
null
CC BY-SA 2.5
null
2008-08-30T17:37:17.800
2008-08-30T17:37:17.800
null
null
null
null
36,183
1
36,191
null
29
17,267
I'm trying to write a regex function that will identify and replace a single instance of a match within a string without affecting the other instances. For example, I have this string: ``` 12||34||56 ``` I want to replace the second set of pipes with ampersands to get this string: ``` 12||34&&56 ``` The regex fu...
Replacing the nth instance of a regex match in Javascript
CC BY-SA 2.5
0
2008-08-30T17:26:09.230
2022-10-09T12:36:34.390
2009-03-09T23:52:36.960
49,485
2,289
[ "javascript", "regex" ]
36,191
2
null
36,183
20
null
here's something that works: ``` "23||45||45||56||67".replace(/^((?:[0-9]+\|\|){n})([0-9]+)\|\|/,"$1$2&&") ``` where n is the one less than the nth pipe, (of course you don't need that first subexpression if n = 0) And if you'd like a function to do this: ``` function pipe_replace(str,n) { var RE = new RegExp("...
null
CC BY-SA 2.5
null
2008-08-30T17:40:39.960
2008-08-30T18:14:39.740
2008-08-30T18:14:39.740
2,541
2,541
null
36,127
1
38,474
null
12
2,966
Are there any VC++ settings I should know about to generate better PDB files that contain more information? I have a crash dump analysis system in place based on the project [crashrpt](http://code.google.com/p/crashrpt/). Also, my production build server has the source code installed on the D:\, but my development m...
Any recommended VC++ settings for better PDB analysis on release builds
CC BY-SA 2.5
0
2008-08-30T16:51:03.730
2010-04-14T21:50:08.997
2010-04-14T21:50:08.997
294,313
3,153
[ "visual-studio", "visual-c++", "pdb-files", "crashrpt" ]
36,188
2
null
36,127
0
null
Is Visual Studio prompting you for the path to the source file? If it isn't then it doesn't think it has symbols for the callstack. Setting the source path should work without having to map the exact original location. You can tell if symbols are loaded by looking at the 'modules' window in Visual Studio. Assuming y...
null
CC BY-SA 2.5
null
2008-08-30T17:34:25.030
2008-08-30T17:34:25.030
null
null
3,631
null
36,203
2
null
36,127
0
null
> Is Visual Studio prompting you for the path to the source file? No. > If it isn't then it doesn't think it has symbols for the callstack. Setting the source path should work without having to map the exact original location. Symbols are loaded successfully. It shows the callstack, but double clicking on ...
null
CC BY-SA 2.5
null
2008-08-30T17:49:23.980
2008-08-30T17:49:23.980
null
null
3,153
null
36,209
2
null
36,064
3
null
Looks like they've added controller.UpdateModel to address this issue, signature is: ``` UpdateModel(object model, string[] keys) ``` I haven't upgraded my app personally, so I'm not sure of the actual usage. I'll be interested to find out about this myself, as I'm using `controller.ReadFromRequest` as well.
null
CC BY-SA 4.0
null
2008-08-30T17:57:16.973
2019-03-19T10:20:03.597
2019-03-19T10:20:03.597
9,020,340
2,646
null
36,206
2
null
36,064
2
null
Not sure where it went. You could roll your own extension though: public static class MyBindingExtensions { ``` public static T ReadFromRequest < T > (this Controller controller, string key) { // Setup HttpContextBase context = controller.ControllerContext.HttpContext; object val = null; T result = ...
null
CC BY-SA 2.5
null
2008-08-30T17:52:00.307
2008-08-30T17:57:28.610
2008-08-30T17:57:28.627
1,946
1,946
null
36,211
2
null
35,407
0
null
@[BCS](https://stackoverflow.com/users/1343/bcs) I'm 99.9% sure that the -l isn't causeing the problem because I can watch the load average on the machine and it drops down to about three and sometimes as low as one (!) without starting the next job.
null
CC BY-SA 2.5
null
2008-08-30T17:58:46.343
2008-08-30T17:58:46.343
2017-05-23T11:48:37.237
-1
1,447
null
36,217
2
null
36,077
13
null
You pointed to a breakpoint in the code. Since you are in the debugger, you could set a breakpoint on the constructor of the exception class, or set Visual Studio debugger to break on all thrown exceptions (Debug->Exceptions Click on C++ exceptions, select thrown and uncaught options)
null
CC BY-SA 2.5
null
2008-08-30T18:08:51.967
2008-08-30T18:08:51.967
null
null
3,657
null
36,197
1
36,253
null
10
1,281
So I'm embarking on an `ASP.NET MVC` project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein controller methods violate SRP (singl...
ASP.NET MVC: Structuring Controllers
CC BY-SA 4.0
0
2008-08-30T17:44:52.807
2019-03-19T10:19:23.760
2019-03-19T10:19:23.760
9,020,340
2,646
[ "c#", "asp.net-mvc" ]
36,210
2
null
36,093
2
null
I was going to suggest [Gridiron Flow](http://www.gridironsoftware.com/Flow/). But Brian beat me to it.
null
CC BY-SA 2.5
null
2008-08-30T17:58:20.247
2008-08-30T17:58:20.247
null
null
3,713
null
36,220
2
null
36,139
8
null
> But how does this handle language specific sorting rules? Does it take locale into account? No, `list.sort()` is a generic sorting function. If you want to sort according to the Unicode rules, you'll have to define a custom sort key function. You can try using the [pyuca](http://jtauber.com/blog/2006/01/27/python_un...
null
CC BY-SA 2.5
null
2008-08-30T18:10:45.193
2008-08-30T18:10:45.193
null
null
3,560
null
36,224
2
null
36,144
3
null
Something which is less Mozilla specific and should work reasonably well with most of the browsers: - - -
null
CC BY-SA 2.5
null
2008-08-30T18:16:47.877
2008-08-30T18:16:47.877
null
null
1,265
null
36,216
2
null
36,144
0
null
try with addTab instead of loadOneTab, and remove the last parameter. Check out [this page](http://developer.mozilla.org/en/Code_snippets/Tabbed_browser) over at the Mozilla Development Center for information on how to open tabs. You could use this function, for example: ``` function openAndReuseOneTabPerURL(url) ...
null
CC BY-SA 2.5
null
2008-08-30T18:07:48.367
2008-08-30T18:07:48.367
null
null
1,585
null
36,219
2
null
12,591
0
null
It seems that lxml does not expose this libxml2 feature, grepping the source only turns up some #defines for the error handling: ``` C:\Dev>grep -ir --include=*.px[id] catalog lxml-2.1.1/src | sed -r "s/\s+/ /g" lxml-2.1.1/src/lxml/dtd.pxi: catalog. lxml-2.1.1/src/lxml/xmlerror.pxd: XML_FROM_CATALOG = 20 # The Catalog...
null
CC BY-SA 2.5
null
2008-08-30T18:10:33.757
2008-08-30T18:10:33.757
null
null
3,665
null
36,194
2
null
36,129
3
null
I use passive view, a flavor of the [Model View Presenter](http://msdn.microsoft.com/en-us/magazine/cc188690.aspx) pattern, with any web forms like development (.NET) to increase testability/maintainability/etc For example, your code-behind file might look something like this ``` Partial Public Class _Default Inh...
null
CC BY-SA 2.5
null
2008-08-30T17:43:12.090
2008-08-30T17:43:12.090
null
null
2,701
null
36,238
2
null
35,753
4
null
One way to judge what python is used for is to look at what products use python at the moment. This [wikipedia page](http://en.wikipedia.org/wiki/Python_software) has a long list including various web frameworks, content management systems, version control systems, desktop apps and IDEs. As it says [here](http://en.w...
null
CC BY-SA 2.5
null
2008-08-30T18:42:19.873
2008-08-30T18:42:19.873
null
null
3,189
null
36,223
2
null
36,077
2
null
Here's how I do it in C++ using GCC libraries: ``` #include <execinfo.h> // Backtrace #include <cxxabi.h> // Demangling vector<Str> backtrace(size_t numskip) { vector<Str> result; std::vector<void*> bt(100); bt.resize(backtrace(&(*bt.begin()), bt.size())); char **btsyms = backtrace_symbols(&(*bt.begin...
null
CC BY-SA 2.5
null
2008-08-30T18:14:57.087
2008-08-30T18:14:57.087
null
null
338
null
36,240
2
null
12,936
1
null
BlaM's testing included all the DB calls made by WordPress. When you're making fewer DB calls, you'll see the performance gain of opcode caches be even more dramatic.
null
CC BY-SA 2.5
null
2008-08-30T18:44:52.897
2008-11-03T18:10:30.037
null
null
3,779
null
36,249
2
null
36,239
4
null
Visual Studio moved to a 64 bit representation of time_t in Visual Studio 2005 (whilst still leaving _time32_t for backwards compatibility). As long as you are careful to always write code in terms of time_t and don't assume anything about the size then as sysrqb points out the problem will be solved by your compiler....
null
CC BY-SA 2.5
null
2008-08-30T18:49:06.350
2008-08-30T18:49:06.350
null
null
3,631
null
36,248
2
null
22,873
2
null
## Common Lisp For a good reference of CL check out [Common Lisp the Language, 2nd Edition](http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/cltl2.html)
null
CC BY-SA 2.5
null
2008-08-30T18:48:40.140
2008-08-30T18:48:40.140
null
null
3,766
null
36,234
2
null
36,028
2
null
There's a couple of different expression types in .ASPX files. There's: ``` <%= TextFromMethod %> ``` which simply reserves a literal control, and outputs the text at render time. and then there's: ``` <%# TextFromMethod %> ``` which is a databinding expression, evaluated when the control is DataBound(). There's...
null
CC BY-SA 3.0
null
2008-08-30T18:32:57.993
2016-10-07T06:43:40.573
2016-10-07T06:43:40.573
4,029,561
2,199
null
36,256
2
null
308
8
null
I write my db release scripts in parallel with coding, and keep the release scripts in a project specific section in SS. If I make a change to the code that requires a db change, then I update the release script at the same time. Prior to release, I run the release script on a clean dev db (copied structure wise from p...
null
CC BY-SA 2.5
null
2008-08-30T18:58:40.787
2008-08-30T18:58:40.787
null
null
3,590
null
36,253
2
null
36,197
9
null
ASP.NET Preview 5 (available on [CodePlex](http://www.codeplex.com/aspnet)) has an answer for this: the [AcceptVerbs] attribute. Phil Haack has a [blog post](http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx) discussion how it's used. As for the view data magic key question, it's an interesting...
null
CC BY-SA 2.5
null
2008-08-30T18:52:47.230
2008-08-30T18:59:03.390
2008-08-30T18:59:03.390
1,554
1,554
null
36,257
2
null
30,288
2
null
The arrayCompare() user-defined function at cflib should do it [http://cflib.org/index.cfm?event=page.udfbyid&udfid=1210](http://cflib.org/index.cfm?event=page.udfbyid&udfid=1210)
null
CC BY-SA 2.5
null
2008-08-30T18:59:05.123
2008-08-30T18:59:05.123
null
null
3,784
null
36,255
2
null
35,211
2
null
A .NET event isn't actually an object, it's an endpoint represented by two functions -- one for adding and one for removing a handler. That's why the compiler won't let you do anything other than += (which represents the add) or -= (which represents the remove). The only way to refer to an event for metaprogramming p...
null
CC BY-SA 2.5
null
2008-08-30T18:54:49.783
2008-09-01T01:17:03.973
2008-09-01T01:17:03.973
533
533
null
36,242
2
null
36,239
-1
null
By 2038, time libraries should all be using 64-bit integers, so this won't actually be that big of a deal (on software that isn't completely unmaintained). COBOL programs might be fun though.
null
CC BY-SA 2.5
null
2008-08-30T18:45:45.623
2008-08-30T18:45:45.623
null
null
3,694
null
36,243
2
null
36,239
-8
null
Operative word being "should". If you need to ensure futureproofing then you can construct your own date/time class and use that but I'd only do that if you think that what you write will be used on legacy OS'
null
CC BY-SA 2.5
null
2008-08-30T18:47:16.337
2008-08-30T18:47:16.337
null
null
1,384,652
null
36,239
1
217,348
null
66
9,037
I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970. ``` #include <stdio.h> #include <time.h> #include <limits.h> void print(time_t rt) { struct tm * t...
What should we do to prepare for 2038?
CC BY-SA 4.0
0
2008-08-30T18:42:57.067
2020-02-02T00:03:44.520
2019-03-07T00:12:15.377
6,164,712
338
[ "unix", "time", "maintainability", "year2038" ]
36,258
2
null
22,873
3
null
- [The C Programming Language](https://rads.stackoverflow.com/amzn/click/com/0131103628)- [Accelerated C++](https://rads.stackoverflow.com/amzn/click/com/020170353X)- [Pro C# 2008 and the .NET 3.5 Platform](https://rads.stackoverflow.com/amzn/click/com/1590598849)- [Expert F#](https://rads.stackoverflow.com/amzn/click/...
null
CC BY-SA 2.5
null
2008-08-30T19:00:39.427
2008-08-30T19:00:39.427
null
null
3,394
null
36,274
1
36,297
null
95
76,216
What is Lazy Loading? [Edit after reading a few answers] Why do people use this term so often? Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview. I guess I should have asked why people use the term Lazy Loading, what "other" types are their?
What is Lazy Loading?
CC BY-SA 2.5
0
2008-08-30T19:20:04.933
2018-10-07T17:00:10.423
2010-04-01T21:00:09.953
14,118
3,747
[ "data-binding", "lazy-loading" ]
36,262
1
36,284
null
1
261
How much should one DataSet represent? Using the example of an ordering system: While showing your order I also show a list of items similar to one of yours as well as a list of our most popular items. While your items are tangled in a web of relationships involving you and your past orders, preferred suppliers, and t...
How much should one DataSet represent?
CC BY-SA 2.5
0
2008-08-30T19:08:50.047
2015-12-20T22:59:12.203
2015-12-20T22:59:12.203
3,618,581
3,777
[ ".net", "dataset" ]
36,260
1
36,527
null
17
3,798
I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent all o...
Dealing with circular dependencies in OCaml
CC BY-SA 2.5
null
2008-08-30T19:06:44.077
2012-02-16T20:51:37.457
null
null
1,891
[ "ocaml" ]
36,276
2
null
36,274
9
null
wikipedia's Definition Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. ... [http://en.wikipedia.org/wiki/Lazy%20loading](http://en.wikipedia.org/wiki/Lazy%20loading)
null
CC BY-SA 2.5
null
2008-08-30T19:21:21.747
2008-08-30T19:21:21.747
null
null
1,940
null
36,287
2
null
36,129
3
null
Use code.google.com For example the [search result](http://code.google.com/search/#q=Factory) for "Factory" will get you a lot of cases where the factory Pattern is implemented.
null
CC BY-SA 2.5
null
2008-08-30T19:31:46.650
2008-08-30T19:31:46.650
null
null
1,733
null
36,285
2
null
36,274
42
null
Lazy Loading is a programming practice in which you only load or initialize an object when you first need it. This can potentially give you a big performance boost, especially if you have a lot of components in your application. As usual, [Wikipedia](http://en.wikipedia.org/wiki/Lazy_loading) has more details.
null
CC BY-SA 2.5
null
2008-08-30T19:26:21.687
2008-08-30T19:26:21.687
null
null
1,074
null
36,279
2
null
36,079
10
null
Gmail's SMTP-server requires a very specific configuration. From [Gmail help](http://mail.google.com/support/bin/answer.py?answer=13287): ``` Outgoing Mail (SMTP) Server (requires TLS) - smtp.gmail.com - Use Authentication: Yes - Use STARTTLS: Yes (some clients call this SSL) - Port: 465 or 587 Account Name: yo...
null
CC BY-SA 2.5
null
2008-08-30T19:22:42.540
2008-08-30T19:22:42.540
null
null
1,074
null
36,284
2
null
36,262
1
null
This is why I don't use datasets. If you use strongly-typed datasets you benefit from the strong typing but you pay for it in terms of the time it takes to create one even if you're just using part of it and its extensibility in terms of the code base. If you want to modify an existing one and you modify a row definiti...
null
CC BY-SA 2.5
null
2008-08-30T19:25:42.657
2008-08-30T19:25:42.657
null
null
1,143
null
36,282
2
null
36,262
4
null
The DataSet is vastly overrated and overused. Use strongly-typed collections (thank you, generics and automatic properties!). As icing on the cake, you can now even do cool query things against your custom objects with LINQ. Good Esposito article on datasets versus custom objects: [http://msdn.microsoft.com/en-us/ma...
null
CC BY-SA 2.5
null
2008-08-30T19:23:21.960
2008-08-30T19:23:21.960
null
null
2,536
null
36,294
1
36,393
null
19
2,227
Looks like here in StackOveflow there is a group of enthusiasts. I'd like to know better this language, so, apart from the [functional programming theory](http://en.wikipedia.org/wiki/Functional_programming), can you point me to the better starting points to start using the F# language? I mean, tutorials, how-tos, b...
F# language - hints for newbie
CC BY-SA 2.5
0
2008-08-30T19:42:24.927
2008-10-19T03:02:06.160
null
null
1,178
[ "f#" ]
36,298
2
null
24,812
3
null
There's an XNA specific tutorial on [flocking](http://creators.xna.com/en-us/sample/flocking).
null
CC BY-SA 2.5
null
2008-08-30T19:47:02.450
2008-08-30T19:47:02.450
null
null
3,431
null
36,297
2
null
36,274
231
null
It's called lazy loading because, like a lazy person, you are putting off doing something you don't want to. The opposite is Eager Loading, where you load something right away, long before you need it. If you are curious why people might use lazy loading, consider an application that takes a LOOOOONG time to start. ...
null
CC BY-SA 2.5
null
2008-08-30T19:44:05.653
2008-08-30T19:44:05.653
null
null
122
null
36,291
2
null
36,274
5
null
Here's an example from some actual Python code I wrote: ``` class Item(Model): ... @property def total(self): if not hasattr(self, "_total"): self._total = self.quantity \ + sum(bi.quantity for bi in self.borroweditem_set.all()) return self._total ``` Basical...
null
CC BY-SA 2.5
null
2008-08-30T19:35:22.273
2008-08-30T19:35:22.273
null
null
1,694
null
36,299
2
null
8,493
2
null
To stop weird russian and chinese spams, I use this procmail configuration. ``` UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987' :0: * ^Content-Type:.*multipart * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE) spam-unreadable ```
null
CC BY-SA 2.5
null
2008-08-30T19:47:08.517
2008-08-30T19:47:08.517
null
null
3,499
null
36,296
1
null
null
4
705
In [today's channel9.msdn.com video](http://channel9.msdn.com/posts/Dan/Countdown-to-PDC2008-By-Developers-for-Developers-Don-Box-and-Chris-Anderson/), the PDC guys posted a challenge to decipher this code: ``` 2973853263233233753482843823642933243283 6434928432937228939232737732732535234532 93352833733772823333492873...
What's the answer to this Microsoft PDC challenge?
CC BY-SA 2.5
null
2008-08-30T19:43:11.680
2017-09-12T18:33:13.533
2008-09-01T02:04:10.367
536
536
[ "encryption", "pdc" ]
36,307
2
null
36,129
3
null
The pattern is implemented in the handling of DOM events. For example, (and simplifying slightly) when an element is clicked on, that element gets the first opportunity to handle the event, and then each ancestor in tern until the top level is reached or one of them explicitly stops the event "bubbling" any further.
null
CC BY-SA 3.0
null
2008-08-30T20:01:58.497
2015-06-11T14:40:17.637
2015-06-11T14:40:17.637
3,140,273
3,187
null
36,304
2
null
36,296
2
null
Well, based on the 332 pattern you pointed out and the fact that the number of numbers is divisible by 3, and that several of the first 3 digit groups have matches... it might be that each 3 digits represent a character. Get a distribution of the number matches for all the 3 digit groups, then see if that distribution...
null
CC BY-SA 3.0
null
2008-08-30T19:57:12.083
2017-09-12T18:33:13.533
2017-09-12T18:33:13.533
6,761,181
122
null
36,309
2
null
33,813
7
null
[I mention some in a review on Boagworld](http://boagworld.com/podcast/123/), I find the snippets, project manager, columnar editing (hold down option while selecting stuff or push it after having selected stuff) and CSS scopes for syntax.
null
CC BY-SA 2.5
null
2008-08-30T20:03:18.010
2008-08-30T20:03:18.010
null
null
1,384,652
null
36,306
2
null
35,123
2
null
If I am not mistaken you need to swap the ``` mParent.layout(); ``` and ``` mParent.setSize(mParent.computeSize(SWT.DEFAULT, SWT.DEFAULT, true)); ``` so that you have: ``` public void createPartControl(Composite parent) { parent.setLayout(new FillLayout()); ScrolledComposite scrollBox = new ScrolledComposit...
null
CC BY-SA 2.5
null
2008-08-30T20:00:53.197
2008-08-30T20:00:53.197
null
null
3,340
null
36,314
1
36,321
null
787
221,407
I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)
What is 'Currying'?
CC BY-SA 2.5
0
2008-08-30T20:12:55.867
2023-02-20T19:32:26.287
2021-06-21T10:19:18.590
12,358,693
3,786
[ "javascript", "functional-programming", "terminology", "definition", "currying" ]
36,312
2
null
32,231
0
null
Do you want the schema, but have it generated, or do you actually want ? For the former I'd go with nhibernate as @tom-carter said. Have it generate your schema for you, and you are all good (atleast until you roll your app out, then look at something like Tarantino and RedGate SQL Diff or whatever it's called to gene...
null
CC BY-SA 2.5
null
2008-08-30T20:08:01.977
2008-08-30T20:08:01.977
null
null
2,947
null
36,311
2
null
36,106
16
null
Unless the data is truly random has a symmetric 1/0 distribution, then this simply becomes a lossless data compression problem and is very analogous to CCITT Group 3 compression used for black and white (i.e.: Binary) FAX images. CCITT Group 3 uses a Huffman Coding scheme. In the case of FAX they are using a fixed set...
null
CC BY-SA 3.0
null
2008-08-30T20:05:37.723
2014-10-02T23:06:39.917
2014-10-02T23:06:39.917
2,683
1,553
null
36,315
1
36,552
null
13
17,019
It'd be really nice to target my Windows Forms app to the .NET 3.5 SP1 framework. But, right now I'm using the `HttpUtility.HtmlDecode` and `HttpUtility.UrlDecode` functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something. So, short from reflectoring the source co...
Alternative to HttpUtility for .NET 3.5 SP1 client framework?
CC BY-SA 2.5
0
2008-08-30T20:13:32.667
2015-03-18T18:02:07.247
2012-01-10T19:19:51.717
50,776
3,191
[ ".net", "deployment", ".net-3.5", ".net-client-profile" ]
36,316
2
null
33,813
29
null
Don't neglect the 'mate' command line tool. You can use it to pipe output into TextMate, so if you do the following... ``` diff file1.py file2.py | mate ``` ...it will not only open in TextMate, but it is smart enough to know that you're looking at a diff and highlight lines on screen. TextMate's SVN integration is...
null
CC BY-SA 2.5
null
2008-08-30T20:14:02.197
2008-08-30T20:14:02.197
null
null
586
null
36,246
2
null
36,114
2
null
Is num1 the variable you're having trouble with? This line: ``` cin >> num1; ``` is setting num1 to the value input by the user. So the value calculated for it in the previous run through the loop is being overwritten each time by the new input.
null
CC BY-SA 2.5
null
2008-08-30T18:47:48.317
2008-08-30T18:47:48.317
null
null
1,739
null
36,326
1
36,332
null
4
1,635
I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is using it?
How can I store user-tweakable configuration in app.config?
CC BY-SA 2.5
0
2008-08-30T20:34:18.060
2013-05-27T17:20:19.527
null
null
3,205
[ "c#", ".net", "app-config" ]
36,325
2
null
35,983
1
null
The svnbook has a section on how Subversion allows you to revert the changes from a particular revision without affecting the changes that occured in subsequent revisions: [http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.undo](http://svnbook.red-bean.com/en/1.4/svn.branchm...
null
CC BY-SA 2.5
null
2008-08-30T20:30:50.847
2008-08-30T20:30:50.847
null
null
3,187
null
36,327
2
null
36,324
21
null
It's a bug, see the [documentation of subprocess.Popen](http://docs.python.org/lib/node528.html). There either needs to be a `"shell=True`" option, or the first argument needs to be a sequence `['svn', '--version']`. As it is now, `Popen` is looking for an executable named, literally, "svn --version" which it doesn't f...
null
CC BY-SA 2.5
null
2008-08-30T20:34:35.877
2008-08-30T20:48:43.080
2008-08-30T20:48:43.097
3,002
3,002
null
36,332
2
null
36,326
6
null
If you use the Settings for the project, you can mark each setting as either application or user. If they're set as user, they will be stored per-user and when you call the Save method it will be updated in the config for that user. Code project has a really detailed [article](http://www.codeproject.com/KB/dotnet/use...
null
CC BY-SA 3.0
null
2008-08-30T20:40:42.307
2013-05-27T17:20:19.527
2013-05-27T17:20:19.527
1,012,641
2,975
null
36,333
1
36,339
null
5
295
In the latest version of WordPress, it gives you the opportunity to view a preview of what your site would look like using a different theme. You basically just click on the theme, it takes over the screen and you have a chance to activate or close it (and return to the previous screen, which is grayed out in the backg...
Preview theme in WordPress
CC BY-SA 3.0
null
2008-08-30T20:41:02.337
2015-08-04T21:42:03.923
2015-08-04T21:42:03.923
1,547,157
2,493
[ "jquery", "html", "wordpress" ]
36,339
2
null
36,333
5
null
It's open source - use the source, Luke. Look in wp-admin/js/theme-preview.js
null
CC BY-SA 2.5
null
2008-08-30T21:02:11.037
2008-08-30T21:02:11.037
null
null
3,333
null
36,337
2
null
36,294
1
null
Check out the [F# Developer Center](http://msdn.microsoft.com/en-gb/fsharp/default.aspx). There is also [hubFS](http://cs.hubfs.net/forums/default.aspx), a forum dedicated to F#.
null
CC BY-SA 2.5
null
2008-08-30T20:54:27.607
2008-08-30T20:54:27.607
null
null
3,280
null
36,321
2
null
36,314
1,057
null
Currying is when you break down a function that takes multiple arguments into a series of functions that each take only one argument. Here's an example in JavaScript: ``` function add (a, b) { return a + b; } add(3, 4); // returns 7 ``` This is a function that takes two arguments, a and b, and returns their sum. W...
null
CC BY-SA 4.0
null
2008-08-30T20:19:51.187
2022-11-15T11:47:41.903
2022-11-15T11:47:41.903
7,942,242
658
null
36,324
1
36,327
null
11
14,410
I'm trying to use `svnmerge.py` to merge some files. Under the hood it uses python, and when I use it I get an error - "The system cannot find the file specified". Colleagues at work are running the same version of `svnmerge.py`, and of python (2.5.2, specifically r252:60911) without an issue. I found [this link](http:...
"The system cannot find the file specified" when invoking subprocess.Popen in python
CC BY-SA 4.0
0
2008-08-30T20:24:38.037
2022-07-11T21:57:13.410
2022-07-11T21:57:13.410
1,145,388
1,714
[ "python", "svn-merge" ]
36,347
1
36,364
null
174
111,975
Java has generics and C++ provides a very strong programming model with `template`s. So then, what is the difference between C++ and Java generics?
What are the differences between "generic" types in C++ and Java?
CC BY-SA 3.0
0
2008-08-30T21:14:27.623
2022-04-15T16:39:10.817
2014-04-04T21:09:17.777
1,089,957
1,556
[ "java", "c++", "generics", "templates", "language-features" ]
36,348
2
null
35,560
3
null
As for any remoting architecture, you'll want to avoid loading a full object graph "down the wire" in an uncontrolled way (unless you have a trivially small number of objects). The [Wikipedia article](http://en.wikipedia.org/wiki/Lazy_loading) has the standard techniques pretty much summarised (and in C#. too!). I've ...
null
CC BY-SA 2.5
null
2008-08-30T21:16:51.627
2008-08-30T21:16:51.627
null
null
3,546
null
36,351
2
null
36,186
1
null
Take a look at Perforce ([www.perforce.com](http://www.perforce.com)), particularly if you are managing these files in the context of development projects. It is a code-oriented system, but it supports binary files well and has a Photoshop plugin. P4 isn't free, but it is worth every penny if you need professional-grad...
null
CC BY-SA 2.5
null
2008-08-30T21:24:48.423
2008-08-30T21:24:48.423
null
null
3,776
null
36,344
1
null
null
8
835
I'm trying to "install SGML::Parser::OpenSP" from the cpan shell, but it fails on the first "make test". I also get the same error if I go into the build directory and run make test. I believe this bit of the output below is the relevant part. Note the Symbol not found when perl gets to the "use" line for the new lib...
Why can't SGML::Parser::OpenSP find the symbol __ZTI15SGMLApplication?
CC BY-SA 2.5
0
2008-08-30T21:08:18.200
2010-01-09T23:28:23.463
2008-11-17T11:10:27.690
13,051
null
[ "perl", "cpan", "sgml" ]