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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,624 | 2 | null | 9,615 | 1 | null | Have a look at the new [Canvas](http://en.wikipedia.org/wiki/Canvas_(HTML_element)) element which has been implemented in many browsers. I heard also that there is an ActiveX control for IE that implements the Canvas element too.
Update: Wait, you already said that. I should read the whole question next time! :)
| null | CC BY-SA 2.5 | null | 2008-08-13T09:55:05.933 | 2008-08-13T09:58:35.537 | 2008-08-13T09:58:35.537 | 893 | 893 | null |
9,623 | 2 | null | 9,601 | 3 | null | I occasionally get this bug, and others related to layout/fonts/colouring etc. A little trick I've found is use the Tools -> Import and Export Settings, export your current settings once you've got everything setup as you like, then close and reopen Visual Studio and import. Hopefully that'll sort you out.
In 2005 the... | null | CC BY-SA 2.5 | null | 2008-08-13T09:51:21.790 | 2008-08-13T09:51:21.790 | null | null | 1,169 | null |
9,617 | 2 | null | 9,612 | 0 | null | I don't think I can access the enumerations via .NET so instead I created the specific constant I needed. For what it's worth here's my code:
> ```
Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2
adNewGroup.Properties("groupType").Value = ADS_GROUP_TYPE_GLOBAL_GROUP
```
Refactoring welcome!
| null | CC BY-SA 2.5 | null | 2008-08-13T09:46:05.623 | 2008-08-13T13:13:42.413 | 2008-08-13T13:13:42.413 | 982 | 982 | null |
9,625 | 2 | null | 9,614 | 2 | null | Could do with some work but here is some sql
```
select distinct T.itemid, A.mark as "A.mark", B.mark as "B.mark"
from (select * from A union select * from B) T
left join A on T.itemid = A.itemid
left join B on T.itemid = B.itemid;
```
This relies on the left join, which returns all the rows in the ori... | null | CC BY-SA 2.5 | null | 2008-08-13T09:56:46.787 | 2008-08-13T10:09:47.743 | 2008-08-13T10:09:47.743 | 716 | 716 | null |
9,614 | 1 | 9,635 | null | 8 | 1,907 | Suppose we have a table A:
```
itemid mark
1 5
2 3
```
and table B:
```
itemid mark
1 3
3 5
```
I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result:
```
itemid A.mark B.mark
1 5 3
2 3 NULL
3 NULL 5
```
Is there a way to do it in one query... | Bidirectional outer join | CC BY-SA 2.5 | 0 | 2008-08-13T09:41:43.917 | 2013-01-22T10:18:48.543 | null | null | 844 | [
"sql",
"mysql"
] |
9,626 | 2 | null | 9,614 | -1 | null | This works for me on SQL Server:
```
select isnull(a.id, b.id), a.mark, b.mark
from a
full outer join b on b.id = a.id
```
| null | CC BY-SA 3.0 | null | 2008-08-13T09:58:23.133 | 2013-01-22T10:18:48.543 | 2013-01-22T10:18:48.543 | 1,410,342 | 615 | null |
9,630 | 2 | null | 9,601 | 11 | null | I had the same problem. It turned out that if the VS window was non-maximized, it was really
small. So after making the non-maximized wider, the problem disappeared.
| null | CC BY-SA 2.5 | null | 2008-08-13T10:04:49.143 | 2008-08-13T10:04:49.143 | null | null | null | null |
9,627 | 2 | null | 9,615 | -1 | null | Go for SVG - and just tell the users to get the ADOBE SVG plug in for IE.
See this excellent site - which is a UK Government Site (public service)
[ELGIN](http://www.elgin.gov.uk)
| null | CC BY-SA 2.5 | null | 2008-08-13T09:59:13.973 | 2008-08-13T09:59:13.973 | null | null | null | null |
9,635 | 2 | null | 9,614 | 8 | null | It's called a full outer join and it's not supported natively in MySQL, judging from its [docs](http://dev.mysql.com/doc/refman/4.1/en/join.html). You can work around this limitation using UNION as described in the comments to the page I linked to.
[edit] Since others posted snippets, here you go. You can see explanat... | null | CC BY-SA 2.5 | null | 2008-08-13T10:15:39.293 | 2008-08-13T10:19:03.763 | 2008-08-13T10:19:03.763 | 1,026 | 1,026 | null |
9,629 | 1 | null | null | 3 | 812 | I have got the following situation. On a machine there is a card. There is a process that is responsible for playing a certain wave file on this device's wave out ( connection is made at startup and made persistent). The scenario is easy, whenever needed the process calls `waveOutWrite()` on the previously opened wave... | Playing wave file ends immediately (C++, Windows) | CC BY-SA 3.0 | null | 2008-08-13T10:04:40.610 | 2018-03-13T17:16:57.783 | 2018-03-13T17:16:57.783 | 1,936,366 | 2,090,742 | [
"c++",
"windows",
"waveout"
] |
9,615 | 1 | null | null | 28 | 11,415 | I need to display some interactive (attaching with DOM listeners etc. and event handling) vector graphics in web site I am working on. There is a W3C recommendation for SVG though this format is still not recognized by Internet Explorer support of which is a must (for a public website). IE handles VML though and there ... | Displaying vector graphics in a browser | CC BY-SA 2.5 | 0 | 2008-08-13T09:43:53.787 | 2008-09-26T19:57:55.623 | 2008-09-26T19:57:55.623 | 2,134 | 837 | [
"cross-browser",
"svg",
"vector-graphics",
"vml"
] |
9,632 | 1 | 2,523,372 | null | 31 | 41,246 | Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background.
I know this works well:
```
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http... | WPF: How to style or disable the default ContextMenu of a TextBox | CC BY-SA 3.0 | 0 | 2008-08-13T10:05:41.747 | 2020-07-20T02:49:48.377 | 2012-06-13T15:39:05.637 | 851,273 | 900 | [
"wpf",
"xaml",
".net-3.5"
] |
9,638 | 2 | null | 9,612 | 0 | null | You're correct, you can't actually get access to the enumerations.
Just a wee nitpick, this constant doesn't need to be an object, you can make it an int32 -
Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2
| null | CC BY-SA 2.5 | null | 2008-08-13T10:19:05.120 | 2008-08-13T10:19:05.120 | null | null | 419 | null |
9,639 | 2 | null | 9,033 | 254 | null | The 'default' keyword in generic types:
```
T t = default(T);
```
results in a 'null' if T is a reference type, and 0 if it is an int, false if it is a boolean,
etcetera.
| null | CC BY-SA 2.5 | null | 2008-08-13T10:20:07.147 | 2008-08-13T10:20:07.147 | null | null | 1,172 | null |
9,641 | 2 | null | 9,472 | 0 | null | Thanks for the resource. It certainly helped me test out the webservice, but it didn't much help with using the WCF service in my .net 2.0 application.
What I eventually ended up doing was going back to the architects and explaining that the 3.0 dll's that I needed to reference got compiled back to run on the 2.0 CLR.... | null | CC BY-SA 2.5 | null | 2008-08-13T10:23:06.517 | 2008-08-13T10:23:06.517 | null | null | 493 | null |
9,634 | 2 | null | 9,615 | 0 | null | IE supports VML, but nothing else does and it's ugly. Microsoft claimed that they'd dropped it (with new XAML and all) but it's still part of their Office XML format (it's how Excel .xlsx supports comments, weirdly enough).
FX and loads more support the new Canvas element. Many support SVG, but given the work MS are... | null | CC BY-SA 2.5 | null | 2008-08-13T10:12:54.227 | 2008-08-13T10:12:54.227 | null | null | 905 | null |
9,637 | 2 | null | 9,615 | 0 | null | I don't think SVG is a good choice for the future. From [Wikipedia](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics):
- - - -
| null | CC BY-SA 2.5 | null | 2008-08-13T10:18:18.007 | 2008-08-13T10:18:18.007 | null | null | 341 | null |
9,643 | 2 | null | 9,543 | 4 | null | I would also suggest checking out the SharePoint Content Deployment Wizard by Chris O'Brien.
[http://www.codeplex.com/SPDeploymentWizard](http://www.codeplex.com/SPDeploymentWizard)
Should help smooth the process you describe, and it's a nice tool for your kitbag regardless
| null | CC BY-SA 2.5 | null | 2008-08-13T10:35:58.363 | 2008-08-13T10:35:58.363 | null | null | 897 | null |
9,653 | 2 | null | 9,650 | 6 | null | Checkout CLISP [wiki-link](http://en.wikipedia.org/wiki/CLISP) that ie. was used by Paul Graham
Direct [link](http://clisp.cons.org/)
| null | CC BY-SA 2.5 | null | 2008-08-13T11:11:42.847 | 2008-08-13T11:11:42.847 | null | null | 842 | null |
9,652 | 2 | null | 6,765 | 1 | null | We've been running an application using Hibernate talking to multiple remote MSQL Server instances for a few years now and we also switched to the jTDS driver early on after a few issues with the M$ driver. Since the switch we haven't had any issues at all. However, it's not a complicated application so it doesn't use ... | null | CC BY-SA 2.5 | null | 2008-08-13T11:11:09.460 | 2008-08-13T11:11:09.460 | null | null | 1,126 | null |
9,667 | 1 | 9,670 | null | 9 | 2,293 | Given a handle of type `HWND` is it possible to confirm that the handle represents a real window?
| Validating a Win32 Window Handle | CC BY-SA 3.0 | null | 2008-08-13T11:42:13.860 | 2018-03-13T17:16:31.253 | 2018-03-13T17:16:31.253 | 1,936,366 | 887 | [
"c++",
"windows",
"winapi"
] |
9,650 | 1 | null | null | 16 | 4,128 | I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs.
Are there any command line interpreters, such that I could type this into the command line:
> lispinterpret sourcefile.lisp
just like I can run perl or python.
While I'd also like to b... | Lisp/Scheme interpreter without Emacs? | CC BY-SA 2.5 | 0 | 2008-08-13T11:06:12.747 | 2017-09-13T22:59:49.500 | 2009-03-04T19:36:07.243 | 31,615 | 1,084 | [
"lisp",
"scheme"
] |
9,655 | 2 | null | 9,650 | 1 | null | Did you try Allegro CL from [http://www.franz.com/](http://www.franz.com/)?
| null | CC BY-SA 2.5 | null | 2008-08-13T11:13:43.433 | 2008-08-13T11:13:43.433 | null | null | 1,065 | null |
9,654 | 2 | null | 9,615 | 9 | null | Safari, Opera and Firefox all support SVG natively (eg. without plugins) to varying degrees of completeness and correctness, including the ability to script the svg from javascript.
There's also the canvas element which is now being standardised in html5, and is already supported in the above browsers as well (with va... | null | CC BY-SA 2.5 | null | 2008-08-13T11:13:39.987 | 2008-08-13T11:19:29.350 | 2008-08-13T11:19:29.350 | 784 | 784 | null |
9,659 | 2 | null | 9,650 | 13 | null | You could also try [DrScheme](http://www.plt-scheme.org/), which whilst not exactly a standalone interpreter, isn't emacs :)
It's basically a simple IDE that has an area to type in code that can be executed as a file, and then another area that is the running interpreter that you can interact with.
(Also, find the UC... | null | CC BY-SA 2.5 | null | 2008-08-13T11:27:55.340 | 2009-03-05T01:27:13.530 | 2009-03-05T01:27:13.530 | 4,203 | 188 | null |
9,668 | 2 | null | 9,615 | 6 | null | Take a look at the [Raphael Javascript library](http://raphaeljs.com/). It's early days but it looks very promising.
I remember the IE roadmap that had SVG support listed in IE7.2.
Depends on how interactive you want it?
| null | CC BY-SA 2.5 | null | 2008-08-13T11:42:58.460 | 2008-08-13T11:42:58.460 | null | null | 342 | null |
9,666 | 1 | 9,788 | null | 66 | 26,565 | I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, because the processor might switch to another thread halfway through a write.
However, I was looking through System.Web.Secu... | Is accessing a variable in C# an atomic operation? | CC BY-SA 2.5 | 0 | 2008-08-13T11:41:29.307 | 2021-01-27T03:15:46.800 | 2008-08-13T12:28:40.787 | 1,016 | 1,016 | [
"c#",
"multithreading"
] |
9,670 | 2 | null | 9,667 | 16 | null | There is a function `IsWindow` which does exactly what you asked for.
```
BOOL isRealHandle = IsWindow(unknwodnHandle);
```
Look at [this link](http://msdn.microsoft.com/en-us/library/ms633528(VS.85).aspx) for more information.
| null | CC BY-SA 3.0 | null | 2008-08-13T11:46:44.537 | 2016-05-26T17:50:42.140 | 2016-05-26T17:50:42.140 | 264,325 | 1,007 | null |
9,673 | 1 | 9,685 | null | 242 | 400,865 | I have been working with a `string[]` array in C# that gets returned from a function call. I could possibly cast to a `Generic` collection, but I was wondering if there was a better way to do it, possibly by using a temp array.
| How do I remove duplicates from a C# array? | CC BY-SA 3.0 | 0 | 2008-08-13T11:48:44.360 | 2021-12-11T16:51:44.590 | 2017-09-26T19:21:51.060 | 3,357,935 | 493 | [
"c#",
"arrays",
"duplicates"
] |
9,671 | 2 | null | 9,667 | 4 | null | Generally no. By the time you've got confirmation that a Window is valid another process/thread my come along and remove it for you.
| null | CC BY-SA 2.5 | null | 2008-08-13T11:47:16.050 | 2008-08-13T11:47:16.050 | null | null | 342 | null |
9,677 | 2 | null | 9,673 | 11 | null | If you needed to sort it, then you could implement a sort that also removes duplicates.
Kills two birds with one stone, then.
| null | CC BY-SA 2.5 | null | 2008-08-13T11:51:52.407 | 2008-08-13T11:51:52.407 | null | null | 188 | null |
9,685 | 2 | null | 9,673 | 488 | null | You could possibly use a LINQ query to do this:
```
int[] s = { 1, 2, 3, 3, 4};
int[] q = s.Distinct().ToArray();
```
| null | CC BY-SA 2.5 | null | 2008-08-13T12:03:05.940 | 2008-08-13T12:03:05.940 | null | null | 1 | null |
9,679 | 2 | null | 9,650 | 7 | null | It looks like Steel Bank Common Lisp (SBCL) also caters to what you want:
[http://www.sbcl.org/manual/#Shebang-Scripts](http://www.sbcl.org/manual/#Shebang-Scripts)
SBCL is both top rate and open source.
| null | CC BY-SA 3.0 | null | 2008-08-13T11:55:48.700 | 2017-09-13T22:59:49.500 | 2017-09-13T22:59:49.500 | -1 | 279 | null |
9,682 | 2 | null | 9,666 | 0 | null | I thought they were - I'm not sure of the point of the lock in your example unless you're also doing something to s_Provider at the same time - then the lock would ensure that these calls happened together.
Does that `//Perform initialization` comment cover creating s_Provider? For instance
```
private static void In... | null | CC BY-SA 2.5 | null | 2008-08-13T12:00:51.343 | 2008-08-13T12:00:51.343 | null | null | 905 | null |
9,675 | 1 | 9,692 | null | 2 | 613 | I'm implementing a document server. Currently, if two users open the same document, then modify it and save the changes, the document's state will be undefined (either the first user's changes are saved permanently, or the second's). This is entirely unsatisfactory. I considered two possibilities to solve this problem:... | Document Server: Handling Concurrent Saves | CC BY-SA 3.0 | null | 2008-08-13T11:49:14.250 | 2014-02-14T16:37:17.100 | 2014-02-14T16:37:17.100 | 2,126,792 | 1,182 | [
"concurrency",
"locking",
"versioning"
] |
9,689 | 2 | null | 9,666 | 2 | null | The Initialize function is faulty. It should look more like this:
```
private static void Initialize()
{
if(s_initialized)
return;
lock(s_lock)
{
if(s_Initialized)
return;
s_Initialized = true;
}
}
```
Without the second check inside the lock it's possible the ini... | null | CC BY-SA 3.0 | null | 2008-08-13T12:08:29.220 | 2014-09-07T20:07:38.420 | 2014-09-07T20:07:38.420 | 2,246,344 | 887 | null |
9,687 | 1 | null | null | 7 | 3,370 | I'm looking for a pattern for performing a dynamic search on multiple tables.
I have no control over the legacy (and poorly designed) database table structure.
Consider a scenario similar to a resume search where a user may want to perform a search against any of the data in the resume and get back a list of resumes ... | Need Pattern for dynamic search of multiple sql tables | CC BY-SA 3.0 | 0 | 2008-08-13T12:06:07.383 | 2013-02-19T00:10:06.270 | 2013-02-19T00:10:06.270 | 1,922,662 | 1,097 | [
"sql",
"database-design",
"design-patterns",
"dynamic-sql",
"table-structure"
] |
9,692 | 2 | null | 9,675 | 0 | null | My suggestion would be something like your first one. When the first user (Bob) opens the document, he acquires a lock so that other users can only read the current document. If the user saves the document while he is using it, he keeps the lock. Only when he exits the document, it is unlocked and other people can edit... | null | CC BY-SA 2.5 | null | 2008-08-13T12:10:43.240 | 2008-08-13T12:10:43.240 | null | null | 614 | null |
9,701 | 2 | null | 9,666 | 0 | null | Perhaps [Interlocked](http://msdn.microsoft.com/en-us/library/system.threading.interlocked(VS.85).aspx) gives a clue. And otherwise [this one](http://msdn.microsoft.com/sv-se/magazine/cc188793(en-us).aspx) i pretty good.
I would have guessed that their not atomic.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:19:22.663 | 2008-08-13T12:19:22.663 | null | null | 1,192 | null |
9,698 | 2 | null | 8,968 | 0 | null | We're looking at Drools/Guvnor, possibly integrated with jBPM (as in this [presentation](http://www.firstpartners.net/blog/technology/java/2008/06/05/jboss-business-rules-and-jbpm-workflow-presentation-dublin/)), to add a workflow engine to our Spring/Java EE app, but we're still in the very early phases of trying it o... | null | CC BY-SA 3.0 | null | 2008-08-13T12:15:19.377 | 2013-08-18T09:19:43.010 | 2013-08-18T09:19:43.010 | 472,792 | 765 | null |
9,703 | 2 | null | 8,761 | 0 | null | "I guess you could use your favourite image editor and pick the colors from a screen grab."
This is essentially what I'm doing at the moment, and I've defined a list of constants from which I pull out the colours. Doesn't seem very elegant though!
| null | CC BY-SA 2.5 | null | 2008-08-13T12:27:42.270 | 2008-08-13T12:27:42.270 | null | null | 1,078 | null |
9,693 | 1 | 9,732 | null | 0 | 1,147 | I have a number of macros written for Visual Studio 2005, but they have since stopped working once I installed Visual Studio 2008 on my computer. No error is returned by the macro when I try and run it, and the environment merely shows the hourglass for a second and then returns to the normal cursor. Currently uninstal... | Visual Studio 2005 Macros stop working when Visual Studio 2008 is installed | CC BY-SA 2.5 | null | 2008-08-13T12:11:07.657 | 2009-03-23T09:32:58.063 | 2009-03-23T09:32:58.063 | 14,444 | 1,185 | [
"visual-studio",
"visual-studio-2008",
"ide",
"visual-studio-2005",
"macros"
] |
9,704 | 1 | 9,708 | null | 2 | 2,200 | In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes.
How can I keep the mouse cursor from being hidden?
| How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown? | CC BY-SA 2.5 | null | 2008-08-13T12:28:57.057 | 2014-05-20T19:02:04.770 | 2014-05-20T19:02:04.770 | 321,731 | 1,042 | [
"mfc",
"mouse",
"visibility",
"ccombobox"
] |
9,699 | 2 | null | 9,666 | 0 | null | What you're asking is whether accessing a field in a method multiple times atomic -- to which the answer is no.
In the example above, the initialise routine is faulty as it may result in multiple initialization. You would need to check the `s_Initialized` flag inside the lock as well as outside, to prevent a race con... | null | CC BY-SA 3.0 | null | 2008-08-13T12:16:39.860 | 2014-09-07T20:09:14.910 | 2014-09-07T20:09:14.910 | 2,246,344 | 784 | null |
9,708 | 2 | null | 9,704 | 2 | null | Call
```
SetCursor(LoadCursor(NULL, IDC_ARROW));
```
immediately after the ShowDropDown() call.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:31:26.023 | 2008-08-13T12:31:26.023 | null | null | 1,042 | null |
9,707 | 2 | null | 9,702 | 0 | null | Maybe I didn't get it, but couldn't you use GUIDs as Ids and still have user and system data together? Then you can access the system data by the (non-changable) GUIDs.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:30:47.867 | 2008-08-13T12:30:47.867 | null | null | 1,069 | null |
9,711 | 2 | null | 9,666 | 1 | null | I think you're asking if `s_Initialized` could be in an unstable state when read outside the lock. The short answer is no. A simple assignment/read will boil down to a single assembly instruction which is atomic on every processor I can think of.
I'm not sure what the case is for assignment to 64 bit variables, it de... | null | CC BY-SA 3.0 | null | 2008-08-13T12:34:20.057 | 2014-09-07T20:08:17.780 | 2014-09-07T20:08:17.780 | 2,246,344 | 887 | null |
9,706 | 2 | null | 9,136 | 4 | null | Looks like it was the configuration. I found a good example of the normal, one-file approach here: [http://www.devx.com/dotnet/Article/31158/0/page/2](http://www.devx.com/dotnet/Article/31158/0/page/2)
Using an external config file is actually trivial once you figure out the syntax for it. Ex.:
In Web.config:
I... | null | CC BY-SA 3.0 | null | 2008-08-13T12:29:57.647 | 2016-02-07T18:24:02.290 | 2016-02-07T18:24:02.290 | 2,921,691 | 767 | null |
9,715 | 2 | null | 9,666 | 1 | null | "Is accessing a variable in C# an atomic operation?"
Nope. And it's not a C# thing, nor is it even a .net thing, it's a processor thing.
OJ is spot on that Joe Duffy is the guy to go to for this kind of info. ANd "interlocked" is a great search term to use if you're wanting to know more.
"Torn reads" can occur on an... | null | CC BY-SA 2.5 | null | 2008-08-13T12:39:33.883 | 2008-08-15T12:46:02.437 | 2008-08-15T12:46:02.437 | 49 | 49 | null |
9,712 | 2 | null | 9,666 | 1 | null | Reads and writes of variables are not atomic. You need to use Synchronisation APIs to emulate atomic reads/writes.
For an awesome reference on this and many more issues to do with concurrency, make sure you grab a copy of Joe Duffy's [latest spectacle](https://rads.stackoverflow.com/amzn/click/com/032143482X). It's a ... | null | CC BY-SA 2.5 | null | 2008-08-13T12:35:12.897 | 2008-08-13T12:35:12.897 | null | null | 611 | null |
9,721 | 2 | null | 9,666 | -1 | null | Ack, nevermind... as pointed out, this is indeed incorrect. It doesn't prevent a second thread from entering the "initialize" code section. Bah.
> You could also decorate s_Initialized with the volatile keyword and forego the use of lock entirely.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:42:16.720 | 2008-08-13T15:21:04.557 | 2008-08-13T15:21:04.557 | 630 | 630 | null |
9,713 | 2 | null | 9,702 | 1 | null | I recommend using the second with the modification that you store the system and user values in one table. GUID is quite reliable in this manner.
Another idea: use any text-based ID (not necessary GUID), which you give for the system values and is generated by a random string or a string based on some kind of custom l... | null | CC BY-SA 2.5 | null | 2008-08-13T12:36:21.193 | 2008-08-13T12:36:21.193 | null | null | 968 | null |
9,702 | 1 | 9,857 | null | 1 | 949 | As part of our current database work, we are looking at a dealing with the process of updating databases.
A point which has been brought up recurrently, is that of dealing with system vs. user values; in our project user and system vals are stored together. For example...
We have a list of templates.
```
1, <system ... | Default database IDs; system and user values | CC BY-SA 3.0 | null | 2008-08-13T12:23:37.863 | 2013-07-04T12:15:52.223 | 2013-07-04T12:15:52.223 | 1,584,286 | 1,193 | [
"database"
] |
9,723 | 2 | null | 9,615 | 0 | null | Of all the possibilities you list, the only one that's not a horrible abuse of an existing technology (Javascript), barely supported (SVG, Canvas element) or a lot of work (Java) is Flash. It was designed as a vector graphics package and is compatible with more browsers than SVG and the canvas tag.
The only reason I ... | null | CC BY-SA 2.5 | null | 2008-08-13T12:43:36.933 | 2008-08-13T12:43:36.933 | null | null | null | null |
9,728 | 2 | null | 9,702 | 0 | null | I don't think that GUID should make any problem.
If you want to avoid it, then use a flag:
> ID inttemplate whateverflag enum/int/bool
Flag shows whether the actual value is a system or a user value.
If you would like to update a system value, then ask only for system values ordered by ID, and it will show you actu... | null | CC BY-SA 2.5 | null | 2008-08-13T12:47:39.407 | 2008-08-13T12:47:39.407 | null | null | 968 | null |
9,732 | 2 | null | 9,693 | 3 | null | You may need to install (reinstall) VS 2005 SP1, since a security update from Microsoft (KB928365) on July 10 may have caused the issue.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:51:50.490 | 2008-08-13T12:51:50.490 | null | null | 1,382 | null |
9,725 | 2 | null | 3,049 | 10 | null | For C/C++ on Windows you have (at least) two choices:
1. Use the SerialPort class provided by .NET.
2. Use the Win32 API. There is an extensive MSDN article dating back to 1995, and many free libraries and examples on the web to get you started.
The .NET option will be much easier.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:44:34.937 | 2008-08-13T12:44:34.937 | null | null | 1,077 | null |
9,735 | 2 | null | 9,673 | 5 | null | Add all the strings to a dictionary and get the Keys property afterwards. This will produce each unique string, but not necessarily in the same order your original input had them in.
If you require the end result to have the same order as the original input, when you consider the first occurance of each string, use th... | null | CC BY-SA 2.5 | null | 2008-08-13T12:53:33.233 | 2008-08-13T12:53:33.233 | null | null | 267 | null |
9,730 | 2 | null | 8,849 | 1 | null | Unfortunately there is no way to swap to a screen where you can get user via the feature activation process. Couple of comments for you:
1. I'm assuming the connection string is going to be different for every installation, so there is no way you can include it directly in the Solution.
2. I'm assuming that you could... | null | CC BY-SA 3.0 | null | 2008-08-13T12:50:32.333 | 2017-12-18T12:24:12.403 | 2017-12-18T12:24:12.403 | 709,443 | 897 | null |
9,741 | 2 | null | 8,761 | 0 | null | @GateKiller, the OP isn't developing an Office 2007 add-in, so the UI guidelines won't really help. It's an MFC application using the [Visual C++ 2008 Feature Pack](http://blogs.msdn.com/somasegar/archive/2008/04/07/visual-c-2008-feature-pack-shipped.aspx) which allows MFC apps to take on the Office 2007 look and feel.... | null | CC BY-SA 2.5 | null | 2008-08-13T12:56:29.343 | 2008-08-13T12:56:29.343 | null | null | 1,042 | null |
9,743 | 2 | null | 6,765 | 1 | null | jTDS is excellent. I've been using it for years without issue in high-availability production environments.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:56:57.203 | 2008-08-13T12:56:57.203 | null | null | 1,174 | null |
9,742 | 2 | null | 9,734 | 0 | null | string is an alias for System.String. They are the same thing.
By convention, though, objects of type (System.String) are generally refered to as the alias - e.g.
```
string myString = "Hello";
```
whereas operations on the class use the uppercase version
e.g.
```
String.IsNullOrEmpty(myStringVariable);
```
| null | CC BY-SA 2.5 | null | 2008-08-13T12:56:39.200 | 2008-08-13T12:56:39.200 | null | null | 377 | null |
9,733 | 2 | null | 8,761 | 0 | null | Looks like CMFCVisualManager offers several methods for getting color information, e.g.
```
CMFCVisualManager::GetSmartDockingBaseGuideColors()
CMFCVisualManager::GetToolbarHighlightColor()
```
Take a look at the MSDN docs for CMFCVisualManager.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:51:51.457 | 2008-08-13T12:51:51.457 | null | null | 1,042 | null |
9,729 | 1 | 22,058 | null | 4 | 2,463 | Is it possible to add a custom tab to a project properties page in the Visual Studio 2008?
What I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library, etc).
| How to extend project properties page? | CC BY-SA 2.5 | 0 | 2008-08-13T12:50:10.557 | 2020-01-19T12:34:28.657 | 2009-03-04T21:43:55.347 | null | 1,196 | [
"visual-studio",
"visual-studio-2008",
"vsx",
"extensibility"
] |
9,739 | 2 | null | 9,734 | 2 | null | "String" is the name of the class. "string" is keyword that maps this class.
it's the same like
- - -
... and so on...
| null | CC BY-SA 2.5 | null | 2008-08-13T12:55:14.523 | 2008-08-13T12:55:14.523 | null | null | 275 | null |
9,731 | 2 | null | 9,702 | 1 | null | +1 for Biri's text based ID - define a "template_mnemonic" text based column and make it the primary key. This will be a known value when you insert it as you, the developers will have decided on it (or auto-generated it) and you will always be able to reference a template by its mnemonic regardless of how many user sp... | null | CC BY-SA 2.5 | null | 2008-08-13T12:51:41.067 | 2008-08-13T12:51:41.067 | null | null | 1,030 | null |
9,734 | 1 | 9,747 | null | 7 | 2,691 | Why does C#.Net allow the declaration of the string object to be case-insensitive?
```
String sHello = "Hello";
string sHello = "Hello";
```
Both the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this.
Can anyone explain why?
| C#.Net case-insensitive string | CC BY-SA 3.0 | 0 | 2008-08-13T12:53:20.550 | 2013-12-16T01:26:06.543 | 2013-12-16T01:26:06.543 | 2,376,156 | 383 | [
"c#",
".net"
] |
9,746 | 2 | null | 9,734 | 1 | null | "string" is a C# keyword. it's just an alias for "System.String" - one of the .NET BCL classes.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:57:26.767 | 2008-08-13T12:57:26.767 | null | null | 1,196 | null |
9,751 | 1 | 15,415 | null | 5 | 2,516 | I want so send every week an update by email. But Im afraid that if there are too many emails sent, they will be marked as spam. Any of you has experience sending many emails (thousands) weekly? What techniques do you use?
| Sending emails without looking like spam | CC BY-SA 4.0 | 0 | 2008-08-13T13:01:08.023 | 2019-12-23T13:22:47.270 | 2019-12-23T13:22:47.270 | 3,002,139 | 1,013 | [
"asp.net",
"email"
] |
9,749 | 1 | null | null | 1 | 819 | I wonder what type of servers for internal usage you virtualize in the last -say- 6 months. Here's what we got virtual so far:
- - -
We didn't virtualize spezialized desktop PCs which are running a certain software product, that is only used once in a while. Do you plan to get rid of those old machines any time soon... | What kind of servers did you virtualize lately? | CC BY-SA 2.5 | 0 | 2008-08-13T13:00:23.063 | 2008-09-22T16:46:09.060 | null | null | 834 | [
"virtualization"
] |
9,752 | 2 | null | 9,750 | 4 | null | What specifically does that question mean?
Does mean setting 1's to 0's and vice versa?
Or does it mean --> where you reverse their order in the byte? Or perhaps just reversing the part that is from the first 1 to the last 1? ie. --> ?
Assuming it means reversing the bit order in the whole byte, here's an x86 as... | null | CC BY-SA 2.5 | null | 2008-08-13T13:03:17.253 | 2008-08-13T13:20:55.830 | 2008-08-13T13:20:55.830 | 267 | 267 | null |
9,750 | 1 | null | null | 5 | 7,886 | I was reading Joel's book where he was suggesting as interview question:
> Write a program to reverse the "ON" bits in a given byte.
I only can think of a solution using C.
Asking here so you can show me how to do in a Non C way (if possible)
| How can I reverse the ON bits in a byte? | CC BY-SA 3.0 | 0 | 2008-08-13T13:00:48.523 | 2013-07-29T04:02:19.390 | 2012-05-03T20:27:12.553 | 12,604 | 123 | [
"language-agnostic"
] |
9,758 | 2 | null | 9,750 | 2 | null | The classic [Bit Hacks](http://graphics.stanford.edu/~seander/bithacks.html) page has several (really very clever) ways to do this, but it's all in C. Any language derived from C syntax (notably Java) will likely have similar methods. I'm sure we'll get some Haskell versions in this thread ;)
| null | CC BY-SA 2.5 | null | 2008-08-13T13:05:31.400 | 2008-08-13T13:05:31.400 | null | null | 1,035 | null |
9,748 | 2 | null | 9,734 | 1 | null | "string" is just an C# alias for the class "String" in the System-namespace.
| null | CC BY-SA 2.5 | null | 2008-08-13T12:58:46.733 | 2008-08-13T12:58:46.733 | null | null | 936 | null |
9,754 | 2 | null | 9,734 | 6 | null | Further to the other answers, it's good practice to use keywords if they exist.
E.g. you should use rather than .
| null | CC BY-SA 2.5 | null | 2008-08-13T13:03:54.100 | 2008-08-13T13:50:08.190 | 2008-08-13T13:50:08.190 | 1,122 | 1,122 | null |
9,764 | 2 | null | 3,607 | 1 | null | The problem is that FogBugz will link to a web page, and file:///etc is not a web page. To get integration two ways, you need a web server for your subversion repository. Either set up Apache or something else that can host those things the proper way.
| null | CC BY-SA 2.5 | null | 2008-08-13T13:08:28.757 | 2008-08-13T13:08:28.757 | null | null | 267 | null |
9,755 | 2 | null | 9,673 | 12 | null | The following tested and working code will remove duplicates from an array. You must include the System.Collections namespace.
```
string[] sArray = {"a", "b", "b", "c", "c", "d", "e", "f", "f"};
var sList = new ArrayList();
for (int i = 0; i < sArray.Length; i++) {
if (sList.Contains(sArray[i]) == false) {
... | null | CC BY-SA 2.5 | null | 2008-08-13T13:04:51.290 | 2008-08-13T13:17:12.217 | 2008-08-13T13:17:12.217 | 383 | 383 | null |
9,756 | 2 | null | 9,750 | 4 | null | Reversing the order of bits in C#:
```
byte ReverseByte(byte b)
{
byte r = 0;
for(int i=0; i<8; i++)
{
int mask = 1 << i;
int bit = (b & mask) >> i;
int reversedMask = bit << (7 - i);
r |= (byte)reversedMask;
}
return r;
}
```
I'm sure there are more clever ways of... | null | CC BY-SA 2.5 | null | 2008-08-13T13:04:59.433 | 2008-08-13T13:22:02.520 | 2008-08-13T13:22:02.520 | 42 | 42 | null |
9,775 | 2 | null | 371 | 8 | null | In the UK it's also best practice to include a real physical address for your company and its registered number.
That way it's all open and honest and they're less likely to manually mark it as spam.
| null | CC BY-SA 2.5 | null | 2008-08-13T13:13:47.623 | 2008-08-13T13:13:47.623 | null | null | 905 | null |
9,769 | 1 | null | null | 0 | 509 | I'd like to script FlexBuilder so that I can run debug or profile without having to switch to FlexBuilder and manually clicking the button (or using the key combo). Is this possible without writing an extension?
To be more specific, this is exactly what I want to do: I want to create a TextMate command that talks to F... | Can I script FlexBuilder without writing an extension? | CC BY-SA 2.5 | null | 2008-08-13T13:09:58.440 | 2009-06-17T07:00:01.927 | 2008-08-18T19:34:10.163 | 905 | 1,109 | [
"eclipse",
"flexbuilder",
"textmate"
] |
9,763 | 2 | null | 9,673 | 9 | null | This might depend on how much you want to engineer the solution - if the array is never going to be that big and you don't care about sorting the list you might want to try something similar to the following:
```
public string[] RemoveDuplicates(string[] myList) {
System.Collections.ArrayList newList = new Sys... | null | CC BY-SA 2.5 | null | 2008-08-13T13:08:28.383 | 2008-08-13T13:08:28.383 | null | null | 1,185 | null |
9,767 | 2 | null | 9,749 | 0 | null | Our build machine running FinalBuilder runs on a Windows XP Virtual Machine running in VMWare Server on Linux.
It is very practical to move it and also to backup, we just stop the Virtual Machine and copy the disk image.
Some days ago we needed to change the host pc, it took less than 2 hours to have our builder up a... | null | CC BY-SA 2.5 | null | 2008-08-13T13:09:08.583 | 2008-08-13T13:09:08.583 | null | null | 727 | null |
9,768 | 2 | null | 9,673 | 4 | null | NOTE : NOT tested!
```
string[] test(string[] myStringArray)
{
List<String> myStringList = new List<string>();
foreach (string s in myStringArray)
{
if (!myStringList.Contains(s))
{
myStringList.Add(s);
}
}
return myStringList.ToString();
}
```
Might do what yo... | null | CC BY-SA 2.5 | null | 2008-08-13T13:09:23.233 | 2008-08-13T13:09:23.233 | null | null | 377 | null |
9,747 | 2 | null | 9,734 | 21 | null | `string` is a language keyword while `System.String` is the type it aliases.
Both compile to exactly the same thing, similarly:
- `int``System.Int32`- `long``System.Int64`- `float``System.Single`- `double``System.Double`- `char``System.Char`- `byte``System.Byte`- `short``System.Int16`- `ushort``System.UInt16`- `uint`... | null | CC BY-SA 3.0 | null | 2008-08-13T12:57:34.520 | 2011-09-13T14:30:35.120 | 2011-09-13T14:30:35.120 | 905 | 905 | null |
9,778 | 2 | null | 9,750 | 2 | null | > `byte ReverseByte(byte b) { return b ^ 0xff; }`
That works if `^` is XOR in your language, but not if it's `AND`, which it often is.
| null | CC BY-SA 2.5 | null | 2008-08-13T13:15:42.393 | 2008-08-13T13:15:42.393 | null | null | 1,190 | null |
9,792 | 2 | null | 9,666 | 1 | null | > You could also decorate s_Initialized with the volatile keyword and forego the use of lock entirely.
That is not correct. You will still encounter the problem of a second thread passing the check before the first thread has had a chance to to set the flag which will result in multiple executions of the initialisatio... | null | CC BY-SA 3.0 | null | 2008-08-13T13:28:47.013 | 2014-09-07T20:07:47.363 | 2014-09-07T20:07:47.363 | 2,246,344 | 887 | null |
9,790 | 2 | null | 9,783 | 0 | null | Is this any use:
[https://web.archive.org/web/1/http://downloads.techrepublic%2ecom%2ecom/5138-9592-6028761.html](https://web.archive.org/web/1/http://downloads.techrepublic%2ecom%2ecom/5138-9592-6028761.html)
NB Registration is required
| null | CC BY-SA 2.5 | null | 2008-08-13T13:26:38.657 | 2008-08-13T13:26:38.657 | 2015-08-20T04:58:43.033 | -1 | 982 | null |
9,791 | 2 | null | 9,675 | 1 | null | The first option you describe is essentially a pessimistic locking model whilst the second is an optimistic model.
Which one to choose really comes down to a number of factors but essentially boils down to how the business wants to work. For example, would it unduly inconvenience the users if a document they needed to ... | null | CC BY-SA 2.5 | null | 2008-08-13T13:26:57.580 | 2008-08-13T13:26:57.580 | null | null | 1,131 | null |
9,783 | 1 | 9,798 | null | 8 | 9,319 | I'm starting a new project here (Windows Forms). What's the best option today for a small (free as in beer) DBMS?
I've used SQL Server Express on the past projects, but time and time again I hear people saying that the product from Oracle is faster and more powerful.
It will be used in a small company (around 20 user... | Oracle XE or SQL Server Express | CC BY-SA 2.5 | 0 | 2008-08-13T13:18:30.950 | 2014-12-31T07:42:13.143 | 2014-12-31T07:42:13.143 | 1,505,120 | 1,213 | [
"sql-server",
"database",
"oracle-xe"
] |
9,803 | 2 | null | 9,769 | 0 | null | Since FlexBuilder essentially is an extended version of Eclipse, any tools/scripts for doing the same in Eclipse should work for FlexBuilder aswell. I couldn't find any tools like this googling it, have you considered doing away with FlexBuilder completely, there are plenty of guides for using the mxmlc (or fcsh) compi... | null | CC BY-SA 2.5 | null | 2008-08-13T13:34:49.077 | 2008-08-13T13:34:49.077 | null | null | 914 | null |
9,801 | 2 | null | 9,783 | 0 | null | Both of KiwiBastard's points are very good and I completely agree with him.
If you really want a free alternative that is similar to MS SQL and supports growth should you need it, you could have a look at MySQL or PostgreSQL. SQLite also seems a good choice.
Surely you can afford an old Linux server if you work in a c... | null | CC BY-SA 2.5 | null | 2008-08-13T13:33:50.250 | 2008-08-13T13:33:50.250 | null | null | 614 | null |
9,788 | 2 | null | 9,666 | 38 | null | For the definitive answer go to the spec. :)
Partition I, Section 12.6.6 of the CLI spec states: "A conforming CLI shall guarantee that read and write access to properly aligned memory locations no larger than the native word size is atomic when all the write accesses to a location are the same size."
So that confirm... | null | CC BY-SA 3.0 | null | 2008-08-13T13:24:41.533 | 2016-01-07T09:57:33.667 | 2016-01-07T09:57:33.667 | 587,803 | 887 | null |
9,798 | 2 | null | 9,783 | 3 | null | Sorry, no link, but one advice. Because we support Oracle and SQL Server, I know that getting fixes for the 'normal' Oracle database, is not something what I call fun. You have to pay for it, and if you have no tool which updates your Oracle system for you, it's a pain in the a.., if you ask me. Check out how the Oracl... | null | CC BY-SA 2.5 | null | 2008-08-13T13:32:06.430 | 2008-08-13T13:32:06.430 | null | null | 1,069 | null |
9,796 | 2 | null | 9,783 | 4 | null | It would be hard to argue either way given the needs you outlined, that either would shine over the other.
What I will say is this:
1. You say you are already familar with SSExpress, then that is a good reason to stick with it
2. IMHO the tools with SSExpress are superior and easier to use than the Oracle equivalen... | null | CC BY-SA 2.5 | null | 2008-08-13T13:29:39.680 | 2008-08-13T13:29:39.680 | null | null | 1,075 | null |
9,806 | 2 | null | 9,805 | 0 | null | How about checking which week the first and last days will be in?
| null | CC BY-SA 2.5 | null | 2008-08-13T13:39:47.850 | 2008-08-13T13:39:47.850 | null | null | 267 | null |
9,809 | 2 | null | 7,674 | 1 | null | I don't really like the flvPlayback-component, it's hard to handle both implementation wise and somewhat tricky to skin nicely and it's also quite bloated. So I'd opt to use either the JW Flash Media Player as recommended by Michael above or rolling my own entirely.
| null | CC BY-SA 2.5 | null | 2008-08-13T13:43:34.583 | 2008-08-13T13:43:34.583 | null | null | 914 | null |
9,815 | 2 | null | 9,805 | 0 | null | Try this,
```
DateTime.DaysInMonth
```
| null | CC BY-SA 3.0 | null | 2008-08-13T13:45:22.613 | 2014-09-07T20:03:46.807 | 2014-09-07T20:03:46.807 | 2,246,344 | 1,094 | null |
9,822 | 2 | null | 9,805 | 0 | null | Check [Calendar.GetWeekOfYear](https://learn.microsoft.com/en-in/dotnet/api/system.globalization.calendar.getweekofyear). It should do the trick.
There is a problem with it, it does not follow the 4 day rule by ISO 8601, but otherwise it is neat.
| null | CC BY-SA 4.0 | null | 2008-08-13T13:46:46.480 | 2021-01-27T03:13:54.237 | 2021-01-27T03:13:54.237 | 5,407,188 | 968 | null |
9,810 | 2 | null | 9,805 | 0 | null | The months in the Julian / Gregorian calendar have the same number of days each year, except February who can have 28 or 29 days depending on the leapness of the year. You can find the number of days in the Description section at [http://en.wikipedia.org/wiki/Gregorian_calendar](http://en.wikipedia.org/wiki/Gregorian_c... | null | CC BY-SA 2.5 | null | 2008-08-13T13:43:42.023 | 2008-08-13T13:56:41.157 | 2008-08-13T13:56:41.157 | 1,065 | 1,065 | null |
9,821 | 2 | null | 9,805 | 2 | null | Well, it depends on the culture you're using, but let's assume you can use Thread.CurrentThread.CurrentCulture, then the code to get the week of today would be:
```
Culture culture = Thread.CurrentThread.CurrentCulture;
Calendar cal = culture.Calendar;
Int32 week = cal.GetWeekOfYear(DateTime.Today,
culture.DateTim... | null | CC BY-SA 3.0 | null | 2008-08-13T13:46:30.317 | 2011-09-14T14:54:16.583 | 2011-09-14T14:54:16.583 | 73,025 | 267 | null |