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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,220 | 2 | null | 1,625 | 16 | null | For Windows, I found Microsoft's own free [XML Notepad](https://microsoft.github.io/XmlNotepad/) to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;)
Requires .net 2.0
| null | CC BY-SA 4.0 | null | 2008-08-06T09:30:50.297 | 2020-12-16T02:21:36.710 | 2020-12-16T02:21:36.710 | null | 483 | null |
3,221 | 2 | null | 1,625 | 3 | null | Altova's [XML Spy](http://www.altova.com/products/xmlspy/xml_editor.html) is a great editor, but not necesarily the cheapest option out there.
| null | CC BY-SA 2.5 | null | 2008-08-06T09:33:16.160 | 2008-08-06T09:33:16.160 | null | null | 377 | null |
3,218 | 2 | null | 3,164 | 56 | null | Perhaps this might work:
```
String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty);
```
| null | CC BY-SA 3.0 | null | 2008-08-06T09:28:50.940 | 2018-03-20T14:18:12.730 | 2018-03-20T14:18:12.730 | 5,894,241 | 383 | null |
3,215 | 2 | null | 3,213 | 3 | null | why massive lookup table?
```
string GetWrittenInteger(int n)
{
string[] a = new string[] {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" }
string[] b = new string[] { "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen" }
string[] c... | null | CC BY-SA 3.0 | null | 2008-08-06T09:22:35.993 | 2016-02-07T14:05:32.510 | 2016-02-07T14:05:32.510 | 2,921,691 | 275 | null |
3,230 | 1 | 10,141 | null | 38 | 33,757 | I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine.
Without doing this you get the error message that the application configuration is not c... | How do you pack a visual studio c++ project for release? | CC BY-SA 2.5 | 0 | 2008-08-06T09:49:27.467 | 2020-03-05T19:29:23.967 | null | null | 370 | [
"c++",
"visual-studio"
] |
3,196 | 1 | 3,197 | null | 26 | 23,438 | If I have data like this:
| Key | Name |
| --- | ---- |
| 1 | Dan |
| 2 | Tom |
| 3 | Jon |
| 4 | Tom |
| 5 | Sam |
| 6 | Dan |
What is the SQL query to bring back the records where `Name` is repeated 2 or more times?
So the result I would want is
| Tom |
| --- |
| Dan |
| SQL query, count and group by | CC BY-SA 4.0 | 0 | 2008-08-06T09:00:58.063 | 2022-01-18T11:02:47.973 | 2020-12-16T21:15:54.893 | 1,367,454 | 230 | [
"sql"
] |
3,231 | 1 | 842,632 | null | 31 | 29,446 | I want to write C/C++ programs that take input from a MIDI device.
The MIDI device connects to my PC using a USB connector.
I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port.
I'm happy manipulating the MIDI data once I get it, I just don... | C/C++ library for reading MIDI signals from a USB MIDI device | CC BY-SA 2.5 | 0 | 2008-08-06T09:51:06.153 | 2019-04-13T20:11:34.717 | 2008-09-10T18:13:56.557 | -1 | 381 | [
"c++",
"c",
"midi",
"signal-processing"
] |
3,233 | 2 | null | 3,224 | 10 | null | Some solutions I have seen involve adding a version number to the end of the file in the form of a query string.
```
<script type="text/javascript" src="funkycode.js?v1">
```
You could use the SVN revision number to automate this [for you](https://stackoverflow.com/questions/2308/aspnet-display-svn-revision-number) ... | null | CC BY-SA 3.0 | null | 2008-08-06T09:52:01.347 | 2013-02-06T06:03:24.553 | 2017-05-23T10:29:36.727 | -1 | 383 | null |
3,224 | 1 | 3,225 | null | 64 | 7,683 | CSS and Javascript files don't change very often, so I want them to be cached by the web browser. But I also want the web browser to see changes made to these files without requiring the user to clear their browser cache. Also want a solution that works well with a version control system such as Subversion.
---
> So... | How can I make the browser see CSS and Javascript changes? | CC BY-SA 3.0 | 0 | 2008-08-06T09:38:15.417 | 2021-10-04T12:41:36.303 | 2020-06-20T09:12:55.060 | -1 | 486 | [
"javascript",
"css",
"http",
"caching"
] |
3,225 | 2 | null | 3,224 | 30 | null | I found that if you append the last modified timestamp of the file onto the end of the URL the browser will request the files when it is modified. For example in PHP:
```
function urlmtime($url) {
$parsed_url = parse_url($url);
$path = $parsed_url['path'];
if ($path[0] == "/") {
$filename = $_SERVER['... | null | CC BY-SA 3.0 | null | 2008-08-06T09:41:02.353 | 2016-02-07T14:04:38.793 | 2016-02-07T14:04:38.793 | 2,921,691 | 486 | null |
3,234 | 1 | 14,496 | null | 21 | 18,891 | How would one display any add content from a "dynamic" aspx page? Currently I am working on using the System.Web.HttpResponse "Page.Response" to write a file that is stored on a web server to a web request.
This would allow people to hit a url to the type [http://www.foo.com?Image=test.jpg](http://www.foo.com?Image=te... | Displaying ad content from Respose.WriteFile()/ Response.ContentType | CC BY-SA 2.5 | 0 | 2008-08-06T09:52:36.603 | 2019-12-27T06:26:45.553 | 2008-09-01T08:15:49.240 | 231 | 231 | [
"c#"
] |
3,240 | 2 | null | 3,234 | 0 | null | This is part of a solution I use on a local intranet. Some of the variables you will have to collect yourself as I pull them from a database but you may pull them from somewhere else.
The only extra but I've got in there is a function called which connects to the database and pulls back the correct mine type based on... | null | CC BY-SA 2.5 | null | 2008-08-06T09:59:38.633 | 2008-08-06T09:59:38.633 | null | null | 383 | null |
3,243 | 2 | null | 1,625 | 2 | null | +1 for XML Spy, I've used both the stand alone product and the visual studio plugin, and I've been impressed.
In terms of FOSS, I use [Notepad++](http://notepad-plus.sourceforge.net/uk/site.htm)
| null | CC BY-SA 2.5 | null | 2008-08-06T10:04:35.237 | 2008-08-06T10:15:05.917 | 2008-08-06T10:15:05.917 | 246 | 246 | null |
3,241 | 2 | null | 3,027 | 1 | null | [Eric Meyer](http://meyerweb.com) implemented a very similar thing as a WordPress plugin called [WP-GateKeeper](http://meyerweb.com/eric/tools/wordpress/wp-gatekeeper.html) that asks human-readable questions like "What colour is an orange?". He did have some issues around asking questions that a non-native English spe... | null | CC BY-SA 2.5 | null | 2008-08-06T10:02:50.060 | 2008-08-06T10:02:50.060 | null | null | 377 | null |
3,245 | 2 | null | 3,180 | 7 | null | I use it as well and quite frankly wouldn't want to work without it.
I've always had some kind of issue tracker available for the projects I work on and thus am quite used to updating it. With FB6 the process is now even better.
Since FB also integrates with Subversion, the source control tool I use for my projects, ... | null | CC BY-SA 2.5 | null | 2008-08-06T10:05:25.237 | 2008-08-06T10:05:25.237 | null | null | 267 | null |
3,255 | 1 | 4,852,666 | null | 970 | 508,513 | Most people with a degree in CS will certainly know what [Big O stands for](http://www.nist.gov/dads/HTML/bigOnotation.html).
It helps us to measure how well an algorithm scales.
But I'm curious, how do calculate or approximate the complexity of your algorithms?
| Big O, how do you calculate/approximate it? | CC BY-SA 4.0 | 0 | 2008-08-06T10:18:16.067 | 2022-04-21T18:19:28.467 | 2019-12-19T17:59:49.437 | 102,937 | 46 | [
"algorithm",
"optimization",
"complexity-theory",
"big-o",
"performance"
] |
3,249 | 2 | null | 2,898 | 3 | null | On Mac OS X, I have used BBEdit since the early 1990's, so I use that as my reference for all other editors. I sometimes use BBEdit to edit files on a Linux box using ftp mode, and that works very well if you have a fast network connection to the Linux box.
I learned emacs two years ago because the rest of the program... | null | CC BY-SA 2.5 | null | 2008-08-06T10:11:19.327 | 2008-08-06T10:11:19.327 | null | null | 491 | null |
3,260 | 1 | 3,288 | null | 59 | 61,398 | We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value which is used in our calculations.
T... | Peak detection of measured signal | CC BY-SA 3.0 | 0 | 2008-08-06T10:23:18.833 | 2020-12-08T08:18:30.347 | 2015-09-18T13:17:51.843 | 1,505,120 | 186 | [
"algorithm",
"language-agnostic"
] |
3,261 | 2 | null | 9 | 46 | null | This is the version we use here. It works, and it's fairly simple. It's the same idea as Jeff's but I think it's a little clearer because it separates out the logic for subtracting one, so it's a little easier to understand.
```
public static int GetAge(this DateTime dateOfBirth, DateTime dateAsAt)
{
return dateAs... | null | CC BY-SA 4.0 | null | 2008-08-06T10:23:30.550 | 2019-12-24T08:53:46.643 | 2019-12-24T08:53:46.643 | 5,407,188 | 489 | null |
3,274 | 2 | null | 3,180 | 14 | null | When I was working for myself doing my consulting business I signed up for a hosted account and honestly I couldn't have done without it.
What I liked most about it was it took 30 seconds to sign up for an account and I was then able to integrate source control using sourcegear vault (which is an excellent source con... | null | CC BY-SA 2.5 | null | 2008-08-06T10:46:14.373 | 2008-08-06T10:46:14.373 | null | null | 493 | null |
3,267 | 2 | null | 3,213 | 70 | null | This should work reasonably well:
```
public static class HumanFriendlyInteger
{
static string[] ones = new string[] { "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" };
static string[] teens = new string[] { "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "S... | null | CC BY-SA 3.0 | null | 2008-08-06T10:31:24.170 | 2016-10-15T19:12:20.550 | 2016-10-15T19:12:20.550 | 332 | 332 | null |
3,280 | 2 | null | 3,255 | 7 | null | Familiarity with the algorithms/data structures I use and/or quick glance analysis of iteration nesting. The difficulty is when you call a library function, possibly multiple times - you can often be unsure of whether you are calling the function unnecessarily at times or what implementation they are using. Maybe lib... | null | CC BY-SA 3.0 | null | 2008-08-06T10:59:40.603 | 2011-05-24T22:15:58.047 | 2011-05-24T22:15:58.047 | 63,550 | 364 | null |
3,275 | 2 | null | 3,272 | 0 | null | The way I see it is this.
You have a Windows Service, which is playing the role of a scheduler and in it there are some classes which simply call the webservices and put the data in your databases.
So, you can use these classes directly from the WebUI as well and import the data based on the WebUI trigger.
I don't l... | null | CC BY-SA 2.5 | null | 2008-08-06T10:53:15.437 | 2008-08-06T10:53:15.437 | null | null | 380 | null |
3,282 | 2 | null | 3,272 | 0 | null | @Vaibhav
Unfortunately, the physical architecture of the solution will not allow any direct communication between the components, other than Web UI to Database, and database to service (which can then call out to the web services). I do, however, agree that re-use of the communication classes would be the ideal here ... | null | CC BY-SA 2.5 | null | 2008-08-06T11:03:12.640 | 2008-08-06T11:03:12.640 | null | null | 377 | null |
3,273 | 2 | null | 3,088 | 2 | null | It really depends on your brother's learning style. Many people learn faster by getting their hands dirty & just getting into it, crystallising the concepts and the big picture as they progress and build their knowledge.
Me, I prefer to start with the big picture and drill down into the nitty-gritty. The first thing I... | null | CC BY-SA 2.5 | null | 2008-08-06T10:44:54.297 | 2008-08-06T10:44:54.297 | null | null | 492 | null |
3,271 | 2 | null | 1,644 | 1 | null | The Stack Overflow podcast is the reason I'm now here. Jeff, unfortunately, is a poor project manager in terms of managing expectations and setting timelines -- yet the beta has arrived, and it's pretty decent! The .NET world is alien to me, so I've enjoyed the Stack Overflow podcast.
This Week in Tech is another podc... | null | CC BY-SA 2.5 | null | 2008-08-06T10:41:16.910 | 2008-08-06T10:41:16.910 | null | null | 491 | null |
3,228 | 2 | null | 3,213 | 10 | null | I use this code.It is VB code but you can easily translate it to C#. It works
```
Function NumberToText(ByVal n As Integer) As String
Select Case n
Case 0
Return ""
Case 1 To 19
Dim arr() As String = {"One","Two","Three","Four","Five","Six","Seven", _
"Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fou... | null | CC BY-SA 3.0 | null | 2008-08-06T09:46:18.863 | 2015-05-22T10:38:03.847 | 2015-05-22T10:38:03.847 | 487 | 487 | null |
3,281 | 1 | 4,270 | null | 23 | 15,279 | I'm wondering if there's a way to do what I can do below with Python, in Ruby:
```
sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data))
```
I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.
| Mapping values from two array in Ruby | CC BY-SA 2.5 | 0 | 2008-08-06T11:02:20.597 | 2014-01-09T08:24:56.067 | 2008-09-10T05:13:44.217 | -1 | 484 | [
"ruby",
"maps",
"reduce"
] |
3,289 | 2 | null | 3,260 | 0 | null | You could apply some [Standard Deviation](http://en.wikipedia.org/wiki/Standard_deviations) to your logic and take notice of peaks over x%.
| null | CC BY-SA 4.0 | null | 2008-08-06T11:17:29.240 | 2018-12-07T02:19:42.850 | 2018-12-07T02:19:42.850 | 276,648 | 383 | null |
3,288 | 2 | null | 3,260 | 10 | null | You could try signal averaging, i.e. for each point, average the value with the surrounding 3 or more points. If the noise blips are huge, then even this may not help.
I realise that this was language agnostic, but guessing that you are using LabView, there are lots of pre-packaged signal processing VIs that come with... | null | CC BY-SA 2.5 | null | 2008-08-06T11:12:48.890 | 2008-08-06T17:13:46.417 | 2008-08-06T17:13:46.417 | 199 | 199 | null |
3,292 | 2 | null | 3,284 | 9 | null | To add to the previous explanations, static method calls are bound to a specific method at , which rather rules out polymorphic behavior.
| null | CC BY-SA 2.5 | null | 2008-08-06T11:24:41.957 | 2008-08-06T11:24:41.957 | null | null | 266 | null |
3,290 | 2 | null | 3,027 | 1 | null | @KP
After your update to the original question, the only real option available to you is to do some jiggery-pokery in Javascript on the client. The only issue with that would be provicing graceful degredation for non-javascript enabled clients.
e.g. You could add some AJAX-y goodness that reads a hidden form filed... | null | CC BY-SA 2.5 | null | 2008-08-06T11:19:28.083 | 2008-08-06T11:19:28.083 | null | null | 377 | null |
3,272 | 1 | 5,101 | null | 15 | 3,125 | I am currently working on a project with specific requirements. A brief overview of these are as follows:
- - - - -
The current (pre-pre-production) model for web service communication triggering is via a database table that stores trigger requests generated from the manual intervention. I do not really want to ... | Timer-based event triggers | CC BY-SA 3.0 | null | 2008-08-06T10:43:16.720 | 2012-01-31T14:26:13.217 | 2012-01-31T14:26:13.217 | 4,714 | 377 | [
"sql",
"web-services",
"service",
"triggers",
"timer"
] |
3,284 | 1 | 3,294 | null | 208 | 127,067 | I've been working with [providers](http://msdn.microsoft.com/en-us/library/aa479030.aspx) a fair bit lately, and I came across an interesting situation where I wanted to have an abstract class that had an abstract static method. I read a few posts on the topic, and it sort of made sense, but is there a nice clear expla... | Why can't I have abstract static methods in C#? | CC BY-SA 2.5 | 0 | 2008-08-06T11:04:33.587 | 2022-06-10T11:07:36.733 | 2011-01-08T22:20:09.187 | 63,550 | 493 | [
"c#",
".net",
"language-design"
] |
3,291 | 2 | null | 3,284 | 46 | null | Static methods cannot be inherited or overridden, and that is why they can't be abstract. Since static methods are defined on the type, not the instance, of a class, they must be called explicitly on that type. So when you want to call a method on a child class, you need to use its name to call it. This makes inheritan... | null | CC BY-SA 4.0 | null | 2008-08-06T11:21:11.667 | 2020-12-11T15:06:22.200 | 2020-12-11T15:06:22.200 | 1,028,230 | 489 | null |
3,297 | 2 | null | 3,255 | 6 | null | Break down the algorithm into pieces you know the big O notation for, and combine through big O operators. That's the only way I know of.
For more information, check the [Wikipedia page](http://en.wikipedia.org/wiki/Big_O_notation) on the subject.
| null | CC BY-SA 2.5 | null | 2008-08-06T11:34:26.803 | 2008-08-06T11:34:26.803 | null | null | 267 | null |
3,300 | 2 | null | 3,260 | 0 | null | I don't know very much about instrumentation, so this might be totally impractical, but then again it might be a helpful different direction. If you know how the readings can fail, and there is a certain interval between peaks given such failures, why not do gradient descent at each interval. If the descent brings yo... | null | CC BY-SA 2.5 | null | 2008-08-06T11:38:37.607 | 2008-08-06T11:38:37.607 | null | null | 279 | null |
3,306 | 2 | null | 2,993 | 2 | null | This also works:
```
host_name = Socket.getaddrinfo(current_ip,nil)
append_to_file("#{host_name[0][2]} - #{current_ip} - #{mac_addr}\n")
```
I'm not sure why `gethostbyaddr` didn't also work.
| null | CC BY-SA 3.0 | null | 2008-08-06T12:04:15.463 | 2013-10-11T00:49:43.380 | 2013-10-11T00:49:43.380 | 128,421 | 155 | null |
3,310 | 2 | null | 3,230 | 0 | null | You'd be looking to static link (as opposed to dynamically link)
I'm not sure how many of the MS redistributables statically link in.
| null | CC BY-SA 2.5 | null | 2008-08-06T12:10:55.920 | 2008-08-06T12:10:55.920 | null | null | 257 | null |
3,308 | 2 | null | 2,913 | 1 | null | You could try [http://selenium.openqa.org/](http://selenium.openqa.org/) it is more for GUI testing rather than a data layer testing application but does record your actions which then can be played back to automate tests across different platforms.
| null | CC BY-SA 2.5 | null | 2008-08-06T12:06:28.597 | 2008-08-06T12:06:28.597 | null | null | 33 | null |
3,313 | 2 | null | 1,988 | 1 | null | It's a tricky question. Since lisp is already structurally so close to a parse tree the difference between a large number of macros and implementing your own mini-language in a parser generator isn't very clear. But, except for the opening and closing paren, you could very easily end up with something that looks noth... | null | CC BY-SA 2.5 | null | 2008-08-06T12:14:12.213 | 2008-08-06T12:14:12.213 | null | null | 279 | null |
3,299 | 2 | null | 3,260 | 2 | null | I think you want to [cross-correlate](http://en.wikipedia.org/wiki/Cross-correlation) your signal with an expected, exemplar signal. But, it has been such a long time since I studied signal processing and even then I didn't take much notice.
| null | CC BY-SA 2.5 | null | 2008-08-06T11:38:05.393 | 2008-08-06T11:38:05.393 | null | null | 488 | null |
3,314 | 2 | null | 3,281 | 2 | null | The Array.zip function does an elementwise combination of arrays. It's not quite as clean as the Python syntax, but here's one approach you could use:
```
weights = [1, 2, 3]
data = [4, 5, 6]
result = Array.new
a.zip(b) { |x, y| result << x * y } # For just the one operation
sum = 0
a.zip(b) { |x, y| sum += x * y } #... | null | CC BY-SA 3.0 | null | 2008-08-06T12:15:50.747 | 2013-05-14T10:24:17.930 | 2013-05-14T10:24:17.930 | 322,020 | 533 | null |
3,316 | 2 | null | 3,315 | 14 | null | As the compiler is telling you, you need to change your return type to IEnumerable. That is how the yield return syntax works.
| null | CC BY-SA 2.5 | null | 2008-08-06T12:19:57.367 | 2008-08-06T12:19:57.367 | null | null | 489 | null |
3,285 | 2 | null | 564 | 20 | null | In Java there are two basic types in the [JVM](http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#22930). 1) Primitive types and 2) Reference Types. int is a primitive type and Integer is a class type (which is kind of reference type).
Primitive values do not share state with other primitive val... | null | CC BY-SA 2.5 | null | 2008-08-06T11:08:52.283 | 2009-02-05T06:58:19.783 | 2009-02-05T06:58:19.783 | 486 | 486 | null |
3,294 | 2 | null | 3,284 | 162 | null | Static methods are not as such, they're just available without an object reference.
A call to a static method is done through the class name, not through an object reference, and the Intermediate Language (IL) code to call it will call the abstract method through the name of the class that defined it, not necessarily... | null | CC BY-SA 4.0 | null | 2008-08-06T11:30:07.093 | 2019-04-15T09:19:49.013 | 2019-04-15T09:19:49.013 | 10,009,545 | 267 | null |
3,320 | 2 | null | 3,319 | 25 | null | ```
var element = document.getElementById('element');
element.style.background = '#FF00AA';
```
| null | CC BY-SA 4.0 | null | 2008-08-06T12:25:13.800 | 2018-06-07T18:55:16.183 | 2018-06-07T18:55:16.183 | 6,331,369 | 192 | null |
3,319 | 1 | 3,321 | null | 129 | 185,262 | How can I set the background color of an HTML element using css in JavaScript?
| How to set background color of HTML element using css properties in JavaScript | CC BY-SA 4.0 | 0 | 2008-08-06T12:23:22.413 | 2021-04-24T15:52:25.827 | 2020-09-23T13:59:13.407 | 13,957,283 | 383 | [
"javascript",
"css",
"background-color"
] |
3,315 | 1 | 3,316 | null | 22 | 12,798 | I need to set the height of every textbox on my form, some of which are nested within other controls. I thought I could do something like this:
```
private static IEnumerator<TextBox> FindTextBoxes(Control rootControl)
{
foreach (Control control in rootControl.Controls)
{
if (control.Controls.Count > ... | Can I have a method returning IEnumerator<T> and use it in a foreach loop? | CC BY-SA 3.0 | 0 | 2008-08-06T12:17:31.320 | 2015-10-22T03:07:56.643 | 2015-10-22T03:07:56.643 | 2,197,604 | 503 | [
"c#",
"foreach",
"ienumerable",
"ienumerator"
] |
3,323 | 2 | null | 3,315 | 1 | null | ```
// Generic function that gets all child controls of a certain type,
// returned in a List collection
private static List<T> GetChildTextBoxes<T>(Control ctrl) where T : Control{
List<T> tbs = new List<T>();
foreach (Control c in ctrl.Controls) {
// If c is of type T, add it to the collection
... | null | CC BY-SA 3.0 | null | 2008-08-06T12:32:59.353 | 2015-08-31T16:10:40.537 | 2015-08-31T16:10:40.537 | 2,185,245 | 51 | null |
3,345 | 2 | null | 3,315 | 3 | null | If you return IEnumerator, it will be a different enumerator object each time call that method (acting as though you reset the enumerator on each iteration). If you return IEnumerable then a foreach can enumerate based on the method with the yield statement.
| null | CC BY-SA 2.5 | null | 2008-08-06T13:04:33.487 | 2008-08-06T13:04:33.487 | null | null | 507 | null |
3,318 | 2 | null | 3,281 | 1 | null | Ruby has a `map` method (a.k.a. the `collect` method), which can be applied to any `Enumerable` object. If `numbers` is an array of numbers, the following line in Ruby:
```
numbers.map{|x| x + 5}
```
is the equivalent of the following line in Python:
```
map(lambda x: x + 5, numbers)
```
For more details, see [he... | null | CC BY-SA 2.5 | null | 2008-08-06T12:21:46.460 | 2008-08-06T12:21:46.460 | null | null | 216 | null |
3,359 | 2 | null | 2,987 | 6 | null | > What is the difference between SetForeGroundWindow, SetActiveWindow, and BringWindowToTop? It appears as if they all do the same thing.
According to MSDN, SetForeGroundWindow will activate the window and direct keyboard focus to it. This attempts to work even when your process is in the background. SetActiveWindow d... | null | CC BY-SA 2.5 | null | 2008-08-06T13:20:08.103 | 2008-08-06T13:20:08.103 | null | null | 457 | null |
3,361 | 2 | null | 3,319 | 21 | null | Or, using a little jQuery:
```
$('#fieldID').css('background-color', '#FF6600');
```
| null | CC BY-SA 2.5 | null | 2008-08-06T13:23:42.247 | 2008-08-06T13:23:42.247 | null | null | 37 | null |
3,321 | 2 | null | 3,319 | 167 | null | In general, CSS properties are converted to JavaScript by making them camelCase without any dashes. So `background-color` becomes `backgroundColor`.
```
function setColor(element, color)
{
element.style.backgroundColor = color;
}
// where el is the concerned element
var el = document.getElementById('elementId');
... | null | CC BY-SA 4.0 | null | 2008-08-06T12:25:54.920 | 2019-09-04T18:44:02.557 | 2019-09-04T18:44:02.557 | 10,686,479 | 489 | null |
3,369 | 2 | null | 2,798 | 2 | null | Instead of learning APIs to each map service provider ( like Gmaps, Ymaps api) Its good to learn [Mapstraction](http://www.mapstraction.com/doc/)
"Mapstraction is a library that provides a common API for various javascript mapping APIs"
I would suggest you go to the URL and learn a general API. There is good amount o... | null | CC BY-SA 2.5 | null | 2008-08-06T13:35:08.930 | 2008-08-06T13:35:08.930 | null | null | 482 | null |
3,362 | 1 | 13,130 | null | 109 | 177,810 | I would like to be able to use the key within a text box to tab over four spaces. The way it is now, the Tab key jumps my cursor to the next input.
Is there some JavaScript that will capture the Tab key in the text box before it bubbles up to the UI?
I understand some browsers (i.e. FireFox) may not allow this. How ... | Capturing TAB key in text box | CC BY-SA 4.0 | 0 | 2008-08-06T13:27:05.453 | 2019-01-18T08:02:43.230 | 2019-01-18T08:02:43.230 | 567,854 | 357 | [
"javascript",
"user-interface"
] |
3,370 | 2 | null | 3,362 | 13 | null | The previous answer is fine, but I'm one of those guys that's firmly against mixing behavior with presentation (putting JavaScript in my HTML) so I prefer to put my event handling logic in my JavaScript files. Additionally, not all browsers implement event (or e) the same way. You may want to do a check prior to runnin... | null | CC BY-SA 3.0 | null | 2008-08-06T13:35:44.157 | 2017-07-29T05:47:51.973 | 2017-07-29T05:47:51.973 | 2,792,083 | 20 | null |
3,372 | 2 | null | 3,362 | 6 | null | I would advise against changing the default behaviour of a key. I do as much as possible without touching a mouse, so if you make my tab key not move to the next field on a form I will be very aggravated.
A shortcut key could be useful however, especially with large code blocks and nesting. Shift-TAB is a bad option... | null | CC BY-SA 2.5 | null | 2008-08-06T13:36:33.640 | 2008-08-06T13:36:33.640 | null | null | 37 | null |
3,329 | 2 | null | 1,069 | 10 | null | I have same problems in my work (we also use `VC6` sometimes). And there is no easy solution for it. I have only some hints:
- [Process Dumper](http://www.microsoft.com/downloads/details.aspx?FamilyID=e089ca41-6a87-40c8-bf69-28ac08570b7e&displaylang=en)- - [Advanced Windows Debugging](https://rads.stackoverflow.com/am... | null | CC BY-SA 3.0 | null | 2008-08-06T12:41:52.737 | 2013-02-07T12:30:58.993 | 2013-02-07T12:30:58.993 | 395,659 | 501 | null |
3,385 | 1 | 10,747 | null | 124 | 244,505 | I know that we can get the MAC address of a user via IE (ActiveX objects).
Is there a way to obtain a user's MAC address using JavaScript?
| MAC addresses in JavaScript | CC BY-SA 3.0 | 0 | 2008-08-06T13:43:44.983 | 2022-07-27T02:57:08.317 | 2017-03-17T17:52:57.883 | 23,199 | 384 | [
"javascript",
"mac-address"
] |
3,375 | 2 | null | 1,615 | 1 | null | You don't have to get out of Ruby to do this, can use the Base64 module in Ruby to encode the document like this:
```
irb(main):005:0> require 'base64'
=> true
irb(main):007:0> Base64.encode64("Hello World")
=> "SGVsbG8gV29ybGQ=\n"
irb(main):008:0> Base64.decode64("SGVsbG8gV29ybGQ=\n")
=> "Hello World"
```
And you... | null | CC BY-SA 3.0 | null | 2008-08-06T13:37:41.657 | 2016-02-07T01:01:35.187 | 2016-02-07T01:01:35.187 | 2,921,691 | 161 | null |
3,390 | 2 | null | 3,385 | 68 | null | The quick and simple answer is No.
Javascript is quite a high level language and does not have access to this sort of information.
| null | CC BY-SA 2.5 | null | 2008-08-06T13:45:00.707 | 2008-08-06T13:45:00.707 | null | null | 383 | null |
3,398 | 2 | null | 3,385 | 7 | null | If this is for an intranet application and all of the clients use DHCP, you can query the DHCP server for the MAC address for a given IP address.
| null | CC BY-SA 2.5 | null | 2008-08-06T13:51:52.267 | 2008-08-06T13:51:52.267 | null | null | 75 | null |
3,368 | 2 | null | 3,255 | 213 | null | Big O gives the upper bound for time complexity of an algorithm. It is usually used in conjunction with processing data sets (lists) but can be used elsewhere.
A few examples of how it's used in C code.
Say we have an array of n elements
```
int array[n];
```
If we wanted to access the first element of the arra... | null | CC BY-SA 2.5 | null | 2008-08-06T13:34:13.753 | 2008-08-06T13:34:13.753 | null | null | 370 | null |
3,371 | 2 | null | 3,362 | 18 | null | I'd rather tab indentation not work than breaking tabbing between form items.
If you want to indent to put in code in the Markdown box, use + (or ⌘K on a Mac).
In terms of actually stopping the action, jQuery (which Stack Overflow uses) will stop an event from bubbling when you return false from an event callback. Th... | null | CC BY-SA 3.0 | null | 2008-08-06T13:36:04.220 | 2013-02-06T06:02:44.313 | 2013-02-06T06:02:44.313 | 938,024 | 265 | null |
3,388 | 2 | null | 2,913 | 2 | null | I guess it depends what database you're using, but Red Gate (www.red-gate.com) make a tool called SQL Data Generator. This can be configured to fill your database with sensible looking test data. You can also tell it to always use the same seed in its random number generator so your 'random' data is the same every ti... | null | CC BY-SA 2.5 | null | 2008-08-06T13:44:48.443 | 2008-08-06T13:44:48.443 | null | null | 475 | null |
3,360 | 2 | null | 3,033 | 226 | null | The rule of thumb is to use the function most suited to your needs.
If you just want the keys and do not plan to ever any of the values, use keys():
```
foreach my $key (keys %hash) { ... }
```
If you just want the values, use values():
```
foreach my $val (values %hash) { ... }
```
If you need the keys the va... | null | CC BY-SA 2.5 | null | 2008-08-06T13:22:14.620 | 2009-06-04T07:05:59.850 | 2009-06-04T07:05:59.850 | 17,389 | 164 | null |
3,406 | 2 | null | 3,404 | 4 | null | IE 8 is supposed to have better tools, but the IE Developer Toolbar is pretty good.
| null | CC BY-SA 3.0 | null | 2008-08-06T13:58:57.167 | 2011-11-29T18:15:55.990 | 2011-11-29T18:15:55.990 | 95 | 34 | null |
3,413 | 2 | null | 3,400 | -1 | null | % Matches any number of characters
_ Matches a single character
I've never used Full-Text indexing but you can accomplish rather complex and fast search queries with simply using the build in T-SQL string functions.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:00:57.600 | 2008-08-06T14:00:57.600 | null | null | 383 | null |
3,422 | 2 | null | 3,400 | 3 | null | One thing worth keeping in mind is that leading wildcard queries come at a significant performance premium, compared to other wildcard usages.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:03:59.123 | 2008-08-06T14:03:59.123 | null | null | 60 | null |
3,409 | 2 | null | 3,404 | 30 | null | You might find [Firebug Lite](http://getfirebug.com/lite.html) useful for that.
Its bookmarklet should be especially useful when debugging on a user's machine.
| null | CC BY-SA 2.5 | null | 2008-08-06T13:59:47.213 | 2008-08-06T13:59:47.213 | null | null | 60 | null |
3,408 | 1 | 166,705 | null | 17 | 4,358 | What do you think is the best set-up for RoR in a Win Vista environment? I've tried the radrails eclipse plug-in, and it just seemed too bulky for me, I've also started to just use Textpad and the command line, but I'm used to having somewhat of an IDE to work with.
| Ruby On Rails with Windows Vista - Best Setup? | CC BY-SA 3.0 | 0 | 2008-08-06T13:59:16.793 | 2013-07-11T02:27:13.160 | 2013-01-09T05:37:54.907 | 1,471,203 | 514 | [
"ruby-on-rails",
"windows",
"ruby",
"ide"
] |
3,404 | 1 | 3,409 | null | 44 | 7,163 | I use Firebug and the Mozilla JS console heavily, but every now and then I run into an IE-only JavaScript bug, which is really hard to locate (ex: , when the source HTML only has 200 lines).
I would love to have a lightweight JS tool ( firebug) for Internet Explorer, something I can install in seconds on a client's PC... | JavaScript Troubleshooting Tools in Internet Explorer | CC BY-SA 4.0 | 0 | 2008-08-06T13:56:42.210 | 2019-01-18T08:02:19.587 | 2019-01-18T08:02:19.587 | 567,854 | 547 | [
"javascript",
"internet-explorer",
"debugging"
] |
3,405 | 2 | null | 3,400 | 3 | null | : this was the answer I submitted for the original version #1 of the question before the `CONTAINS` keyword was introduced in revision #2. It's still factually accurate.
The wildcard character in SQL Server is the `%` sign and it works just fine, leading, trailing or otherwise.
That said, if you're going to be doing an... | null | CC BY-SA 4.0 | null | 2008-08-06T13:57:28.683 | 2020-07-21T18:31:18.243 | 2020-07-21T18:31:18.243 | 419 | 419 | null |
3,421 | 2 | null | 3,408 | 0 | null | You might want to take a look at this:
[http://www.sapphiresteel.com/](http://www.sapphiresteel.com/)
There's a free personal edition too
(Updated: Assuming that you already have Visual Studio Full Fat Edition)
| null | CC BY-SA 2.5 | null | 2008-08-06T14:03:43.210 | 2008-08-06T14:12:47.437 | 2008-08-06T14:12:47.437 | 419 | 419 | null |
3,425 | 2 | null | 3,408 | 1 | null | [Instant Rails](http://instantrails.rubyforge.org/wiki/wiki.pl) is a good way to get started quick.
I can verify that it works well on Vista.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:07:13.733 | 2008-08-06T14:07:13.733 | null | null | 60 | null |
3,427 | 2 | null | 3,400 | 17 | null | The problem with leading Wildcards: They cannot be indexed, hence you're doing a full table scan.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:07:59.973 | 2008-08-06T14:07:59.973 | null | null | 91 | null |
3,423 | 2 | null | 2,214 | 4 | null | I've had great success using [NUnit](http://www.nunit.org) as well.
I've also used [NMock](http://www.nmock.org) when the need arose for mock objects. As an added bonus, the factory for creating your mock objects is called the Mockery.
To facilitate the running of unit tests, I've used [TestDriven.NET](http://testdri... | null | CC BY-SA 2.5 | null | 2008-08-06T14:06:19.540 | 2008-08-06T14:06:19.540 | null | null | 512 | null |
3,439 | 2 | null | 3,432 | 10 | null | ```
UPDATE table1, table2 SET table1.col1='value', table2.col1='value' WHERE table1.col3='567' AND table2.col6='567'
```
This should work for ya.
There is a reference in [the MySQL manual](http://dev.mysql.com/doc/refman/5.0/en/update.html) for multiple tables.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:14:33.737 | 2010-06-24T23:56:42.373 | 2010-06-24T23:56:42.373 | 1,288 | 115 | null |
3,428 | 2 | null | 3,408 | 2 | null | Are you just looking for an IDE, or a full stack (IDE, source control, database, web server)?
If just an IDE, I would recommend [NetBeans](http://www.netbeans.org/) or [RadRails](http://www.aptana.com/rails). Both have syntax highlighting, code help, support for Rails projects, code completion, and basically everythi... | null | CC BY-SA 2.5 | null | 2008-08-06T14:09:03.933 | 2008-08-06T14:17:43.307 | 2008-08-06T14:17:43.307 | 308 | 308 | null |
3,400 | 1 | null | null | 50 | 66,430 | I using SQL's Full-text search capabilities, CONTAINS clauses and all - the * is the wildcard in full-text, % is for LIKE clauses only.
I've read in several places now that "leading wildcard" searches (e.g. using "*overflow" to match "stackoverflow") is not supported in MS SQL. I'm considering using a [CLR function... | How do you get leading wildcard full-text searches to work in SQL Server? | CC BY-SA 2.5 | 0 | 2008-08-06T13:52:29.067 | 2020-07-21T18:31:18.243 | 2009-07-17T11:26:21.777 | 76,337 | 35 | [
"sql-server",
"full-text-search"
] |
3,432 | 1 | 3,466 | null | 444 | 478,739 | I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL?
Edit:
For example I have the following
```
Name id Col1 Col2
Row1 1 6 1
Row2 2 2 3
Row3 3 9 5
Row4 4 16 8
```
I want to combine all the following Up... | Multiple Updates in MySQL | CC BY-SA 2.5 | 0 | 2008-08-06T14:12:09.903 | 2023-01-17T09:07:18.080 | 2013-06-25T20:03:23.627 | 426,671 | 1,384,652 | [
"mysql",
"sql",
"sql-update"
] |
3,441 | 2 | null | 3,408 | 5 | null | [e-texteditor](http://e-texteditor.com) seems to be growing as the editor of choice for rails development on ruby. Too bad it isn't free.
Aside from that, the [RailsOnWindows](http://wiki.rubyonrails.org/rails/pages/RailsOnWindows) guide works fine. And Sqlite is by far your best choice for development: [RailsWithSqli... | null | CC BY-SA 2.5 | null | 2008-08-06T14:15:34.000 | 2008-08-06T14:15:34.000 | null | null | 34 | null |
3,443 | 2 | null | 2,214 | 9 | null | We use [MbUnit](http://www.mbunit.com/) and [Rihno Mocks](http://www.ayende.com/Blog/archive/2007/03/28/Rhino-Mocks-3.0-Released.aspx) and they prove to work very well together. When doing TDD you will almost certainly need to do some form of dependency injection, while this can be done manually, its worth looking at a... | null | CC BY-SA 3.0 | null | 2008-08-06T14:16:35.790 | 2014-10-31T04:40:50.290 | 2014-10-31T04:40:50.290 | 2,575,662 | 230 | null |
3,437 | 1 | 20,612 | null | 20 | 15,189 | We recently discovered that the Google Maps API does not play nicely with SSL. Fair enough, but what are some options for overcoming this that others have used effectively?
> [Will the Maps API work over SSL (HTTPS)?](http://code.google.com/support/bin/answer.py?answer=65301&topic=10945)At this time, the Maps API is ... | Options for Google Maps over SSL | CC BY-SA 2.5 | 0 | 2008-08-06T14:14:29.383 | 2017-06-03T07:56:26.933 | 2012-02-19T12:20:12.870 | 2,153,784 | 308 | [
"google-maps",
"iframe",
"ssl",
"https"
] |
3,449 | 2 | null | 3,432 | -4 | null | ```
UPDATE tableName SET col1='000' WHERE id='3' OR id='5'
```
This should achieve what you'r looking for. Just add more id's. I have tested it.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:22:37.837 | 2010-06-24T23:55:25.433 | 2010-06-24T23:55:25.433 | 1,288 | 115 | null |
3,445 | 2 | null | 3,432 | 2 | null | You may also be interested in using joins on updates, which is possible as well.
```
Update someTable Set someValue = 4 From someTable s Inner Join anotherTable a on s.id = a.id Where a.id = 4
-- Only updates someValue in someTable who has a foreign key on anotherTable with a value of 4.
```
Edit: If the values you ... | null | CC BY-SA 2.5 | null | 2008-08-06T14:20:23.257 | 2008-08-06T14:20:23.257 | null | null | 26 | null |
3,452 | 1 | 34,153 | null | 484 | 697,837 | How can I connect to a remote SQL server using Mac OS X? I don't really need a GUI, but it would be nice to have for the color coding and resultset grid. I'd rather not have to use a VM.
Is there a SQL client for Mac OS X that works with MS SQL Server?
| SQL Client for Mac OS X that works with MS SQL Server | CC BY-SA 3.0 | 0 | 2008-08-06T14:25:17.457 | 2018-11-05T11:44:52.220 | 2016-11-29T16:16:09.797 | 1,676,152 | 437 | [
"sql-server",
"macos"
] |
3,448 | 1 | 3,492 | null | 21 | 1,990 | I've noticed a lot of sites, SO included, use XHTML as their mark-up language and then fail to adhere to the spec. Just browsing the source for SO there are missing closing tags for paragraphs, invalid elements, etc.
So should tools (and developers) use the XHTML doctype if they are going to produce invalid mark up? A... | Is it acceptable for invalid XHTML? | CC BY-SA 2.5 | 0 | 2008-08-06T14:21:18.823 | 2021-12-05T11:57:54.680 | 2010-02-25T09:06:21.317 | 342 | 342 | [
"xhtml",
"markup"
] |
3,460 | 2 | null | 3,448 | 1 | null | I wouldn't use XHTML at all just to save myself the philosophical stress. It's not like any browsers are treating it like XHTML anyway.
Browsers will reject poor mark-up if the page is sent as application/xhtml+xml, but they rarely are. This is fine.
I would be more concerned about things like inline use of CSS and J... | null | CC BY-SA 2.5 | null | 2008-08-06T14:29:44.780 | 2008-08-06T14:29:44.780 | null | null | 265 | null |
3,457 | 2 | null | 3,448 | 0 | null | So long as it works in IE, FF, Safari, (insert other browser here) you should be okay. Validation isn't as important as having it render correctly in multiple browsers. Just because it is valid, doesn't mean it'll work in IE properly, for instance.
Run Google Analytics or similar on your site and see what kind of br... | null | CC BY-SA 2.5 | null | 2008-08-06T14:29:09.697 | 2008-08-06T14:29:09.697 | null | null | 396 | null |
3,455 | 2 | null | 3,452 | 1 | null | This doesn't specifically answer your question, because I'm not sure in any clients exist in Mac OS X, but I generally just [Remote Desktop](http://en.wikipedia.org/wiki/Remote_Desktop_Services#Remote_Desktop_Connection) into the server and work through that. Another option is [VMware Fusion](http://en.wikipedia.org/wi... | null | CC BY-SA 3.0 | null | 2008-08-06T14:28:13.613 | 2012-06-14T21:11:08.377 | 2012-06-14T21:11:08.377 | 63,550 | 26 | null |
3,444 | 2 | null | 3,432 | -2 | null | The following will update all rows in one table
```
Update Table Set
Column1 = 'New Value'
```
The next one will update all rows where the value of Column2 is more than 5
```
Update Table Set
Column1 = 'New Value'
Where
Column2 > 5
```
There is all [Unkwntech](https://stackoverflow.com/questions/3432/multiple-upd... | null | CC BY-SA 2.5 | null | 2008-08-06T14:18:21.217 | 2008-08-06T14:18:21.217 | 2017-05-23T12:10:54.147 | -1 | 383 | null |
3,453 | 2 | null | 3,448 | 0 | null | It depends. I had that [issue with my blog](http://www.stum.de/2008/02/29/valid-xhtml-and-youtube-embedding/) where a YouTube video caused invalid XHTML, but it rendered fine. On the other hand, I have a "Valid XHTML" link, and a combination of a "Valid XHTML" claim and invalid XHTML is not professional.
As SO does no... | null | CC BY-SA 2.5 | null | 2008-08-06T14:25:40.577 | 2008-08-06T14:25:40.577 | null | null | 91 | null |
3,461 | 2 | null | 3,448 | 0 | null | I say, if it renders OK, then it doesn't matter if it's pixel perfect.
It takes a while to get a site up and running the way you want it, going back and making changes is going to change the way the page renders slightly, then you have to fix problems.
Now, I'm not saying you should built sloppy web pages, but I se... | null | CC BY-SA 2.5 | null | 2008-08-06T14:29:56.543 | 2008-08-06T14:29:56.543 | null | null | 30 | null |
3,464 | 2 | null | 564 | 8 | null | One more thing that I don't see in previous answers:
In Java the primitive wrappers classes like Integer, Double, Float, Boolean... and String are suposed to be invariant, so that when you pass an instance of those classes the invoked method couldn't alter your data in any way, in opositión with most of other classes, ... | null | CC BY-SA 2.5 | null | 2008-08-06T14:33:33.090 | 2010-03-05T02:48:56.727 | 2010-03-05T02:48:56.727 | 42,439 | 518 | null |
3,465 | 2 | null | 3,448 | 0 | null | There are so many standards and they are so badly "enforced" or supported that I don't think it matters. Don't get me wrong, I think there should be standards but because they are not enforced, nobody follows them and it's a massive downward spiral.
| null | CC BY-SA 2.5 | null | 2008-08-06T14:33:33.947 | 2008-08-06T14:33:33.947 | null | null | 1,384,652 | null |
3,462 | 2 | null | 3,448 | 0 | null | I don't understand why everyone get caught up trying to make their websites fit the standard when some browsers sill have problems properly rendering standard code. I've been in web design for something like 10 years and I stopped double codding (read: hacking css), and changing stupid stuff just so I could put a butt... | null | CC BY-SA 2.5 | null | 2008-08-06T14:30:23.203 | 2008-08-06T14:30:23.203 | null | null | 115 | null |
3,466 | 2 | null | 3,432 | 718 | null | Yes, that's possible - you can use INSERT ... ON DUPLICATE KEY UPDATE.
Using your example:
```
INSERT INTO table (id,Col1,Col2) VALUES (1,1,1),(2,2,3),(3,9,3),(4,10,12)
ON DUPLICATE KEY UPDATE Col1=VALUES(Col1),Col2=VALUES(Col2);
```
| null | CC BY-SA 2.5 | null | 2008-08-06T14:33:41.560 | 2008-08-06T14:33:41.560 | null | null | 136 | null |