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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32,343 | 1 | 32,348 | null | 66 | 65,697 | Let's say I had a program in C# that did something computationally expensive, like encoding a list of WAV files into MP3s. Ordinarily I would encode the files one at a time, but let's say I wanted the program to figure out how many CPU cores I had and spin up an encoding thread on each core. So, when I run the program ... | How do I spawn threads on different CPU cores? | CC BY-SA 3.0 | 0 | 2008-08-28T14:11:20.523 | 2016-05-18T12:01:17.233 | 2016-05-18T12:01:17.233 | 33,311 | 2,577 | [
"c#",
".net",
"windows",
"multithreading"
] |
32,352 | 2 | null | 32,343 | 2 | null | It is the operating system's job to split threads across different cores, and it will do so when automatically when your threads are using a lot of CPU time. Don't worry about that. As for finding out how many cores your user has, try `Environment.ProcessorCount` in C#.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:13:57.367 | 2008-08-28T14:13:57.367 | null | null | 2,018 | null |
32,347 | 2 | null | 32,343 | 2 | null | Where each thread goes is generally handled by the OS itself...so generate 4 threads on a 4 core system and the OS will decide which cores to run each on, which will usually be 1 thread on each core.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:13:01.877 | 2008-08-28T14:13:01.877 | null | null | 194 | null |
32,353 | 2 | null | 32,332 | 0 | null | Is there any class in STL that takes a string... I dont think so (couldnt find any in my quick search). So it's probably some design decision, that no class in STL should be dependent on any other STL class (that is not directly needed for functionality).
| null | CC BY-SA 2.5 | null | 2008-08-28T14:14:24.447 | 2008-08-28T14:14:24.447 | null | null | 2,957 | null |
32,338 | 1 | 32,670 | null | 4 | 256 | I just saw [Clone Detective](http://www.codeplex.com/CloneDetectiveVS) linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.
Edit: For those who don't want to follow the link, Clone Detective scan... | Are there similar tools to Clone Detective for other languages/IDEs? | CC BY-SA 3.0 | null | 2008-08-28T14:09:25.880 | 2014-12-13T08:27:19.127 | 2014-12-13T08:27:19.127 | 1,810,429 | 3,326 | [
"c#",
"language-agnostic"
] |
32,341 | 1 | null | null | 0 | 1,570 | I may just be missing this functionality, but does anyone know if there is a widget available:
I need to list the subject for all the entries that are associated with a given tag.
For example: I have 5 articles tagged with "Tutorial", I'd like to see a list as follows:
- - - -
Does functionality like this exists i... | How do I list all Entries with a certain tag in Wordpress? | CC BY-SA 3.0 | null | 2008-08-28T14:10:52.100 | 2019-10-08T08:24:54.233 | 2012-04-25T22:08:20.933 | 1,332,690 | 2,490 | [
"wordpress",
"widget"
] |
32,354 | 2 | null | 32,282 | 8 | null | If you are an Emacs user, the command `re-builder` lets you type an Emacs regex and shows on the fly the matching strings in the current buffer, with colors to mark groups. It's free as Emacs.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:14:30.593 | 2008-08-28T14:14:30.593 | null | null | 2,797 | null |
32,348 | 2 | null | 32,343 | 63 | null | Don't bother doing that.
Instead use the [Thread Pool](http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx). The thread pool is a mechanism (actually a class) of the framework that you can query for a new thread.
When you ask for a new thread it will either give you a new one or enqueue the work ... | null | CC BY-SA 2.5 | null | 2008-08-28T14:13:41.920 | 2008-08-28T14:35:50.510 | 2008-08-28T14:35:50.510 | 2,695 | 2,695 | null |
32,359 | 2 | null | 32,343 | 3 | null | You shouldn't have to worry about doing this yourself. I have multithreaded .NET apps running on dual-quad machines, and no matter how the threads are started, whether via the ThreadPool or manually, I see a nice even distribution of work across all cores.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:16:11.337 | 2008-08-28T14:16:11.337 | null | null | 1,219 | null |
32,364 | 1 | 32,466 | null | 6 | 1,233 | How do I exercise an action to ensure it redirects to the correct action or route?
| Assert action redirected to correct action/route? | CC BY-SA 2.5 | 0 | 2008-08-28T14:17:11.477 | 2010-07-06T15:21:20.433 | null | null | 1,946 | [
"asp.net-mvc",
"unit-testing"
] |
32,336 | 2 | null | 32,260 | 1,155 | null | Be sure to use `System.Net.Mail`, not the deprecated `System.Web.Mail`. Doing SSL with `System.Web.Mail` is a gross mess of hacky extensions.
```
using System.Net;
using System.Net.Mail;
var fromAddress = new MailAddress("from@gmail.com", "From Name");
var toAddress = new MailAddress("to@example.com", "To Name");
cons... | null | CC BY-SA 4.0 | null | 2008-08-28T14:08:03.307 | 2021-07-14T14:55:29.687 | 2021-07-14T14:55:29.687 | 4,592,248 | 3,191 | null |
32,360 | 1 | 32,394 | null | 9 | 9,391 | How do you specify that a foreign key constraint should be a 1:1 relationship in transact sql? Is declaring the column UNIQUE enough? Below is my existing code.!
```
CREATE TABLE [dbo].MyTable(
[MyTablekey] INT IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[OtherTableKey] INT NOT NULL UNIQUE
CONSTRAINT [... | 1:1 Foreign Key Constraints | CC BY-SA 3.0 | 0 | 2008-08-28T14:16:15.520 | 2016-08-12T19:25:39.643 | 2016-08-12T19:25:39.643 | 1,274,572 | 3,400 | [
"sql",
"sql-server"
] |
32,372 | 2 | null | 32,360 | 4 | null | You could declare the column to be both the primary key and a foreign key. This is a good strategy for "extension" tables that are used to avoid putting nullable columns into the main table.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:19:05.387 | 2008-08-28T14:19:05.387 | null | null | 1,219 | null |
32,368 | 2 | null | 32,332 | 14 | null | There are several places where the C++ standard committee did not really optimize the interaction between facilities in the standard library.
`std::string` and its use in the library is one of these.
One other example is `std::swap`. Many containers have a swap member function, but no overload of std::swap is supplie... | null | CC BY-SA 2.5 | null | 2008-08-28T14:18:08.947 | 2008-08-28T14:24:32.193 | 2008-08-28T14:24:32.193 | 3,186 | 3,186 | null |
32,365 | 2 | null | 32,282 | 9 | null | Here are some for the Mac: ()
- [RegExhibit](http://homepage.mac.com/roger_jolly/software/)- [Reggy](http://code.google.com/p/reggy/)- [RegexWidget](http://robrohan.com/2008/06/25/mac-os-x-regex-widget-update-17/)
| null | CC BY-SA 2.5 | null | 2008-08-28T14:17:31.833 | 2008-08-28T14:17:31.833 | null | null | 792 | null |
32,356 | 2 | null | 32,145 | 3 | null | [@Brian](https://stackoverflow.com/questions/32145/is-this-a-reasonable-way-to-handle-getterssetters-in-a-php-class#32219)
> > > > My problem with this is that adding "more logic later" requires that you add blanket logic that applies to all properties accessed with the getter/setter or that you use if or switch state... | null | CC BY-SA 2.5 | null | 2008-08-28T14:14:57.893 | 2008-08-28T14:26:23.217 | 2017-05-23T10:27:50.457 | -1 | 305 | null |
32,369 | 1 | 32,386 | null | 457 | 313,997 | One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don't get me wrong, I'm all for doing everything possible to protect people's personal information (health, financial, surfing habits, etc.), but sometimes peo... | Disable browser 'Save Password' functionality | CC BY-SA 3.0 | 0 | 2008-08-28T14:18:09.150 | 2023-02-07T20:18:18.093 | 2013-10-10T15:03:52.127 | 531,179 | 3,262 | [
"security",
"browser",
"autocomplete",
"passwords"
] |
32,376 | 1 | 9,721,453 | null | 34 | 29,822 | I am looking for a lean and well constructed open source implementation of a B-tree library written in C. It needs to be under a non-GPL license so that it can be used in a commercial application. Ideally, this library supports the B-tree index to be stored/manipulated as a disk file so that large trees can be built us... | What is a good open source B-tree implementation in C? | CC BY-SA 2.5 | 0 | 2008-08-28T14:21:10.657 | 2012-09-26T17:16:40.457 | 2008-08-28T14:41:53.413 | 1,553 | 1,553 | [
"c",
"algorithm",
"data-structures",
"b-tree"
] |
32,361 | 2 | null | 8,485 | 3 | null | My understanding is that this is how HTML works. If you do a `<form url="foo" method="get">` and post the form, then the form will post foo?
```
param1=value1&...¶mn=valuen
```
It has nothing to do with MVC.
Besides, what part of REST does that URL violate? It's not a URL, but by strict definition of REST, it ... | null | CC BY-SA 3.0 | null | 2008-08-28T14:16:24.787 | 2015-07-14T01:46:57.580 | 2015-07-14T01:46:57.580 | 3,555,000 | 598 | null |
32,381 | 2 | null | 32,366 | 2 | null | I'd say that it is very important to consider how much load you are causing. For instance, if your crawler requests every object of a single site, more or less at once, it might cause load problems for that particular site.
In other words, make sure your crawler is not too aggressive.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:21:56.863 | 2008-08-28T14:21:56.863 | null | null | 2,964 | null |
32,358 | 2 | null | 30,230 | 4 | null | It turns out this is a bug with Firefox + ASP.NET where the generated javascript for the defaultButton stuff doesn't work in Firefox. I had to put a replacement for the WebForm_FireDefatultButton function as described [here](http://forums.asp.net/t/1294544.aspx):
```
function WebForm_FireDefaultButton(event, target) {... | null | CC BY-SA 2.5 | null | 2008-08-28T14:16:01.743 | 2009-02-18T00:51:36.017 | 2009-02-18T00:51:36.017 | 2,462 | 2,462 | null |
32,380 | 2 | null | 32,360 | 0 | null | Based on your code above, the unique constraint would be enough given that the for every primary key you have in the table, the unique constrained column is also unique. Also, this assumes that in [OtherTable], the [OtherTableKey] column is the primary key of that table.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:21:47.207 | 2008-08-28T14:21:47.207 | null | null | 1,875 | null |
32,378 | 2 | null | 32,369 | 8 | null | Not really - the only thing you could realistically do is offer advice on the site; maybe, before their first time signing in, you could show them a form with information indicating that it is not recommended that they allow the browser to store the password.
Then the user will immediately follow the advice, write dow... | null | CC BY-SA 2.5 | null | 2008-08-28T14:21:19.203 | 2008-08-28T14:21:19.203 | null | null | 1,790 | null |
32,390 | 2 | null | 32,369 | 0 | null | One way I know is to use (for instance) JavaScript to copy the value out of the password field before submitting the form.
The main problem with this is that the solution is tied to JavaScript.
Then again, if it can be tied to JavaScript you might as well hash the password on the client-side before sending a request ... | null | CC BY-SA 2.5 | null | 2008-08-28T14:23:48.247 | 2008-08-28T14:23:48.247 | null | null | 1,830 | null |
32,384 | 2 | null | 32,280 | 1 | null | Although it is not strictly related you might want to take a look to [Spec#](http://research.microsoft.com/SpecSharp/).
I think it is still in development (by Microsoft) but some CTP are available and it looks promising. Basically it allows you to do this:
```
public static int Divide(int x, int y)
requires y != ... | null | CC BY-SA 2.5 | null | 2008-08-28T14:22:28.220 | 2008-08-28T14:22:28.220 | null | null | 2,695 | null |
32,392 | 2 | null | 32,366 | 9 | null | Obey robots.txt (and not too aggressive like has been said already).
You might want to think about your user-agent string - they're a good place to be up-front about what you're doing and how you can be contacted.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:24:01.757 | 2008-08-28T14:24:01.757 | null | null | 987 | null |
32,385 | 1 | 32,402 | null | 10 | 2,253 | This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:
1. Edit the configuration of Python apps that use source modules for configuration.
2. Se... | Programmatically editing Python source | CC BY-SA 3.0 | 0 | 2008-08-28T14:23:00.247 | 2015-05-03T02:57:26.957 | 2015-05-03T02:57:26.957 | 15,168 | 2,147 | [
"python",
"file-io"
] |
32,366 | 1 | 32,392 | null | 11 | 3,159 | I just started thinking about creating/customizing a web crawler today, and know very little about web crawler/robot etiquette. A majority of the writings on etiquette I've found seem old and awkward, so I'd like to get some current (and practical) insights from the web developer community.
I want to use a crawler to... | What are the key considerations when creating a web crawler? | CC BY-SA 2.5 | 0 | 2008-08-28T14:17:35.780 | 2014-04-24T00:24:18.120 | 2014-04-24T00:19:13.017 | 881,229 | 326 | [
"web-crawler"
] |
32,396 | 2 | null | 32,341 | 1 | null | If you are comfortable with hacking WP you can try adding to your sidebar with wp_list_pages, [http://codex.wordpress.org/Template_Tags/wp_list_pages](http://codex.wordpress.org/Template_Tags/wp_list_pages).
Or there are plug-ins like Simple-Tags([http://wordpress.org/extend/plugins/simple-tags/](http://wordpress.org/... | null | CC BY-SA 2.5 | null | 2008-08-28T14:24:15.937 | 2008-08-28T14:24:15.937 | null | null | 3,290 | null |
32,394 | 2 | null | 32,360 | 9 | null | A foreign key column with the UNIQUE and NOT NULL constraints that references a UNIQUE, NOT NULL column in another table creates a 1:(0|1) relationship, which is probably what you want.
If there was a true 1:1 relationship, every record in the first table would have a corresponding record in the second table and vice-... | null | CC BY-SA 2.5 | null | 2008-08-28T14:24:12.113 | 2008-08-28T14:24:12.113 | null | null | 619 | null |
32,395 | 1 | 32,418 | null | 4 | 7,940 | How does one go about referencing a class's static properties in xaml? In other words, I want to do something like this:
```
Class BaseThingy {
public static readonly Style BaseStyle;
...
}
```
```
<ResoureDictionary ...>
<Style BasedOn="BaseThingy.Style" TargetType="BaseThingy" />
</ResourceDictionary>
```... | Accessing static fields in XAML | CC BY-SA 3.0 | 0 | 2008-08-28T14:24:15.157 | 2012-02-11T18:19:57.583 | 2012-02-11T18:19:57.583 | 546,730 | 93 | [
"c#",
".net",
"wpf",
"silverlight",
"xaml"
] |
32,386 | 2 | null | 32,369 | 335 | null | I'm not sure if it'll work in all browsers but you should try setting autocomplete="off" on the form.
```
<form id="loginForm" action="login.cgi" method="post" autocomplete="off">
```
> The easiest and simplest way to disable Form and prevent form data from being cached in session history is to use the autocomplete f... | null | CC BY-SA 4.0 | null | 2008-08-28T14:23:22.913 | 2021-01-09T17:24:44.973 | 2021-01-09T17:24:44.973 | 10,607,772 | 2,114 | null |
32,398 | 2 | null | 32,282 | 1 | null | I'll add to the vote of [Reggy](http://reggyapp.com/) for the Mac, gonna try out some of the other ones that Joseph suggested and upvote that post tomorrow when my limit gets reset.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:25:37.167 | 2008-08-28T14:25:37.167 | null | null | 1,384,652 | null |
32,393 | 2 | null | 32,100 | 27 | null | I see both some SQL Server specific and some MySQL specific solutions here, so you might want to clarify which database you need. Though if I had to guess I'd say SQL Server since this is trivial in MySQL.
I also see some solutions that won't work because they fail to take into account the possibility for duplicates, ... | null | CC BY-SA 4.0 | null | 2008-08-28T14:24:04.143 | 2021-04-23T13:14:59.450 | 2021-04-23T13:14:59.450 | 3,043 | 3,043 | null |
32,401 | 1 | null | null | 6 | 11,400 | How do I validate a UK phone number in C# using a regex?
| Validate a UK phone number | CC BY-SA 2.5 | 0 | 2008-08-28T14:26:42.903 | 2011-10-11T15:04:25.707 | 2008-09-02T14:09:22.487 | 1,414 | 2,868 | [
"c#",
"regex",
"language-agnostic"
] |
32,402 | 2 | null | 32,385 | 6 | null | Python's standard library provides pretty good facilities for working with Python source; note the [tokenize](https://docs.python.org/2/library/tokenize.html) and [parser](https://docs.python.org/2/library/parser.html) modules.
| null | CC BY-SA 3.0 | null | 2008-08-28T14:27:37.410 | 2014-12-07T22:09:25.897 | 2014-12-07T22:09:25.897 | 258,138 | 3,207 | null |
32,388 | 2 | null | 32,369 | -1 | null | > Is there a way for a site to tell the browser not to offer to remember passwords?
The website tells the browser that it is a password by using `<input type="password">`. So if you do this from a website perspective then you would have to change that. (Obviously I don't recommend this).
The best solution would be... | null | CC BY-SA 2.5 | null | 2008-08-28T14:23:41.197 | 2008-08-28T14:23:41.197 | null | null | 792 | null |
32,397 | 1 | 32,399 | null | 14 | 3,859 | On SO 18 Joel mentioned an algorithm that would rank items based on their age and popularity and it's based on gravity. Could someone post this? C# would be lovely, but really any language (well, I can't do LISP) would be fine.
| Popularity algorithm | CC BY-SA 2.5 | 0 | 2008-08-28T14:24:21.303 | 2011-07-25T21:29:56.750 | 2008-08-28T14:26:24.417 | 1,414 | 1,942 | [
"c#",
"algorithm",
"math"
] |
32,406 | 2 | null | 32,332 | 0 | null | I believe that this has been thought about and was done to avoid the dependency; i.e. #include <fstream> should not force one to #include <string>.
To be honest, this seems like quite an inconsequential issue. A better question would be, why is std::string's interface so large?
| null | CC BY-SA 2.5 | null | 2008-08-28T14:28:52.883 | 2008-08-28T14:28:52.883 | null | null | 2,131 | null |
32,405 | 2 | null | 32,145 | 1 | null | @Mark
But even your method requires a fresh declaration of the method, and it somewhat takes away the advantage of putting it in a method so that you can add more logic, because to add more logic requires the old-fashioned declaration of the method, anyway. In its default state (which is where it is impressive in what... | null | CC BY-SA 2.5 | null | 2008-08-28T14:28:13.150 | 2008-08-28T14:28:13.150 | null | null | 1,344 | null |
32,391 | 2 | null | 13,832 | 1 | null | I would recommend that you take the language specific compilers out of the equation for this one. And you can still use NAnt to do this:
First start off with a target that uses MSBuild because that will compile your project regardless of language used and take care of the dependencies for you. That means you don't nee... | null | CC BY-SA 2.5 | null | 2008-08-28T14:24:01.663 | 2008-08-28T14:24:01.663 | null | null | 1,107 | null |
32,410 | 2 | null | 32,343 | 1 | null | One of the reasons you should not (as has been said) try to allocated this sort of stuff yourself, is that you just don't have enough information to do it properly, particularly into the future with NUMA, etc.
If you have a thread read-to-run, and there's a core idle, the kernel run your thread, don't worry.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:29:39.730 | 2008-08-28T14:29:39.730 | null | null | 987 | null |
32,417 | 2 | null | 32,412 | 5 | null | Restore the data from a recent backup.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:31:58.553 | 2008-08-28T14:31:58.553 | null | null | 2,131 | null |
32,399 | 2 | null | 32,397 | 11 | null | My understanding is that it is approximately the following from another [Jeff Atwood](https://stackoverflow.com/questions/24066/what-formula-should-be-used-to-determine-hot-questions) post
```
t = (time of entry post) - (Dec 8, 2005)
x = upvotes - downvotes
y = {1 if x > 0, 0 if x = 0, -1 if x < 0)
z = {1 if x < 1, o... | null | CC BY-SA 2.5 | null | 2008-08-28T14:26:05.777 | 2009-11-16T03:19:54.397 | 2017-05-23T12:33:26.220 | -1 | 1,553 | null |
32,404 | 1 | 32,440 | null | 324 | 403,813 | I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level interface for operations on these objects, and the other programs to access the objects through that service.
I am currently a... | How do you run a Python script as a service in Windows? | CC BY-SA 3.0 | 0 | 2008-08-28T14:28:04.493 | 2022-06-15T07:51:59.157 | 2018-02-27T21:29:18.850 | 1,849,664 | 2,077 | [
"python",
"windows",
"cross-platform"
] |
32,418 | 2 | null | 32,395 | 11 | null | Use [x:Static](http://msdn.microsoft.com/en-us/library/ms742135.aspx) markup extension
```
<ResoureDictionary ...
xmlns:local="clr-namespace:Namespace.Where.Your.BaseThingy.Class.Is.Defined"
>
<Style BasedOn="{x:Static local:BaseThingy.BaseStyle}" TargetType="BaseThingy" />
</ResourceDictionary>
```
| null | CC BY-SA 2.5 | null | 2008-08-28T14:32:03.873 | 2008-08-28T14:46:32.140 | 2008-08-28T14:46:32.140 | 1,196 | 1,196 | null |
32,412 | 1 | 32,417 | null | 9 | 2,719 | I've been tasked with the the maintenance of a nonprofit website that recently fell victim to a SQL injection attack. Someone exploited a form on the site to add text to every available text-like field in the database (varchar, nvarchar, etc.) which, when rendered as HTML, includes and executes a JavaScript file.
A G... | What's the best way of cleaning up after a SQL Injection? | CC BY-SA 2.5 | 0 | 2008-08-28T14:29:59.370 | 2015-11-25T10:13:06.290 | null | null | 2,577 | [
"sql",
"sql-server",
"database",
"security"
] |
32,400 | 2 | null | 32,198 | 4 | null | A more sophosticated aproach would be to use IO Completion ports. (Windows)
With IO Completion ports you leave to the operating system to manage polling, which lets it potentially use very high level of optimization with NIC driver support.
Basically, you have a queue of network operations which is OS managed, and prov... | null | CC BY-SA 2.5 | null | 2008-08-28T14:26:26.557 | 2008-08-28T14:26:26.557 | null | null | 972 | null |
32,425 | 2 | null | 31,930 | 0 | null | After fooling around with the tunctionallity that gets the reportStream, I was able to fix the mail sending problem.
The error wasn't in the SendMail method, but somewehere else. The exception was thrown in the context, of SendMail though. Buggered!
| null | CC BY-SA 2.5 | null | 2008-08-28T14:33:50.187 | 2008-08-28T14:33:50.187 | null | null | 2,972 | null |
32,414 | 1 | 32,427 | null | 691 | 593,299 | We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slowing down this process. That being said, one issue we are running into is that after we push out an update with new JavaScript files, the client b... | How can I force clients to refresh JavaScript files? | CC BY-SA 3.0 | 0 | 2008-08-28T14:30:26.233 | 2022-08-11T23:33:54.363 | 2011-08-03T19:04:24.250 | 496,830 | 2,176 | [
"javascript",
"caching",
"versioning"
] |
32,433 | 1 | 32,465 | null | 54 | 197,159 | This query works great:
```
var pageObject = (from op in db.ObjectPermissions
join pg in db.Pages on op.ObjectPermissionName equals page.PageName
where pg.PageID == page.PageID
select op)
.SingleOrDefault();
```
I get a new type with my 'op' fiel... | Creating a LINQ select from multiple tables | CC BY-SA 3.0 | 0 | 2008-08-28T14:35:50.637 | 2017-08-03T23:17:36.443 | 2017-08-03T23:17:36.443 | 3,047 | 3,047 | [
"c#",
"linq"
] |
32,427 | 2 | null | 32,414 | 608 | null | As far as I know a common solution is to add a `?<version>` to the script's src link.
For instance:
```
<script type="text/javascript" src="myfile.js?1500"></script>
```
---
> I assume at this point that there isn't a better way than find-replace to increment these "version numbers" in all of the script tags?
... | null | CC BY-SA 3.0 | null | 2008-08-28T14:34:12.870 | 2015-04-17T21:22:10.607 | 2015-04-17T21:22:10.607 | 3,889,449 | 1,830 | null |
32,441 | 2 | null | 27,027 | 1 | null | For distributed SCM systems like git and mercurial shouldn't be a problem as Matthew mentioned.
If you need to use a centralized SCM like Subversion or CVS, then you can zip up (archive) your bundles before checking them into source control. This can be painful and takes an extra step. There is a good blog post abou... | null | CC BY-SA 2.5 | null | 2008-08-28T14:39:37.337 | 2008-08-28T14:39:37.337 | null | null | 2,813 | null |
32,442 | 2 | null | 32,332 | 2 | null | > It is inconsequential, that is true. What do you mean by std::string's interface being large? What does large mean, in this context - lots of method calls? I'm not being facetious, I am actually interested.
It has more methods than it really needs, and its behaviour of using integral offsets rather than iterators is... | null | CC BY-SA 2.5 | null | 2008-08-28T14:39:40.860 | 2008-08-28T14:39:40.860 | null | null | 2,131 | null |
32,445 | 2 | null | 32,433 | 4 | null | You must create a new anonymous type:
```
select new { op, pg }
```
Refer to the official [guide](http://msdn.microsoft.com/en-us/library/bb397696.aspx).
| null | CC BY-SA 2.5 | null | 2008-08-28T14:40:55.430 | 2008-08-28T14:40:55.430 | null | null | 1,968 | null |
32,409 | 2 | null | 32,369 | 17 | null | You can prevent the browser from matching the forms up by randomizing the name used for the password field on each show. Then the browser sees a password for the same the url, but can't be sure it's the . Maybe it's controlling something else.
note that this should be using autocomplete or other tactics, not a repl... | null | CC BY-SA 4.0 | null | 2008-08-28T14:29:11.823 | 2020-10-08T13:08:16.333 | 2020-10-08T13:08:16.333 | 3,043 | 3,043 | null |
32,449 | 2 | null | 32,433 | 1 | null | change
```
select op)
```
to
```
select new { op, pg })
```
| null | CC BY-SA 2.5 | null | 2008-08-28T14:41:58.187 | 2008-08-28T14:41:58.187 | null | null | 1,196 | null |
32,450 | 2 | null | 32,414 | 3 | null | My colleague just found a reference to that method right after I posted (in reference to css) at [http://www.stefanhayden.com/blog/2006/04/03/css-caching-hack/](http://www.stefanhayden.com/blog/2006/04/03/css-caching-hack/). Good to see that others are using it and it seems to work. I assume at this point that there ... | null | CC BY-SA 3.0 | null | 2008-08-28T14:42:14.223 | 2011-12-15T15:22:48.060 | 2011-12-15T15:22:48.060 | 560,648 | 2,176 | null |
32,428 | 1 | 37,379 | null | 13 | 71,496 | I've created an assembly and referenced it in my Reporting Services report. I've tested the report locally (works), and I then uploaded the report to a report server (doesn't work).
Here is the error that is thrown by the custom code I've written.
> System.Security.SecurityException:
Request for the permission of t... | How do I resolve a System.Security.SecurityException with custom code in SSRS? | CC BY-SA 2.5 | 0 | 2008-08-28T14:34:26.020 | 2019-02-22T15:26:41.083 | 2008-08-31T01:02:29.510 | 305 | 326 | [
"reporting-services",
"securityexception"
] |
32,452 | 2 | null | 32,366 | 2 | null | It's perfectly accetable to do - just make sure it only visits each page once for each session. As you're technically creating a searchbot you must obey robots.txt and `no-cache` rules. People can still block your bot specifically if needed by blocking IPs.
You're only looking for source code as far as I can tell so ... | null | CC BY-SA 2.5 | null | 2008-08-28T14:43:28.747 | 2008-08-28T14:43:28.747 | null | null | 2,025 | null |
32,451 | 2 | null | 15,241 | 8 | null | In defence of the CSLA, although I do agree with many of the comments that have been made particularly the unit testing one...
My company used it extensively for a Windows Forms data entry application, with a high degree of success.
- -
On the whole I would say that any issues that it caused were more than outwayed... | null | CC BY-SA 2.5 | null | 2008-08-28T14:42:25.067 | 2009-02-23T08:56:59.507 | 2009-02-23T08:56:59.507 | 1,127,460 | 1,127,460 | null |
32,453 | 2 | null | 28,932 | 4 | null | If you use Packer, just go far the 'shrink variables' option and gzip the resulting code. The base62 option is only for if your server cannot send gzipped files. Packer with 'shrink vars' achieves better compression the YUI, but can introduce bugs if you've skipped a semicolon somewhere.
base62 is basically a poor man... | null | CC BY-SA 2.5 | null | 2008-08-28T14:43:38.073 | 2008-08-28T14:43:38.073 | null | null | 3,424 | null |
32,455 | 2 | null | 32,227 | 2 | null | You could abstract fields to a separate table so that they are many-to-many to the Form table:
## Form
Name
etc.
## Field
Label
Value
## FormField
| null | CC BY-SA 2.5 | null | 2008-08-28T14:44:26.230 | 2008-08-28T14:44:26.230 | null | null | 1,414 | null |
32,448 | 1 | 37,293 | null | 6 | 1,675 | The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are however scared of c-compiler bugs (for a... | Which 4.x version of gcc should one use? | CC BY-SA 2.5 | null | 2008-08-28T14:41:23.150 | 2017-10-11T11:43:08.087 | 2017-10-11T11:43:08.087 | 1,000,551 | 1,524 | [
"c",
"gcc"
] |
32,456 | 2 | null | 32,412 | 1 | null | Assuming you've fallen victim to the same attack as everyone else, then SQLMenace' code is close. However, that attack uses a number of different script urls, so you'll have to customize it to make sure it matches the url you're seeing in your database.
[I wrote about it as well](http://jcoehoorn.vox.com/library/po... | null | CC BY-SA 2.5 | null | 2008-08-28T14:44:59.240 | 2008-08-28T15:04:44.310 | 2008-08-28T15:04:44.310 | 3,043 | 3,043 | null |
32,457 | 2 | null | 32,366 | 2 | null | Load is a big consideration. Put limits on how often you crawl a particular site and what is the most basic info you need to accomplish your goal. If you are looking for text do not download all images, stuff like that.
Of course obey robots.txt but also make sure your user agent string includes accurate contact inf... | null | CC BY-SA 2.5 | null | 2008-08-28T14:45:16.917 | 2008-08-28T14:45:16.917 | null | null | 3,290 | null |
32,408 | 2 | null | 32,369 | 1 | null | Markus raised a great point. I decided to look up the `autocomplete` attribute and got the following:
> The only downside to using this
attribute is that it is not standard
(it works in IE and Mozilla browsers),
and would cause XHTML validation to
fail. I think this is a case where
it's reasonable to break... | null | CC BY-SA 2.5 | null | 2008-08-28T14:29:01.340 | 2008-08-28T14:29:01.340 | null | null | 792 | null |
32,462 | 1 | 32,522 | null | 0 | 251 | So I've got a hobby site I'm working on. I've got items that are tagged and I want to associate those items with photos from Flickr. Even with restrictive searches, I might get results numbering in the thousands.
Requirements:
1. I want to display between 10-20 pictures but I want to randomize the photos each time... | Pulling limited tagged photos from Flickr | CC BY-SA 4.0 | null | 2008-08-28T14:46:04.247 | 2019-01-18T11:12:23.653 | 2019-01-18T11:12:23.653 | 567,854 | 2,863 | [
"php",
"tags",
"flickr"
] |
32,463 | 2 | null | 32,231 | 1 | null | Grails uses Hibernate to persist domain objects and produces behavior similar to what you describe. To alter the schema you simply modify the domain, in this simple case the file is named User.groovy.
```
class User {
String userName
String firstName
String lastName
Date dateCreated
Date lastUpdat... | null | CC BY-SA 2.5 | null | 2008-08-28T14:46:07.413 | 2008-08-28T14:46:07.413 | null | null | 3,014 | null |
32,465 | 2 | null | 32,433 | 91 | null | You can use anonymous types for this, i.e.:
```
var pageObject = (from op in db.ObjectPermissions
join pg in db.Pages on op.ObjectPermissionName equals page.PageName
where pg.PageID == page.PageID
select new { pg, op }).SingleOrDefault();
```
This will make pageO... | null | CC BY-SA 2.5 | null | 2008-08-28T14:46:40.437 | 2010-11-09T16:15:58.320 | 2010-11-09T16:15:58.320 | 41,956 | 3,394 | null |
32,466 | 2 | null | 32,364 | 10 | null | ```
public ActionResult Foo()
{
return RedirectToAction("Products", "Index");
}
[Test]
public void foo_redirects_to_products_index()
{
var controller = new BarController();
var result = controller.Foo() as RedirectToRouteResult;
if(result == null)
Assert.Fail("should have redirected");
Assert.Th... | null | CC BY-SA 2.5 | null | 2008-08-28T14:47:08.113 | 2008-08-28T15:00:17.253 | 2008-08-28T15:00:17.253 | 3,381 | 3,381 | null |
32,471 | 2 | null | 32,333 | 1 | null | I guess Ruby has that a feature - valued more over it being a security issue. Ducktyping too.
E.g. I can add my own methods to the Ruby String class rather than extending or wrapping it.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:48:38.780 | 2008-08-28T14:48:38.780 | null | null | 1,695 | null |
32,467 | 2 | null | 30,790 | 10 | null | We use the OraDirect driver from Devart. It includes ADO.NET Entity framework support. You can download a trial version [here](http://www.devart.com/news/2008/directs475.html). You may then use LINQ to entities or entity SQL on top of this.
The pricing of this is quite developer friendly, you pay per developer seat an... | null | CC BY-SA 2.5 | null | 2008-08-28T14:47:12.357 | 2008-08-28T15:00:19.877 | 2008-08-28T15:00:19.877 | 224 | 224 | null |
32,440 | 2 | null | 32,404 | 288 | null | Yes you can. I do it using the pythoncom libraries that come included with [ActivePython](http://www.activestate.com/Products/activepython/index.mhtml) or can be installed with [pywin32](https://sourceforge.net/projects/pywin32/) (Python for Windows extensions).
This is a basic skeleton for a simple service:
```
impo... | null | CC BY-SA 3.0 | null | 2008-08-28T14:39:04.763 | 2016-11-14T04:26:45.200 | 2016-11-14T04:26:45.200 | 830,495 | 3,399 | null |
32,475 | 2 | null | 32,448 | 1 | null | I don't have a specific version for you, but why not have a 4.X 3.4.6 installed? Then you could try and keep the code compiling on both versions, and if you run across a show-stopping bug in 4, you have an exit policy.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:49:22.663 | 2008-08-28T14:49:22.663 | null | null | 61 | null |
32,476 | 2 | null | 11,740 | 2 | null | I've now researched what it takes to do this in both Entity Framework and LINQ to SQL and [documented the steps required in each](http://theruntime.com/blogs/jacob/archive/2008/08/27/changing-table-names-in-an-orm.aspx). It's much longer than answers here tend to be so I'll be content with a link to the answer rather t... | null | CC BY-SA 2.5 | null | 2008-08-28T14:49:41.663 | 2008-08-28T14:49:41.663 | null | null | 1,336 | null |
32,472 | 2 | null | 9,033 | 3 | null | Returning IQueryable projections
```
protected void LdsPostings_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var dc = new MyDataContext();
var query = dc.Posting.AsQueryable();
if (isCondition1)
{
query = query.Where(q => q.PostedBy == Username);
e.Result = QueryProje... | null | CC BY-SA 2.5 | null | 2008-08-28T14:49:03.490 | 2008-08-28T14:49:03.490 | null | null | null | null |
32,473 | 2 | null | 32,173 | 3 | null | I found 2 ways to get this to work, the below code correctly distinguishes between the RadioButton and Checkbox controls.
```
private static void DisableControl(WebControl control)
{
Type controlType = control.GetType();
if (controlType == typeof(CheckBox))
{
((CheckBox)control... | null | CC BY-SA 2.5 | null | 2008-08-28T14:49:10.340 | 2008-08-28T14:49:10.340 | null | null | 2,808 | null |
32,482 | 2 | null | 32,458 | 0 | null | Depending on your object/app, random data would have a place in load testing. I think more important would be to use data that explicitly tests the boundary conditions of the data.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:51:06.807 | 2008-08-28T14:51:06.807 | null | null | 1,358 | null |
32,478 | 2 | null | 31,128 | 2 | null | We don't have a physical document we all adhere to where I work. There are a number of guidelines we try and keep in mind but there isn't really enough information to require a physcial document. [This article](http://www.louddog.com/bloggity/2008/03/css-best-practices.php) sums them up these guidelines pretty well. ... | null | CC BY-SA 3.0 | null | 2008-08-28T14:49:54.267 | 2014-07-19T02:27:30.627 | 2014-07-19T02:27:30.627 | 3,739,658 | 1,900 | null |
32,483 | 2 | null | 32,460 | 4 | null | ```
row.Table.DefaultView[row.Table.Rows.IndexOf(row)]
```
This is an okay answer. But if you find yourself in this situation, you should consider learning more about DataViews and how they are used, then refactor your code to be view-centric rather than table-centric.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:52:16.900 | 2009-01-06T15:15:25.850 | 2009-01-06T15:15:25.850 | null | null | null |
32,484 | 2 | null | 32,041 | 1 | null | Another possibility is to put the if statement within your logging function, you get less code this way, but at the expense of some extra function calls.
I'm also not a big fan of completely removing the debug code. Once you're in production, you'll probably need access to debug messages if something goes wrong. If yo... | null | CC BY-SA 2.5 | null | 2008-08-28T14:52:49.020 | 2008-08-28T14:52:49.020 | null | null | 2,567 | null |
32,487 | 2 | null | 31,875 | 129 | null | A slightly different approach to implement the singleton in Python is the [borg pattern](http://code.activestate.com/recipes/66531/) by Alex Martelli (Google employee and Python genius).
```
class Borg:
__shared_state = {}
def __init__(self):
self.__dict__ = self.__shared_state
```
So instead of forc... | null | CC BY-SA 3.0 | null | 2008-08-28T14:53:54.680 | 2016-03-13T20:46:02.813 | 2016-03-13T20:46:02.813 | 63,550 | 720 | null |
32,490 | 2 | null | 32,458 | 4 | null | Can you generate some random data once (I mean exactly once, not once per test run), then use it in all tests thereafter?
I can definitely see the value in creating random data to test those cases that you haven't thought of, but you're right, having unit tests that can randomly pass or fail is a bad thing.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:55:05.457 | 2008-08-28T14:55:05.457 | null | null | 1,471 | null |
32,477 | 2 | null | 32,343 | 9 | null | In the case of managed threads, the complexity of doing this is a degree greater than that of native threads. This is because CLR threads are not directly tied to a native OS thread. In other words, the CLR can switch a thread from native thread to native thread as it sees fit. The function [Thread.BeginThreadAffin... | null | CC BY-SA 2.5 | null | 2008-08-28T14:49:52.443 | 2009-02-20T00:52:26.043 | 2009-02-20T00:52:26.043 | 35,070 | 1,875 | null |
32,491 | 2 | null | 32,366 | 3 | null | Besides WillDean's and Einar's good answers, I would really recommend you take a time to read about the meaning of the HTTP response codes, and what your crawler should do when encountering each one, since it will make a big a difference on your performance, and on wether or not you are banned from some sites.
Some u... | null | CC BY-SA 2.5 | null | 2008-08-28T14:55:07.127 | 2008-08-28T14:55:07.127 | null | null | 3,399 | null |
32,496 | 2 | null | 32,458 | 9 | null | > -
If your test case does not accurately record what it is testing, perhaps you need to recode the test case. I always want to have logs that I can refer back to for test cases so that I know exactly what caused it to fail whether using static or random data.
| null | CC BY-SA 2.5 | null | 2008-08-28T14:57:55.217 | 2008-09-18T01:10:53.767 | 2008-09-18T01:10:53.767 | 3,560 | 1,358 | null |
32,495 | 2 | null | 32,000 | 2 | null | Since you seem to be just getting started with this now is the best time to familiarize yourself with the concept of a Data Access Layer ([obligatory wikipedia link](http://en.wikipedia.org/wiki/Data_access_layer)). It will be very helpful for you down the road when you're apps have more interaction with the database ... | null | CC BY-SA 2.5 | null | 2008-08-28T14:57:37.917 | 2008-08-28T14:57:37.917 | null | null | 794 | null |
32,493 | 1 | 32,543 | null | 8 | 950 | I've always felt that my graphic design skills have lacked, but I do have a desire to improve them. Even though I'm not the worlds worst artist, it's discouraging to see the results from a professional designer, who can do an amazing mockup from a simple spec in just a few hours. I always wonder how they came up with... | Advice on how to be graphically creative | CC BY-SA 2.5 | 0 | 2008-08-28T14:56:09.073 | 2014-08-10T16:18:55.303 | 2014-08-10T16:18:55.303 | 2,801,037 | 3,085 | [
"graphics"
] |
32,506 | 2 | null | 32,448 | 0 | null | If you are interested in OpenMP then you will need to move to gcc 4.2 or greater. We are using 4.2.2 on a code base of around 5M lines and are not having any problems with it.
| null | CC BY-SA 2.5 | null | 2008-08-28T15:02:35.750 | 2008-08-28T15:02:35.750 | null | null | 2,897 | null |
32,494 | 1 | 42,043 | null | 68 | 37,036 | I coded a Mancala game in Java for a college class this past spring, and I used the [Eclipse](https://www.eclipse.org) IDE to write it. One of the great (and fairly simple) visual aids in Eclipse is if you select a particular token, say a declared variable, then the IDE will automatically highlight all other reference... | Visual Studio identical token highlighting | CC BY-SA 3.0 | 0 | 2008-08-28T14:56:55.810 | 2018-03-05T12:20:16.853 | 2017-08-09T04:11:16.830 | 1,033,581 | 418 | [
"visual-studio",
"visual-studio-2008",
"visual-studio-2005"
] |
32,499 | 2 | null | 31,868 | 1 | null | From a colleage at work:
> Lazy way: your Windows WebDAV filesystem interface. It is bad as a programmatic solution because it relies on the WindowsClient service running on your OS, and also only works on websites running on port 80. Map a drive to the document library and get with the file copying.There is additional... | null | CC BY-SA 2.5 | null | 2008-08-28T14:59:12.560 | 2008-08-28T14:59:12.560 | 2020-06-20T09:12:55.060 | -1 | 3,381 | null |
32,460 | 1 | 6,989,851 | null | 8 | 13,088 | Here's the situation: I need to bind a WPF `FixedPage` against a `DataRow`. Bindings don't work against `DataRows`; they work against `DataRowViews`. I need to do this in the most generic way possible, as I know nothing about and have no control over what is in the `DataRow`.
What I need is to be able to get a `D... | Get the DefaultView DataRowView from a DataRow | CC BY-SA 3.0 | 0 | 2008-08-28T14:45:43.920 | 2012-04-26T01:39:21.557 | 2012-04-26T01:39:21.557 | 643,977 | null | [
"wpf",
"binding",
"dataset",
"datarowview",
"defaultview"
] |
32,508 | 2 | null | 32,058 | 6 | null | Unfortunately I don't think this is possible.
The exception you are raising in your web service code is being encoded into a Soap Fault, which then being passed as a string back to your client code.
What you are seeing in the SoapException message is simply the text from the Soap fault, which is not being converted b... | null | CC BY-SA 2.5 | null | 2008-08-28T15:03:21.397 | 2008-08-28T15:03:21.397 | null | null | 1,908 | null |
32,505 | 1 | null | null | 1 | 2,376 | Most XML parsers will give up after the first error in a document. In fact, IIRC, that's actually part of the 'official' spec for parsers.
I'm looking for something that will break that rule. It should take a given schema (assuming a valid schema) and an xml input and attempt to keep going after the first error an... | XML Parser Validation Report | CC BY-SA 3.0 | 0 | 2008-08-28T15:02:29.213 | 2017-08-04T14:32:58.297 | 2017-08-04T14:32:58.297 | 1,836,618 | 3,043 | [
"xml",
"validation"
] |
32,510 | 2 | null | 32,493 | 1 | null | I have a BFA in Graphic Design, although I don't use it much lately. Here's my $.02.
Get a copy of "Drawing on the Right Side of the Brain" and go through it. You will become a better artist/drawer as a result and I'm a firm believer that if you can't do it with pencil/paper you won't be successful on the computer. Al... | null | CC BY-SA 2.5 | null | 2008-08-28T15:04:56.667 | 2008-08-28T15:04:56.667 | null | null | null | null |
32,511 | 2 | null | 32,494 | 2 | null | [DevExpress CodeRush](http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/) does this when you press TAB when the cursor is in an identifier, you can then tab through all the highlighted instances. There's also a DXCore plugin (the foundation upon which CodeRush/Refactor Pro are built) that does c... | null | CC BY-SA 2.5 | null | 2008-08-28T15:04:59.223 | 2008-08-28T15:04:59.223 | null | null | 1,278 | null |
32,509 | 2 | null | 31,380 | 4 | null | In this case, I would do as you are doing (use a byte array for buffering and not one of the stream buffers).
There are exceptions, though. One place you see buffers (output this time) is in the servlet API. Data isn't written to the underlying stream until is called, allowing you to buffer output but then dump the b... | null | CC BY-SA 2.5 | null | 2008-08-28T15:03:31.053 | 2008-08-28T15:03:31.053 | null | null | 304 | null |
32,518 | 2 | null | 6,926 | 1 | null | You should also look at RenderMonkey. It's a good tool. As far as books go, check out XNA 2.0 Game Programming Recipes from Riemer Grootjans ... great book.
| null | CC BY-SA 2.5 | null | 2008-08-28T15:08:18.500 | 2008-08-28T15:08:18.500 | null | null | 3,433 | null |
32,458 | 1 | 32,631 | null | 180 | 60,737 | I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, whereas a normal test only uses a single static value.
I've given him a number of different reasons against this, the main on... | Random data in Unit Tests? | CC BY-SA 2.5 | 0 | 2008-08-28T14:45:26.807 | 2022-04-06T06:45:49.230 | 2008-08-29T18:15:11.850 | 1,414 | 517 | [
"unit-testing",
"tdd",
"mocking"
] |