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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,106 | 2 | null | 11,099 | 4 | null | My preference is to be consistent, e.g., if you use brackets on one block, use brackets all throughout even with just one statement:
```
if (cond1)
{
SomeOperation();
Another();
}
elseif (cond2)
{
DoSomething();
}
else
{
DoNothing();
DoAnother();
}
```
But if you have just a bunch of one liners:
```
... | null | CC BY-SA 2.5 | null | 2008-08-14T14:27:17.047 | 2008-08-14T14:30:45.247 | 2008-08-14T14:30:45.247 | 372 | 372 | null |
11,118 | 2 | null | 11,099 | 1 | null | There is no right or wrong way to write the above statement. There are plenty of accepted coding [styles](http://en.wikipedia.org/wiki/Indent_style). However, for me, I prefer keeping the coding style consist throughout the entire project. ie. If the project is using K&R style, you should use K&R.
| null | CC BY-SA 2.5 | null | 2008-08-14T14:32:48.707 | 2008-08-14T14:32:48.707 | null | null | 889 | null |
11,121 | 2 | null | 11,043 | 0 | null | I always use aliases, since to get proper performance on MSSQL you need to prefix with schema at all times. So you'll see a lot of
> Select
Person.Name
From
dbo.Person As Person
| null | CC BY-SA 2.5 | null | 2008-08-14T14:33:56.753 | 2008-08-14T14:33:56.753 | null | null | 414 | null |
11,124 | 2 | null | 11,055 | 7 | null | You might try prototyping your design - create an initial version of the database and write some scripts (or use a tool) to populate the tables with a reasonable amount of data. Then you will know for sure how much space X rows takes up. If it's too much, you can go back to the drawing board with your design. I know... | null | CC BY-SA 2.5 | null | 2008-08-14T14:34:49.763 | 2008-08-14T14:34:49.763 | null | null | 1,219 | null |
11,116 | 2 | null | 11,099 | 10 | null | I recommend
```
if(a==b)
{
doSomething();
}
```
because I find it far easier to do it up-front than to try to remember to add the braces when I add a second statement to to success condition...
```
if(a==b)
doSomething();
doSomethingElse();
```
is very different to
```
if(a==b)
{
doSomething();
... | null | CC BY-SA 2.5 | null | 2008-08-14T14:31:55.773 | 2008-08-14T14:31:55.773 | null | null | 377 | null |
11,117 | 2 | null | 11,099 | 8 | null | I tend to use braces at all times. You can get some subtle bugs where you started off with something like:
```
if(something)
DoOneThing();
else
DoItDifferently();
```
and then decide to add another operation to the `else` clause and forget to wrap it in braces:
```
if(something)
DoOneThing();
else
DoItDiffere... | null | CC BY-SA 2.5 | null | 2008-08-14T14:32:35.913 | 2009-03-12T17:44:40.833 | 2009-03-12T17:44:40.833 | 419 | 419 | null |
11,122 | 2 | null | 10,810 | 2 | null | For AzMan with ASP.NET, turn on impersonation in `web.config` (`<identity impersonate="true" username="xx" pasword="xx" />`), and make sure with an AD administrator that the impersonation account has "reader" permissions on the AzMan store; plus, give write permissions to this account on the `Temporary ASP.NET Files` f... | null | CC BY-SA 3.0 | null | 2008-08-14T14:34:30.030 | 2014-12-13T07:35:42.273 | 2014-12-13T07:35:42.273 | 1,810,429 | null | null |
11,126 | 2 | null | 11,055 | 1 | null | To be accurate, this can get really complex. For example, this is how you do it on MS SQL Server:
[http://msdn.microsoft.com/en-us/library/aa933068(SQL.80).aspx](http://msdn.microsoft.com/en-us/library/aa933068(SQL.80).aspx)
| null | CC BY-SA 2.5 | null | 2008-08-14T14:36:30.477 | 2008-08-14T14:36:30.477 | null | null | 414 | null |
11,120 | 2 | null | 11,099 | 0 | null | I tend to agree with Joel Spolsky on that one with that article ([Making Wrong Code Look Wrong](http://www.joelonsoftware.com/articles/Wrong.html)) with the following code example :
```
if (i != 0)
bar(i);
foo(i);
```
Foo is now unconditionnal. Wich is real bad!
I always use brackets for decision statements. It he... | null | CC BY-SA 2.5 | null | 2008-08-14T14:33:00.063 | 2008-08-14T14:46:01.877 | 2008-08-14T14:46:01.877 | 1,291 | 1,291 | null |
11,128 | 2 | null | 11,060 | 0 | null | Yes, results are the ONLY thing that matters. The real chore is writing a framework that allows your generated code to run independently... spend your time there.
| null | CC BY-SA 2.5 | null | 2008-08-14T14:38:19.630 | 2008-08-14T14:38:19.630 | null | null | 414 | null |
11,127 | 1 | 11,132 | null | 8 | 10,158 | In a C++ Windows (XP and NT, if it makes a difference) application I'm working on, I need to get the network name associated with the computer the code is executing on, so that I can convert local filenames from C:\filename.ext to \\network_name\C$\filename.ext. How would I do this?
Alternatively, if there's a functio... | In C++/Windows how do I get the network name of the computer I'm on? | CC BY-SA 2.5 | null | 2008-08-14T14:37:27.120 | 2015-10-08T07:04:58.477 | 2008-08-25T18:10:47.523 | 123 | 179 | [
"c++",
"windows-xp",
"networking",
"windows-nt"
] |
11,119 | 2 | null | 11,099 | 2 | null | I would strongly advocate using braces, even when they're optional. Why? Take this chunk of C++ code:
```
if (var == 1)
doSomething();
doSomethingElse();
```
Now, someone comes along who isn't really paying enough attention and decides that something extra needs to happen if (var == 1), so they do this:
```
if (... | null | CC BY-SA 2.5 | null | 2008-08-14T14:32:51.560 | 2008-08-14T14:32:51.560 | null | null | 1,236 | null |
11,129 | 2 | null | 10,564 | 6 | null | [Vim/gVim](http://www.vim.org/) works well for me.
```
>echo %EDITOR%
c:\Vim\Vim71\vim.exe
```
| null | CC BY-SA 4.0 | null | 2008-08-14T14:39:14.887 | 2019-11-13T07:55:04.907 | 2019-11-13T07:55:04.907 | 63,550 | 1,322 | null |
11,131 | 2 | null | 11,112 | 2 | null | I find the wiki in Fogbugz to be very good using it with the iPhone.
| null | CC BY-SA 2.5 | null | 2008-08-14T14:39:56.960 | 2008-08-14T14:39:56.960 | null | null | 1,154 | null |
11,132 | 2 | null | 11,127 | 7 | null | You'll want Win32's GetComputerName:
[http://msdn.microsoft.com/en-us/library/ms724295(VS.85).aspx](http://msdn.microsoft.com/en-us/library/ms724295(VS.85).aspx)
| null | CC BY-SA 2.5 | null | 2008-08-14T14:40:31.217 | 2008-08-14T14:40:31.217 | null | null | 414 | null |
11,136 | 2 | null | 10,412 | 10 | null | Have you considered using .RTF as an alternative?
It supports embedding images and tables as well as text, opens by default using Microsoft Word and whilst it's featureset is more limited (count out any advanced formatting) for something that looks and feels and opens like a Word document it's not far off.
Your end ... | null | CC BY-SA 2.5 | null | 2008-08-14T14:43:18.967 | 2008-08-14T14:43:18.967 | null | null | 1,297 | null |
11,115 | 2 | null | 10,999 | 1 | null | We use TFS with a somewhat distributed team - they aren't too far away but connect via a slow and unreliable VPN.
For your first issue, get latest on checkout is not the default behaviour. (Here's an [explanation](http://blogs.msdn.com/buckh/archive/2005/08/20/454140.aspx)) There is an [add-in](http://blogs.microsoft.... | null | CC BY-SA 2.5 | null | 2008-08-14T14:30:59.553 | 2008-08-14T14:34:37.907 | 2008-08-14T14:34:37.907 | 1,042 | 1,042 | null |
11,148 | 2 | null | 11,141 | 2 | null | The ASP.NET caching mechanism has been around for a while, so it's stable and well understood. There are lots of resources out there to help you make the most of it.
Rolling your own might be the right solution, depending on your requirements.
The hard part about caching is choosing what is safe to cache, and when. ... | null | CC BY-SA 2.5 | null | 2008-08-14T14:55:42.777 | 2008-08-14T14:55:42.777 | null | null | 1,219 | null |
11,138 | 2 | null | 9,629 | 2 | null | I don't have the time to Google too much for this, but I know that either Larry Osterman or Raymond Chen blogged about a similar situation.
I'll check back later when I have more time to see if this question is still open.
| null | CC BY-SA 2.5 | null | 2008-08-14T14:43:52.520 | 2008-08-14T14:43:52.520 | null | null | 414 | null |
11,135 | 1 | 11,188 | null | 1 | 2,041 | I need to create an ASP page (classic, not ASP.NET) which runs remote shell scripts on a UNIX server, then captures the output into variables in VBScript within the page itself.
I have never done ASP or VBScipt before. I have tried to google this stuff, but all I find are references to remote server side scripting, no... | How to run remote shell scripts from ASP pages? | CC BY-SA 3.0 | null | 2008-08-14T14:42:50.887 | 2013-04-17T22:18:08.603 | 2013-04-17T22:18:08.603 | 1,454,806 | 1,311 | [
"asp-classic",
"vbscript"
] |
11,134 | 2 | null | 11,099 | 0 | null | I prefer
```
if (cond)
{
//statement
}
```
even with only a single statement. If you were going to write something once, had no doubts that it worked, and never planned on another coder ever looking at that code, go ahead and use whatever format you want. But, what does the extra bracketing really cost you... | null | CC BY-SA 2.5 | null | 2008-08-14T14:42:47.670 | 2008-08-14T14:42:47.670 | null | null | 1,179 | null |
11,146 | 2 | null | 11,141 | 4 | null | I think the maxim "let the computer do it; it's smarter than you" applies here. Just like memory management and other complicated things, the computer is a lot more informed about what it's doing than your are; consequently, able to get more performance than you are.
Microsoft has had a team of engineers working on it... | null | CC BY-SA 2.5 | null | 2008-08-14T14:52:54.267 | 2008-08-14T14:52:54.267 | null | null | 1,975,282 | null |
11,150 | 2 | null | 8,970 | 2 | null | If you poke around Apple's mailing lists you can find some code to do it in Java as well. [Here's a simple example suitable for capturing individual frames](http://lists.apple.com/archives/QuickTime-java/2007/Jan/msg00003.html), and [here's a more complicated one that's fast enough to display live video](http://lists.a... | null | CC BY-SA 2.5 | null | 2008-08-14T14:56:14.633 | 2008-08-14T14:56:14.633 | null | null | 1,114 | null |
11,145 | 1 | 12,120 | null | 15 | 11,353 | I am trying to code a flowchart generator for a language using Ruby.
I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes.
I would really prefer not having to write code for drawing basic shapes, if I can help it. ... | Drawing Library for Ruby | CC BY-SA 3.0 | 0 | 2008-08-14T14:51:28.217 | 2017-06-26T04:25:53.477 | 2017-06-26T04:25:53.477 | 1,307,905 | 1,311 | [
"ruby",
"graphics",
"drawing"
] |
11,153 | 2 | null | 805 | 1 | null | I've previously used a component from here: www.weonlydo.com. I didn't find it the easiest piece of kit to develop against but it got the job done in a hurry.
| null | CC BY-SA 2.5 | null | 2008-08-14T14:57:32.587 | 2008-08-14T14:57:32.587 | null | null | 984 | null |
11,141 | 1 | 11,146 | null | 2 | 589 | Recently I have been investigating the possibilities of caching in ASP.NET.
I rolled my own "Cache", because I didn't know any better, it looked a bit like this:
```
public class DataManager
{
private static DataManager s_instance;
public static DataManager GetInstance()
{
}
private D... | ASP.NET Caching | CC BY-SA 2.5 | 0 | 2008-08-14T14:46:30.317 | 2010-09-21T07:28:46.357 | 2008-08-14T15:02:35.370 | 419 | null | [
"asp.net",
"sql",
"caching"
] |
11,162 | 2 | null | 10,412 | 3 | null | Check out VSTO (Visual Studio Tools for Office). It is fairly simple to create a Word template, inject an xml data island into it, then send it to the client. When the user opens the doc in Word, Word reads the xml and transforms it into WordML and renders it. You will want to look at the ServerDocument class of the... | null | CC BY-SA 2.5 | null | 2008-08-14T15:03:28.893 | 2008-08-14T15:03:28.893 | null | null | 1,334 | null |
11,149 | 2 | null | 10,915 | 0 | null | I think the problem you have here is that your AcceptedOffer object contains a Plan object, and then your Plan object appears to contain an AcceptedOffers collection that contains AcceptedOffer objects. Same thing with Customers. The fact that the objects are a child of each other is what causes your problem, I think.
... | null | CC BY-SA 2.5 | null | 2008-08-14T14:56:01.437 | 2008-08-14T15:00:42.503 | 2008-08-14T15:00:42.503 | 372 | 372 | null |
11,155 | 2 | null | 10,412 | 10 | null | I have found [Aspose Words](http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx) to be the best as not everybody can open Office Open XML/*.docx format files and the Word interop and Word automation can be buggy. Aspose Words supports most document file types from Word 97... | null | CC BY-SA 2.5 | null | 2008-08-14T14:57:55.410 | 2010-02-03T20:42:38.113 | 2010-02-03T20:42:38.113 | 63,550 | 33 | null |
11,166 | 2 | null | 10,915 | 0 | null | A tip that may (or may not) be helpful in NHibernate: you can map your objects against Views as though the View was a table. Just specify the view name as a table name; as long as all NOT NULL fields are included in the view and the mapping it will work fine.
| null | CC BY-SA 3.0 | null | 2008-08-14T15:04:57.347 | 2012-08-11T15:51:17.700 | 2012-08-11T15:51:17.700 | 1,477,076 | 372 | null |
11,170 | 2 | null | 1,760 | 8 | null | Stick to NUnit. Don't go anywhere near MSTest.
NUnit + ReSharper is an absolute joy to work with.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:09:17.867 | 2008-08-14T15:09:17.867 | null | null | 1,122 | null |
11,163 | 2 | null | 1,760 | 2 | null | NUnit, MSTest, etc. all do pretty much the same thing. However, I find NMock indispensable.
NMock or any mocking package is not unit testing, but it makes it so much easier to do unit testing that it might as well be.
| null | CC BY-SA 4.0 | null | 2008-08-14T15:04:08.673 | 2020-07-30T11:10:27.153 | 2020-07-30T11:10:27.153 | 63,550 | 1,327 | null |
11,167 | 2 | null | 11,099 | 0 | null | I used to follow the "use curly braces always" line like an apparatchik. However, I've modified my style to allow for omitting them on single line conditional expressions:
```
if(!ok)return;
```
For any multistatement scenario though I'm still of the opinion that braces should be mandatory:
```
if(!ok){
do()... | null | CC BY-SA 3.0 | null | 2008-08-14T15:08:51.503 | 2011-11-17T15:07:16.327 | 2011-11-17T15:07:16.327 | 496,830 | 64 | null |
11,154 | 2 | null | 11,141 | 1 | null | Caching in ASP.NET is feature rich and you can configure caching in quite a granular way.
In your case (data caching) one of the features you're missing out on is the ability to invalidate and refresh the cache if data on the SQL server is updated in some way (SQL Cache Dependency).
[http://msdn.microsoft.com/en-us/... | null | CC BY-SA 2.5 | null | 2008-08-14T14:57:32.727 | 2008-08-14T15:02:04.623 | 2008-08-14T15:02:04.623 | 419 | 419 | null |
11,194 | 1 | 11,203 | null | 101 | 109,525 | We're working on a Log Viewer. The use will have the option to filter by user, severity, etc. In the Sql days I'd add to the query string, but I want to do it with Linq. How can I conditionally add where-clauses?
| How can I conditionally apply a Linq operator? | CC BY-SA 4.0 | 0 | 2008-08-14T15:20:26.973 | 2021-07-01T09:40:09.820 | 2021-07-01T09:40:09.820 | 542,251 | 1,204 | [
"c#",
"linq",
"linq-to-sql"
] |
11,179 | 2 | null | 3,725 | 0 | null | I would probably create several panel classes based on a base class inheriting CustomControl. These controls would then have methods like Save/Load and stuff like that. If so I can design each of these panels separately.
I have used a Wizard control that in design mode, handled several pages, so that one could click n... | null | CC BY-SA 2.5 | null | 2008-08-14T15:13:40.183 | 2008-08-14T15:17:18.617 | 2008-08-14T15:17:18.617 | 1,192 | 1,192 | null |
11,164 | 2 | null | 10,915 | 3 | null | I'd steer away from having child object containing their logical parent, it can get very messy and very recursive pretty quickly when you do that. I'd take a look at how you're intending to use the domain model before you do that sort of thing. You can easily still have the ID references in the tables and just leave ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:04:15.240 | 2008-08-14T15:04:15.240 | null | null | 1,297 | null |
11,195 | 2 | null | 11,055 | 0 | null | Having an exact size wasn't too important, so I went with littlegeek's method. I figured out what my tables and columns would be, and [looked up the sizes of the data types](http://lbd.epfl.ch/f/teaching/courses/oracle8i/server.815/a68003/01_04blt.htm), then did some good 'ole multiplying.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:21:51.867 | 2008-08-14T15:21:51.867 | null | null | 543 | null |
11,191 | 2 | null | 11,145 | 3 | null | It sounds like you're going to be limited mainly by the capabilities of whatever user agent you're building for; if this is a web project, drawing capabilities are going to be dependent on the browser. Since Ruby is running server-side, you would at minimum need some JavaScript to allow dragging/zooming, etc. There's p... | null | CC BY-SA 3.0 | null | 2008-08-14T15:19:21.543 | 2017-06-16T16:12:07.420 | 2017-06-16T16:12:07.420 | 4,099,593 | 1,331 | null |
11,188 | 2 | null | 11,135 | 0 | null | If the shell scripts are normally run on a telnet session then you could screen scrape and parse the responses. There are commercial COM components out there such as the Dart telnet library: [http://www.dart.com/pttel.aspx](http://www.dart.com/pttel.aspx) that would let you do this.
Either that or you could roll your ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:17:54.217 | 2008-08-14T15:17:54.217 | null | null | 419 | null |
11,197 | 2 | null | 10,366 | 7 | null | Since setting the properties with javascript never seemed to work, but setting using Firebug's inspect did, I started to suspect that the javascript ID selector was broken - maybe there were multiple items in the DOM with the same ID? The source didn't show that there were, but looping through all divs using javascrip... | null | CC BY-SA 2.5 | null | 2008-08-14T15:23:10.273 | 2008-08-14T15:23:10.273 | null | null | 521 | null |
11,199 | 1 | 11,215 | null | 5 | 3,993 | When developing a desktop application in .NET, is it possible to not require the .NET Framework? Is developing software in .NET a preferred way to develop desktop applications? What is the most used programming language that software companies use to develop desktop applications?
Is the requirement of the .NET Frame... | .NET Framework dependency | CC BY-SA 2.5 | 0 | 2008-08-14T15:25:44.637 | 2014-02-19T21:31:54.330 | 2008-09-12T16:47:45.500 | 299 | 299 | [
".net",
"frameworks",
"dependencies"
] |
11,152 | 1 | null | null | 3 | 1,236 | a little new to the windows workflow stuff so go easy :)
I wish to design a workflow host environment that has high availability - a minimum of 2 WF runtime hosts on separate hardware both pointing to the same persistance or tracking SQL database.
I am looking for a pattern whereby I can asynchronously create new wor... | How do I create a workflow instance reliably based on an external event? | CC BY-SA 2.5 | 0 | 2008-08-14T14:56:30.123 | 2008-11-02T16:55:44.120 | 2008-11-02T16:49:27.223 | null | null | [
".net",
"workflow",
"workflow-foundation"
] |
11,196 | 2 | null | 11,127 | 9 | null | There are more than one alternatives:
a. Use Win32's GetComputerName() as suggested by Stu.
Example: [http://www.techbytes.ca/techbyte97.html](http://www.techbytes.ca/techbyte97.html)
OR
b. Use the function gethostname() under Winsock. This function is cross platform and may help if your app is going to be run on ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:22:23.067 | 2008-08-14T15:22:23.067 | null | null | 1,311 | null |
11,205 | 2 | null | 11,199 | 2 | null | You can't run a .Net app without the .Net framework. The framework takes care of some of the more tedious background tasks so you couldn't run the app without the framework.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:28:11.463 | 2008-08-14T15:28:11.463 | null | null | 730 | null |
11,201 | 2 | null | 11,194 | 0 | null | Just use C#'s && operator:
```
var items = dc.Users.Where(l => l.Date == DateTime.Today && l.Severity == "Critical")
```
Edit: Ah, need to read more carefully. You wanted to know how to add additional clauses. In that case, I have no idea. :) What I'd probably do is just prepare several queries, and execute the rig... | null | CC BY-SA 2.5 | null | 2008-08-14T15:26:12.780 | 2008-08-14T15:26:12.780 | null | null | 1,975,282 | null |
11,176 | 2 | null | 10,915 | 1 | null | Didn't see your database diagram whilst I was writing.
```
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping default-cascade="save-update" xmlns="urn:nhibernate-mapping-2.2">
<class lazy="false" name="Namespace.Customer, Namespace" table="Customer">
<id name="Id" type="Int32" unsaved-value="0">
... | null | CC BY-SA 2.5 | null | 2008-08-14T15:12:04.477 | 2008-08-14T15:12:04.477 | null | null | 1,297 | null |
11,203 | 2 | null | 11,194 | 169 | null | if you want to only filter if certain criteria is passed, do something like this
```
var logs = from log in context.Logs
select log;
if (filterBySeverity)
logs = logs.Where(p => p.Severity == severity);
if (filterByUser)
logs = logs.Where(p => p.User == user);
```
Doing so this way will allow yo... | null | CC BY-SA 2.5 | null | 2008-08-14T15:27:09.297 | 2010-07-16T18:00:35.910 | 2010-07-16T18:00:35.910 | 30,946 | 77 | null |
11,206 | 2 | null | 10,303 | 1 | null | At 470,000 records you might want to check to see if you're approaching the 2 gigabyte limit on FoxPro table size. As I understand it, the records can still be there, but become inaccessible after the 2 gig point.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:28:39.280 | 2008-08-14T15:28:39.280 | null | null | 1,339 | null |
11,207 | 2 | null | 11,199 | -1 | null | It is possible not to require the .NET Framework; there are some companies that sell (for thousands of dollars, mind you) solutions that will allow you to do this. These are complete hacks, however, and not supported by Microsoft.
How you develop desktop applications (ie, using .NET or not) depends on your requirement... | null | CC BY-SA 2.5 | null | 2008-08-14T15:28:59.623 | 2008-08-14T15:28:59.623 | null | null | 1,975,282 | null |
11,200 | 1 | 11,240 | null | 1 | 8,688 | I'm guessing it needs to be something like:
```
CONVERT(CHAR(24), lastModified, 101)
```
However I'm not sure of the right value for the third parameter.
Thanks!
---
Well I'm trying to write a script to copy my sql server db to a sqlite file, which gets downloaded to an air app, which then syncs the data to an... | T-Sql date format for seconds since last epoch / formatting for sqlite input | CC BY-SA 3.0 | null | 2008-08-14T15:26:11.327 | 2011-11-21T03:41:19.560 | 2011-11-21T03:41:19.560 | 50,049 | 26 | [
"tsql",
"sqlite",
"date"
] |
11,210 | 2 | null | 11,199 | 2 | null | On the Windows platform using .NET is the preferred way to develop desktop applications. The WinForms model of .NET is one way to develop traditional or thick client apps, with Windows Presentation Foundation of .NET being the latest technology direction from MS.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:30:17.123 | 2008-08-14T15:30:17.123 | null | null | 1,341 | null |
11,214 | 2 | null | 5,017 | 0 | null | Currently adobe is not supporting opening files in there default applications. Passing it off to the browser seems to be the only way to make it work.
You could however use a FileStream and write a small html file with some javascript that sets the location of an iframe to the file, then after 100ms or so calls window... | null | CC BY-SA 2.5 | null | 2008-08-14T15:32:09.147 | 2008-08-14T15:32:09.147 | null | null | 22 | null |
11,213 | 2 | null | 11,200 | 0 | null | Define "last epoch". Does this come close?
Select Cast(lastModified As Integer)
| null | CC BY-SA 2.5 | null | 2008-08-14T15:32:00.770 | 2008-08-14T15:32:00.770 | null | null | 414 | null |
11,204 | 2 | null | 11,194 | 0 | null | You could use an external method:
```
var results =
from rec in GetSomeRecs()
where ConditionalCheck(rec)
select rec;
...
bool ConditionalCheck( typeofRec input ) {
...
}
```
This would work, but can't be broken down into expression trees, which means Linq to SQL would run the check code against ev... | null | CC BY-SA 2.5 | null | 2008-08-14T15:27:15.880 | 2008-08-14T15:34:29.533 | 2008-08-14T15:34:29.533 | 905 | 905 | null |
11,216 | 2 | null | 11,200 | 2 | null | Last epoch is when 1970 GMT?
```
SELECT DATEDIFF(s,'19700101 05:00:00:000',lastModified)
```
See also [Epoch Date](http://wiki.lessthandot.com/index.php/Epoch_Date)
| null | CC BY-SA 2.5 | null | 2008-08-14T15:33:02.703 | 2008-08-14T15:33:02.703 | null | null | 740 | null |
11,217 | 2 | null | 11,199 | 1 | null | I guess what I'm trying to say is that when I look at system requirements for certain software I rarely ever see the .NET Framework as being a requirement. So, I always wonder how they get by without it being a requirement (if they developed the software in .NET). So, I just assume that most commercial software is no... | null | CC BY-SA 2.5 | null | 2008-08-14T15:33:04.467 | 2008-08-14T15:33:04.467 | null | null | 299 | null |
11,219 | 1 | 11,238 | null | 28 | 60,926 | I'd like to start moving our application business layers into a collection of REST web services. However, most of our Intranet has been built using Classic ASP and most of the developers where I work keep programming in Classic ASP. Ideally, then, for them to benefit from the advantages of a unique set of web APIs, it ... | Calling REST web services from a classic asp page | CC BY-SA 3.0 | 0 | 2008-08-14T15:34:26.757 | 2020-07-02T00:32:27.063 | 2017-12-14T09:51:19.260 | 3,817,004 | 160 | [
"web-services",
"rest",
"asp-classic"
] |
11,209 | 2 | null | 10,870 | 6 | null | Are you using only the dragEnter method? If you are trying to reject the drag while still dragging over the same component you need to use both the dragEnter and dragOver methods.
Check out this example:
```
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absol... | null | CC BY-SA 2.5 | null | 2008-08-14T15:29:51.070 | 2008-08-14T15:29:51.070 | null | null | 22 | null |
11,229 | 2 | null | 11,200 | 0 | null | If you store them as varchar, store them as YYYYMMDD. That way you CAN sort by them later if you want to.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:41:30.127 | 2008-08-14T15:41:30.127 | null | null | 414 | null |
11,220 | 2 | null | 3,255 | 12 | null | Basically the thing that crops up 90% of the time is just analyzing loops. Do you have single, double, triple nested loops? The you have O(n), O(n^2), O(n^3) running time.
Very rarely (unless you are writing a platform with an extensive base library (like for instance, the .NET BCL, or C++'s STL) you will encounter ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:35:50.200 | 2008-08-14T15:35:50.200 | null | null | 1,341 | null |
11,224 | 2 | null | 10,228 | 2 | null | There really is a problem with your tests if they need to run in a certain order. Each test should be totally independent of the others: it helps you with defect localization, and allows you to get repeatable (and therefore debuggable) results.
Checkout [this site](http://www.xunitpatterns.com) for a whole load of id... | null | CC BY-SA 3.0 | null | 2008-08-14T15:39:32.847 | 2013-01-04T01:50:04.443 | 2013-01-04T01:50:04.443 | 50,049 | 912 | null |
11,215 | 2 | null | 11,199 | 10 | null | You can still develop applications for the windows desktop using C/C++, eliminating the requirement to the .NET framework, but you'll need to make sure the necessary libraries are already on the system or installed.
The nice thing about the .NET framework is that Windows XP SP2 and Vista has the 3.0 framework runtime ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:32:49.410 | 2008-08-14T23:23:51.940 | 2008-08-14T23:23:51.940 | 71 | 71 | null |
11,226 | 2 | null | 11,199 | 1 | null | [Mono](http://www.go-mono.com/mono-downloads/download.html) Has a Windows release, if you absolutely have to avoid dependency on .NET.
Any way you look at it, though, you are going to need a .NET compatible runtime on any computer that your application is running on. So if you want to completely avoid .NET, you will ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:40:03.657 | 2008-08-14T15:40:03.657 | null | null | 121 | null |
11,233 | 2 | null | 11,199 | 1 | null | The best practice for .NET application distribution is that the installer is somehow bootstrapped with the .NET Redistributable installer for the required framework, so that if the required framework is not yet installed (say, you need 3.5 in Windows XP) then the installer will just put it in.
The .NET Runtime is smal... | null | CC BY-SA 2.5 | null | 2008-08-14T15:44:38.577 | 2008-08-14T15:44:38.577 | null | null | 372 | null |
11,225 | 2 | null | 11,194 | 0 | null | Well, what I thought was you could put the filter conditions into a generic list of Predicates:
```
var list = new List<string> { "me", "you", "meyou", "mow" };
var predicates = new List<Predicate<string>>();
predicates.Add(i => i.Contains("me"));
predicates.Add(i => i.EndsWith("w"));
var results = ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:39:33.063 | 2008-08-14T15:39:33.063 | null | null | 372 | null |
11,235 | 2 | null | 11,060 | 0 | null | If you are running on *nux you might consider dumping the unittest framework in favor of a bash script or makefile. on windows you might consider building a shell app/function that runs the generator and then uses the code (as another process) and unittest that.
A third option would be to generate the code and then bu... | null | CC BY-SA 2.5 | null | 2008-08-14T15:46:01.927 | 2008-08-14T15:46:01.927 | null | null | 1,343 | null |
11,238 | 2 | null | 11,219 | 33 | null | You could use a combination of JQuery with JSON calls to consume REST services from the client
or
if you need to interact with the REST services from the ASP layer you can use
MSXML2.ServerXMLHTTP
like:
```
Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.open "GET", "Rest_URI", False
HttpReq.send... | null | CC BY-SA 2.5 | null | 2008-08-14T15:49:27.413 | 2008-08-14T16:10:31.083 | 2008-08-14T16:10:31.083 | 439 | 439 | null |
11,242 | 2 | null | 11,219 | 0 | null | All you need is an HTTP client. In .Net, WebRequest works well. For classic ASP, you will need a specific component like [this one](http://web.archive.org/web/20140829190201/http://www.coalesys.com/products/httpclient/features/default.asp).
| null | CC BY-SA 4.0 | null | 2008-08-14T15:54:08.557 | 2020-07-02T00:32:27.063 | 2020-07-02T00:32:27.063 | 9,780,149 | 268 | null |
11,234 | 2 | null | 11,200 | 0 | null | SQL server has only 2 failsafe date formats
ISO = YYYYMMDD, run this to see that
```
select convert(varchar(10),getdate(),112)
```
ISO8601 = yyyy-mm-dd Thh:mm:ss:mmm(no spaces) run this to see that
```
select convert(varchar(30),getdate(),126)
```
To learn more about how dates are stored in SQL server I wrote ... | null | CC BY-SA 2.5 | null | 2008-08-14T15:45:00.760 | 2008-08-14T15:45:00.760 | null | null | 740 | null |
11,236 | 2 | null | 8,422 | 2 | null | Can you share some info on your authentication method?
MS provides some report samples that include everything you need to get started.
For SSRS 2005
[http://www.codeplex.com/MSFTRSProdSamples/Wiki/View.aspx?title=SS2005!Server%20Management%20Sample%20Reports&referringTitle=Home](http://www.codeplex.com/MSFTRSProdSam... | null | CC BY-SA 2.5 | null | 2008-08-14T15:48:03.517 | 2008-08-14T15:48:03.517 | null | null | 1,293 | null |
11,237 | 2 | null | 11,219 | 6 | null | Here are a few articles describing how to call a web service from a class ASP page:
- [Integrating ASP.NET XML Web Services with 'Classic' ASP Applications](https://web.archive.org/web/20210125161040/http://www.4guysfromrolla.com/webtech/070302-1.shtml)- [Consuming XML Web Services in Classic ASP](http://www.dotnetjun... | null | CC BY-SA 2.5 | null | 2008-08-14T15:49:01.750 | 2008-08-14T15:49:01.750 | null | null | 509 | null |
11,240 | 2 | null | 11,200 | 1 | null | I wound up using format 120 in MS SQL:
```
convert(char(24), lastModified, 120)
```
Each time I needed to a select a date in SQLite for non-display purposes I used:
```
strftime(\"%Y-%m-%d %H:%M:%S\", dateModified) as dateModified
```
Now I just need a readable/friendly way to display the date to the user!
edit... | null | CC BY-SA 2.5 | null | 2008-08-14T15:52:17.237 | 2008-08-14T16:03:25.340 | 2008-08-14T16:03:25.340 | 26 | 26 | null |
11,244 | 2 | null | 11,152 | 0 | null | I would go with MSMQ/event table. Polling is only dirty if you do it wrong.
One thing to keep in mind: you say you want multiple WF servers for high availability, ? High availability only works if you remove single points of failure, not just some of them.
| null | CC BY-SA 2.5 | null | 2008-08-14T15:56:19.490 | 2008-08-14T15:56:19.490 | null | null | 414 | null |
11,241 | 2 | null | 11,194 | 1 | null | It isn't the prettiest thing but you can use a lambda expression and pass your conditions optionally. In TSQL I do a lot of the following to make parameters optional:
> WHERE Field = @FieldVar OR @FieldVar IS NULL
You could duplicate the same style with a the following lambda (an example of checking authentication):... | null | CC BY-SA 2.5 | null | 2008-08-14T15:53:50.837 | 2008-08-14T15:53:50.837 | null | null | 64 | null |
11,259 | 2 | null | 7,212 | 2 | null | Depending on how many methods your class has, this may work:
Actual Class:
```
public class SampleClass
{
public function SampleClass()
{
}
public function method1():void {
Alert.show("Hi");
}
```
Quick Wrapper:
```
var actualClass:SampleClass = new SampleClass();
var QuickWrapper:Obj... | null | CC BY-SA 2.5 | null | 2008-08-14T16:07:33.617 | 2008-08-14T16:07:33.617 | null | null | 22 | null |
11,257 | 2 | null | 10,309 | 1 | null | I've definitely been fighting with unmanaged issues in a C# managed app for a while -- it's not easy.
What I've found to be most helpful is to have a regular output to a text log file. For example you can print the output of [GlobalMemoryStatus](http://msdn.microsoft.com/en-us/library/aa908760.aspx) every couple of... | null | CC BY-SA 2.5 | null | 2008-08-14T16:06:04.087 | 2008-08-14T16:06:04.087 | null | null | 945 | null |
11,247 | 2 | null | 6,926 | 5 | null | I'd just like to reiterate how great the GPU Gems books are - a truly fantastic resource for any serious graphics development.
OJ has basically summed up a really good process of learning, I'd just add that having a good foundation in geometric math (vectors/matrices as a minimum) cannot be underestimated - but it's n... | null | CC BY-SA 2.5 | null | 2008-08-14T15:57:36.833 | 2008-08-14T16:02:48.853 | 2008-08-14T16:02:48.853 | 1,169 | 1,169 | null |
11,263 | 1 | 11,271 | null | 8 | 9,510 | I'm looking for patterns that concern coding parts of a GUI. as global as , that I'm quite familiar with, but patterns and good ideas and best practices concerning single controls and inputs.
Let say I want to make a control that display some objects that may overlap. Now if I click on an object, I need to find out w... | Do you know any patterns for GUI programming? (Not patterns on designing GUIs) | CC BY-SA 2.5 | 0 | 2008-08-14T16:09:55.030 | 2012-08-06T09:03:44.940 | 2008-08-23T14:57:50.483 | 2,134 | 1,192 | [
"user-interface",
"design-patterns"
] |
11,274 | 2 | null | 11,263 | 2 | null | I don't think the that benefit of design patterns come from trying to find a design pattern to fit a problem. You can however use some heuristics to help clean up your design in this quite a bit, like keeping the UI as decoupled as possible from the rest of the objects in your system.
There is a pattern that might hel... | null | CC BY-SA 2.5 | null | 2008-08-14T16:19:21.360 | 2008-08-14T16:19:21.360 | null | null | 390 | null |
11,253 | 2 | null | 11,199 | 1 | null | > I guess what I'm trying to say is that
when I look at system requirements for
certain software I rarely ever see the
.NET Framework as being a requirement.
So, I always wonder how they get by
without it being a requirement (if
they developed the software in .NET).
So, I just assume that most commercial
... | null | CC BY-SA 2.5 | null | 2008-08-14T16:01:14.737 | 2008-08-14T16:01:14.737 | null | null | 71 | null |
11,251 | 2 | null | 11,219 | 10 | null | @[KP](https://stackoverflow.com/questions/11219/calling-rest-web-services-from-a-classic-asp-page#11238)
You should actually use `MSXML2.ServerXMLHTTP` from ASP/server side applications. `XMLHTTP` should only be used client side because it uses WinInet which is not supported for use in server/service apps.
See [http... | null | CC BY-SA 2.5 | null | 2008-08-14T15:59:58.110 | 2009-04-13T08:58:20.390 | 2017-05-23T12:34:51.097 | -1 | 419 | null |
11,269 | 2 | null | 7,398 | 1 | null | It turns out there was a very simple solution in my case. The vendor project gathers several header files into one monolithic header file, which is then `#include`d by the vendor sources. But the make rule that builds the monolithic header accidentally included the generated `config.h`. The presence of the PACKAGE, ... | null | CC BY-SA 2.5 | null | 2008-08-14T16:16:56.203 | 2008-08-14T16:16:56.203 | null | null | 737 | null |
11,275 | 1 | 11,421 | null | 2 | 3,254 | Anyone know how to do this without using a third party program? If there no way to do it with a add-on someone can recommend one?
EDIT: I need to add this in the server so all users have the same signature.
Thanks
| Standard Signature a Text in a Message using Exchange Server | CC BY-SA 2.5 | null | 2008-08-14T16:19:49.613 | 2011-06-09T07:52:18.067 | 2008-08-14T16:39:55.937 | 1,154 | 1,154 | [
"outlook",
"exchange-server"
] |
11,284 | 2 | null | 11,279 | 0 | null | I'm no VB.NET expert, but have you tried to set the value to for example 1.0.0.*?
This should increase the revision number (at least it does in the AssemblyInfo.cs in C#).
| null | CC BY-SA 2.5 | null | 2008-08-14T16:29:30.827 | 2008-08-14T16:29:30.827 | null | null | 936 | null |
11,271 | 2 | null | 11,263 | 6 | null | I think to be honest you a better just boning up on your standard design patterns and applying them to the individual problems that you face in developing your UI.
While there are common UI "themes" (such as dealing with modifier keys) the actual implementation may vary widely.
I have O'Reilly's [Head First Design Patt... | null | CC BY-SA 2.5 | null | 2008-08-14T16:18:10.553 | 2008-08-14T16:18:10.553 | 2020-06-20T09:12:55.060 | -1 | 832 | null |
11,279 | 1 | 11,297 | null | 2 | 8,530 | I have a small VB.NET application that I'm working on using the full version of Visual Studio 2005. In the properties of the project, I have it set to .
The issue is that it's only incrementing the revision in the Setup files. It doesn't seem to be updating the version number in the About Box (which is the generic, b... | Automatically incremented revision number doesn't show up in the About Box | CC BY-SA 3.0 | 0 | 2008-08-14T16:25:12.457 | 2012-05-02T13:26:48.453 | 2012-05-02T13:26:48.453 | 1,011,616 | 305 | [
"vb.net",
"visual-studio"
] |
11,267 | 1 | 11,307 | null | 5 | 1,469 |
# Outline
OK, I have Google'd this and already expecting a big fat But I thought I should ask since I know sometimes there can be the odd little gem of knowledge lurking around in peoples heads ^_^
I am working my way through some excercises in a book for study, and this particular exercise is User Controls. I ha... | ASP.NET UserControl's and DefaultEvent | CC BY-SA 3.0 | null | 2008-08-14T16:14:36.427 | 2012-08-12T21:10:04.573 | 2012-08-11T15:50:18.467 | 1,477,076 | 832 | [
"c#",
"asp.net",
"user-controls",
"attributes"
] |
11,283 | 2 | null | 11,099 | 1 | null | Ruby nicely obviates one issue in the discussion. The standard for a one-liner is:
```
do_something if (a == b)
```
and for a multi-line:
```
if (a == b)
do_something
do_something_else
end
```
This allows concise one-line statements, but it forces you to reorganize the statement if you go from single- to mul... | null | CC BY-SA 2.5 | null | 2008-08-14T16:29:24.447 | 2008-08-14T16:29:24.447 | null | null | 1,190 | null |
11,286 | 2 | null | 11,279 | 0 | null | The option you select is only to update the setup number. To update the program number you have to modify the AssemblyInfo.
C#
[assembly: AssemblyVersion("X.Y.")]
VB.NET
Assembly: AssemblyVersion("X.Y.*")
| null | CC BY-SA 2.5 | null | 2008-08-14T16:29:45.240 | 2008-08-14T16:29:45.240 | null | null | 1,154 | null |
11,285 | 2 | null | 11,135 | 0 | null | @Pascal, sadly I'm not aware of any F/OSS alternatives. We usually just buy in these types of libraries provided that they're not hugely expensive, and more often than not the cost is built into the customer's overall project cost.
If you had .NET on the server, you could build a COM wrapped component to do the heavy ... | null | CC BY-SA 2.5 | null | 2008-08-14T16:29:37.083 | 2008-08-14T16:29:37.083 | null | null | 419 | null |
11,290 | 2 | null | 10,661 | 3 | null | Internally, the OutputCacheAttribute (aka output cache filter) uses the same internal mechanism as [page output caching](http://msdn.microsoft.com/en-us/library/hdxfb6cy.aspx) (aka the @OutputCache directive).
Therefore, it's not any faster than page output caching. However, with MVC, you really can't use page output ... | null | CC BY-SA 2.5 | null | 2008-08-14T16:32:22.693 | 2008-08-14T16:32:22.693 | null | null | 598 | null |
11,291 | 1 | 11,312 | null | 15 | 6,642 | I'm slowly learning Objective-C and Cocoa, and the only way I see so far to capture key events in Text Views is to use delegation, but I'm having trouble finding useful documentation and examples on how to implement such a solution. Can anyone point me in the right direction or supply some first-hand help?
| Best way to capture key events in NSTextView? | CC BY-SA 3.0 | null | 2008-08-14T16:32:22.957 | 2015-11-20T15:53:19.067 | 2015-11-20T15:53:19.067 | -1 | 1,344 | [
"objective-c",
"cocoa",
"events"
] |
11,300 | 2 | null | 11,112 | 2 | null | It is very easy to override the mediawiki skins with your own. You could remove whatever you want to without much of a problem.
| null | CC BY-SA 2.5 | null | 2008-08-14T16:38:00.870 | 2008-08-14T16:38:00.870 | null | null | 673 | null |
11,297 | 2 | null | 11,279 | 1 | null | Change the code for the About box to
```
Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Deployment.CurrentVersion.ToString)
```
Please note that all the other answers are correct for "how do I get my assembly version", not the stated question "how do I show my publish version".
| null | CC BY-SA 2.5 | null | 2008-08-14T16:35:52.903 | 2008-08-14T17:06:14.183 | 2008-08-14T17:06:14.183 | 414 | 414 | null |
11,277 | 2 | null | 3,088 | 0 | null | At first I was interested in how different programs worked, so I started by looking at the source code. Then when I began to understand how the program worked, I would change certain parameters to see what would happen. So basically I learned how to read before I learned how to write. Which coincidently is how most peo... | null | CC BY-SA 2.5 | null | 2008-08-14T16:23:14.240 | 2008-10-09T13:49:48.820 | 2008-10-09T13:49:48.820 | 2,766,176 | 1,337 | null |
11,304 | 2 | null | 11,279 | 1 | null | It took me a second to find this, but I believe this is what you are looking for:
```
using System;
using System.Reflection;
public class VersionNumber
{
public static void Main()
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
Version version = assembly.Get... | null | CC BY-SA 2.5 | null | 2008-08-14T16:41:22.720 | 2008-08-14T16:41:22.720 | null | null | 1,185 | null |
11,307 | 2 | null | 11,267 | 0 | null | Here is a answer, without testing (like martin did).
In reflector, you will see that the DefaultEventAttribute allows itself to be inherited.
In reflector, you see that the UserControl class has it's default event set to the Load event.
So the possible reason is that even though you are decorating your user control... | null | CC BY-SA 2.5 | null | 2008-08-14T16:42:13.093 | 2008-08-14T16:42:13.093 | null | null | 77 | null |
11,288 | 1 | 23,933 | null | 7 | 8,286 | So WPF doesn't support standard sorting or filtering behavior for views of CompositeCollections, so what would be a best practice for solving this problem.
There are two or more object collections of different types. You want to combine them into a single sortable and filterable collection (withing having to manually... | Sorting a composite collection | CC BY-SA 3.0 | 0 | 2008-08-14T16:30:49.933 | 2016-09-30T14:22:46.353 | 2016-09-30T14:22:46.353 | 2,060,725 | 1,346 | [
"c#",
".net",
"wpf",
"data-binding",
"collections"
] |
11,299 | 2 | null | 10,985 | 29 | null | [Nick's answer](https://stackoverflow.com/questions/10985/how-to-prevent-an-object-being-created-on-the-heap#11003) is a good starting point, but incomplete, as you actually need to overload:
```
private:
void* operator new(size_t); // standard new
void* operator new(size_t, void*); // placement new... | null | CC BY-SA 2.5 | null | 2008-08-14T16:36:41.233 | 2008-08-14T16:53:11.870 | 2017-05-23T12:02:06.780 | -1 | 363 | null |