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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37,245 | 2 | null | 36,953 | 3 | null | I suggest [http://www.canonware.com/Parsing/](http://www.canonware.com/Parsing/), since it is pure python and you don't need to learn a grammar, but it isn't widely used, and has comparatively little documentation. The heavyweight is ANTLR and PyParsing. ANTLR can generate java and C++ parsers too, and AST walkers but ... | null | CC BY-SA 2.5 | null | 2008-08-31T23:14:54.283 | 2008-08-31T23:14:54.283 | null | null | 3,926 | null |
37,240 | 2 | null | 37,198 | 9 | null | My docs would probably best be handled by accessing:
```
System.getProperty("user.home");
```
Look up the docs on [System.getProperty](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html).
| null | CC BY-SA 2.5 | null | 2008-08-31T23:08:15.937 | 2008-08-31T23:08:15.937 | null | null | 3,926 | null |
37,254 | 2 | null | 37,189 | 0 | null | If you are running in Vista, you may find that the elevation is getting in the way. You may need to ensure your task runs as a proper administrator, not as a restricted user.
| null | CC BY-SA 2.5 | null | 2008-08-31T23:27:33.003 | 2008-08-31T23:27:33.003 | null | null | 3,146 | null |
37,252 | 2 | null | 773 | 51 | null | A neato trick with groupby is to run length encoding in one line:
```
[(c,len(list(cgen))) for c,cgen in groupby(some_string)]
```
will give you a list of 2-tuples where the first element is the char and the 2nd is the number of repetitions.
Edit: Note that this is what separates `itertools.groupby` from the SQL `G... | null | CC BY-SA 3.0 | null | 2008-08-31T23:27:16.920 | 2017-08-08T10:01:05.637 | 2017-08-08T10:01:05.637 | 3,926 | 3,926 | null |
37,256 | 2 | null | 37,104 | 4 | null | In response to Christian Lescuyer's post, you also need to enable the "svn:keywords" property on the file with that line in it. Subversion won't bother looking in your files for keywords like $Revision$ unless that property is set.
Also, if using PHP like in his example, you may want to put $Revision$ inside a single-... | null | CC BY-SA 2.5 | null | 2008-08-31T23:30:53.293 | 2008-08-31T23:30:53.293 | null | null | 1,384 | null |
37,260 | 2 | null | 37,248 | 11 | null | Consider taking a look at an aspect-oriented solution like [PostSharp](http://www.postsharp.org/), which injects code after the fact based on custom attributes. It's the opposite of a precompiler but can give you the sort of functionality you're looking for (PropertyChanged notifications etc).
| null | CC BY-SA 2.5 | null | 2008-08-31T23:37:27.910 | 2008-08-31T23:37:27.910 | null | null | 615 | null |
37,104 | 1 | 37,132 | null | 10 | 9,380 | What's are the best practices for versioning web sites?
- - -
| Best Practices for versioning web site? | CC BY-SA 3.0 | 0 | 2008-08-31T21:05:48.943 | 2017-08-09T20:18:35.423 | 2017-08-09T20:18:35.423 | 1,836,618 | 116 | [
"version-control"
] |
37,268 | 2 | null | 37,248 | 0 | null | If I were designing the next version of C#, I'd think about each function having an automatically included local variable holding the name of the class and the name of the function. In most cases, the compiler's optimizer would take it out.
I'm not sure there's much of a demand for that sort of thing though.
| null | CC BY-SA 2.5 | null | 2008-08-31T23:47:48.540 | 2008-08-31T23:55:00.193 | 2008-08-31T23:55:00.193 | 3,568 | 3,568 | null |
37,274 | 2 | null | 37,271 | 4 | null | Have a look at Hibernate as a simpler way to interface to a database.
| null | CC BY-SA 2.5 | null | 2008-08-31T23:54:01.303 | 2008-08-31T23:54:01.303 | null | null | 3,333 | null |
37,248 | 1 | 37,260 | null | 22 | 9,742 | While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (although, unfortunately, I can't find ... | C# Preprocessor | CC BY-SA 2.5 | 0 | 2008-08-31T23:18:41.917 | 2021-05-25T09:17:13.933 | 2016-07-08T13:17:37.987 | 4,370,109 | 708 | [
"c#",
"c-preprocessor"
] |
37,183 | 2 | null | 37,162 | 4 | null | A quick Google indicates that it's not really supported. There's more than a few folks out there trying to [hack](http://www.daniweb.com/forums/showthread.php?t=14877&page=2&highlight=javascript+print+landscape) [their](http://home.tampabay.rr.com/bmerkey/examples/landscape-test.html) way to it - but I'd strongly sugge... | null | CC BY-SA 2.5 | null | 2008-08-31T22:21:15.113 | 2008-08-31T22:21:15.113 | null | null | 2,199 | null |
37,267 | 2 | null | 37,219 | 79 | null | To combine revision 3 and 4 into a single revision, you can use git rebase. If you want to remove the changes in revision 3, you need to use the edit command in the interactive rebase mode. If you want to combine the changes into a single revision, use squash.
I have successfully used this squash technique, but have n... | null | CC BY-SA 3.0 | null | 2008-08-31T23:46:33.880 | 2014-11-06T02:19:40.750 | 2014-11-06T02:19:40.750 | 800,817 | 2,219 | null |
37,263 | 1 | 37,291 | null | 1 | 1,601 | I got into a mini-argument with my boss recently regarding "project failure." After three years, our project to migrate a codebase to a new platform (a project I was on for 1.5 years, but my team lead was on for only a few months) went live. He, along with senior management of both my company and the client (I'm one of... | Where does "Change Management" end and "Project Failure" begin? | CC BY-SA 2.5 | 0 | 2008-08-31T23:39:48.590 | 2012-01-31T15:02:46.080 | 2012-01-31T15:02:46.080 | 21,234 | 1,588 | [
"project-management",
"change-management"
] |
37,275 | 1 | 37,290 | null | 66 | 218,026 | What is the SQL query to select all of the MSSQL Server's logins?
Thank you. More than one of you had the answer I was looking for:
```
SELECT * FROM syslogins
```
| SQL Query for Logins | CC BY-SA 3.0 | 0 | 2008-08-31T23:57:08.317 | 2022-11-17T03:05:33.273 | 2016-08-12T19:21:13.620 | 1,274,572 | 1,208 | [
"sql",
"sql-server"
] |
37,276 | 2 | null | 31,295 | 4 | null | I have found [MooTools](http://en.wikipedia.org/wiki/MooTools) to be pretty slick for animations, just a little smoother than jQuery.
I generally prefer jQuery, which I find to be a little more intuitive (in my head anyway), but I would use MooTools if slick animation is the most important requirement.
| null | CC BY-SA 2.5 | null | 2008-08-31T23:58:52.117 | 2011-01-29T17:59:55.980 | 2011-01-29T17:59:55.980 | 63,550 | 3,354 | null |
37,277 | 2 | null | 37,263 | 0 | null | I suppose how successful the project is depends on who the client is. If the client were the company directors and they are happy, then the project was successful regardless of the failures along the way.
| null | CC BY-SA 2.5 | null | 2008-08-31T23:59:54.283 | 2008-08-31T23:59:54.283 | null | null | 383 | null |
37,271 | 1 | 37,300 | null | 10 | 3,881 | I have a large tree of Java Objects in my Desktop Application and am trying to decide on the best way of persisting them as a file to the file system.
Some thoughts I've had were:
- : This would give me the greatest control of what was in the file, but at the cost of micromanaging it.- : I'm not sold on it though si... | What's the best way to persist data in a Java Desktop Application? | CC BY-SA 3.0 | 0 | 2008-08-31T23:50:24.727 | 2012-06-13T17:31:45.847 | 2012-06-13T17:31:45.847 | 851,273 | 2,443 | [
"java",
"persistence",
"desktop",
"oop"
] |
37,278 | 2 | null | 37,271 | 1 | null | XStream from codehaus.org
XML serialization/deserialization largely without coding.
You can use annotations to tweak it.
Working well in two projects where I work.
See my users group presentation at [http://cjugaustralia.org/?p=61](http://cjugaustralia.org/?p=61)
| null | CC BY-SA 2.5 | null | 2008-09-01T00:00:02.693 | 2008-09-01T00:00:02.693 | null | null | 2,789 | null |
37,280 | 2 | null | 37,275 | 18 | null | ```
EXEC sp_helplogins
```
You can also pass an "@LoginNamePattern" parameter to get information about a specific login:
```
EXEC sp_helplogins @LoginNamePattern='fred'
```
| null | CC BY-SA 2.5 | null | 2008-09-01T00:00:55.153 | 2008-09-01T00:00:55.153 | null | null | 615 | null |
37,279 | 2 | null | 37,271 | 5 | null | I would go for the your final option JavaDB (Sun's distribution of [Derby](http://db.apache.org/derby)) and use an object relational layer like [Hibernate](http://hibernate.org) or [iBatis](http://ibatis.apache.org). Using the first three aproaches means you are going to spend more time building a database engine than ... | null | CC BY-SA 2.5 | null | 2008-09-01T00:00:26.873 | 2008-09-01T00:00:26.873 | null | null | 1,969 | null |
37,282 | 2 | null | 37,185 | 2 | null | I have found that Indy, while a simpler concept in the beginning, is awkward to manage due to the need to kill sockets to free threads at application termination. In addition, I had the Indy library stop working after an OS patch upgrade. ScktComp works well for my application.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:02:03.263 | 2008-09-01T00:02:03.263 | null | null | 1,743 | null |
37,284 | 2 | null | 37,275 | 2 | null | ```
Select * From Master..SysUsers Where IsSqlUser = 1
```
| null | CC BY-SA 2.5 | null | 2008-09-01T00:03:29.657 | 2008-09-01T00:03:29.657 | null | null | 383 | null |
37,285 | 2 | null | 9,033 | 115 | null | ```
Environment.NewLine
```
for system independent newlines.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:03:41.560 | 2009-09-27T19:25:06.737 | 2009-09-27T19:25:06.737 | 63,550 | 3,926 | null |
37,283 | 2 | null | 37,122 | 1 | null | you could change the title of the web page with each new message to alert the user. I did this for a browser chat client and most users thought it worked well enough.
```
document.title = "[user] hello world";
```
| null | CC BY-SA 2.5 | null | 2008-09-01T00:02:59.237 | 2008-09-01T00:12:27.717 | 2008-09-01T00:12:27.717 | 2,701 | 2,701 | null |
37,287 | 2 | null | 37,275 | 1 | null | Have a look in the syslogins or sysusers tables in the master schema. Not sure if this still still around in more recent MSSQL versions though. In MSSQL 2005 there are views called sys.syslogins and sys.sysusers.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:04:00.997 | 2008-09-01T00:04:00.997 | null | null | 1,072 | null |
37,288 | 2 | null | 37,275 | 4 | null | Selecting from sysusers will get you information about on the selected database, not on the server.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:05:03.413 | 2008-09-01T00:05:03.413 | null | null | 615 | null |
37,286 | 2 | null | 37,275 | 4 | null | @allain, @GateKiller your query selects users not logins
To select logins you can use this query:
```
SELECT name FROM master..sysxlogins WHERE sid IS NOT NULL
```
In MSSQL2005/2008 syslogins table is used insted of sysxlogins
| null | CC BY-SA 2.5 | null | 2008-09-01T00:03:48.953 | 2008-09-01T00:03:48.953 | null | null | 1,196 | null |
37,290 | 2 | null | 37,275 | 61 | null | Is this what you're after?
```
select * from master.syslogins
```
| null | CC BY-SA 4.0 | null | 2008-09-01T00:07:08.480 | 2018-12-20T12:52:21.807 | 2018-12-20T12:52:21.807 | 319,826 | 1,554 | null |
37,293 | 2 | null | 32,448 | 4 | null | The best quality control for gcc is the linux kernel. GCC is the compiler of choice for basically all major open source C/C++ programs. A released GCC, especially one like 4.3.X, which is in major linux distros, should be pretty good.
GCC 4.3 also has better support for optimizations on newer cpus.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:10:42.493 | 2008-09-01T00:10:42.493 | null | null | 3,926 | null |
37,294 | 2 | null | 34,109 | -2 | null | I don't know the answer to your specific question, but hopefully this information will point you in the right direction.
The "native" format for WF workflows is ".xoml" files. These are basically identical to XAML files, and both are nothing more than generic persistence formats for a .NET object tree. If you can ac... | null | CC BY-SA 2.5 | null | 2008-09-01T00:11:58.000 | 2008-09-01T00:11:58.000 | null | null | 533 | null |
37,292 | 2 | null | 37,263 | 1 | null | Unless the goals were clearly stated in the beginning of the project, there are no clear lines between "success" and "failure." Often, a project would have varying degree of success/failure.
For some, just getting some concepts in code would be a success, while other may measure success as recovering all investments a... | null | CC BY-SA 2.5 | null | 2008-09-01T00:09:13.607 | 2008-09-01T00:09:13.607 | null | null | 3,827 | null |
37,289 | 2 | null | 30,877 | 0 | null | @DrPizza Profiling only really helps improve an implementation, it doesn't reveal opportunities for parallel execution, or suggest better algorithms (unless you've experience to the otherwise, in which case I'd really like to see your profiler).
I've only single core machines at home, but ran a Java equivalent of your... | null | CC BY-SA 2.5 | null | 2008-09-01T00:06:01.740 | 2008-09-01T00:06:01.740 | null | null | 1,527 | null |
37,297 | 2 | null | 35,849 | 0 | null | Thanks guys, lot of good info, but Martin has given me a bit more detail on how to proceed. I'll give him the answer, as it seems like now we're off the front few pages answers will drop off.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:18:00.713 | 2008-09-01T00:18:00.713 | null | null | 3,717 | null |
37,269 | 2 | null | 37,162 | 2 | null | Possible in [CSS2](http://www.w3.org/TR/CSS2/page.html#page-size-prop) (@page, looks like [Opera only](http://www.webdevout.net/browser-support-css#css2propsprint)) and in [CSS3](http://www.w3.org/TR/css3-page/#page-size-prop) which will work [nowhere](http://www.webdevout.net/browser-support-css#css3propsprint). Sorry... | null | CC BY-SA 2.5 | null | 2008-08-31T23:48:27.650 | 2008-08-31T23:48:27.650 | null | null | 1,072 | null |
37,300 | 2 | null | 37,271 | 3 | null | [db4objects](http://www.db4o.com) might be the best choice
| null | CC BY-SA 2.5 | null | 2008-09-01T00:18:37.313 | 2008-09-01T00:18:37.313 | null | null | 1,196 | null |
37,303 | 2 | null | 37,299 | 2 | null | I found the following in an [Apple Forum](http://lists.apple.com/archives/Cocoa-dev/2003/Nov/msg00166.html):
> Xcode doesn't come with any symbolic breaks built in - but they're
quick to add. Go to the breakpoints window and add:-[NSException raise]
| null | CC BY-SA 2.5 | null | 2008-09-01T00:22:03.340 | 2008-09-01T00:22:03.340 | null | null | 383 | null |
37,296 | 1 | null | null | 5 | 445 | If one has a peer-to-peer system that can be queried, one would like to
- - - -
Given these requirements:
1. Are there any standard approaches? If not, is there any respected, but experimental, research? I'm familiar some with distribution schemes, but I haven't seen anything really address learning for robustnes... | How to robustly, but minimally, distribute items across a peer-to-peer system | CC BY-SA 2.5 | 0 | 2008-09-01T00:17:45.597 | 2008-09-26T14:56:20.183 | 2008-09-17T04:58:29.187 | 422 | 279 | [
"language-agnostic",
"distributed",
"machine-learning",
"p2p",
"fault-tolerance"
] |
37,302 | 2 | null | 37,248 | 4 | null | I know a lot of people think short code equals elegant code but that isn't true.
The example you propose is perfectly solved in code, as you have shown so, what do you need a preprocessor directive to? You don't want to "preprocess" your code, you want the compiler to insert some code for you in your properties. It's ... | null | CC BY-SA 2.5 | null | 2008-09-01T00:20:52.703 | 2008-09-01T00:20:52.703 | null | null | 2,695 | null |
37,299 | 1 | 37,304 | null | 23 | 17,604 | What's the instruction to cause a hard-break in Xcode? For example under Visual Studio I could do '_asm int 3' or 'DebugBreak()'. Under some GCC implementations it's asm("break 0") or asm("trap").
I've tried various combos under Xcode without any luck. (inline assembler works fine so it's not a syntax issue).
For ref... | Xcode equivalent of ' __asm int 3 / DebugBreak() / Halt? | CC BY-SA 3.0 | 0 | 2008-09-01T00:18:18.263 | 2012-09-07T16:16:06.890 | 2011-08-31T18:12:29.230 | 111,783 | 1,043 | [
"xcode",
"macos",
"debugbreak"
] |
37,304 | 2 | null | 37,299 | 24 | null | [http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/090_Running_Programs/chapter_11_section_3.html](http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/090_Running_Programs/chapter_11_section_3.html)
```
asm {trap} ; Halts a progra... | null | CC BY-SA 2.5 | null | 2008-09-01T00:22:27.223 | 2008-09-01T00:22:27.223 | null | null | 3,560 | null |
37,308 | 2 | null | 37,248 | 0 | null | > @Jorge wrote: If you want to process your code in a different way the use a preprocessor directive but if you just want a code snippet then find another way because the preprocessor wasn't meant to do that.
Interesting. I don't really consider a preprocessor to necessarily work this way. In the example provided, I a... | null | CC BY-SA 2.5 | null | 2008-09-01T00:34:14.123 | 2008-09-01T00:34:14.123 | null | null | 708 | null |
37,314 | 2 | null | 37,067 | 1 | null | Not really, at least, not last time I looked. I mean, boost::thread_group might make things marginally tidier in places, but not so as would make much of a difference, I don't think.
Boost's thread support seems marginally useful when writing something that's cross-platform, but given that what you're writing is goin... | null | CC BY-SA 2.5 | null | 2008-09-01T00:46:10.180 | 2008-09-01T00:46:10.180 | null | null | 2,131 | null |
37,310 | 1 | 37,316 | null | 24 | 27,395 | I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object.
What is the best way to test that the factory ha... | Checking the results of a Factory in a unit test | CC BY-SA 2.5 | 0 | 2008-09-01T00:40:03.830 | 2021-02-23T19:35:48.497 | 2008-09-01T08:08:33.127 | 3,576 | 3,576 | [
"java",
"unit-testing",
"tdd"
] |
37,273 | 2 | null | 33,923 | 29 | null | It means that rather than needing to push the instruction pointer on the stack, you can simply jump to the top of a recursive function and continue execution. This allows for functions to recurse indefinitely without overflowing the stack.
I wrote a [blog](http://blogs.msdn.com/chrsmith/archive/2008/08/07/understandi... | null | CC BY-SA 2.5 | null | 2008-08-31T23:52:34.567 | 2008-08-31T23:52:34.567 | null | null | 322 | null |
37,313 | 2 | null | 37,306 | 1 | null | First of all, you can find out which version of Windows you are using with the [OperatingSystem.Platform](http://msdn.microsoft.com/en-us/library/system.operatingsystem.platform.aspx) property in the System library.
Second, it is possible that you may put your font settings in Resource files, and determine which resou... | null | CC BY-SA 2.5 | null | 2008-09-01T00:45:37.137 | 2008-09-01T00:45:37.137 | null | null | 372 | null |
37,306 | 1 | 37,371 | null | 2 | 371 | I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good way to deal with this?
An example: I have a `Label`... | Font-dependent control positioning | CC BY-SA 2.5 | null | 2008-09-01T00:32:32.397 | 2008-09-25T11:19:06.123 | 2008-09-25T11:19:06.123 | 615 | 3,191 | [
".net",
"winforms",
"user-interface",
"layout",
"fonts"
] |
37,320 | 2 | null | 37,317 | 1 | null | I think what you're doing is fine. The only thing I could think of to improve it would be to store each control into a stack as they are accessed. That would give you a complete time line of what was accessed.
| null | CC BY-SA 2.5 | null | 2008-09-01T00:51:33.473 | 2008-09-01T00:51:33.473 | null | null | 2,066 | null |
37,319 | 2 | null | 37,317 | 0 | null | Your implementation looks good enough -- what I do want to know is why you want to do this in the first place? Won't it be preferrable for the focus to cycle back to the first entry? Is the data in the last text box so malleable that once they click the button it is "remembered"? Or do you have some sort of operation t... | null | CC BY-SA 2.5 | null | 2008-09-01T00:51:15.800 | 2008-09-01T00:51:15.800 | null | null | 372 | null |
37,316 | 2 | null | 37,310 | 23 | null | Since I don't know how your factory method looks like, all I can advise right now is to
1. Check to see the object is the correct concrete implementation you were looking for: IMyInterface fromFactory = factory.create(...);
Assert.assertTrue(fromFactory instanceof MyInterfaceImpl1);
2. You can check if the factory... | null | CC BY-SA 2.5 | null | 2008-09-01T00:47:22.907 | 2008-09-01T01:30:25.953 | 2008-09-01T01:30:25.953 | 3,087 | 3,087 | null |
37,309 | 2 | null | 37,141 | 3 | null | I assume that you followed the [dijit.Tree and dojo.data in Dojo 1.1](http://dojotoolkit.org/2008/02/12/dijit-tree-and-dojo-data-dojo-1-1) tutorial which directed you to pass the data to the tree control using a data store. That had me banging my head of a brick wall for a while.
Its not really a great approach and t... | null | CC BY-SA 2.5 | null | 2008-09-01T00:38:52.973 | 2008-09-01T00:38:52.973 | null | null | 1,969 | null |
37,291 | 2 | null | 37,263 | 5 | null | I think, most of the time, we developers forget this we all do is, after all, about bussiness.
From that point of view a project is not a failure while the client is willing to pay for it. It all depends on the client, some clients have more patience and understand better the risks of software development, other just ... | null | CC BY-SA 2.5 | null | 2008-09-01T00:07:26.760 | 2008-09-01T00:07:26.760 | null | null | 2,695 | null |
37,322 | 2 | null | 36,832 | 2 | null | > Virtual functions in constructors, why do languages differ?
Because there's no one good behaviour. I find the C++ behaviour makes more sense (since base class c-tors are called first, it stands to reason that they should call base class virtual functions--after all, the derived class c-tor hasn't run yet, so it may... | null | CC BY-SA 2.5 | null | 2008-09-01T00:57:41.650 | 2008-09-01T00:57:41.650 | null | null | 2,131 | null |
37,324 | 1 | 37,332 | null | 478 | 677,034 | I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an `ON` clause in C#.
How do you represent the following in LINQ to SQL:
```
select DealerContact.*
from Dealer
inner join DealerContact on Dealer.DealerID = DealerContact.DealerID
```
| What is the syntax for an inner join in LINQ to SQL? | CC BY-SA 3.0 | 0 | 2008-09-01T01:00:24.467 | 2019-08-09T05:45:53.720 | 2017-08-21T10:31:09.050 | 148,412 | 2,975 | [
"c#",
".net",
"sql",
"linq-to-sql",
"join"
] |
37,317 | 1 | 37,336 | null | 7 | 12,264 | I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they wa... | How do you return the focus to the last used control after clicking a button in a winform app? | CC BY-SA 2.5 | 0 | 2008-09-01T00:48:03.637 | 2014-06-18T19:14:17.867 | 2017-02-08T14:07:42.863 | -1 | 3,452 | [
"c#",
".net",
"winforms"
] |
37,330 | 2 | null | 34,987 | 2 | null | Instead of that macro, might I suggest this one:
```
template<typename T, int N>
inline size_t array_size(T(&)[N])
{
return N;
}
#define ARRAY_SIZE(X) (sizeof(array_size(X)) ? (sizeof(X) / sizeof((X)[0])) : -1)
```
1) We want to use a macro to make it a compile-time constant; the function call's result is not... | null | CC BY-SA 2.5 | null | 2008-09-01T01:05:36.043 | 2008-09-01T01:05:36.043 | null | null | 2,131 | null |
37,318 | 2 | null | 37,310 | 0 | null | ```
if (myNewObject instanceof CorrectClass)
{
/* pass test */
}
```
Don't know why this got marked down, so I'll expand it a bit...
```
public void doTest()
{
MyInterface inst = MyFactory.createAppropriateObject();
if (! inst instanceof ExpectedConcreteClass)
{
/* FAIL */
}
}
```
| null | CC BY-SA 2.5 | null | 2008-09-01T00:49:18.517 | 2008-10-23T10:40:34.487 | 2008-10-23T10:40:34.487 | 974 | 974 | null |
37,331 | 2 | null | 37,317 | 1 | null | Your approach looks good. If you want to avoid having to add an the event handler to every control you add, you could create a recursive routine to add a [GotFocus](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.gotfocus.aspx) listener to every control in your form. This will work for any type of ... | null | CC BY-SA 2.5 | null | 2008-09-01T01:07:00.863 | 2008-09-01T01:07:00.863 | null | null | 392 | null |
37,338 | 2 | null | 37,317 | 0 | null | Yeah, I admit the requirement is a bit unusual. Some of the information that the users will be entering into this application exists in scans of old documents that are in a couple of different repositories. The buttons facilitate finding and opening these old docs. It's difficult to predict where the users will be o... | null | CC BY-SA 2.5 | null | 2008-09-01T01:13:05.123 | 2008-09-01T01:13:05.123 | null | null | 3,452 | null |
37,333 | 2 | null | 37,324 | 25 | null | Use [Linq Join](http://www.hookedonlinq.com/JoinOperator.ashx) operator:
```
var q = from d in Dealer
join dc in DealerConact on d.DealerID equals dc.DealerID
select dc;
```
| null | CC BY-SA 2.5 | null | 2008-09-01T01:09:30.420 | 2008-09-01T01:15:09.283 | 2008-09-01T01:15:09.283 | 1,196 | 1,196 | null |
37,336 | 2 | null | 37,317 | 16 | null | For a bit of 'simplicity' maybe try.
```
public Form1()
{
InitializeComponent();
foreach (Control ctrl in Controls)
{
if (ctrl is TextBox)
{
ctrl.Enter += delegate(object sender, EventArgs e)
{
... | null | CC BY-SA 2.5 | null | 2008-09-01T01:11:00.587 | 2008-09-01T01:11:00.587 | null | null | 820 | null |
37,332 | 2 | null | 37,324 | 612 | null | It goes something like:
```
from t1 in db.Table1
join t2 in db.Table2 on t1.field equals t2.field
select new { t1.field2, t2.field3}
```
It would be nice to have sensible names and fields for your tables for a better example. :)
I think for your query this might be more appropriate:
```
var dealercontacts = from... | null | CC BY-SA 2.5 | null | 2008-09-01T01:08:58.110 | 2008-09-01T01:25:35.747 | 2008-09-01T01:25:35.747 | 372 | 372 | null |
37,321 | 2 | null | 37,073 | 110 | null | I go for a belt and braces approach here.
I create a 32x32 icon in both the `.ico` and `.png` formats called `favicon.ico` and `favicon.png`. The icon name doesn't really matter unless you are dealing with older browsers.
1. Place favicon.ico at your site root to support the older browsers (optional and only releva... | null | CC BY-SA 3.0 | null | 2008-09-01T00:55:43.010 | 2015-10-28T03:30:18.480 | 2015-10-28T03:30:18.480 | 2,206,004 | 1,969 | null |
37,315 | 2 | null | 35,211 | 4 | null | As [Curt](https://stackoverflow.com/questions/35211/identify-an-event-via-a-linq-expression-tree#36255) has pointed out, my implementation is rather flawed in that it can only be used from within the class that declares the event :) Instead of "`x => x.MyEvent`" returning the event, it was returning the backing field,... | null | CC BY-SA 2.5 | null | 2008-09-01T00:47:10.193 | 2008-09-01T19:43:37.963 | 2017-05-23T10:27:50.457 | -1 | 2,495 | null |
37,348 | 2 | null | 37,346 | 31 | null | The compiler needs to know how big "B" is before it can generate the appropriate layout information. If instead, you said `std::vector<B*>`, then the compiler wouldn't need to know how big B is because it knows how big a pointer is.
| null | CC BY-SA 2.5 | null | 2008-09-01T01:29:43.617 | 2008-09-01T01:29:43.617 | null | null | 533 | null |
37,335 | 1 | 37,349 | null | 551 | 2,018,234 | I am writing a client-side application (graphical font designer) on . Recently, I am running into `java.lang.OutOfMemoryError: Java heap space` error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick r... | How to deal with "java.lang.OutOfMemoryError: Java heap space" error? | CC BY-SA 4.0 | 0 | 2008-09-01T01:10:03.727 | 2022-10-06T15:26:34.903 | 2020-10-24T14:58:15.413 | 157,882 | 3,827 | [
"java",
"jvm",
"out-of-memory",
"heap-memory"
] |
37,343 | 1 | 2,189,015 | null | 3 | 1,821 | I have my Wordpress install and MediaWiki [sharing the same login information](https://stackoverflow.com/questions/33745). Unfortunately, users need to log into both separately, but at least they use the same credentials.
What I would like to do is cause a successful login on the Wordpress blog to also cause a logi... | Wordpress MediaWiki Cookie Integration | CC BY-SA 4.0 | null | 2008-09-01T01:23:51.400 | 2019-01-18T10:59:29.857 | 2019-01-18T10:59:29.857 | 567,854 | 255 | [
"php",
"wordpress",
"lamp",
"mediawiki"
] |
37,347 | 2 | null | 37,346 | 5 | null | To instantiate A::v, the compiler needs to know the concrete type of B.
If you're trying to minimize the amount of #included baggage to improve compile times, there are two things you can do, which are really variations of each other:
1. Use a pointer to B
2. Use a lightweight proxy to B
| null | CC BY-SA 2.5 | null | 2008-09-01T01:29:36.940 | 2008-09-01T01:29:36.940 | null | null | 257 | null |
37,350 | 2 | null | 37,346 | -13 | null | The reason you can't use a forward declaration is because the size of B is unknown.
There's no reason in your example that you can't include B.h inside of A.h, so what problem are you really trying to solve?
There's another way to solve this problem, too: stop using C/C++! It's so 1970s... ;)
| null | CC BY-SA 2.5 | null | 2008-09-01T01:30:10.697 | 2008-09-01T01:30:10.697 | null | null | 1,554 | null |
37,346 | 1 | 37,348 | null | 33 | 21,026 | If I create a class like so:
```
// B.h
#ifndef _B_H_
#define _B_H_
class B
{
private:
int x;
int y;
};
#endif // _B_H_
```
and use it like this:
```
// main.cpp
#include <iostream>
#include <vector>
class B; // Forward declaration.
class A
{
public:
A() {
std::cout << v.size() << std::end... | Why can't a forward declaration be used for a std::vector? | CC BY-SA 2.5 | 0 | 2008-09-01T01:27:25.400 | 2016-11-13T03:10:07.133 | 2008-09-01T02:14:21.247 | 234 | 61 | [
"c++",
"stl"
] |
37,363 | 2 | null | 37,157 | 1 | null | I think the query cache size is 0 by default, which is off.
Edit your my.cnf file to give it at least a few megabytes.
No PHP changes necessary :)
| null | CC BY-SA 2.5 | null | 2008-09-01T02:01:16.067 | 2008-09-01T02:01:16.067 | null | null | 3,407 | null |
37,358 | 2 | null | 2,540 | 5 | null | There's some stuff in the [Apache Portable Runtime](http://apr.apache.org/) (APR) that I'd expect to be very solid.
| null | CC BY-SA 2.5 | null | 2008-09-01T01:56:18.747 | 2008-09-01T01:56:18.747 | null | null | 3,948 | null |
37,365 | 2 | null | 37,306 | 1 | null | is the problem working out the placement of controls? i.e. you know font X and Y work on OS A and B, and give the layout you want with the text you're using on those systems?
MeasureString method might help in working out your layout in a way that you weren't tied to specific fonts.
float textWidth = graphics.Measure... | null | CC BY-SA 2.5 | null | 2008-09-01T02:02:07.907 | 2008-09-01T02:02:07.907 | null | null | 3,716 | null |
37,349 | 2 | null | 37,335 | 299 | null | Ultimately you always have a finite max of heap to use no matter what platform you are running on. In Windows 32 bit this is around `2GB` (not specifically heap but total amount of memory per process). It just happens that Java chooses to make the default smaller (presumably so that the programmer can't create programs... | null | CC BY-SA 4.0 | null | 2008-09-01T01:29:54.457 | 2019-03-23T08:44:16.293 | 2019-03-23T08:44:16.293 | 2,361,308 | 2,925 | null |
37,369 | 2 | null | 30,373 | 3 | null | PRQA have [an excellent and free C++ coding standard](http://www.codingstandard.com/) based on books from Scott Meyers, Bjarne Stroustrop and Herb Sutter. It brings all this information together in one document.
| null | CC BY-SA 3.0 | null | 2008-09-01T02:03:56.793 | 2014-01-22T21:30:22.830 | 2014-01-22T21:30:22.830 | 63,550 | 3,836 | null |
37,368 | 2 | null | 37,343 | 1 | null | You could consider some kind of single-sign-on software. I am unaware of any that are free and I've only ever used [SiteMinder](http://ca.com/us/internet-access-control.aspx) which is neither free nor good. [Crowd](http://www.atlassian.com/software/crowd/default.jsp) may be better (but is again not [free](http://www.at... | null | CC BY-SA 2.5 | null | 2008-09-01T02:03:16.733 | 2008-09-01T02:03:16.733 | null | null | 1,666 | null |
37,378 | 1 | 37,406 | null | 13 | 1,826 | Everyone I work with is obsessed with the data-centric approach to enterprise development and hates the idea of using custom collections/objects. What is the best way to convince them otherwise?
| How to convince my co-workers not to use datasets for enterprise development (.NET 2.0+) | CC BY-SA 2.5 | 0 | 2008-09-01T02:16:17.623 | 2012-07-27T07:59:25.113 | 2012-07-27T07:59:25.113 | 918,414 | 2,701 | [
"oop"
] |
37,371 | 2 | null | 37,306 | 1 | null | It's strange to need to layout one control within another. You might be solving an upstream problem wrong. Are you able to split the label into two labels with the updown between and maybe rely on a Windows Forms TableLayout panel?
If it's essential to try to position based on font sizes, you could use [Graphics.Me... | null | CC BY-SA 2.5 | null | 2008-09-01T02:08:47.173 | 2008-09-01T12:34:18.433 | 2008-09-01T12:34:18.433 | 1,042 | 1,042 | null |
37,375 | 1 | 37,387 | null | 18 | 14,553 | We have a whole bunch of DLLs that give us access to our database and other applications and services.
We've wrapped these DLLs with a thin WCF service layer which our clients then consume.
I'm a little unsure on how to write unit tests that only test the WCF service layer. Should I just write unit tests for the DLLs... | How do I unit test a WCF service? | CC BY-SA 3.0 | 0 | 2008-09-01T02:13:52.090 | 2015-11-20T11:46:48.940 | 2015-11-20T11:46:48.940 | 3,218,692 | 781 | [
"wcf",
"unit-testing"
] |
37,374 | 1 | 37,587 | null | 33 | 18,269 | We've just started using LINQ to SQL at work for our DAL & we haven't really come up with a standard for out caching model. Previously we had being using a base 'DAL' class that implemented a cache manager property that all our DAL classes inherited from, but now we don't have that. I'm wondering if anyone has come u... | How do you implement caching in Linq to SQL? | CC BY-SA 2.5 | 0 | 2008-09-01T02:13:07.163 | 2010-12-07T15:45:43.457 | 2017-05-23T12:17:39.967 | -1 | 2,975 | [
".net",
"sql",
"linq-to-sql",
"iis",
"caching"
] |
37,384 | 2 | null | 37,011 | 3 | null | In short, yes.
Protected member variables allow access to the variable from any sub-classes as well as any classes in the same package. This can be highly useful, especially for read-only data. I don't believe that they are ever necessary however, because any use of a protected member variable can be replicated usin... | null | CC BY-SA 2.5 | null | 2008-09-01T02:25:59.160 | 2008-09-01T02:25:59.160 | null | null | 3,547 | null |
37,355 | 2 | null | 37,271 | 4 | null | In my experience, you're probably better off using an embedded database. SQL, while less than perfect, is usually much easier than designing a file format that performs well and is reliable.
I haven't used JavaDB, but I've had good luck with [H2](http://www.h2database.com) and [SQLite](http://www.sqlite.org/). SQLit... | null | CC BY-SA 2.5 | null | 2008-09-01T01:43:47.390 | 2008-09-01T01:43:47.390 | null | null | 3,547 | null |
37,364 | 2 | null | 32,243 | 2 | null | Regrading the preserve transparency, then yes like stated in other posts imagesavealpha() have to be set to true, to use the alpha flag imagealphablending() must be set to false else it doesn't work.
Also I spotted two minor things in your code:
1. You don't need to call getimagesize() to get the width/height for im... | null | CC BY-SA 3.0 | null | 2008-09-01T02:01:23.353 | 2012-01-11T18:17:44.460 | 2012-01-11T18:17:44.460 | 651,918 | 3,908 | null |
37,381 | 1 | 37,408 | null | 13 | 1,975 | I'm exploring the possibility of writing an application in Erlang, but it would need to have a portion written in Cocoa (presumably Objective-C). I'd like the front-end and back-end to be able to communicate easily. How can this best be done?
I can think of using C ports and connected processes, but I think I'd like a... | What's a good way to write a Cocoa front-end to an Erlang application? | CC BY-SA 2.5 | 0 | 2008-09-01T02:22:26.423 | 2010-09-22T12:28:50.343 | 2008-11-10T15:08:54.333 | 1,288 | 3,948 | [
"objective-c",
"cocoa",
"macos",
"erlang"
] |
37,387 | 2 | null | 37,375 | 4 | null | The consumer of your service doesn't care what's underneath your service.
To really test your service layer, I think your layer needs to go down to DLLs and the database and write at least [CRUD](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete) test.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:27:57.143 | 2008-09-01T02:27:57.143 | null | null | 3,827 | null |
37,389 | 2 | null | 37,388 | 1 | null | i think when you do step 2 and install the documentation just tell direct it to the usb key drive letter. easy peasy.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:34:13.820 | 2008-09-01T02:34:13.820 | null | null | 3,746 | null |
37,386 | 2 | null | 29,654 | 0 | null | My original question obviously wasn't clear, sorry about that.
The problem wasn't with databinding to a DataGridView in general, or with the implementation of a DataGridViewComboBoxColumn - as the people who have answered already rightly say, that is well documented on the web.
The problem I've been trying to solve i... | null | CC BY-SA 4.0 | null | 2008-09-01T02:27:30.887 | 2019-06-11T15:26:54.910 | 2019-06-11T15:26:54.910 | 2,660 | 2,660 | null |
37,392 | 2 | null | 37,378 | 21 | null | Do it by example and tread lightly. Anything stronger will just alienate you from the rest of the team.
Remember to consider the possibility that they're onto something you've missed. Being part of a team means taking turns learning & teaching.
No single person has all the answers.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:39:21.547 | 2008-09-01T02:39:21.547 | null | null | 305 | null |
37,388 | 1 | null | null | 2 | 623 | Is there a way to have msdn documentation on a usb key ?
either web or the MSDN Library program.
i've been setting up my usbkey with portableapps stuff.
| Having MSDN on a usb key | CC BY-SA 2.5 | 0 | 2008-09-01T02:32:47.193 | 2021-03-12T06:37:37.940 | 2009-06-11T14:02:55.583 | 25,093 | 2,566 | [
"msdn",
"portability",
"portable-applications"
] |
37,394 | 2 | null | 37,378 | 2 | null | I guess you can trying selling the idea of O/R mapping and mapper tools. The benefit of treating rows as objects is pretty powerful.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:40:55.067 | 2008-09-01T02:40:55.067 | null | null | 3,827 | null |
37,391 | 1 | 1,381,855 | null | 8 | 4,687 | Ok, so PHP isn't the best language to be dealing with arbitrarily large integers in, considering that it only natively supports 32-bit signed integers. What I'm trying to do though is create a class that could represent an arbitrarily large binary number and be able to perform simple arithmetic operations on two of the... | Arithmetic with Arbitrarily Large Integers in PHP | CC BY-SA 2.5 | null | 2008-09-01T02:37:53.483 | 2013-12-22T15:12:45.450 | null | null | 1,384 | [
"php",
"integer"
] |
37,399 | 2 | null | 37,343 | 1 | null | I've seen a setup going through [Invision Power Board](http://www.invisionpower.com/community/board/), using [IpbWiki](http://www.ipbwiki.com/) and a Wordpress integration mod. Mind you, it's expensive and excessive.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:52:23.497 | 2008-09-01T02:52:23.497 | null | null | 853 | null |
37,390 | 2 | null | 35,102 | 1 | null | A quick look at [http://www.update.uu.se/~ams/slask/emacs/src/frame.h](http://www.update.uu.se/~ams/slask/emacs/src/frame.h) returns:
```
List of buffers that were viewed, then buried in this frame. The
most recently buried buffer is first.
```
So in theory you can use cdr to obtain the same list as Ben Collins sai... | null | CC BY-SA 2.5 | null | 2008-09-01T02:35:46.093 | 2008-09-01T02:35:46.093 | null | null | 161 | null |
37,385 | 2 | null | 37,375 | 7 | null | If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.
For example, in the below service I break out my data access repository using "Poor Man's Dependency Injection"... | null | CC BY-SA 2.5 | null | 2008-09-01T02:26:40.437 | 2008-09-01T16:31:52.760 | 2008-09-01T16:31:52.760 | 2,701 | 2,701 | null |
37,398 | 1 | 37,402 | null | 131 | 158,899 | My current preferred C++ environment is the free and largely excellent Microsoft Visual Studio 2005 Express edition. From time to time I have sent release .exe files to other people with pleasing results. However recently I made the disturbing discovery that the pleasing results were based on more luck that I would lik... | How do I make a fully statically linked .exe with Visual Studio Express 2005? | CC BY-SA 2.5 | 0 | 2008-09-01T02:49:02.053 | 2020-05-09T13:29:30.493 | 2008-09-10T04:30:38.207 | 3,955 | 3,955 | [
"c++",
"visual-studio",
"linker"
] |
37,402 | 2 | null | 37,398 | 149 | null | For the C-runtime go to the project settings, choose C/C++ then 'Code Generation'. Change the 'runtime library' setting to 'multithreaded' instead of 'multithreaded dll'.
If you are using any other libraries you may need to tell the linker to ignore the dynamically linked CRT explicitly.
| null | CC BY-SA 2.5 | null | 2008-09-01T02:55:07.780 | 2008-09-01T02:55:07.780 | null | null | 3,631 | null |
37,400 | 2 | null | 37,396 | 2 | null | My 2c:
I'd recommend basing your system on [Debian](http://www.debian.org/) - the [apt](http://wiki.debian.org/Apt) system has become the de-facto way to quickly install and update programs on Linux. [Ubuntu](http://www.ubuntu.com/) is Debian based with an emphasis on usability and compatibility. As for windowing mana... | null | CC BY-SA 2.5 | null | 2008-09-01T02:53:44.677 | 2008-09-04T20:29:36.313 | 2008-09-04T20:29:36.313 | 658 | 658 | null |
37,403 | 2 | null | 37,398 | 5 | null | I've had this same dependency problem and I also know that you can include the VS 8.0 DLLs (release only! not debug!---and your program has to be release, too) in a folder of the appropriate name, in the parent folder with your .exe:
[How to: Deploy using XCopy (MSDN)](http://msdn.microsoft.com/en-us/library/ms235291... | null | CC BY-SA 4.0 | null | 2008-09-01T02:59:55.397 | 2020-05-09T13:29:30.493 | 2020-05-09T13:29:30.493 | 10,147,399 | 2,543 | null |
37,406 | 2 | null | 37,378 | 10 | null | If you are working on legacy code (e.g., apps ported from .NET 1.x to 2.0 or 3.5) then it would be a bad idea to depart from datasets. Why change something that already works?
If you are, however, creating a new apps, there a few things that you can cite:
- - -
What is important is that whatever approach you use yo... | null | CC BY-SA 2.5 | null | 2008-09-01T03:09:06.450 | 2008-09-01T03:09:06.450 | null | null | 372 | null |
37,407 | 2 | null | 37,011 | 38 | null | Generally, if something is not deliberately conceived as public, I make it private.
If a situation arises where I need access to that private variable or method from a derived class, I change it from private to protected.
This hardly ever happens - I'm really not a fan at all of inheritance, as it isn't a particularl... | null | CC BY-SA 2.5 | null | 2008-09-01T03:09:28.180 | 2008-09-01T03:09:28.180 | null | null | 234 | null |
37,404 | 2 | null | 37,378 | 9 | null | >
Seconded. The whole idea that "enterprise development" is somehow distinct from (and usually the implication is 'more important than') normal development really irks me.
If there really is a benefit for using some technology, then you'll need to come up with a considered list of all the pros and cons that would oc... | null | CC BY-SA 2.5 | null | 2008-09-01T03:00:31.090 | 2008-09-01T03:00:31.090 | null | null | 234 | null |