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
25,188
2
null
25,182
3
null
For most database related performance questions, the real answer is to run it and analyze what the DB does for your dataset. Run an explain plan or trace to see if your query is hitting the proper indexes or create indexes if necessary. I would likely go with the first using the IN clause since that carries the most s...
null
CC BY-SA 2.5
null
2008-08-24T17:00:45.143
2008-08-24T17:00:45.143
null
null
1,750
null
25,166
2
null
25,147
3
null
This does what Erik suggested (id no. as array key) and merges vlaues in `$array2` to `$results`. ``` $results = array(); foreach($array as $subarray) { $results[$subarray['id']] = array('name' => $subarray['name']); } foreach($array2 as $subarray) { if(array_key_exists($subarray['id'], $results)) { ...
null
CC BY-SA 2.5
null
2008-08-24T16:38:01.733
2008-08-24T16:38:01.733
null
null
2,025
null
25,158
1
25,512
null
11
20,105
I'm rewriting an old application and use this as a good opportunity to try out C# and .NET development (I usually do a lot of plug-in stuff in C). The application is basically a timer collecting data. It has a start view with a button to start the measurement. During the measurement the app has five different views de...
Building C# .NET windows application with multiple views
CC BY-SA 2.5
0
2008-08-24T16:31:25.713
2008-09-23T16:43:57.433
2008-08-25T07:49:58.827
493
2,703
[ "c#", ".net", "windows" ]
25,144
2
null
25,132
3
null
If using XHTML, it's actually recommended not to use named entities ([citation needed]). Some browsers (Firefox …), when parsing this as XML (which they normally don't), don't read the DTD files and thus are unable to handle the entities. As it's best practice anyway to use UTF-8 as encoding if there are no compelling...
null
CC BY-SA 2.5
null
2008-08-24T16:17:09.723
2010-06-20T13:55:25.540
2010-06-20T13:55:25.540
1,968
1,968
null
25,190
2
null
25,182
1
null
I do not have MS SQL Query Analyzer at hand to actually check my hypothesis, but think that WHERE IN variant would be faster because with UNION server will have to do 3 table scans whereas with WHERE IN will need only one. If you have Query Analyzer check execution plans for both queries. On the Internet you may ofte...
null
CC BY-SA 2.5
null
2008-08-24T17:03:58.787
2008-08-24T17:03:58.787
null
null
2,586
null
25,176
2
null
20,910
11
null
Another advantage of Flex development is that you can switch to developing desktop applications (Adobe AIR) with the same source code (and same IDE) and distribute them from web. You can check out [this](http://labs.adobe.com) for the future of Flash platform. Update Q3/2011: Flash 11 supports low-level 3D accelerati...
null
CC BY-SA 3.0
null
2008-08-24T16:46:51.633
2017-07-16T12:52:02.427
2017-07-16T12:52:02.427
2,277,364
2,277,364
null
25,187
2
null
24,866
2
null
By not using a library, you risk generating or parsing data that isn't well-formed, which sooner or later happen. For the same reason `document.write` isn't allowed in XHTML, you shouldn't write your XML markup as a string.
null
CC BY-SA 2.5
null
2008-08-24T16:59:50.450
2008-08-24T16:59:50.450
null
null
1,600
null
25,192
1
1,067,648
null
32
49,034
I'm looking for a Java library for SWIFT messages. I want to - - - Theoretically, I need to support all SWIFT message types. But at the moment I need MT103+, MT199, MT502, MT509, MT515 and MT535. So far I've looked at two libraries - [link text](http://www.anasys.com/products/messageobjects/)- [link text](http://w...
Java SWIFT Library
CC BY-SA 3.0
0
2008-08-24T17:05:40.997
2021-04-17T16:05:18.333
2017-07-19T16:47:35.467
2,227,743
2,367
[ "java", "swift-mt" ]
25,180
2
null
25,116
24
null
As long as you don't try to put any unicode data into your `StringIO` and you are careful NOT to use `cStringIO` you should be fine. According to the [StringIO](https://docs.python.org/library/stringio.html) documentation, as long as you keep to either unicode or 8-bits everything works as expected. Presumably, `Strin...
null
CC BY-SA 3.0
null
2008-08-24T16:52:29.453
2014-11-02T03:37:41.497
2014-11-02T03:37:41.497
2,213,647
2,010
null
25,191
2
null
24,866
1
null
You don't have to use library to parse XML, but check out this question [What considerations should be made before reinventing the wheel?](https://stackoverflow.com/questions/18428/what-considerations-should-be-made-before-reinventing-the-wheel) before you start writing your own code for parsing/generating xml.
null
CC BY-SA 2.5
null
2008-08-24T17:05:22.260
2008-12-01T10:00:11.777
2017-05-23T12:33:27.093
-1
1,534
null
25,182
1
25,293
null
6
6,228
I'm writing a program that sends an email out at a client's specific local time. I have a .NET method that takes a timezone & time and destination timezone and returns the time in that timezone. So my method is to select every distinct timezone in the database, check if it is the correct time using the method, then sel...
What's optimal? UNION vs WHERE IN (str1, str2, str3)
CC BY-SA 3.0
0
2008-08-24T16:53:34.223
2014-12-21T21:34:23.397
2014-12-21T21:34:23.397
2,227,834
26
[ "sql", "optimization" ]
25,207
2
null
24,816
481
null
Since you're using [jQuery](https://jquery.com/), you can just set the element's [text](http://api.jquery.com/text/) property: ``` // before: // <div class="someClass">text</div> var someHtmlString = "<script>alert('hi!');</script>"; // set a DIV's text: $("div.someClass").text(someHtmlString); // after: // <div cla...
null
CC BY-SA 3.0
null
2008-08-24T17:22:15.480
2018-04-07T10:09:33.267
2018-04-07T10:09:33.267
7,600,492
1,414
null
25,209
2
null
25,174
0
null
The company I work for has been using Symfony and the workaround that we've used is to trigger a warning with javascript before the user gets logged out. I suspect that there is a a way to make 'heartbeat' ajax calls to the server to trigger the timer to reset, but that may be a lot of trouble. I think that there may n...
null
CC BY-SA 2.5
null
2008-08-24T17:25:23.867
2008-08-24T17:25:23.867
null
null
2,567
null
25,193
2
null
19,339
29
null
You could also do ``` result = ([ a for a,b in original ], [ b for a,b in original ]) ``` It scale better. Especially if Python makes good on not expanding the list comprehensions unless needed. (Incidentally, it makes a 2-tuple (pair) of lists, rather than a list of tuples, like `zip` does.) If generators instea...
null
CC BY-SA 2.5
null
2008-08-24T17:07:57.027
2008-08-24T17:14:46.513
2008-08-24T17:14:46.513
1,421
1,421
null
25,197
2
null
19
44
null
There's actually a whole book dedicated (amongst other things) to methods for the computation of \pi: 'Pi and the AGM', by Jonathan and Peter Borwein ([available on Amazon](https://rads.stackoverflow.com/amzn/click/com/047131515X)). I studied the AGM and related algorithms quite a bit: it's quite interesting (though ...
null
CC BY-SA 3.0
null
2008-08-24T17:14:08.060
2012-01-06T00:48:57.983
2012-01-06T00:48:57.983
1,076,318
2,638
null
25,212
2
null
25,182
0
null
Some DBMS's Query Optimizers modify your query to make it more efficient, so depending on the DBMS your using, you probably shouldn't care.
null
CC BY-SA 2.5
null
2008-08-24T17:28:11.380
2008-08-24T17:28:11.380
null
null
2,721
null
25,213
2
null
594
6
null
There's also the way `psyco-pg` seems to do it... From what I gather, it seems to create dictionary-like row-proxies to map key lookup into the memory block returned by the query. In that case, fetching the whole answer and working with a similar proxy-factory over the rows seems like useful idea. Come to think of it t...
null
CC BY-SA 2.5
null
2008-08-24T17:28:26.200
2008-08-24T17:28:26.200
null
null
1,421
null
25,219
2
null
25,200
2
null
Your problem could be that you're not actually overriding Autosize in your code (ie, in the same way that you're overriding Font or ForeColor).
null
CC BY-SA 2.5
null
2008-08-24T17:38:53.460
2008-08-24T17:38:53.460
null
null
1,975,282
null
25,220
2
null
24,542
2
null
Patrick made good points, and I'm not going to repeat them. However might I suggest reducing 'if' statements to readable english wherever possible by using well-named boolean vars.For example, and this is using boolean operators but you could equally use bitwise and name the bools appropriately: ``` bool onlyAIsTrue =...
null
CC BY-SA 2.5
null
2008-08-24T17:42:30.550
2008-08-24T17:42:30.550
null
null
2,714
null
25,221
2
null
25,147
10
null
@Andy > [http://se.php.net/array_merge](http://se.php.net/array_merge) That was my first thought but it doesn't quite work - however [array_merge_recursive](http://www.php.net/manual/en/function.array-merge-recursive.php) might work - too lazy to check right now.
null
CC BY-SA 2.5
null
2008-08-24T17:43:00.033
2008-08-24T17:43:00.033
null
null
2,025
null
25,200
1
33,726
null
7
6,980
I don't like the AutoSize property of the Label control. I have a custom Label that draws a fancy rounded border among other things. I'm placing a `AutoSize = false` in my constructor, however, when I place it in design mode, the property always is True. I have overridden other properties with success but this one is...
C#.NET Winforms: Is it possible to override Label.Autosize?
CC BY-SA 3.0
0
2008-08-24T17:17:51.763
2022-08-19T14:04:26.597
2013-04-11T10:24:56.360
488,657
2,684
[ "c#", "winforms" ]
25,211
2
null
25,161
7
null
The [title](http://www.w3.org/TR/html4/struct/global.html#h-7.4.3) attribute is the simplest solution and guaranteed to work, degrade gracefully for useragents that don't support it correctly.
null
CC BY-SA 2.5
null
2008-08-24T17:27:44.237
2008-08-24T17:27:44.237
null
null
1,414
null
25,215
2
null
25,147
-3
null
``` $new = array(); foreach ($array as $arr) { $match = false; foreach ($array2 as $arr2) { if ($arr['id'] == $arr2['id']) { $match = true; $new[] = array_merge($arr, $arr2); break; } } if ( !$match ) $new[] = $arr; } ```
null
CC BY-SA 3.0
null
2008-08-24T17:32:42.647
2017-01-09T12:46:45.560
2017-01-09T12:46:45.560
4,380,409
1,993
null
25,229
2
null
25,225
0
null
you probably need to clarify or retag your question but as it stands the answer is below. joining two files under Linux ``` cat filetwo >> fileone ```
null
CC BY-SA 2.5
null
2008-08-24T17:52:05.470
2008-08-24T17:52:05.470
null
null
269
null
25,225
1
25,231
null
2
1,096
I have a couple of files containing a value in each line. I figured out the answer to this question while in the midst of writing the post and didn't realize I had posted it by mistake in its incomplete state. I was trying to do: ``` paste -d ',' file1 file2 file 3 file 4 > file5.csv ``` and was getting a weird ...
Combining values from different files into one CSV file
CC BY-SA 3.0
0
2008-08-24T17:49:02.390
2017-12-16T22:35:09.690
2017-12-16T22:35:09.690
858,913
1,582
[ "regex", "linux", "unix", "shell" ]
25,238
1
null
null
184
301,853
> What's the best way to make an element of 100% minimum height across a wide range of browsers ? In particular if you have a layout with a `header` and `footer` of fixed `height`, how do you make the middle content part fill `100%` of the space in between with the `footer` fixed to the bottom ?
100% Min Height CSS layout
CC BY-SA 4.0
0
2008-08-24T17:59:04.050
2022-05-13T07:49:06.380
2020-01-24T06:19:28.843
11,393,381
1,725
[ "html", "css", "xhtml" ]
25,230
2
null
25,192
0
null
I can not really help you out with a Java implementation. Microsoft of course, have their own Biztalk adapter for ISO15022 and 20022. And they will actually do the validation fairly well. But as you say you are actually looking for a java solution. You might find, as I did when I researched this 6 years ago, that ma...
null
CC BY-SA 3.0
null
2008-08-24T17:52:15.643
2015-09-11T12:44:28.173
2015-09-11T12:44:28.173
710,877
224
null
25,240
1
null
null
2
1,292
FCKeditor has InsertHtml API ([JavaScript API document](http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API)) that inserts HTML in the current cursor position. How do I insert at the very end of the document? Do I need to start browser sniffing with something like this ``` if ( element.insertAdjac...
Inserting at the very end in FCKeditor
CC BY-SA 3.0
null
2008-08-24T18:00:47.197
2015-12-10T21:21:26.443
2015-12-10T21:21:26.443
1,240,676
2,515
[ "javascript", "dom", "plugins", "fckeditor" ]
25,224
1
25,248
null
2
351
I have a postgres database with a user table (userid, firstname, lastname) and a usermetadata table (userid, code, content, created datetime). I store various information about each user in the usermetadata table by code and keep a full history. so for example, a user (userid 15) has the following metadata: ``` 15, 'Q...
joining latest of various usermetadata tags to user rows
CC BY-SA 3.0
null
2008-08-24T17:48:12.983
2015-04-16T05:22:10.417
2015-04-16T05:22:10.417
707,364
2,462
[ "database", "postgresql" ]
25,244
2
null
25,182
1
null
I think that there are several very important information missing in the question. First of all, it is of great importance weather timezoneID is indexed or not, is it part of the primary key etc. I would advice everyone to have a look at the analyzer, but in my experience the WHERE clause should be faster, especially...
null
CC BY-SA 2.5
null
2008-08-24T18:07:58.163
2008-08-24T18:07:58.163
null
null
null
null
25,241
1
null
null
8
2,911
How do you unit test a `HttpModule` in asp.net given that `HttpApplication` and `HttpContext` do no implement an interface ?
Unit testing IHttpModule
CC BY-SA 3.0
0
2008-08-24T18:00:54.407
2012-04-26T00:45:38.260
2012-04-26T00:45:38.260
1,332,690
1,725
[ "c#", "asp.net", "unit-testing", "mocking" ]
25,247
2
null
18,632
1
null
Yeah I've used both Tail for Win32 and tail on Cygwin. I've found both to be excellent, although I prefer Cygwin slightly as I'm able to tail files over the internet efficiently without crashes (Tail for Win32 has crashed on me in some instances). So basically, I would use tail on Cygwin and redirect the output to a f...
null
CC BY-SA 2.5
null
2008-08-24T18:10:17.907
2008-08-24T18:10:17.907
null
null
2,454
null
25,237
2
null
25,147
1
null
[@Andy](https://stackoverflow.com/questions/25147?sort=oldest#25215) I've already looked at that and didn't see how it can help merge multidimensional arrays. Maybe you could give an example. [@kevin](https://stackoverflow.com/questions/25147?sort=oldest#25214) That is probably what I will need to do as I think the ...
null
CC BY-SA 2.5
null
2008-08-24T17:58:57.983
2008-08-24T17:58:57.983
2017-05-23T10:29:57.607
-1
2,118
null
25,236
2
null
25,225
1
null
I have a feeling you haven't finished typing your question yet, but I'll give it a shot still. ;) ``` file1: file2: file3: 1 a A 2 b B 3 c C ~$ paste file{1,2,3} |sed 's/^\|$/"/g; s/\t/","/g' "1","a","A" "2","b","B" "3","c","C" ``` Or, ``` ~$ paste --delimiter , file{1,2,3} 1...
null
CC BY-SA 2.5
null
2008-08-24T17:58:51.947
2008-08-24T17:58:51.947
null
null
456
null
25,249
2
null
25,238
119
null
I am using the following one: [CSS Layout - 100 % height](http://www.xs4all.nl/~peterned/examples/csslayout1.html) > The #container element of this page has a min-height of 100%. That way, if the content requires more height than the viewport provides, the height of #content forces #container to become longer as w...
null
CC BY-SA 3.0
null
2008-08-24T18:12:21.007
2017-05-05T16:03:04.647
2017-05-05T16:03:04.647
738,808
2,078
null
25,255
2
null
25,137
3
null
I just finished a class on model checking and the big tools we used were [Spin](http://spinroot.com/spin/whatispin.html) and [SMV](http://www.cs.cmu.edu/~modelcheck/smv.html). We ended up using them to check properties on common synchronization problems, and I found SMV just a little bit easier to use. Although these ...
null
CC BY-SA 2.5
null
2008-08-24T18:17:20.777
2008-08-24T18:17:20.777
null
null
422
null
25,256
2
null
25,241
2
null
Essentially you need to remove the HttpModule's reliance on HttpApplication and HttpContext, replacing them with an interface. You could create your own IHttpApplication and IHttpContext (along with IHttpResonse, IHttpRequest, etc) or use the ones mentioned by @Dale Ragan or use the shiny new ones in System.Web.Abstra...
null
CC BY-SA 2.5
null
2008-08-24T18:18:14.910
2008-08-24T18:18:14.910
null
null
1,573
null
25,250
2
null
25,241
2
null
In the past before moving to ASP.NET MVC, I used [this library](http://haacked.com/archive/2007/09/09/ihttpcontext-and-other-interfaces-for-your-duck-typing-benefit.aspx) Phil Haack created for Unit Testing anything that used the HttpApplication and HttpContext. It in turned used a [Duck Typing library](http://www.def...
null
CC BY-SA 2.5
null
2008-08-24T18:14:04.530
2008-08-24T18:14:04.530
null
null
1,117
null
25,259
1
25,486
null
266
44,495
What is a good complete [regular expression](http://en.wikipedia.org/wiki/Regular_expression) or some other process that would take the title: > How do you change a title to be part of the URL like Stack Overflow? and turn it into ``` how-do-you-change-a-title-to-be-part-of-the-url-like-stack-overflow ``` that is...
How does Stack Overflow generate its SEO-friendly URLs?
CC BY-SA 4.0
0
2008-08-24T18:21:11.237
2022-09-07T06:37:46.750
2020-01-09T04:15:09.110
5,513,988
1,632
[ "regex", "language-agnostic", "seo", "friendly-url", "slug" ]
25,261
1
25,281
null
31
33,644
I haven't completely understood, how to use `sigprocmask()`. Particularly, how the `set` and `oldset` and its syntax work and how to use them. ``` int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); ``` Please explain with an example, to block, say SIGUSR1 for a few seconds and then unblock and handle i...
Set and Oldset in sigprocmask()
CC BY-SA 3.0
0
2008-08-24T18:23:21.527
2017-11-05T13:17:50.853
2017-07-19T16:31:18.527
7,750,640
2,727
[ "c", "posix", "signals", "sigprocmask" ]
25,262
2
null
25,161
9
null
Yes, you can do this without Javascript. Use an HTML image map, with title attributes, like this: ``` <img usemap="#logo" src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png"> <map name="logo"> <area shape="rect" href="" coords="52,42,121,65" title="Stack"> <area shape="rect" href="" coords="122,42,24...
null
CC BY-SA 3.0
null
2008-08-24T18:24:07.343
2018-01-05T13:22:34.310
2018-01-05T13:22:34.310
92,701
2,670
null
25,268
1
1,067,011
null
21
9,435
Has anybody out there used the [SWIG](http://www.swig.org/exec.html) library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files where I can use them in my .NET a...
What are the best practices when using SWIG with C#?
CC BY-SA 2.5
0
2008-08-24T18:31:54.580
2009-07-01T17:49:21.633
2020-06-20T09:12:55.060
-1
1,117
[ "c#", "c", "swig" ]
25,231
2
null
25,225
2
null
file 1: file2: ``` paste --delimiters=\; file1 file2 ``` Will yield:
null
CC BY-SA 3.0
null
2008-08-24T17:54:52.437
2014-09-05T04:10:07.083
2014-09-05T04:10:07.083
970,195
1,324,220
null
25,203
2
null
24,965
50
null
First, it is alright and normal to feel frustrated when you first start trying to use TDD in your coding style. Just don't get discouraged and quit, you will need to give it some time. It is a major paradigm shift in how we think about solving a problem in code. I like to think of it like when we switched from proce...
null
CC BY-SA 3.0
null
2008-08-24T17:19:30.090
2011-08-27T20:33:46.497
2011-08-27T20:33:46.497
1,117
1,117
null
25,252
1
340,769
null
1
3,372
I'm using [Zend Studio](http://www.zend.com/en/products/studio/) to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts? I have several helper apps to make my application run. It would be really useful to fire up the remote debugger throu...
Remote Debugging PHP Command Line Scripts with Zend?
CC BY-SA 2.5
null
2008-08-24T18:14:54.887
2016-01-15T15:32:26.313
2011-03-30T17:00:45.623
168,868
2,506
[ "php", "debugging", "xdebug", "zend-studio" ]
25,263
2
null
25,259
16
null
You will want to setup a custom route to point the [URL](http://en.wikipedia.org/wiki/Uniform_Resource_Locator) to the controller that will handle it. Since you are using Ruby on Rails, here is an [introduction](http://manuals.rubyonrails.com/read/chapter/65) in using their routing engine. In Ruby, you will need a reg...
null
CC BY-SA 3.0
null
2008-08-24T18:24:10.917
2013-07-10T11:59:40.277
2013-07-10T11:59:40.277
63,550
1,117
null
25,269
1
56,473
null
3
9,206
I'm having an amazing amount of trouble starting and stopping a service on my remote server from my msbuild script. SC.EXE and the ServiceController MSBuild task don't provide switches to allow a username/password so they won't authenticate, so I'm using RemoteService.exe from www.intelliadmin.com -Authenticating wit...
Remotely starting and stopping a service on a W2008 server
CC BY-SA 2.5
0
2008-08-24T18:32:14.220
2011-11-16T20:50:53.210
2011-03-14T12:30:39.150
1,288
2,086
[ "service", "windows-server-2008" ]
25,270
2
null
24,965
0
null
Keep tests short, "atomic". Test the smallest assumption in each test. Make each TestMethod independent, for integration tests I even create a new database for each method. If you need to build some data for each test use an "Init" method. Use mocks to isolate the class your testing from it's dependencies. I always t...
null
CC BY-SA 2.5
null
2008-08-24T18:33:10.147
2008-08-24T18:33:10.147
null
null
1,725
null
25,278
2
null
18,632
1
null
+1 for BareTail. I actually use [BareTailPro](http://www.baremetalsoft.com/baretailpro/index.php), which provides real-time filtering on the tail with basic search strings or search strings using regex.
null
CC BY-SA 2.5
null
2008-08-24T18:48:16.630
2008-08-24T18:48:16.630
null
null
803
null
25,246
2
null
24,995
-1
null
C++ may not be a pure functional language, but parts of STL are certainly functional. See [Bjarne Stroustrup FAQ](http://www.research.att.com/~bs/bs_faq.html) (the inventor of the c++)
null
CC BY-SA 2.5
null
2008-08-24T18:09:55.787
2008-08-24T18:09:55.787
null
null
224
null
25,248
2
null
25,224
1
null
I suppose you're not willing to modify your schema, so I'm afraid my answe might not be of much help, but here goes... One possible solution would be to have the time field empty until it was replaced by a newer value, when you insert the 'deprecation date' instead. Another way is to expand the table with an 'active' ...
null
CC BY-SA 2.5
null
2008-08-24T18:11:02.603
2008-08-24T18:11:02.603
null
null
2,010
null
25,204
2
null
12,374
12
null
I ran into this same issue a while back and found that if I created a simple abstract base class for data access that allowed me to inject a connection and transaction, I could unit test my sprocs to see if they did the work in SQL that I asked them to do and then rollback so none of the test data is left in the db. ...
null
CC BY-SA 2.5
null
2008-08-24T17:20:14.487
2008-08-26T12:12:58.173
2008-08-26T12:12:58.173
2,701
2,701
null
25,279
2
null
25,259
4
null
I don't much about Ruby or Rails, but in Perl, this is what I would do: ``` my $title = "How do you change a title to be part of the url like Stackoverflow?"; my $url = lc $title; # Change to lower case and copy to URL. $url =~ s/^\s+//g; # Remove leading spaces. $url =~ s/\s+$//g; # Remove trailing spaces....
null
CC BY-SA 2.5
null
2008-08-24T18:48:59.890
2008-08-24T18:48:59.890
null
null
683
null
25,277
1
25,456
null
3
1,248
There is a [request](https://web.archive.org/web/20081014140251/http://stackoverflow.uservoice.com:80/pages/general/suggestions/16644) to make the SO search default to an AND style functionality over the current OR when multiple terms are used. The official response was: > not as simple as it sounds; we use SQL Server ...
Can you perform an AND search of keywords using FREETEXT() on SQL Server 2005?
CC BY-SA 4.0
null
2008-08-24T18:47:16.197
2021-11-11T16:14:48.740
2021-11-11T16:14:48.740
4,751,173
2,134
[ "sql-server-2005", "search", "full-text-search", "freetext" ]
25,275
2
null
25,259
5
null
I am not familiar with Ruby on Rails, but the following is (untested) PHP code. You can probably translate this very quickly to Ruby on Rails if you find it useful. ``` $sURL = "This is a title to convert to URL-format. It has 1 number in it!"; // To lower-case $sURL = strtolower($sURL); // Replace all non-word chara...
null
CC BY-SA 3.0
null
2008-08-24T18:41:43.463
2014-01-02T15:13:02.333
2014-01-02T15:13:02.333
1,606
1,606
null
25,284
2
null
25,182
2
null
In the book "SQL Performance Tuning", the authors found that the UNION queries were slower in all 7 DBMS' that they tested (SQL Server 2000, Sybase ASE 12.5, Oracle 9i, DB2, etc.): [http://books.google.com/books?id=3H9CC54qYeEC&pg=PA32&vq=UNION&dq=sql+performance+tuning&source=gbs_search_s&sig=ACfU3U18uYZWYVHxr2I3uUj8k...
null
CC BY-SA 2.5
null
2008-08-24T18:58:53.110
2008-08-24T18:58:53.110
null
null
2,590
null
25,292
2
null
25,269
0
null
If I understand your scenario correctly, it could help running the script with a domain account which is administrator on your remote machine (or better: has the right to start and stop the service).
null
CC BY-SA 2.5
null
2008-08-24T19:20:52.123
2008-08-24T19:20:52.123
null
null
1,069
null
25,287
2
null
25,277
2
null
As far as I've seen, it is possible to do AND when using FREETEXT() under SQL 2005 (nor 2008, afaik). A FREETEXT query ignores Boolean, proximity, and wildcard operators by design. However you could do this: ``` WHERE FREETEXT('You gotta love MS-SQL') > 0 AND FREETEXT('You gotta love MySQL too...') > 0 ``` Or ...
null
CC BY-SA 2.5
null
2008-08-24T19:10:34.207
2008-08-24T19:20:50.127
2008-08-24T19:20:50.127
2,684
2,684
null
25,282
1
null
null
34
28,015
The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example. Why not just use the built in hash functions in your sp...
How would you implement a hashtable in language x?
CC BY-SA 2.5
0
2008-08-24T18:58:16.263
2015-01-14T15:52:17.807
2014-04-23T06:17:59.920
3,440,302
1,797
[ "arrays", "hash", "language-agnostic" ]
25,285
2
null
25,259
2
null
Brian's code, in Ruby: ``` title.downcase.strip.gsub(/\ /, '-').gsub(/[^\w\-]/, '') ``` `downcase` turns the string to lowercase, `strip` removes leading and trailing whitespace, the first `gsub` call lobally stitutes spaces with dashes, and the second removes everything that isn't a letter or a dash.
null
CC BY-SA 2.5
null
2008-08-24T19:03:47.530
2008-08-24T19:03:47.530
null
null
1,600
null
25,291
2
null
25,240
2
null
It looks like you could use a combination of GetHTML and SetHTML to get the current contents, append your html and reinsert everything into the editor. Although it does say > Note that when using this method, you will lose any listener that you may have previously registered on the editor.EditorDocument. Hope that h...
null
CC BY-SA 3.0
null
2008-08-24T19:17:43.020
2015-12-03T19:43:24.263
2015-12-03T19:43:24.263
3,393,505
956
null
25,293
2
null
25,182
3
null
# Hey! These queries are not equivalent. Results will be same only if assuming that one email belongs only to the one time zone. Of course it does however SQL engine doesn't know that and tries to remove duplicities. So the first query should be faster. Always use UNION ALL, unless you know why you want to use UNI...
null
CC BY-SA 2.5
null
2008-08-24T19:25:50.520
2008-09-08T16:15:57.870
2017-05-23T11:54:24.673
-1
2,361
null
25,300
2
null
25,297
37
null
Prefixing reserved words in C# is done with @. ``` public enum Test { @as = 1, @is = 2 } ```
null
CC BY-SA 2.5
null
2008-08-24T19:39:17.447
2008-08-24T19:39:17.447
null
null
1,554
null
25,296
2
null
23,755
1
null
> You also have a fourth alternative that I think would be better than alternative 3:``` haystack.find(needle, searcher) ``` I see your point, but what if `searcher` implements a searching interface that allows for searching other types of objects than haystacks, and finding other things than needles in them? The i...
null
CC BY-SA 2.5
null
2008-08-24T19:33:11.000
2008-08-24T21:47:03.130
2008-08-24T21:47:03.130
1,709
1,709
null
25,299
2
null
25,282
-1
null
I went and read some of the Wikipedia-page on hashing: [http://en.wikipedia.org/wiki/Hash_table](http://en.wikipedia.org/wiki/Hash_table). It seems like a lot of work, to put up code for a hashtable here, especially since most languages I use allready have them built in. Why would you want implementations here? This st...
null
CC BY-SA 2.5
null
2008-08-24T19:38:00.397
2008-08-24T19:38:00.397
null
null
2,260
null
25,294
2
null
25,225
0
null
Also don't forget about the ever versatile [LogParser](http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) if you're on Windows. It can run SQL-like queries against flat text files to perform all sorts of merge operations.
null
CC BY-SA 2.5
null
2008-08-24T19:30:56.827
2008-08-24T19:30:56.827
null
null
338
null
25,303
2
null
25,277
1
null
I just started reading about freetext so bear with me. If what you are trying to do is allow searches for a tag, say VB, also find things tagged as VB6, Visual Basic, VisualBasic and VB.Net, wouldn't those values be set as synonyms in the DB's Thesaurus rather than query parameters? If that is indeed the case, this [l...
null
CC BY-SA 2.5
null
2008-08-24T19:46:56.867
2008-08-25T00:07:58.313
2008-08-25T00:07:58.313
149
149
null
25,317
2
null
24,165
4
null
I have made the switch, since you pointed out it will be the preferred way for microsoft shops. The switch was pretty trivial and as Mike pointed out it ships with the webform view engine as the default, but like Mike also said you can still take advantage of the views you wrote in brail and nvelocity with the [MvcCon...
null
CC BY-SA 2.5
null
2008-08-24T20:18:06.290
2008-08-24T20:23:17.590
2008-08-24T20:23:17.590
1,117
1,117
null
25,281
2
null
25,261
77
null
The idea is that you provide a mask in `set`, effectively a list of signals. The `how` argument says what you should do with the mask in `set`. You can either use `SIG_BLOCK` to block the signals in the `set` list, or `SIG_UNBLOCK` to unblock them. Neither of these changes the signals that aren't set in the list. `...
null
CC BY-SA 3.0
null
2008-08-24T18:57:50.587
2017-11-05T13:17:50.853
2017-11-05T13:17:50.853
1,084
1,084
null
25,318
2
null
13,540
10
null
If to be used with SQL Server 2000/2005 the original code needs to be enclosed in transaction to make sure that data remain consistent in concurrent scenario. ``` BEGIN TRANSACTION Upsert update myTable set Col1=@col1, Col2=@col2 where ID=@ID if @@rowcount = 0 insert into myTable (Col1, Col2) values (@col1, @col2) COM...
null
CC BY-SA 2.5
null
2008-08-24T20:21:28.530
2008-08-24T20:21:28.530
null
null
2,586
null
25,280
2
null
25,259
3
null
Assuming that your model class has a title attribute, you can simply override the to_param method within the model, like this: ``` def to_param title.downcase.gsub(/ /, '-') end ``` [This Railscast episode](http://railscasts.com/episodes/63-model-name-in-url) has all the details. You can also ensure that the title...
null
CC BY-SA 2.5
null
2008-08-24T18:49:42.027
2008-08-24T18:49:42.027
null
null
1,450
null
25,297
1
25,300
null
21
3,920
I would like to use `as` and `is` as members of an enumeration. I know that this is possible in VB.NET to write it like this: ``` Public Enum Test [as] = 1 [is] = 2 End Enum ``` How do I write the equivalent statement in C#? The following code does not compile: ``` public enum Test { as = 1, is = 2 ...
Reserved Keyword in Enumeration in C#
CC BY-SA 3.0
null
2008-08-24T19:37:24.237
2016-07-21T18:14:55.763
2015-07-14T01:38:37.650
1,567,352
2,717
[ "c#", "vb.net", ".net-2.0" ]
25,322
2
null
15,390
1
null
Read the code of other (good) javascript apps and see how they handle things. But I start out with a file per class. But once its ready for production, I would combine the files into one large file and minify. The only reason, I would not combine the files, is if I didn't need all the files on all the pages.
null
CC BY-SA 2.5
null
2008-08-24T20:32:26.723
2008-08-24T20:32:26.723
null
null
2,687
null
25,298
2
null
25,282
0
null
I think you need to be a little more specific. There are several variations on hashtables with regards to the following options - - - The list can go on and on. Each of these constraints could lead to multiple implementations in any language. Personally, I would just use the built-in hashtable that is available i...
null
CC BY-SA 2.5
null
2008-08-24T19:37:37.060
2008-08-24T19:37:37.060
null
null
2,470
null
25,323
1
28,710
null
10
2,851
Typical scenario. We use old-school XML Web Services `internally` for communicating between a server farm and several distributed local clients. No third parties involved, only our applications used by ourselves and our customers. We're currently pondering moving from `XML` `WS` to a `WCF/object-based` model and have...
WCF - Domain Objects and IExtensibleDataObject
CC BY-SA 4.0
0
2008-08-24T20:34:10.293
2018-05-07T05:36:58.653
2018-05-07T05:36:58.653
6,529,212
2,741
[ "wcf", "serialization", "soap", "domain-driven-design", "soa" ]
25,301
2
null
25,297
8
null
You will need to prefix them with the @ symbol to use them. Here is the [msdn page](https://msdn.microsoft.com/en-us/library/x53a06bb.aspx) that explains it.
null
CC BY-SA 3.0
null
2008-08-24T19:40:59.657
2016-07-21T18:14:55.763
2016-07-21T18:14:55.763
1,324
1,117
null
25,328
2
null
24,797
5
null
If either of these issues affects you, you should never store local times in the database: 1. With DST is that there is an "hour of uncertainty" around the falling back period where a local time cannot be unambiguously converted. If exact dates & times are required, then store in UTC. 2. If you want to show users the...
null
CC BY-SA 2.5
null
2008-08-24T20:45:26.087
2008-08-24T20:45:26.087
null
null
1,554
null
25,334
2
null
24,995
3
null
The 'D' language was designed as a successor to C++. A purely functional subset of D is being developed by Andrei Alexandrescu for D 2.0. I am guessing D interoperates well with C++.
null
CC BY-SA 2.5
null
2008-08-24T21:01:48.247
2008-08-24T21:01:48.247
null
null
455,552
null
25,337
2
null
23,755
5
null
> When implementing a needle search of a haystack in an object-oriented way, you essentially have three alternatives: 1. needle.find(haystack) 2. haystack.find(needle) 3. searcher.find(needle, haystack) Which do you prefer, and why? Correct me if I'm wrong, but in all three examples you already a reference to ...
null
CC BY-SA 2.5
null
2008-08-24T21:05:20.780
2008-08-24T21:05:20.780
null
null
1,710
null
25,329
2
null
25,063
14
null
During an internship w/ a large company that had a lot of in house IT, I was paired w/ a mentor. The practice definitely aided my career development, both in terms of technical skills and business skills. Here are some of the reasons the mentoring worked out so well: - - - - -
null
CC BY-SA 2.5
null
2008-08-24T20:48:22.693
2008-08-24T20:48:22.693
null
null
null
null
25,340
2
null
24,995
1
null
I agree that I am not sure of an ecosystem for C++. [OCaml](http://caml.inria.fr/ocaml/) is pretty popular for doing functional programming outside of .NET. F# is also based off of it.
null
CC BY-SA 2.5
null
2008-08-24T21:08:47.603
2008-08-24T21:08:47.603
null
null
1,117
null
25,341
2
null
25,282
7
null
A HashTable is a really simple concept: it is an array in which key and value pairs are placed into, (like an associative array) by the following scheme: A hash function hashes the key to a (hopefully) unused index into the array. the value is then placed into the array at that particular index. Data retrieval is eas...
null
CC BY-SA 2.5
null
2008-08-24T21:09:30.037
2008-08-24T21:09:30.037
null
null
1,638
null
25,343
1
25,346
null
54
38,008
I am familiar with nunit for unit testing of the business layer however I am looking now to automate the test of the win forms gui layer. I have seen [watin](http://watin.sourceforge.net/) and the watin recorder for automating tests on web application by accessing the controls and automating them. However I am strug...
Is there any way to automate windows forms testing?
CC BY-SA 3.0
0
2008-08-24T21:10:33.373
2021-11-14T18:22:22.130
2012-11-21T16:30:18.593
33
33
[ "c#", ".net", "vb.net", "winforms", "automated-tests" ]
25,325
2
null
25,269
0
null
Quick followup question - can you use the "runas" command from an MSBuild script? If so, wouldn't you be able to simply impersonate another user with runas /user:dsfsdf /password:dfdf sc.exe ... (or similiar - I haven't researched the command-line options)?
null
CC BY-SA 2.5
null
2008-08-24T20:36:19.697
2008-08-24T20:36:19.697
null
null
2,741
null
25,326
2
null
25,269
6
null
Often, you can connect to the IPC$ "pseudo-share" on the machine to help establish the credentials before running commands like SC.EXE. Use a command like: ``` C:\> net use \\xx.xx.xx.xx\ipc$ * /user:username ``` The `*` tells it to prompt you for the password.
null
CC BY-SA 3.0
null
2008-08-24T20:36:38.523
2011-11-16T20:50:53.210
2011-11-16T20:50:53.210
11,635
1,554
null
25,344
2
null
25,343
8
null
[AutomatedQA's TestComplete](http://www.automatedqa.com/products/testcomplete/index.asp) is a good testing application to automate GUI testing. It supports more than just Windows Forms also, so you can reuse it for other applications. It is not open source and this is the best that I have found. I haven't seen an op...
null
CC BY-SA 2.5
null
2008-08-24T21:12:55.100
2008-08-24T21:12:55.100
null
null
1,117
null
25,319
2
null
24,165
1
null
The ASP.NET MVC team is still making changes before v1.0, so now's a good time to [provide feedback](http://forums.asp.net/1146.aspx). Also, be aware that there are more frequent releases on [CodePlex](http://www.codeplex.com/aspnet), while the home page on www.asp.net still links to Preview 3.
null
CC BY-SA 2.5
null
2008-08-24T20:22:49.960
2008-08-24T20:22:49.960
null
null
1,554
null
25,345
2
null
25,332
0
null
Your getting into really far out AI type domain. I have done extensive work in text transformation into machine knowledge mainly using Attempto Controlled English (see: [http://attempto.ifi.uzh.ch/site/](http://attempto.ifi.uzh.ch/site/)), it is a natural language (english) that is completely computer processable into ...
null
CC BY-SA 2.5
null
2008-08-24T21:14:55.610
2008-08-24T21:14:55.610
null
null
1,638
null
25,350
2
null
25,349
0
null
The best way is the builtin way: Use `string.Replace`. Why do you need alternatives?
null
CC BY-SA 2.5
null
2008-08-24T21:25:54.663
2008-08-24T21:25:54.663
null
null
1,968
null
25,311
2
null
10,042
220
null
The obvious solution to developers familiar to Java is to use the class already provided in . Say, however, you wanted to make your own implementation for some reason. Here is a quick example of a linked list that inserts a new link at the beginning of the list, deletes from the beginning of the list and loops through...
null
CC BY-SA 3.0
null
2008-08-24T20:03:56.310
2017-05-14T14:02:05.703
2017-05-14T14:02:05.703
3,001,352
2,628
null
25,324
2
null
13,055
211
null
Boxed values are [data structures](http://en.wikipedia.org/wiki/Data_structure) that are minimal wrappers around [primitive types](http://en.wikipedia.org/wiki/Primitive_type)*. Boxed values are typically stored as pointers to objects on [the heap](http://en.wikipedia.org/wiki/Dynamic_memory_allocation). Thus, boxed ...
null
CC BY-SA 3.0
null
2008-08-24T20:35:12.520
2012-12-12T05:49:18.987
2012-12-12T05:49:18.987
101
101
null
25,351
2
null
25,349
2
null
``` string sample = "abc" + Environment.NewLine + "def"; string replaced = sample.Replace(Environment.NewLine, ","); ```
null
CC BY-SA 3.0
null
2008-08-24T21:25:58.937
2011-11-24T07:00:26.877
2011-11-24T07:00:26.877
41,596
1,324,220
null
25,349
1
25,354
null
12
9,321
I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma. What would be, in your opinion, the best way to do this using C#.NET 2.0?
What would be the fastest way to remove Newlines from a String in C#?
CC BY-SA 3.0
null
2008-08-24T21:23:23.310
2020-03-30T18:20:53.793
2015-11-20T11:39:24.153
3,218,692
2,684
[ "c#", ".net", "string", "replace" ]
25,353
2
null
25,349
8
null
Like this: ``` string s = "hello\nworld"; s = s.Replace(Environment.NewLine, ","); ```
null
CC BY-SA 2.5
null
2008-08-24T21:28:32.440
2008-08-24T21:28:32.440
null
null
1,857
null
25,347
2
null
25,147
3
null
``` <?php $a = array('a' => '1', 'b' => array('t' => '4', 'g' => array('e' => '8'))); $b = array('c' => '3', 'b' => array('0' => '4', 'g' => array('h' => '5', 'v' => '9'))); $c = array_merge_recursive($a, $b); print_r($c); ?> ``` [array_merge_recursive — Merge two or more arrays recursively](h...
null
CC BY-SA 3.0
null
2008-08-24T21:19:05.427
2016-07-05T05:25:34.547
2016-07-05T05:25:34.547
4,311,889
115
null
25,354
2
null
25,349
20
null
Why not: ``` string s = "foobar\ngork"; string v = s.Replace(Environment.NewLine,","); System.Console.WriteLine(v); ```
null
CC BY-SA 3.0
null
2008-08-24T21:29:06.277
2012-07-11T13:46:22.330
2012-07-11T13:46:22.330
142,162
1,638
null
25,352
2
null
25,349
2
null
Don't reinvent the wheel — just use: ``` myString.Replace(Environment.NewLine, ",") ```
null
CC BY-SA 4.0
null
2008-08-24T21:26:54.923
2020-03-30T18:20:53.793
2020-03-30T18:20:53.793
9,555,272
1,710
null
25,332
1
null
null
14
6,224
I'm looking for an existing library to summarize or paraphrase content (I'm aiming at blog posts) - any experience with existing natural language processing libraries? I'm open to a variety of languages, so I'm more interested in the abilities & accuracy.
What's a good natural language library to use for paraphrasing?
CC BY-SA 2.5
0
2008-08-24T20:57:33.873
2014-04-02T23:33:37.750
2009-01-28T00:24:30.460
18,154
1,592
[ "language-agnostic", "nlp" ]
25,355
1
25,371
null
3
3,040
I've got two Silverlight Controls in my project, both have properties TeamId. I would like to bind these together in XAML in the control hosting both user controls similar to: ``` <agChat:UserTeams x:Name="oUserTeams" /> <agChat:OnlineUser x:Name="oOnlineUsers" TeamId="{Binding ElementName=oUserTeams, Path=Te...
Custom Attribute Binding in Silverlight
CC BY-SA 3.0
null
2008-08-24T21:31:33.510
2013-12-02T12:47:28.380
2013-12-02T12:47:28.380
2,432,317
2,723
[ "silverlight" ]
25,356
1
87,558
null
8
1,182
I've done several flash projects working as the ActionScripter with a designer doing all the pretty things and animation. When starting out I found quite a lot of information about ActionScript coding and flash design. Most of the information available seems to focus on one or the other. I didn't find any information ...
Flash designer/coder collaboration best practices
CC BY-SA 3.0
0
2008-08-24T21:32:21.353
2017-07-19T16:26:53.313
2017-07-19T16:26:53.313
7,750,640
2,178
[ "flash", "actionscript" ]