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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21,294 | 1 | 242,607 | null | 192 | 207,917 | How can you reliably and dynamically load a JavaScript file? This will can be used to implement a module or component that when 'initialized' the component will dynamically load all needed JavaScript library scripts on demand.
The client that uses the component isn't required to load all the library script files (and... | Dynamically load a JavaScript file | CC BY-SA 3.0 | 0 | 2008-08-21T21:59:31.080 | 2023-01-26T00:06:07.080 | 2014-04-11T22:01:42.697 | 1,350,209 | 1,341 | [
"javascript",
"file",
"import",
"include"
] |
21,298 | 2 | null | 21,265 | 3 | null | The current version I am using is this
```
bool is_equals(float A, float B,
float maxRelativeError, float maxAbsoluteError)
{
if (fabs(A - B) < maxAbsoluteError)
return true;
float relativeError;
if (fabs(B) > fabs(A))
relativeError = fabs((A - B) / B);
else
relativeError = fabs((A... | null | CC BY-SA 2.5 | null | 2008-08-21T22:00:37.397 | 2008-08-21T22:22:26.767 | 2008-08-21T22:22:26.767 | 2,328 | 2,328 | null |
21,297 | 2 | null | 21,294 | 10 | null | Here is some example code I've found... does anyone have a better way?
```
function include(url)
{
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", url);
var nodes = document.getElementsByTagName("*");
var node = nodes[nodes.length -1].par... | null | CC BY-SA 2.5 | null | 2008-08-21T22:00:13.887 | 2008-08-21T22:00:13.887 | null | null | 1,341 | null |
21,299 | 2 | null | 21,274 | 3 | null | You might also want to look at [YUI's Rich Text Editor](http://developer.yahoo.com/yui/editor/).
If you're starting your site from scratch or haven't invested a lot of effort into another JavaScript platform, [Yahoo User Interface (YUI)](http://developer.yahoo.com/yui/) is a very complete JavaScript library that coul... | null | CC BY-SA 2.5 | null | 2008-08-21T22:01:27.660 | 2008-08-21T22:29:11.663 | 2008-08-21T22:29:11.663 | 680 | 680 | null |
21,287 | 2 | null | 21,280 | 2 | null | The point is that LINQ integrates your queries into your primary programming language, allowing your IDE to provide you with some facilities (Intellisense and debug support, for example) that you otherwise would not have, and to allow the compiler to type-check your SQL code (which is impossible with a normal string qu... | null | CC BY-SA 2.5 | null | 2008-08-21T21:56:11.290 | 2008-08-21T21:56:11.290 | null | null | 1,975,282 | null |
21,304 | 2 | null | 9,231 | 2 | null | We've been using DataDomain appliances for that purpose for about 2 years. They're not inexpensive, but compared to $12,000/month they'd pay for themselves pretty quickly.
Basically, we send our backups over NFS and CIFS to one DataDomain appliance, it deduplicates the data and then replicates the differences to the ... | null | CC BY-SA 2.5 | null | 2008-08-21T22:02:59.933 | 2008-08-21T22:02:59.933 | null | null | 331 | null |
21,307 | 2 | null | 21,265 | 0 | null | > it's the best way to do it that I've come across, insofar as it provides the most robust comparisons even in the face of floating point errors.
If you have floating point errors you have even more problems than this. Although I guess that is up to personal perspective.
| null | CC BY-SA 3.0 | null | 2008-08-21T22:05:05.497 | 2012-07-03T15:00:35.260 | 2012-07-03T15:00:35.260 | 142,162 | 1,799 | null |
21,268 | 2 | null | 21,232 | 2 | null | Generic.List should provide the Skip() and Take() methods, so you could do this:
```
Dim PageObjects As New System.Collections.Generic.List(Of MyCustomClass)
PageObjects = AllOfMyCustomClassObjects.Skip(pagenumber * pagesize).Take(pagesize)
```
---
If by "without Linq" you meant on the 2.0 Framework, I don't bel... | null | CC BY-SA 2.5 | null | 2008-08-21T21:47:46.943 | 2008-08-21T22:06:50.627 | 2008-08-21T22:06:50.627 | 1,249 | 1,249 | null |
21,302 | 2 | null | 19,030 | 2 | null | > I want to add a rule that checks for
the presence of a folder.jpg file in
each directory, but to add this would
make the code substantially more messy
in it's current state..
This doesn't look bad. In fact your current code does it very nicely, and Sven mentioned a good way to do it as well:
1. Get a list... | null | CC BY-SA 2.5 | null | 2008-08-21T22:02:01.853 | 2008-08-21T22:02:01.853 | null | null | 792 | null |
21,312 | 2 | null | 21,265 | 0 | null | > This seems to take care of most problems by combining relative and absolute error tolerance. Is the ULP approach better? If so, why?
ULPs are a direct measure of the "distance" between two floating point numbers. This means that they don't require you to conjure up the relative and absolute error values, nor do you... | null | CC BY-SA 2.5 | null | 2008-08-21T22:07:11.700 | 2008-08-21T22:07:11.700 | null | null | 2,131 | null |
21,303 | 1 | 21,322 | null | 83 | 93,952 | VC++ makes functions which are implemented within the class declaration inline functions.
If I declare a class `Foo` as follows, then are the CONSTRUCTOR and DESTRUCTOR inline functions?
```
class Foo
{
int* p;
public:
Foo() { p = new char[0x00100000]; }
~Foo() { delete [] p; }
};
{
Foo f;
(f);
... | In C++ can constructor and destructor be inline functions? | CC BY-SA 2.5 | 0 | 2008-08-21T22:02:58.310 | 2022-11-21T03:51:19.073 | 2008-08-21T22:13:28.580 | 234 | 1,556 | [
"c++",
"constructor",
"destructor"
] |
21,318 | 2 | null | 21,265 | 0 | null | If you are looking for two floats to be equal, then they should be identically equal in my opinion. If you are facing a floating point rounding problem, perhaps a fixed point representation would suit your problem better.
| null | CC BY-SA 2.5 | null | 2008-08-21T22:09:43.053 | 2008-08-21T22:09:43.053 | null | null | 1,490 | null |
21,317 | 2 | null | 21,265 | 0 | null | > If you have floating point errors you have even more problems than this. Although I guess that is up to personal perspective.
Even if we do the numeric analysis to minimize accumulation of error, we can't eliminate it and we can be left with results that ought to be identical (if we were calculating with reals) but ... | null | CC BY-SA 2.5 | null | 2008-08-21T22:09:05.957 | 2008-08-21T22:09:05.957 | null | null | 2,131 | null |
21,300 | 2 | null | 21,294 | 0 | null | all the major javascript libraries like jscript, prototype, YUI have support for loading script files. For example, in YUI, after loading the core you can do the following to load the calendar control
```
var loader = new YAHOO.util.YUILoader({
require: ['calendar'], // what components?
base: '../../build/',... | null | CC BY-SA 2.5 | null | 2008-08-21T22:01:29.437 | 2008-10-28T04:27:40.127 | 2008-10-28T04:27:40.127 | 77 | 77 | null |
21,320 | 2 | null | 21,294 | 3 | null | > does anyone have a better way?
I think just adding the script to the body would be easier then adding it to the last node on the page. How about this:
```
function include(url) {
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", url);
document.body.a... | null | CC BY-SA 2.5 | null | 2008-08-21T22:10:08.760 | 2008-08-21T22:10:08.760 | null | null | 792 | null |
21,311 | 2 | null | 21,294 | 20 | null | I did basically the same thing that you did Adam, but with a slight modification to make sure I was appending to the `head` element to get the job done. I simply created an `include` function (code below) to handle both script and CSS files.
This function also checks to make sure that the script or CSS file hasn't alr... | null | CC BY-SA 4.0 | null | 2008-08-21T22:06:42.967 | 2021-07-06T09:31:41.763 | 2021-07-06T09:31:41.763 | 70,157 | 312 | null |
21,322 | 2 | null | 21,303 | 87 | null | Defining the body of the constructor INSIDE the class has the same effect as placing the function OUTSIDE the class with the "inline" keyword.
In both cases it's a hint to the compiler. An "inline" function doesn't necessarily mean the function will be inlined. That depends on the complexity of the function and other r... | null | CC BY-SA 4.0 | null | 2008-08-21T22:10:59.647 | 2022-11-21T03:51:19.073 | 2022-11-21T03:51:19.073 | 3,958,633 | null | null |
21,323 | 2 | null | 21,265 | 0 | null | > If you are looking for two floats to be equal, then they should be identically equal in my opinion. If you are facing a floating point rounding problem, perhaps a fixed point representation would suit your problem better.
Perhaps we cannot afford the loss of range or performance that such an approach would inflict.
| null | CC BY-SA 2.5 | null | 2008-08-21T22:11:27.837 | 2008-08-21T22:11:27.837 | null | null | 2,131 | null |
21,324 | 2 | null | 21,303 | 5 | null | Putting the function definition in the class body is equivalent to marking a function with the inline keyword. That means the function may or may not be inlined by the compiler. So I guess the best answer would be "maybe"?
| null | CC BY-SA 4.0 | null | 2008-08-21T22:11:43.327 | 2022-11-21T03:49:18.020 | 2022-11-21T03:49:18.020 | 3,958,633 | 1,494 | null |
21,310 | 2 | null | 21,288 | 4 | null | I've used [Spring.NET](http://www.springframework.net/) in the past and had great success with it. I never noticed any substantial overhead with it, though the project we used it on was fairly heavy on its own. It only took a little time reading through the [documentation](http://www.springframework.net/documentation.h... | null | CC BY-SA 2.5 | null | 2008-08-21T22:06:23.090 | 2008-08-21T22:06:23.090 | null | null | 512 | null |
21,331 | 2 | null | 21,280 | 5 | null | So the really, really big deal about LINQ has nothing to do with Linq to SQL. It's about the enhancements it brought to the C# language itself.
| null | CC BY-SA 2.5 | null | 2008-08-21T22:18:05.217 | 2008-08-21T22:18:05.217 | null | null | 1,538 | null |
21,327 | 2 | null | 21,303 | 2 | null | To the same extent that we can make any other function inline, yes.
| null | CC BY-SA 2.5 | null | 2008-08-21T22:12:26.697 | 2008-08-21T22:12:26.697 | null | null | 2,131 | null |
21,315 | 2 | null | 21,288 | 2 | null | The great thing about C# is that it is following a path beaten by years of Java developers before it. So, my advice, generally speaking when looking for tools of this nature, is to look for the solid Java answer and see if there exists a .NET adaptation yet.
So when it comes to DI (and there are so many options out th... | null | CC BY-SA 2.5 | null | 2008-08-21T22:07:37.050 | 2008-08-21T22:07:37.050 | null | null | 2,213 | null |
21,326 | 2 | null | 21,303 | 34 | null | The short answer is yes. Any function can be declared inline, and putting the function body in the class definition is one way of doing that. You could also have done:
```
class Foo
{
int* p;
public:
Foo();
~Foo();
};
inline Foo::Foo()
{
p = new char[0x00100000];
}
inline Foo::~Foo()
{
delete... | null | CC BY-SA 4.0 | null | 2008-08-21T22:12:21.453 | 2022-11-21T03:48:23.663 | 2022-11-21T03:48:23.663 | 3,958,633 | 1,367 | null |
21,337 | 2 | null | 21,265 | 0 | null | > If you are looking for two floats to be equal, then they should be identically equal in my opinion. If you are facing a floating point rounding problem, perhaps a fixed point representation would suit your problem better.
Perhaps I should explain the problem better. In C++, the following code:
```
#include <iostre... | null | CC BY-SA 2.5 | null | 2008-08-21T22:20:37.300 | 2008-12-10T04:07:58.970 | 2008-12-10T04:07:58.970 | 1,343 | 2,328 | null |
21,344 | 2 | null | 20,993 | 6 | null | For security's sake, I would generate (either a GUID or cryptographically safe RNG) a session ID and have a table that just maps session IDs to user IDs. Then, you just store the session ID in their cookies, and have it act as a proxy for the user id.
> `|Session |UserID |`
`|--------+-------|`
`|a1d4e...+ 12345 ... | null | CC BY-SA 2.5 | null | 2008-08-21T22:27:13.977 | 2008-08-21T22:27:13.977 | null | null | 2,363 | null |
21,356 | 2 | null | 21,347 | 1 | null | Here is the MSDN page about [AVRCP](http://msdn.microsoft.com/en-us/library/aa916569.aspx)
Microsofts solution uses the Audio/Video Control Transport Control Protocol (AVCTP). The Microsoft component is an extension layer to the L2CAP layer in the [Microsoft Bluetooth Protocol Stack](http://msdn.microsoft.com/en-us/lib... | null | CC BY-SA 2.5 | null | 2008-08-21T22:38:12.593 | 2008-08-21T22:38:12.593 | 2020-06-20T09:12:55.060 | -1 | 2,257 | null |
21,366 | 2 | null | 21,353 | 6 | null | There is a free tool called [SubCommander](http://subsonicproject.com/subcommander/using-the-command-line-tool-subcommander/) that is a part of the open source [SubSonic](http://subsonicproject.com/) software. I have successfully used this tool myself to create both schema and data "dumps" each night.
> You can script... | null | CC BY-SA 2.5 | null | 2008-08-21T22:45:02.903 | 2008-08-21T22:45:02.903 | null | null | 2,257 | null |
21,375 | 2 | null | 15,349 | 0 | null | You probably could use any modern scripting / bytecode language.
If you're willing to put up with the growing pains of a new product, you could use the [Parrot](http://www.parrotcode.org) VM. Which has support for many, if not all of the languages listed on this page. Unfortunately it's not done yet, but that hasn't s... | null | CC BY-SA 2.5 | null | 2008-08-21T22:51:31.657 | 2008-08-21T22:51:31.657 | null | null | 1,337 | null |
21,377 | 2 | null | 21,274 | 2 | null | I just did a full day of evaluation of all the ones mentioned so far (and then some), and the one I liked the best is [Obout Editor](http://www.obout.com/editor_new/). I think it might be for ASP.NET only, so it might not work for you, but if you are using .NET, it's great. The HTML output is clean and nicely styled, a... | null | CC BY-SA 2.5 | null | 2008-08-21T22:52:44.227 | 2008-08-21T22:52:44.227 | null | null | 1,436 | null |
21,347 | 1 | null | null | 0 | 1,270 | Is there a general way to handle Bluetooth [Audio/Video Remote Control Profile (AVRCP)](http://en.wikipedia.org/wiki/Bluetooth_profile#Audio.2FVideo_Remote_Control_Profile_.28AVRCP.29) events on a WM device? I'm especially interested in a Compact Framework way, but I would be happy with just a simple P/Invoke API.
I'... | Audio/Video Remote Control Profile (AVRCP) on Windows Mobile | CC BY-SA 3.0 | 0 | 2008-08-21T22:28:59.167 | 2014-03-05T19:23:44.510 | 2014-03-05T19:23:44.510 | 23,368 | 2,313 | [
"windows-mobile"
] |
21,277 | 2 | null | 21,265 | 7 | null | The best approach I think is to compare [ULPs](http://en.wikipedia.org/wiki/Unit_in_the_last_place).
```
bool is_nan(float f)
{
return (*reinterpret_cast<unsigned __int32*>(&f) & 0x7f800000) == 0x7f800000 && (*reinterpret_cast<unsigned __int32*>(&f) & 0x007fffff) != 0;
}
bool is_finite(float f)
{
return (*rei... | null | CC BY-SA 2.5 | null | 2008-08-21T21:53:18.350 | 2008-08-21T22:09:57.933 | 2008-08-21T22:09:57.933 | 2,131 | 2,131 | null |
21,384 | 2 | null | 21,265 | 1 | null | > @DrPizza: I am no performance guru but I would expect fixed point operations to be quicker than floating point operations (in most cases).
It rather depends on what you are doing with them. A fixed-point type with the same range as an IEEE float would be many many times slower (and many times larger).
> Things s... | null | CC BY-SA 2.5 | null | 2008-08-21T22:57:00.147 | 2008-08-21T22:57:00.147 | null | null | 2,131 | null |
21,374 | 2 | null | 21,265 | 0 | null | @DrPizza: I am no performance guru but I would expect fixed point operations to be quicker than floating point operations (in most cases).
@Craig H: Sure. I'm totally okay with it printing that. If a or b store money then they should be represented in fixed point. I'm struggling to think of a real world example wh... | null | CC BY-SA 2.5 | null | 2008-08-21T22:51:20.487 | 2008-08-21T22:51:20.487 | null | null | 1,490 | null |
21,353 | 1 | 21,366 | null | 4 | 1,703 | Is it possible to somehow use a file to script the schema and/or content of a SQL Server database?
I can do this via the wizard, but would like to streamline the creation of this file for source control purposes.
I would like to avoid the use of 3rd party tools, just limiting myself to the tools that come with SQL S... | Batch file to "Script" a Database | CC BY-SA 3.0 | 0 | 2008-08-21T22:36:15.750 | 2015-05-07T15:25:08.783 | 2015-05-07T15:25:08.783 | 1,362,287 | 708 | [
"sql-server",
"batch-file",
"command-line",
"scripting",
"batch-processing"
] |
21,355 | 1 | 21,637 | null | 4 | 572 | I've ran into a problem while trying to test following IRepository based on NHibernate:
```
public class NHibernateRepository<T>: Disposable, IRepository<T>
where T : IdentifiableObject
{
...
public IQueryable<T> Query()
{
return NHibernateSession.Linq<T>();
}
}
```
How on the Hell to m... | Mocking and IQueryable<T> | CC BY-SA 3.0 | 0 | 2008-08-21T22:38:06.137 | 2017-11-08T12:47:39.427 | 2017-11-08T12:47:39.427 | 2,470,765 | 2,313 | [
"linq"
] |
21,389 | 2 | null | 21,184 | 30 | null | If you have your linq-query that contains all the rows you want to display, this code can be used:
```
var pageNum = 3;
var pageSize = 20;
query = query.Skip((pageNum - 1) * pageSize).Take(pageSize);
```
You can also make an extension method on the object to be able to write
```
query.Page(2,50)
```
to get the fi... | null | CC BY-SA 2.5 | null | 2008-08-21T23:02:29.273 | 2008-08-21T23:02:29.273 | null | null | 2,257 | null |
21,402 | 2 | null | 21,388 | 1 | null | I'd do a consecutive number, with a trigger on the table that "makes room" for a priority if it already exists.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:12:30.123 | 2008-08-21T23:12:30.123 | null | null | 414 | null |
21,408 | 2 | null | 18,705 | 0 | null | As far as I know, the only programatic access to PS 2003 is through PWS.
I don't know if it would work, but you could try writing a managed extension for Microsoft Project 2003 (The client application) .There [is a managed API for MS Project 2003](http://msdn.microsoft.com/en-us/library/aa209377(office.11).aspx), and... | null | CC BY-SA 2.5 | null | 2008-08-21T23:15:34.050 | 2008-08-21T23:15:34.050 | null | null | null | null |
21,388 | 1 | 694,735 | null | 36 | 5,584 | I have a collection of objects in a database. Images in a photo gallery, products in a catalog, chapters in a book, etc. Each object is represented as a row. I want to be able to arbitrarily order these images, storing that ordering in the database so when I display the objects, they will be in the right order.
For... | Represent Ordering in a Relational Database | CC BY-SA 2.5 | 0 | 2008-08-21T23:01:30.400 | 2018-12-15T15:04:28.223 | 2009-03-29T14:48:12.173 | 2,363 | 2,363 | [
"sql",
"database",
"django",
"django-models"
] |
21,407 | 2 | null | 15,681 | 1 | null | You might try the demo of [textmate](http://macromates.com/) and see how you like it for working with objective-c or any other type of text really. It will import xcode project settings so you can still compile and run from textmate rather than having to go back to xcode.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:14:43.910 | 2008-08-21T23:14:43.910 | null | null | 1,474 | null |
21,392 | 2 | null | 21,294 | 2 | null | The technique we use at work is to request the javascript file using an AJAX request and then eval() the return. If you're using the prototype library, they support this functionality in their Ajax.Request call.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:03:53.093 | 2008-08-21T23:03:53.093 | null | null | 2,284 | null |
21,395 | 2 | null | 11,491 | 20 | null | ```
> std::string data = “Abc”;
> std::transform(data.begin(), data.end(), data.begin(), ::toupper);
```
This will work, but this will use the standard "C" locale. You can use facets if you need to get a tolower for another locale. The above code using facets would be:
```
locale loc("");
const ctype<char>& ct = us... | null | CC BY-SA 2.5 | null | 2008-08-21T23:05:23.650 | 2010-03-10T03:12:00.897 | 2010-03-10T03:12:00.897 | 87,234 | 2,281 | null |
21,411 | 1 | null | null | 15 | 6,633 | I'm running Apache on Linux within VMWare.
One of the PHP pages I'm requesting does a `sleep()`, and I find that if I attempt to request a second page whilst the first page is `sleep()'ing`, the second page hangs, waiting for the `sleep()` from the first page to finish.
I know that [PHP](http://php.net/) isn't , but t... | sleep() silently hogs CPU | CC BY-SA 3.0 | 0 | 2008-08-21T23:17:41.687 | 2016-10-10T15:19:10.600 | 2020-06-20T09:12:55.060 | -1 | 1,693 | [
"php",
"performance",
"sleep"
] |
21,421 | 2 | null | 21,091 | 3 | null | I think perhaps there isn't a definitive answer - hence the lack of "interest" in this question.
But I have personally had mixed experience with MDA. The only time it was good experience was with great tools - I used to use TogetherSoft (I believe they somehow ended up at borland) - they were one of the first to intr... | null | CC BY-SA 2.5 | null | 2008-08-21T23:23:41.143 | 2008-08-21T23:23:41.143 | null | null | 699 | null |
21,404 | 1 | 511,006 | null | 1 | 2,084 | I am developing an that caters to "" performing specific tasks, using the Shell. As they operate on files, they need to be able to use TFS for source control. This is mainly due to the fact that Developers will also operate on the same files from TFS but using Visual studio 2008.
After looking and searching I still c... | Source Control in Visual Studio Isolated Shell | CC BY-SA 3.0 | 0 | 2008-08-21T23:13:05.007 | 2012-12-05T17:46:04.447 | 2011-09-26T21:57:12.677 | 419 | 1,747 | [
"visual-studio",
"vsx",
"extensibility"
] |
21,348 | 2 | null | 21,288 | 353 | null | (not by the author): There is a comprehensive list of IoC frameworks available at [https://github.com/quozd/awesome-dotnet/blob/master/README.md#ioc](https://github.com/quozd/awesome-dotnet/blob/master/README.md#ioc):
- [Castle Windsor](https://github.com/castleproject/Windsor)- [Unity](https://github.com/unitycontain... | null | CC BY-SA 4.0 | null | 2008-08-21T22:29:16.000 | 2021-12-06T07:49:11.283 | 2021-12-06T07:49:11.283 | 8,700,582 | 1,107 | null |
21,422 | 1 | null | null | 2 | 390 | Tag-based web sites often suffer from the delicacy of language such as synonyms, homonyms, etc. For programmers looking for information, say on Stack Overflow, concrete examples are:
- - -
The problem is that we want to preserve our delicacy of language and make the machine deal with it as good as possible.
A site... | How to address semantic issues with tag-based web sites | CC BY-SA 3.0 | 0 | 2008-08-21T23:23:52.157 | 2015-12-16T08:23:25.233 | 2014-02-22T22:44:55.860 | 488,657 | 2,050 | [
"tags",
"folksonomy"
] |
21,418 | 2 | null | 21,280 | 5 | null | LINQ is not just an ORM system, as Jonathan pointed out it brings a lot of functional programming elements to C#. And it lets you do a lot of "database-y" things in regular C# code. It's difficult to explain just how incredibly powerful that can be. Consider how much having solid, well designed generic data structures ... | null | CC BY-SA 2.5 | null | 2008-08-21T23:20:41.663 | 2008-08-21T23:20:41.663 | null | null | 332 | null |
21,434 | 2 | null | 21,243 | 4 | null | Are you looking for something along the lines of distributed pub/sub with content based filtering? If so, you may want to look into [Siena](http://serl.cs.colorado.edu/~serl/dot/siena.html) and some of the associated papers such as [Design and Evaluation of a Wide-Area Event Notification Service](http://www.inf.unisi.c... | null | CC BY-SA 2.5 | null | 2008-08-21T23:33:31.103 | 2008-08-21T23:33:31.103 | null | null | 1,750 | null |
21,429 | 2 | null | 21,422 | 1 | null | I completely agree. The mass of tags that have currently. I don't participate in other tagged based sites. However having a hierarchy of tags would be very helpful, instead of [ruby](/questions/tagged/ruby) [rails](/questions/tagged/rails) [ruby-on-rails](/questions/tagged/ruby-on-rails) [rubyonrails](/questions/tag... | null | CC BY-SA 3.0 | null | 2008-08-21T23:30:28.693 | 2015-12-16T08:23:25.233 | 2015-12-16T08:23:25.233 | 1,016,716 | 1,470 | null |
21,399 | 2 | null | 21,388 | 4 | null | The acts_as_list mixin in Rails handles this basically the way you outlined in #1. It looks for an INTEGER column called position (of which you can override to name of course) and using that to do an ORDER BY. When you want to re-order things you update the positions. It has served me just fine every time I've used it... | null | CC BY-SA 2.5 | null | 2008-08-21T23:11:17.820 | 2008-08-21T23:11:17.820 | null | null | 2,168 | null |
21,437 | 1 | 21,440 | null | 4 | 1,952 | What are some effective strategies for preventing the use of my proprietary images?
I'm talking about saving them, direct linking to them etc...
Presently I have a watermark on the image, but I'd rather not.
.NET platform preferred, but if there's a strategy that's on another platform that integrates with my existin... | Preventing a visitor from saving an image from my site | CC BY-SA 2.5 | 0 | 2008-08-21T23:36:14.577 | 2012-07-08T16:20:12.237 | null | null | 1,975 | [
"image"
] |
21,413 | 2 | null | 123 | 18 | null | This solution does not need any CSV or XML libraries and, I know, it does not handle any illegal characters and encoding issues, but you might be interested in it as well, provided your CSV input does not break the above mentioned rules.
You should not use this code unless you know what you do or don't have the chanc... | null | CC BY-SA 3.0 | null | 2008-08-21T23:17:56.070 | 2015-11-02T14:14:39.387 | 2015-11-02T14:14:39.387 | 1,793 | 1,793 | null |
21,436 | 2 | null | 21,422 | 1 | null | How would the system know which tags to semantically link? Would it keep an ever-growing map of tags? I can't see that working. What if someone typed sbversion instead? How would that get linked?
I think that asking the user when they submit tags could work. For example, "You've entered the following tags: sbversion, ... | null | CC BY-SA 2.5 | null | 2008-08-21T23:35:12.317 | 2008-08-21T23:35:12.317 | null | null | 2,019 | null |
21,427 | 2 | null | 21,422 | 1 | null | The way the software on blogspot.com is set up, is that there is an ajax-autocomplete-thingie on the box where you write the name of the tags. This searches all your previous posts for tags that start with the same letters. At least that way you catch different casings and spellings (but not synonyms).
| null | CC BY-SA 2.5 | null | 2008-08-21T23:27:14.410 | 2008-08-21T23:27:14.410 | null | null | 2,257 | null |
21,417 | 2 | null | 21,411 | 1 | null | Are you actually seeing the CPU go to 100% or just that no other pages are being served? How many apache-instances are you runnning? Are they all stopping when you run sleep() in of of the threads?
PHP's sleep() function essentially runs through an idle loop for n seconds. It doesn't release any memory, but it should ... | null | CC BY-SA 2.5 | null | 2008-08-21T23:20:26.160 | 2008-08-21T23:20:26.160 | null | null | 2,257 | null |
21,440 | 2 | null | 21,437 | 30 | null | It's not possible to make it "impossible" to download. When a user visits your site you're sending them the pictures. The user will have a copy of that image in the browsers cache and he'd be able to access it even after he leaves the site ( depending on the browser, of course ). Your only real option is to watermark t... | null | CC BY-SA 2.5 | null | 2008-08-21T23:38:43.463 | 2008-08-21T23:38:43.463 | null | null | 87 | null |
21,414 | 2 | null | 21,229 | 5 | null | - - -
Bear in mind that this has an impact on how you expect the application/web site to be deployed. If it is ever used outside the root of a web server, the URL paths will be incorrect.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:18:56.317 | 2008-08-22T09:26:46.530 | 2008-08-22T09:26:46.530 | 2,373 | 2,373 | null |
21,441 | 2 | null | 21,437 | 4 | null | using JavaScript to override the click event is the most common I have seen...
see: [http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=41](http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=41)
| null | CC BY-SA 2.5 | null | 2008-08-21T23:39:07.220 | 2008-08-21T23:39:07.220 | null | null | 1,638 | null |
21,426 | 2 | null | 21,265 | 0 | null | > It rather depends on what you are
doing with them. A fixed-point type
with the same range as an IEEE float
would be many many times slower (and
many times larger).
Okay, but if I want a infinitesimally small bit-resolution then it's back to my original point: == and != have no meaning in the context of such ... | null | CC BY-SA 2.5 | null | 2008-08-21T23:27:11.883 | 2008-08-21T23:27:11.883 | null | null | 1,490 | null |
21,449 | 1 | null | null | 16 | 14,014 | What is the difference between the following types of endianness?
- - - -
Are there other types/variations?
| Types of endianness | CC BY-SA 2.5 | 0 | 2008-08-21T23:42:44.060 | 2022-04-05T07:44:14.120 | 2009-06-17T15:39:39.443 | 49,246 | 2,045 | [
"endianness"
] |
21,442 | 2 | null | 21,437 | 1 | null | Realistically you can't, unless you don't want them to see it in the first place. You could use some javascript to catch the right mouse button click, but that's really about it.
Another thought, you could possibly embed it in flash, but again, they could just take a screenshot.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:39:20.280 | 2008-08-21T23:39:20.280 | null | null | 841 | null |
21,453 | 2 | null | 21,437 | 13 | null | You could embed each image inside of a flash application, then the browser wouldn't know how to 'save' the image and wouldn't store the raw jpg in the cache folder either. They could still just press the print screen key to get a copy of the image, but it would probably be enough to stop most visitors.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:46:03.087 | 2008-08-21T23:46:03.087 | null | null | 1,367 | null |
21,458 | 2 | null | 21,437 | 0 | null | Anything you send to the client is, like, on the client. Not much you can do about it besides making somewhere between "sorta hard" and "quite hard" to save the image.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:50:00.050 | 2008-08-21T23:50:00.050 | null | null | 1,490 | null |
21,450 | 2 | null | 4,306 | 13 | null | Boost has a templated implementation of BLAS called uBLAS that contains a sparse matrix.
[https://www.boost.org/doc/libs/release/libs/numeric/ublas/doc/index.htm](https://www.boost.org/doc/libs/release/libs/numeric/ublas/doc/index.htm)
| null | CC BY-SA 4.0 | null | 2008-08-21T23:45:29.017 | 2019-10-14T10:15:41.310 | 2019-10-14T10:15:41.310 | 264,047 | 2,281 | null |
21,459 | 2 | null | 10,898 | 0 | null | What provider are you using for Sql 2000? I'm pretty sure MS has an x64 OLEDB driver for DB2 (part of Host Integration Server, but available as a separate download). IBM has x64 for .NET and ODBC, and possible OLEDB as well (though it's a PITA to find).
Once you get the linked server setup, I'm pretty sure all of your... | null | CC BY-SA 2.5 | null | 2008-08-21T23:50:22.640 | 2008-08-21T23:50:22.640 | null | null | 2,199 | null |
21,455 | 2 | null | 21,449 | -1 | null | the basic concept is the ordering of bits:
```
1010 0011
```
in little-endian is the same as
```
0011 1010
```
in big-endian (and vice-versa).
You'll notice the order changes by grouping, not by individual bit. I don't know of a system, for example, where
```
1100 0101
```
would be the "other-endian" version... | null | CC BY-SA 2.5 | null | 2008-08-21T23:49:01.923 | 2008-08-21T23:49:01.923 | null | null | 1,190 | null |
21,454 | 1 | null | null | 100 | 64,665 | How do I go about specifying and using an ENUM in a Django model?
| Specifying a mySQL ENUM in a Django model | CC BY-SA 3.0 | 0 | 2008-08-21T23:48:08.777 | 2022-09-18T18:49:30.953 | 2013-10-14T14:31:23.640 | 1,902,864 | 2,019 | [
"python",
"mysql",
"django",
"django-models",
"enums"
] |
21,443 | 2 | null | 21,211 | 2 | null | The API function GetClipboardOwner returns the clipboard owner
([http://msdn.microsoft.com/en-us/library/ms649041(VS.85).aspx](http://msdn.microsoft.com/en-us/library/ms649041(VS.85).aspx)), -sorry cannot mark as link because the "()" in the URL-
Don't know Java, I suppose you can call native API functions from insid... | null | CC BY-SA 3.0 | null | 2008-08-21T23:39:37.000 | 2015-08-20T22:21:58.047 | 2015-08-20T22:21:58.047 | 7,226 | 394 | null |
21,465 | 2 | null | 21,437 | 1 | null | Sorry. That's impossible. All you can do is make it inconvenient a la flickr.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:53:40.337 | 2008-08-21T23:53:40.337 | null | null | 159 | null |
21,460 | 1 | null | null | 9 | 4,199 | I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
| Does Hostmonster support Django | CC BY-SA 2.5 | 0 | 2008-08-21T23:51:10.313 | 2021-05-02T20:12:01.750 | 2008-10-02T03:04:30.687 | 432 | 2,019 | [
"django",
"shared-hosting",
"hostmonster"
] |
21,464 | 1 | 21,494 | null | 8 | 1,649 | This is my first post here and I wanted to get some input from people doing iPhone development. Other than the Apple DevCenter, where are there good sites to learn iPhone developement?
I know Apple has a tough NDA but there has to be people talking about writing applications for the iPhone.
| Recommended iPhone Development Resources | CC BY-SA 3.0 | 0 | 2008-08-21T23:53:36.797 | 2017-09-05T11:26:45.373 | 2017-09-05T11:26:45.373 | 1,000,551 | 2,305 | [
"ios"
] |
21,467 | 2 | null | 21,461 | 4 | null | Depends on what /define compiler options you use. `Visual Studio` puts the `DEBUG` symbol in there for you via the project settings, but you could create any ones that you want.
| null | CC BY-SA 3.0 | null | 2008-08-21T23:54:27.653 | 2012-08-11T15:55:07.290 | 2012-08-11T15:55:07.290 | 1,477,076 | 1,490 | null |
21,448 | 1 | null | null | 7 | 24,103 | I have an SSIS package that exports data to a couple of Excel files for transfer to a third party. To get this to run as a scheduled job on a 64-bit server I understand that I need to set the step as a CmdExec type and call the 32-bit version of DTExec. But I don't seem to be able to get the command right to pass in th... | How do I access Excel data source from an SSIS package deployed on a 64-bit server? | CC BY-SA 3.0 | null | 2008-08-21T23:42:39.507 | 2015-09-30T16:43:14.090 | 2015-09-30T16:43:14.090 | 5,071,535 | 2,375 | [
"sql-server",
"excel",
"ssis"
] |
21,471 | 2 | null | 21,437 | 2 | null | I would watermark them, and reduce the resolution, of the actual files, instead of doing it through an application on the user's end.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:58:23.663 | 2008-08-21T23:58:23.663 | null | null | 1,337 | null |
21,472 | 2 | null | 21,437 | 3 | null | Short answer: you can't. Whatever you display to a user is going to be available to them. You can watermark it, blur it, or offer a low-res version of it, but the bottom line is that whatever images are displayed in the user's browser are going to be available to them in some way.
| null | CC BY-SA 2.5 | null | 2008-08-21T23:58:37.377 | 2008-08-21T23:58:37.377 | null | null | 1,574 | null |
21,468 | 2 | null | 21,454 | 113 | null | From the [Django documentation](https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.choices):
```
MAYBECHOICE = (
('y', 'Yes'),
('n', 'No'),
('u', 'Unknown'),
)
```
And you define a charfield in your model :
```
married = models.CharField(max_length=1, choices=MAYBECHOICE)
``... | null | CC BY-SA 3.0 | null | 2008-08-21T23:54:52.253 | 2016-09-16T13:43:42.723 | 2016-09-16T13:43:42.723 | 1,589,422 | 446,497 | null |
21,466 | 2 | null | 21,060 | 0 | null | It suppose to be a [registry change](http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/55200.mspx?mfr=true) that helps with this type of situations (mentioned in [this](http://www.codinghorror.com/blog/archives/001011.html) Coding Horror post about the subject of "focus stealing"). I try it,... | null | CC BY-SA 2.5 | null | 2008-08-21T23:54:07.730 | 2008-08-21T23:54:07.730 | null | null | 394 | null |
21,438 | 2 | null | 20,047 | 3 | null | Setting your default to read uncommitted is not a good idea. Your will undoubtedly introduce inconsistencies and end up with a problem that is worse than what you have now. Snapshot isolation might work well, but it is a drastic change to the way Sql Server works and puts a load on tempdb.
Here is what you should d... | null | CC BY-SA 2.5 | null | 2008-08-21T23:37:14.247 | 2008-08-26T17:14:22.877 | 2008-08-26T17:14:22.877 | 1,219 | 1,219 | null |
21,481 | 2 | null | 21,464 | 2 | null | this is probably a good place to start
[http://developer.apple.com/iphone/](http://developer.apple.com/iphone/)
| null | CC BY-SA 2.5 | null | 2008-08-22T00:07:11.490 | 2008-08-22T00:07:11.490 | null | null | 202 | null |
21,479 | 2 | null | 21,461 | 4 | null | To add to what Nick said, the MSDN documentation does not list any pre-defined names. It would seem that all need to come from `#define` and `/define`.
[#if on MSDN](http://msdn.microsoft.com/en-us/library/4y6tbswk.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-22T00:06:12.337 | 2008-08-22T00:06:12.337 | null | null | 338 | null |
21,474 | 2 | null | 20,233 | 2 | null | This might be of no help at all, but the (very good) podcast player [BeyondPod](http://www.codeplex.com/beyondpod) has a built in player, based on Windows Media Player, and it's open source - so you could have a look at what API they are using.
Obviously if they've written their own custom player, you wont be able to ... | null | CC BY-SA 2.5 | null | 2008-08-21T23:59:31.230 | 2008-08-21T23:59:31.230 | null | null | 1,367 | null |
21,491 | 2 | null | 21,437 | 3 | null | It's just not possible. There is the PrintScreen button.
Whatever is displayed, can be captured.
| null | CC BY-SA 2.5 | null | 2008-08-22T00:15:22.937 | 2008-08-22T00:15:22.937 | null | null | 369 | null |
21,470 | 2 | null | 21,449 | 4 | null | There's also middle or mixed endian. See [wikipedia](http://en.wikipedia.org/wiki/Middle_endian#Middle-endian) for details.
The only time I had to worry about this was when writing some networking code in C. Networking typically uses big-endian IIRC. Most languages either abstract the whole thing or offer libraries to... | null | CC BY-SA 2.5 | null | 2008-08-21T23:57:39.673 | 2008-08-21T23:57:39.673 | null | null | 909 | null |
21,494 | 2 | null | 21,464 | 2 | null | [This site](http://www.icodeblog.com/tag/iphone/) covers some of the basics with little regard for the NDA. Start at the bottom and work up.
| null | CC BY-SA 3.0 | null | 2008-08-22T00:16:32.577 | 2012-07-07T22:48:33.933 | 2012-07-07T22:48:33.933 | 811 | 1,569 | null |
21,461 | 1 | 21,479 | null | 9 | 865 | ```
#if SYMBOL
//code
#endif
```
what values does C# predefine for use?
| What Predefined #if symbos does c# have? | CC BY-SA 2.5 | 0 | 2008-08-21T23:51:23.777 | 2012-08-11T15:55:07.290 | null | null | 1,343 | [
"c#"
] |
21,492 | 2 | null | 21,489 | 0 | null | For this particular case, all you need to do is group by the name and ask for the count, like this:
```
select Name, count(*)
from MyTable
group by Name
```
That'll get you the count for each name as a second column.
You can get it all as one column by concatenating like this:
```
select Name + ' (' + cast(count(*... | null | CC BY-SA 2.5 | null | 2008-08-22T00:16:00.940 | 2008-08-22T00:16:00.940 | null | null | 615 | null |
21,513 | 2 | null | 21,437 | 2 | null | unfortunately you can always screen grab the browser and crop the image out, not perfect but it circumvents almost every solution posted here :(
| null | CC BY-SA 2.5 | null | 2008-08-22T00:29:00.050 | 2008-08-22T00:29:00.050 | null | null | 2,272 | null |
21,476 | 2 | null | 21,437 | 13 | null | Response.WriteBinary(), embedded flash, JavaScript hacks, hidden divs.
Over the years I have seen and tried every possible way to secure an image and I have come to one conclusion: If it can be seen online; it can be taken, my friend.
So, what you really should consider what the final goal of this action would really... | null | CC BY-SA 2.5 | null | 2008-08-22T00:02:02.563 | 2008-08-22T00:09:52.437 | 2008-08-22T00:09:52.437 | 2,213 | 2,213 | null |
21,515 | 2 | null | 21,460 | 0 | null | Well, if it support Python, you might be able to run Django using a FastCGI setup, as described here: [FastCGI Docs](https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/). If it supports mod_python (which I guess it's what you mean), then sure, you can install it using the steps listed here: [ModPython docs]... | null | CC BY-SA 3.0 | null | 2008-08-22T00:29:17.943 | 2013-07-23T15:08:30.587 | 2013-07-23T15:08:30.587 | 1,011,749 | 2,384 | null |
21,502 | 2 | null | 21,461 | 0 | null | Well, that depends on the compiler you are using, and the command line options. Mono defines different names than Microsoft's compiler by default, and depending on what system you are you get different defines, etc.
If you provide a more specific system for which you are compiling, we might be able to come up with the... | null | CC BY-SA 2.5 | null | 2008-08-22T00:20:47.153 | 2008-08-22T00:20:47.153 | null | null | 2,384 | null |
21,510 | 2 | null | 21,489 | 1 | null | Well, this:
```
select Name, count(Id)
from MyTable
group by Name
```
will give you this:
```
Harry Johns, 1
Adam Taylor, 1
John Smith, 2
Bill Manning, 1
```
and this (MS SQL syntax):
```
select Name +
case when ( count(Id) > 1 )
then ' ('+cast(count(Id) as varchar)+')'
else ''
end
fr... | null | CC BY-SA 2.5 | null | 2008-08-22T00:25:27.033 | 2008-08-22T00:25:27.033 | null | null | 369 | null |
21,527 | 2 | null | 21,288 | 2 | null | I think a good place to start is with Ninject, it is new and has taken into account alot of fine tuning and is really fast. Nate, the developer, really has a great site and great support.
| null | CC BY-SA 2.5 | null | 2008-08-22T00:37:04.477 | 2008-08-22T00:37:04.477 | null | null | 2,305 | null |
21,505 | 2 | null | 21,422 | 0 | null | Tags are basically our admission that search algorithms aren't up to snuff. If we can get a computer to be smart enough to identify that things tagged "Subversion" have similar content to things tagged "svn", presumably we can parse the contents, so why not skip tags altogether, and match a search term directly to t... | null | CC BY-SA 2.5 | null | 2008-08-22T00:23:41.653 | 2008-08-22T00:23:41.653 | null | null | 1,490 | null |
21,524 | 2 | null | 21,288 | 36 | null | Autofac. [https://github.com/autofac/Autofac](https://github.com/autofac/Autofac) It is really fast and pretty good. Here is a link with comparisons (made after Ninject fixed a memory leak issue).
[http://www.codinginstinct.com/2008/05/ioc-container-benchmark-rerevisted.html](http://www.codinginstinct.com/2008/05/io... | null | CC BY-SA 3.0 | null | 2008-08-22T00:35:36.430 | 2018-02-23T09:15:12.743 | 2018-02-23T09:15:12.743 | 869,033 | 76 | null |
21,514 | 1 | 21,546 | null | 6 | 24,469 | Within c#, I need to be able to
- - -
So for example I would connect to \SOMESYSTEM with appropriate creds, and fetch back a list of local administrators including SOMESYSTEM\Administrator, SOMESYSTEM\Bob, DOMAIN\AlanH, "DOMAIN\Domain Administrators".
I've tried this with system.directoryservices.accountmanagement ... | Enumerate Windows user group members on remote system using c# | CC BY-SA 2.5 | 0 | 2008-08-22T00:29:05.837 | 2011-02-05T15:55:33.823 | 2011-02-05T15:55:33.823 | 240,733 | 2,383 | [
"c#",
"windows",
"user-management",
"usergroups"
] |
21,531 | 2 | null | 21,449 | 1 | null | Actually, I'd describe the endianness of a machine as the order of inside of a word, and not the order of .
By "bytes" up there I mean the "smallest unit of memory the architecture can manage individually". So, if the smallest unit is 16 bits long (what in x86 would be called a ) then a 32 bit "word" representing the... | null | CC BY-SA 2.5 | null | 2008-08-22T00:39:51.520 | 2008-08-22T00:39:51.520 | null | null | 2,384 | null |
21,489 | 1 | 21,545 | null | 7 | 262 | SQL Experts,
Is there an efficient way to group runs of data together using SQL?
Or is it going to be more efficient to process the data in code.
For example if I have the following data:
```
ID|Name
01|Harry Johns
02|Adam Taylor
03|John Smith
04|John Smith
05|Bill Manning
06|John Smith
```
I need to display thi... | Grouping runs of data | CC BY-SA 3.0 | null | 2008-08-22T00:13:06.000 | 2014-05-04T21:51:04.703 | 2014-05-04T21:51:04.703 | 1,537,726 | 2,281 | [
"sql"
] |
21,532 | 2 | null | 21,288 | 4 | null | I can recommend Ninject. It's incredibly fast and easy to use but only if you don't need XML configuration, else you should use Windsor.
| null | CC BY-SA 2.5 | null | 2008-08-22T00:40:09.757 | 2008-08-22T00:40:09.757 | null | null | 2,148 | null |