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
17,068
2
null
17,057
3
null
Best solution is to let IIS do it. [IIS6 Compression](http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/502ef631-3695-4616-b268-cbe7cf1351ce.mspx?mfr=true) - most likely you need to [specify file types to be compressed](http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS...
null
CC BY-SA 2.5
null
2008-08-19T22:11:31.707
2008-08-19T22:11:31.707
null
null
77
null
17,062
2
null
17,054
5
null
Here's an example taken from [http://www.bastisoft.de/programmierung/pascal/pasinet.html](http://www.bastisoft.de/programmierung/pascal/pasinet.html) ``` program daytime; { Simple client program } uses sockets, inetaux, myerror; const RemotePort : Word = 13; var Sock : LongInt; sAddr : TInetSockAddr; ...
null
CC BY-SA 3.0
null
2008-08-19T22:09:15.207
2011-05-25T21:32:34.950
2011-05-25T21:32:34.950
-1
1,494
null
17,051
2
null
4,306
4
null
Small detail in the index comparison. You need to do a lexicographical compare, otherwise: ``` a= (1, 2, 1); b= (2, 1, 2); (a<b) == (b<a) is true, but b!=a ``` Edit: So the comparison should probably be: ``` return lhs.x<rhs.x ? true : lhs.x==rhs.x ? lhs.y<rhs.y ? true : ...
null
CC BY-SA 3.0
null
2008-08-19T21:59:23.207
2012-07-03T14:54:31.923
2012-07-03T14:54:31.923
142,162
1,799
null
17,069
2
null
16,991
1
null
+1 for TextMate on Mac OS X. See also answers to [this question](https://stackoverflow.com/questions/16064/what-ide-to-use-for-developing-in-ruby-on-rails-on-windows#16086). I [recommend](https://stackoverflow.com/questions/16064/what-ide-to-use-for-developing-in-ruby-on-rails-on-windows#16086) trying [NetBeans](http...
null
CC BY-SA 2.5
null
2008-08-19T22:11:58.507
2011-02-06T15:58:45.960
2017-05-23T12:09:11.970
-1
1,190
null
17,056
1
18,226
null
13
3,850
I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle names So say I have 3 rows with the following i...
SQL Server Full Text Searching
CC BY-SA 3.0
0
2008-08-19T22:04:13.627
2012-11-01T10:07:50.300
2012-11-01T10:07:50.300
1,410,342
1,925
[ "sql-server", "search", "full-text-search" ]
17,087
2
null
16,926
7
null
When I first saw this, I thought "Great question! Neat answer, danb!" After a little thought, I'm not so sure this is a good idea. It's a little like generating event handlers for all controls in an ASP.NET page, or generating CRUD procedures for all tables in a database. I think it's better to create them as needed f...
null
CC BY-SA 2.5
null
2008-08-19T22:18:36.480
2008-08-19T22:18:36.480
null
null
5
null
17,011
2
null
15,254
3
null
Placement new itself is portable, but the assumptions you make about what it does with a specified block of memory are not portable. Like what was said before, if you were a compiler and were given a chunk of memory, how would you know how to allocate an array and properly destruct each element if all you had was a poi...
null
CC BY-SA 3.0
null
2008-08-19T21:36:16.077
2012-07-03T14:51:43.403
2012-07-03T14:51:43.403
142,162
1,799
null
17,098
1
null
null
4
1,163
What's the best way to implement authentication over WCF? I'd prefer to not use WS-* as it needs to be transport independent. Should I "roll my own"? Is there any guidance for doing that (articles/blog posts)? Or is there some way to use the built in ASP.NET Membership and Profile providers on the server side? ­­­­­...
What's the best way to authenticate over WCF?
CC BY-SA 3.0
null
2008-08-19T22:26:12.763
2017-07-10T21:56:34.657
2017-07-10T21:56:34.657
7,750,640
1,851
[ ".net", "asp.net", "wcf", "authentication", "membership" ]
16,984
2
null
2,898
0
null
Vim is a nice upgrade for Vi, offering decent features and a more usable set of keybindings and default behaviour. However, graphical versions like GVim, KVim and even Cream are extremely lacking in my opinion. I've been using [Geany](http://geany.uvena.de/) a lot lately, but it also has its shortcomings. I just can't...
null
CC BY-SA 2.5
null
2008-08-19T21:22:12.517
2008-08-19T21:22:12.517
null
null
2,018
null
17,022
2
null
16,991
19
null
The latest Netbeans IDE (6.1) has a pretty solid Ruby support. You can check it out [here](http://www.netbeans.org/features/ruby/index.html).
null
CC BY-SA 2.5
null
2008-08-19T21:42:54.877
2008-08-19T21:42:54.877
null
null
1,311
null
17,103
2
null
15,632
1
null
@Mark Struzinski I actually discovered that it was a problem with the installer, when installing the "Full Version". I discovered, since the product was downloaded, instead of delivered on CD/DVD, that the installer was looking for information in a path that was not correct. There was a MS Knowledge Base article ...
null
CC BY-SA 2.5
null
2008-08-19T22:29:23.693
2008-08-19T22:29:23.693
null
null
1,580
null
17,104
2
null
16,815
0
null
> I know I'm doing something silly (I'm a php newbie) but I can't seem to find what it is... that is how you are going to learn a lot ;) enjoy it ...
null
CC BY-SA 2.5
null
2008-08-19T22:29:32.367
2008-08-19T22:29:32.367
null
null
1,532
null
17,110
2
null
16,991
7
null
[NetBeans](http://netbeans.org) has some really solid Ruby support.
null
CC BY-SA 2.5
null
2008-08-19T22:32:11.080
2008-08-19T22:32:11.080
null
null
1,467
null
17,108
1
17,120
null
4
685
I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a continuous integration process with CruiseControl.NET. Is...
Where to start with CruiseControl.NET
CC BY-SA 2.5
0
2008-08-19T22:31:40.443
2013-02-20T06:33:26.800
null
null
1,363
[ "continuous-integration", "cruisecontrol.net" ]
17,106
1
28,121
null
198
266,124
We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that? There are apparently no free tools for this, and I...
How to generate sample XML documents from their DTD or XSD?
CC BY-SA 2.5
0
2008-08-19T22:29:47.840
2019-09-10T23:11:39.670
2008-09-25T13:57:58.953
1,428
1,428
[ "xml", "xsd", "dtd", "test-data" ]
17,112
2
null
17,108
-1
null
Really, the [documentation](http://confluence.public.thoughtworks.org/display/CCNET/Documentation) is pretty solid
null
CC BY-SA 2.5
null
2008-08-19T22:34:30.217
2008-08-19T22:34:30.217
null
null
77
null
17,085
1
null
null
1
1,866
I have a simple CAML query like ``` <Where><Eq><Field="FieldName"><Value Type="Text">Value text</Value></Field></Eq></Where> ``` And I have a variable to substitute for `Value text`. What's the best way to validate/escape the text that is substituted here in the .NET framework? I've done a quick web search on this p...
Escaping XML tag contents
CC BY-SA 3.0
null
2008-08-19T22:18:17.947
2015-09-22T15:43:32.870
2015-09-22T15:33:37.530
4,551,041
578
[ ".net", "xml", "frameworks", "escaping", "encode" ]
17,101
2
null
16,860
14
null
You might want to look at [TDD on Three Index Cards](http://blog.objectmentor.com/articles/2008/03/06/tdd-on-three-index-cards) and [Three Index Cards to Easily Remember the Essence of Test-Driven Development](http://blog.briandicroce.com/2008/03/14/three-index-cards-to-easily-remember-the-essence-of-test-driven-develo...
null
CC BY-SA 2.5
null
2008-08-19T22:28:56.690
2008-08-19T22:28:56.690
null
null
372
null
17,125
1
1,692,705
null
14
3,028
I know what `yield` does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem? (Ideally some problem that cannot be solved some other way)
What are real life applications of yield?
CC BY-SA 2.5
0
2008-08-19T22:45:19.300
2013-12-03T22:53:29.600
2008-09-22T14:26:16.760
1,782
1,782
[ "c#", ".net", "yield" ]
17,120
2
null
17,108
6
null
Before leveraging CruiseControl to it's fullest extent, you need to create an automated build script that can be run by msbuild or nant. After you get your project building in one step, then you can start integrating CruiseControl into the mix. Here are some resources to help get you started: - [CruiseControl.net Wi...
null
CC BY-SA 3.0
null
2008-08-19T22:40:00.187
2013-02-20T06:33:26.800
2013-02-20T06:33:26.800
1,522,061
1,117
null
17,127
1
67,969
null
3
439
I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?
Can you link 68K code compiled with CodeWarrior for Palm OS with code compiled with PRC-Tools (GCC)?
CC BY-SA 2.5
null
2008-08-19T22:46:21.157
2008-10-14T16:05:19.127
2008-10-14T16:05:19.127
1,323
1,323
[ "palm-os", "garnet-os", "codewarrior", "prc-tools" ]
17,117
1
19,609
null
6
1,568
Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages? I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages for MSVC8 it requires 1.1GB. While I am ...
C++ std::tr2 for VS2005
CC BY-SA 2.5
0
2008-08-19T22:35:25.830
2019-07-01T13:04:59.147
2019-07-01T13:04:59.147
3,204,551
342
[ "c++", "boost", "visual-studio-2005", "c++-tr2" ]
17,128
2
null
17,127
2
null
No, CodeWarrior uses a different object file format than PRC-Tools. Also, the compiler support libraries are different, so even if the code could be linked together, it may use symbols in a different way. However, if you can wrap the third-party library into a shared library using CodeWarrior, then you should be able...
null
CC BY-SA 2.5
null
2008-08-19T22:48:00.153
2008-08-19T22:48:00.153
null
null
1,323
null
17,093
2
null
17,085
0
null
use `System.Xml.Linq.XElement` and `SetValue` method. This will format the text , but also allows you to set xml as the value.
null
CC BY-SA 3.0
null
2008-08-19T22:20:47.520
2015-09-22T15:43:32.870
2015-09-22T15:43:32.870
4,551,041
77
null
17,140
1
null
null
35
62,094
How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.
How do you spawn another process in C?
CC BY-SA 2.5
0
2008-08-19T22:53:47.130
2017-08-01T14:13:27.927
2016-06-07T16:21:42.877
6,083,675
432
[ "c", "process" ]
17,133
2
null
17,125
5
null
actually I use it in a non traditional way on my site [IdeaPipe](http://www.ideapipe.com) ``` public override IEnumerator<T> GetEnumerator() { // goes through the collection and only returns the ones that are visible for the current user // this is done at this level instead of the display level so that ideas ...
null
CC BY-SA 2.5
null
2008-08-19T22:51:19.163
2008-08-19T22:51:19.163
null
null
17
null
17,141
2
null
16,815
2
null
In the [PHP Manual](http://au2.php.net/manual/en/function.session-destroy.php) it has code snippet for destroying a session. ``` session_start(); $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); ```
null
CC BY-SA 2.5
null
2008-08-19T22:54:33.990
2008-08-19T22:54:33.990
null
null
486
null
17,148
2
null
17,140
12
null
``` #include <stdlib.h> int main() { system("echo HAI"); return 0; } ```
null
CC BY-SA 3.0
null
2008-08-19T22:58:47.757
2015-04-16T23:13:35.717
2015-04-16T23:13:35.717
432
456
null
17,137
2
null
17,085
0
null
I am not sure what context the xml is coming from, but if it is stored in a string const variable that you created, then the easiest way to modify it would be: ``` public class Example { private const string CAMLQUERY = "<Where><Eq><Field=\"FieldName\"><Value Type=\"Text\">{0}</Value></Field></Eq></Where>"; p...
null
CC BY-SA 2.5
null
2008-08-19T22:52:38.940
2008-08-19T22:58:53.917
2017-05-23T10:27:42.823
-1
1,117
null
17,150
2
null
17,140
2
null
One solution is the system function defined in stdlib.h ``` int system(const char *string); ``` [system api example](http://www.cplusplus.com/reference/clibrary/cstdlib/system.html)
null
CC BY-SA 2.5
null
2008-08-19T22:59:56.897
2008-08-19T22:59:56.897
null
null
1,791
null
17,170
1
17,295
null
207
171,331
I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type?
When to use IList and when to use List
CC BY-SA 2.5
0
2008-08-19T23:09:54.720
2022-02-16T17:30:37.813
null
null
1,560
[ "c#", ".net" ]
17,100
2
null
17,032
4
null
@jongalloway - var doesn't necessarily make your code more unreadable. ``` var myvariable = DateTime.Now DateTime myvariable = DateTime.Now; ``` The first is just as readable as the second and requires less work ``` var myvariable = ResultFromMethod(); ``` here, you have a point, var could make the code less readable...
null
CC BY-SA 4.0
null
2008-08-19T22:26:44.447
2021-07-11T16:36:59.143
2021-07-11T16:36:59.143
2,667,173
77
null
17,167
2
null
17,108
1
null
Here are some links that might be useful: - [http://www.codeproject.com/KB/dotnet/cruisecontrol_continuous.aspx](http://www.codeproject.com/KB/dotnet/cruisecontrol_continuous.aspx)- [http://devlicio.us/blogs/ziemowit_skowronski/archive/2007/03/10/continuous-integration-1-the-environment-and-the-first-build.aspx](http:...
null
CC BY-SA 3.0
null
2008-08-19T23:07:12.930
2012-07-30T16:35:12.263
2012-07-30T16:35:12.263
142,162
2,041
null
17,159
2
null
15,247
1
null
Here are some links but as with most things i have not got round to trying them yet. [http://gathadams.com/2007/08/21/add-google-maps-to-your-net-site-in-10-minutes/](http://gathadams.com/2007/08/21/add-google-maps-to-your-net-site-in-10-minutes/) [http://www.mapbuilder.net/](http://www.mapbuilder.net/) Cheers John
null
CC BY-SA 2.5
null
2008-08-19T23:02:38.650
2008-08-19T23:02:38.650
null
null
2,041
null
17,171
2
null
17,125
1
null
LINQ's operators on the Enumerable class are implemented as iterators that are created with the yield statement. It allows you to chain operations like Select() and Where() without actually enumerating anything until you actually use the enumerator in a loop, typically by using the statement. Also, since only one valu...
null
CC BY-SA 2.5
null
2008-08-19T23:10:16.543
2008-08-19T23:10:16.543
null
null
1,659
null
17,175
1
17,218
null
12
1,869
I'll take away the obvious one here: mic and webcam support. Other than that, if you ran the Silverlight team, what would your highest priority be for Silverlight v.Next? Disclaimer: If we get some good responses, I'll pass them along to folks I know on the Silverlight team. : The best place to report Silverlight fea...
What's your top feature request for Silverlight?
CC BY-SA 2.5
0
2008-08-19T23:16:20.723
2009-09-19T16:22:47.083
2009-09-19T16:22:47.083
5
5
[ ".net", "silverlight", "silverlight-3.0" ]
17,178
2
null
17,172
11
null
Use the bitwise OR operator (|) to set bits, use the AND operator (&) to check bits. Your code should look like this: ``` <?php $guest = 1; $editor = 2; $admin = 4; $user = $editor; if( $user & ($editor | $admin) ) { echo "Test"; } ?> ``` If you don't understand binary and exa...
null
CC BY-SA 2.5
null
2008-08-19T23:17:43.110
2008-11-03T18:15:12.807
null
null
813
null
17,126
2
null
17,032
1
null
One of the advantages of a tool like ReSharper is that you can write the code however you like and have it reformat to something more maintainable afterward. I have R# set to always reformat such that the actual type in use is visible, however, when writing code I nearly always type 'var'. Good tools let you have the b...
null
CC BY-SA 4.0
null
2008-08-19T22:46:10.407
2021-07-11T16:37:44.947
2021-07-11T16:37:44.947
2,667,173
887
null
17,180
2
null
17,172
1
null
(2 | 4) is evaluating to 6, but 2 == 6 is false.
null
CC BY-SA 2.5
null
2008-08-19T23:18:18.210
2008-11-03T18:15:12.807
2008-08-20T06:01:46.943
1,797
1,797
null
17,173
2
null
17,172
2
null
It's been a long time since I used PHP, but I will assume that this will work: ``` <?php $guest = 1; $editor = 2; $admin = 4; $user = $editor; if( ($user == $editor) || ($user == $admin) ) { echo "Test"; } ?> ```
null
CC BY-SA 2.5
null
2008-08-19T23:14:35.673
2008-11-03T18:15:12.807
null
null
1,542
null
17,179
2
null
17,170
1
null
In situations I usually come across, I rarely use IList directly. Usually I just use it as an argument to a method ``` void ProcessArrayData(IList almostAnyTypeOfArray) { // Do some stuff with the IList array } ``` This will allow me to do generic processing on almost any array in the .NET framework, unless i...
null
CC BY-SA 2.5
null
2008-08-19T23:17:46.133
2008-08-19T23:17:46.133
null
null
392
null
17,177
2
null
17,170
2
null
I don't think there are hard and fast rules for this type of thing, but I usually go by the guideline of using the lightest possible way until absolutely necessary. For example, let's say you have a `Person` class and a `Group` class. A `Group` instance has many people, so a List here would make sense. When I declare ...
null
CC BY-SA 2.5
null
2008-08-19T23:17:07.790
2008-08-19T23:17:07.790
null
null
736
null
17,183
2
null
17,170
5
null
If you're working within a single method (or even in a single class or assembly in some cases) and no one outside is going to see what you're doing, use the fullness of a List. But if you're interacting with outside code, like when you're returning a list from a method, then you only want to declare the interface witho...
null
CC BY-SA 2.5
null
2008-08-19T23:20:12.463
2008-08-19T23:20:12.463
null
null
1,659
null
17,185
2
null
17,170
2
null
You should use the interface only if you need it, e.g., if your list is casted to an IList implementation other than List. This is true when, for example, you use NHibernate, which casts ILists into an NHibernate bag object when retrieving data. If List is the only implementation that you will ever use for a certain c...
null
CC BY-SA 2.5
null
2008-08-19T23:20:22.027
2008-08-19T23:20:22.027
null
null
372
null
17,193
2
null
17,172
1
null
@mk: (2 | 4) evaluates to 6.
null
CC BY-SA 2.5
null
2008-08-19T23:24:22.483
2008-11-03T18:15:12.807
null
null
813
null
17,192
2
null
17,181
0
null
I don't know which particlar TDD subcommunity you're refering to but the TDD patterns I've come across either use Assert.AreEqual() for positive results or otherwise use an ExpectedException mechanism (e.g., attributes in .NET) to declare the error that should be observed.
null
CC BY-SA 2.5
null
2008-08-19T23:23:51.487
2008-08-19T23:23:51.487
null
null
1,659
null
17,187
2
null
16,891
13
null
You probably have the text-to-speech narrator enabled. [http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2467648&SiteID=1&mode=1](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2467648&SiteID=1&mode=1) > Just uncheck all checkboxes under "Text-To-Speech" narrator software.--> To open Narrator using the ...
null
CC BY-SA 3.0
null
2008-08-19T23:21:07.110
2014-02-24T06:27:49.310
2014-02-24T06:27:49.310
2,096,990
1,347
null
17,196
2
null
17,172
1
null
``` $guest = 1; $editor = 2; $admin = 4; $user = $editor; if (user == $editor || $user == $admin) { echo "Test"; } ```
null
CC BY-SA 2.5
null
2008-08-19T23:26:13.570
2008-11-03T18:15:12.807
null
null
1,467
null
17,204
2
null
17,181
1
null
There is no reason why your test package cannot catch asserts such as the one in doMoreWonderfulThings. This can be done either by having your ASSERT handler support a callback mechanism, or your test asserts contain a try/catch block.
null
CC BY-SA 2.5
null
2008-08-19T23:31:17.367
2008-08-19T23:31:17.367
null
null
1,043
null
17,202
2
null
17,125
2
null
One interesting use is as a mechanism for asynchronous programming esp for tasks that take multiple steps and require the same set of data in each step. Two examples of this would be Jeffery Richters AysncEnumerator [Part 1](http://msdn.microsoft.com/en-us/magazine/cc163323.aspx) and [Part 2](http://msdn.microsoft.com/...
null
CC BY-SA 2.5
null
2008-08-19T23:29:52.313
2008-08-19T23:39:32.197
2008-08-19T23:39:32.197
748
748
null
17,209
2
null
15,838
0
null
Realistically, setting I to be a register variable won't do anything that the compiler wouldn't do already. If you are willing to spend some time upfront preprocessing the reference array, you should google "The World's Fastest Scrabble Program" and implement that. Spoiler: it's a DAG optimized for character lookups.
null
CC BY-SA 3.0
null
2008-08-19T23:33:40.700
2012-07-03T15:00:26.167
2012-07-03T15:00:26.167
142,162
1,799
null
17,206
2
null
17,194
1
null
I could be wrong but shouldn't you be using a full outer join instead of just a left join? That way you will be getting 'empty' columns from both tables. [http://en.wikipedia.org/wiki/Join_(SQL)#Full_outer_join](http://en.wikipedia.org/wiki/Join_(SQL)#Full_outer_join)
null
CC BY-SA 2.5
null
2008-08-19T23:32:00.813
2008-08-24T23:53:36.100
2008-08-24T23:53:36.100
1
202
null
17,200
2
null
17,125
1
null
Another good use for yield is to perform a function on the elements of an IEnumerable and to return a result of a different type, for example: ``` public delegate T SomeDelegate(K obj); public IEnumerable<T> DoActionOnList(IEnumerable<K> list, SomeDelegate action) { foreach (var i in list) yield return ac...
null
CC BY-SA 2.5
null
2008-08-19T23:29:01.320
2008-08-19T23:29:01.320
null
null
372
null
17,210
2
null
17,175
4
null
Okay, fine, I'll throw another one out there: audio file support. I'd love to be able to generate WAV data on the client and immediately play it. As it is, Silverlight only plays WMV and MP3, neither of which is simple (legal?) to create without a per-client license.
null
CC BY-SA 2.5
null
2008-08-19T23:34:01.790
2008-08-19T23:34:01.790
null
null
5
null
17,213
2
null
17,175
3
null
Parity with WPF. Triggers (event triggers and data triggers too), Binding to other elements in xaml, Multi-part value converters, and DynamicResources. Commands... maybe if they got time.
null
CC BY-SA 2.5
null
2008-08-19T23:39:08.017
2008-08-19T23:59:39.700
2008-08-19T23:59:39.700
580
580
null
17,194
1
17,290
null
5
70,456
I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this: ``` Category | Revenue | Yearh | Month Bikes 10 000 2008 1 Bikes 12 000 2008 2 Bikes 12 000 2008 3 Bikes 15 000 2008 1 Bikes ...
SQL query to compare product sales by month
CC BY-SA 2.5
0
2008-08-19T23:24:47.460
2017-06-29T14:03:35.943
2014-11-25T16:38:02.997
2,641,576
1,199,387
[ "sql", "sql-server", "sql-server-2005", "reporting" ]
17,216
2
null
17,170
9
null
It's always best to use the lowest base type possible. This gives the implementer of your interface, or consumer of your method, the opportunity to use whatever they like behind the scenes. For collections you should aim to use IEnumerable where possible. This gives the most flexibility but is not always suited.
null
CC BY-SA 2.5
null
2008-08-19T23:41:13.160
2008-08-19T23:41:13.160
null
null
1,851
null
17,219
2
null
17,125
0
null
Using yield can prevent downcasting to a concrete type. This is handy to ensure that the consumer of the collection doesn't manipulate it.
null
CC BY-SA 2.5
null
2008-08-19T23:41:43.533
2008-08-19T23:41:43.533
null
null
1,894
null
17,220
2
null
17,172
0
null
In my opinion this doesn't scale well. I haven't actually tried using it on a large scale project, but a CMS sounds way to complicated to use this on.
null
CC BY-SA 2.5
null
2008-08-19T23:42:09.353
2008-11-03T18:15:12.807
null
null
1,542
null
17,218
2
null
17,175
8
null
- - - Also, since you brought up Webcam I have to plug my Silverlight 2 Webcam Support POC. It's using Flash interop and allows you to capture PNG stills from Silverlight. I guess it's more a fun example of Silverlight, JavaScript and Flash interoperability than a really useful webcam solution. But you can do fun thi...
null
CC BY-SA 2.5
null
2008-08-19T23:41:34.503
2008-08-19T23:41:34.503
null
null
1,199,387
null
17,181
1
null
null
9
1,620
In my most C++ project I heavily used ASSERTION statement as following: ``` int doWonderfulThings(const int* fantasticData) { ASSERT(fantasticData); if(!fantasticData) return -1; // ,,, return WOW_VALUE; } ``` But TDD community seems like to enjoy doing something like this: ``` int doMoreWon...
Test Cases VS ASSERTION statement
CC BY-SA 2.5
0
2008-08-19T23:19:18.377
2013-08-27T21:01:59.080
null
null
1,556
[ "c++", "tdd", "defensive-programming" ]
17,114
2
null
17,106
10
null
[XMLSpy](http://www.altova.com/xmlspy.html) does that for you, although that's not free... I believe that [Liquid Xml Studio](https://www.liquid-technologies.com/xml-studio) does it for you and is free, but I have not personally used it to create test data.
null
CC BY-SA 3.0
null
2008-08-19T22:34:44.960
2016-09-09T08:11:03.557
2016-09-09T08:11:03.557
1,942,551
1,666
null
17,225
1
17,293
null
12
35,019
In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. Normally this is useful but sometimes I want to see what is goin...
How can Perl's system() print the command that it's running?
CC BY-SA 2.5
0
2008-08-19T23:47:00.947
2020-10-06T07:09:14.747
2009-10-21T10:36:44.927
2,766,176
432
[ "perl", "system" ]
17,228
1
null
null
55
68,278
I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind. What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?
What tools do you use to develop C++ applications on Linux?
CC BY-SA 2.5
0
2008-08-19T23:49:40.287
2015-11-22T21:20:51.050
null
null
1,449
[ "c++", "linux", "eclipse", "gdb", "valgrind" ]
17,214
2
null
17,172
1
null
> Awesome, this seems like the best way to do permissions in a CMS. Yes? No? Maybe, I've never really done it that way. What I have done is used bitwise operators to store a whole bunch of "yes or no" settings in a single number in a single column in the database. I guess for permissions, this way would work good if ...
null
CC BY-SA 2.5
null
2008-08-19T23:39:48.280
2008-11-03T18:15:12.807
null
null
813
null
17,226
2
null
17,140
4
null
On UNIX, I think you basically need to fork it if you want the spawned process to run detached from your the spawing one : For instance if you don't want your spawned process to be terminate when you quit your spawning process. [Here is a](http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html) page that explains all...
null
CC BY-SA 3.0
null
2008-08-19T23:47:13.537
2016-09-12T11:04:26.243
2016-09-12T11:04:26.243
1,798,015
446,497
null
17,232
2
null
17,228
8
null
g++ and make
null
CC BY-SA 2.5
null
2008-08-19T23:51:28.580
2008-08-19T23:51:28.580
null
null
432
null
17,233
2
null
16,963
2
null
At my company we use grids everywhere, mostly ComponentArt Grid ([http://www.componentart.com/](http://www.componentart.com/)). Yeah it's bloatware but you get a lot of functionality that wouldn't be much fun to re-invent: sorting, paging, grouping, column reordering, inline editing, templating (server-side and client-...
null
CC BY-SA 2.5
null
2008-08-19T23:53:14.863
2008-08-19T23:53:14.863
null
null
2,047
null
17,231
1
17,367
null
5
4,167
I was looking at [http://tldp.org/LDP/abs/html/why-shell.html](http://tldp.org/LDP/abs/html/why-shell.html) and was struck by: > When not to use shell scripts...- Why not?
Why shouldn't I "bet the future of the company" on shell scripts?
CC BY-SA 2.5
0
2008-08-19T23:50:47.040
2019-09-28T19:43:16.040
2008-08-20T20:07:33.400
1,438
1,438
[ "bash", "shell", "ksh" ]
17,238
2
null
17,231
0
null
I would wager the author is showing they are uncomfortable with certain aspects of qualtiy wrt shell scripting. Who unit tests BASH scripts for example. Also scripts are rather heavily coupled with the underlying operating system, which could be something of a negative thing.
null
CC BY-SA 2.5
null
2008-08-19T23:58:32.543
2008-08-19T23:58:32.543
null
null
1,666
null
17,245
2
null
17,225
5
null
Use open instead. Then you can capture the output of the command. ``` open(LS,"|ls"); print LS; ```
null
CC BY-SA 2.5
null
2008-08-20T00:04:56.210
2008-08-20T06:05:47.340
2008-08-20T06:05:47.340
1,797
1,797
null
17,132
2
null
15,247
11
null
I'm assuming you have the basics for Maps in your code already with your API Key. ``` <head> <script type="text/javascript" href="http://maps.google.com/maps? file=api&v=2&key=xxxxx"> function createMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(37.44...
null
CC BY-SA 2.5
null
2008-08-19T22:50:52.487
2008-08-19T22:56:29.913
2008-08-19T22:56:29.913
1,992
1,992
null
17,249
2
null
17,228
7
null
I believe KDevelop is what would be the closest from Microsoft Visual Studio. You get pretty much everything (except unfortunately VS debugger which is indeed a killer). Its already mature and its development is pretty fast and promising. It actually implement a few stuff you won't even see in VS. For instance, open h...
null
CC BY-SA 2.5
null
2008-08-20T00:08:35.950
2008-08-20T00:08:35.950
null
null
446,497
null
17,236
2
null
16,998
3
null
Haven't tried it this with a "chunked" response but would something like this work? ``` StringBuilder sb = new StringBuilder(); Byte[] buf = new byte[8192]; Stream resStream = response.GetResponseStream(); string tmpString = null; int count = 0; do { count = resStream.Read(buf, 0, buf.Length); if(count != 0...
null
CC BY-SA 2.5
null
2008-08-19T23:54:37.670
2008-08-19T23:54:37.670
null
null
null
null
17,251
2
null
17,231
6
null
I kind of think the article points out a really good list of the reasons when not to use shell scripts - with the single mission critical bullet you point out being more of a conclusion based on all the other bullets. With that said, I think the reason you do not want to build a mission critical application on a shell...
null
CC BY-SA 2.5
null
2008-08-20T00:17:20.890
2008-08-20T00:17:20.890
null
null
1,553
null
17,263
2
null
17,231
5
null
Obviously, this is a bit of a straw man for me to knock down. I really am interested in why people believe shell scripts should be avoided in "mission-critical applications", but I can't think of a compelling reason. For instance, I've seen (and written) some ksh scripts that interact with an Oracle database using SQ...
null
CC BY-SA 2.5
null
2008-08-20T00:33:25.547
2008-08-20T00:33:25.547
null
null
1,438
null
17,269
1
17,284
null
-1
159
Browse to a webpage with hyperlinks using IE (I am using IE7) Once on the page, enlarge the fonts using ctl + mouse wheel. Now when you try to hover over the hyperlinks, they are laterally displaced to the right. To click on the link, i have to move the mouse to the right till the cursor turns into a hand. Anyone ha...
Hyperlinks displaced on IE7
CC BY-SA 3.0
null
2008-08-20T00:54:15.187
2013-02-13T01:37:16.697
2013-02-13T01:37:16.697
1,288
1,647
[ "browser" ]
17,229
2
null
17,181
4
null
In my (limited) experience the first option is quite a bit safer. In a test-case you only test predefined input and compare the outcome, this works well as long as every possible edge-case has been checked. The first option just checks every input and thus tests the 'live' values, it filters out bugs real quickly, howe...
null
CC BY-SA 2.5
null
2008-08-19T23:49:54.450
2008-08-20T00:30:52.497
2008-08-20T00:30:52.497
1,830
1,830
null
17,274
1
null
null
5
1,433
Although I've done programming, I'm not a programmer. I've recently agreed to coordinate getting a Website up for a club. The resources are--me, who has done Web content maintenance (putting content into HTML and ColdFusion templates via a gatekeeper to the site itself; doing simple HTML and XML coding); a serious Web ...
REALLY Simple Website--How Basic Can You Go?
CC BY-SA 3.0
null
2008-08-20T01:02:55.523
2017-07-10T20:30:04.563
2017-07-10T20:30:04.563
7,750,640
1,110
[ "html" ]
17,275
2
null
17,274
0
null
1. It's fine 2. Rails (or purchase / use a CMS) 3. Not unless you start becoming crazy-popular 4. It really depends on what you go with for 2. Rails has a plethora of tutorials on the net and any product you go with will have its own community etc. To be perfectly honest though, if the dynamic part is someone elses...
null
CC BY-SA 2.5
null
2008-08-20T01:04:45.223
2008-08-20T01:04:45.223
null
null
1,666
null
17,276
2
null
17,274
1
null
There's no reason to not go with plain old HTML and JPGs if you don't know any server side scripting languages. Also, once you want to get more advanced, most cheap hosting services have tools that can be installed with one click, and provide things like blogs, photo galleries, bulletin boards (PHPBB), and even content...
null
CC BY-SA 2.5
null
2008-08-20T01:07:47.570
2008-08-20T01:07:47.570
null
null
1,862
null
17,260
2
null
17,231
6
null
Scripts are nothing more or less than computer programs. Some would argue that scripts are less sophisticated. These same folks will usually admit that you can write sophisticated code in scripting languages, but that these scripts are really not scripts any more, but full-fledged programs, by definition. Whatever. ...
null
CC BY-SA 2.5
null
2008-08-20T00:29:22.360
2008-08-20T00:37:34.587
2008-08-20T00:37:34.587
958
958
null
17,277
2
null
17,194
1
null
About the markdown - Yeah that is frustrating. The editor did preview my HTML table, but after posting it was gone - So had to remove all HTML formatting from the post... @kcrumley I think we've reached similar conclusions. This query easily gets real ugly. I actually solved this before reading your answer, using a ...
null
CC BY-SA 2.5
null
2008-08-20T01:09:30.110
2008-08-20T01:09:30.110
null
null
1,199,387
null
17,284
2
null
17,269
1
null
IE7 doesn't handle Zoom correctly, You can see this error on this page (I mean the page you're reading right now) if you zoom large enough, view the logout | about link at the top, hover over it, hover off to the right, back over.
null
CC BY-SA 2.5
null
2008-08-20T01:19:13.987
2008-08-20T01:29:28.970
2008-08-20T01:29:28.970
null
null
null
17,285
2
null
16,963
51
null
Anyone that thinks nobody uses *Grid controls has clearly never worked on an internal corporate webapp.
null
CC BY-SA 2.5
null
2008-08-20T01:19:21.100
2008-08-20T01:19:21.100
null
null
35
null
17,256
2
null
17,228
24
null
g++ of course, but also [Code::Blocks](http://www.codeblocks.org/) which is an absolutely fantastic cross platform IDE (Win32, *nix, Mac). I use the nightly (more like weekly lately) builds from the SVN. It has almost all the bells and whistles you would expect from a modern IDE. It's really a truly fantastic Open Sou...
null
CC BY-SA 2.5
null
2008-08-20T00:25:06.317
2009-12-23T21:47:20.250
2009-12-23T21:47:20.250
209,605
1,366
null
17,265
2
null
17,194
4
null
@Christian -- markdown editor -- UGH; especially when the preview and the final version of your post disagree... @Christian -- full outer join -- the full outer join is overruled by the fact that there are references to SP1 in the WHERE clause, and the WHERE clause is applied after the JOIN. To do a full outer join wi...
null
CC BY-SA 2.5
null
2008-08-20T00:39:00.743
2008-08-20T00:39:00.743
null
null
1,818
null
17,283
2
null
16,963
15
null
I've been reading your posts guys and it made me feel dumb. I mean in every application I made where I work there is at least one datagrid/gridview in it. And I didn't have the feeling I am missing something. Sure I find datagrid/gridview kinda bloated but are they that much to use?
null
CC BY-SA 2.5
null
2008-08-20T01:18:04.927
2009-03-07T03:30:24.920
2009-03-07T03:30:24.920
1,291
1,291
null
17,172
1
17,178
null
8
1,247
I've tried to do this several times with no luck. After reading [this post](https://stackoverflow.com/questions/1451/what-is-the-best-way-to-handle-multiple-permission-types#1477), it made me interested in doing this again. So can anyone tell me why the following doesn't work? ``` <?php $guest = 1; $editor = 2; $ad...
Implementing permissions in PHP
CC BY-SA 3.0
0
2008-08-19T23:11:49.613
2015-06-04T10:25:28.367
2017-05-23T12:32:15.637
-1
40
[ "php", "permissions" ]
17,280
2
null
17,269
0
null
All of the links on that page are displaced to the right on my copy of IE7 (7.0.6001.18000) even before I enlarge or shrink the fonts. Whereas other pages act normally. (My test page was [http://www.frito-lay.com/fl/flstore/cgi-bin/good_questions.htm](http://www.frito-lay.com/fl/flstore/cgi-bin/good_questions.htm)). ...
null
CC BY-SA 2.5
null
2008-08-20T01:11:52.740
2008-08-20T01:11:52.740
null
null
1,954
null
17,289
1
17,323
null
8
4,994
I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using iframes so that you incur the load time only once? Is there a CSS alternative to the iframe? Feel free to [preview the site](http://csm.dev11.com). It is very much a work in progress. ­­­­­­­­­­­­­...
iFrame Best Practices
CC BY-SA 3.0
0
2008-08-20T01:28:00.907
2017-07-10T20:49:49.357
2017-07-10T20:49:49.357
7,750,640
2,056
[ "html", "css", "iframe" ]
17,250
1
null
null
44
47,507
I am creating an ZIP file with `ZipFile` in Python 2.5, it works OK so far: ``` import zipfile, os locfile = "test.txt" loczip = os.path.splitext (locfile)[0] + ".zip" zip = zipfile.ZipFile (loczip, "w") zip.write (locfile) zip.close() ``` But I couldn't find how to encrypt the files in the ZIP file. I could use syst...
How to create an encrypted ZIP file?
CC BY-SA 4.0
0
2008-08-20T00:16:40.330
2022-06-24T13:40:39.437
2021-10-06T18:00:39.490
355,230
394
[ "python", "zip", "python-zipfile" ]
17,298
2
null
17,289
0
null
Well, the browser appears to cache all seven banner images upon the first load, and runs them out from the cache (for each subsequent page) thereafter. I don't think you have a problem :D Try it out with Firebug's Net monitoring tool in Firefox.
null
CC BY-SA 2.5
null
2008-08-20T01:43:20.917
2008-08-20T01:43:20.917
null
null
1,951
null
17,292
2
null
17,274
12
null
If you don't require any dynamic content, heck, if you don't plan on editing the content more than once a week, I'd say stick to basic HTML. Later, you'd probably want a basic, no-fuss and easily installable CMS. The brand really depends on the platform (most likely PHP/Rails/ASP), but most of them can be found by typ...
null
CC BY-SA 2.5
null
2008-08-20T01:28:58.317
2008-08-20T01:28:58.317
null
null
1,536
null
17,297
2
null
17,289
0
null
I find the main challenge with iFrame headers is resizing. Since the font in your header is of static size, I don't see a problem with using an iFrame. Although I'm not sure if it's really intensive enough to be worth it.
null
CC BY-SA 2.5
null
2008-08-20T01:43:01.310
2008-08-20T01:43:01.310
null
null
1,533
null
17,287
2
null
17,250
-1
null
You can use the [Chilkat](http://www.chilkatsoft.com/python.asp) library. It's commercial, but has a free evaluation and seems pretty nice. Here's an example I got from [here](http://www.example-code.com/python/zip.asp): ``` import chilkat # Demonstrates how to create a WinZip-compatible 128-bit AES strong encrypte...
null
CC BY-SA 3.0
null
2008-08-20T01:20:48.180
2013-05-01T00:57:03.933
2013-05-01T00:57:03.933
416,224
1,057
null
17,293
2
null
17,225
10
null
As I understand, system() will print the result of the command, but not assign it. Eg. ``` [daniel@tux /]$ perl -e '$ls = system("ls"); print "Result: $ls\n"' bin dev home lost+found misc net proc sbin srv System tools var boot etc lib media mnt opt root selinux sys tmp usr Result: 0 ...
null
CC BY-SA 4.0
null
2008-08-20T01:30:36.597
2020-10-06T07:09:14.747
2020-10-06T07:09:14.747
1,564,946
1,848
null
17,301
2
null
17,228
0
null
[Anjuta](http://anjuta.sourceforge.net/) is a nice idea that makes Linux C++ dev quite enjoyable as well.
null
CC BY-SA 2.5
null
2008-08-20T01:45:12.303
2008-08-20T01:45:12.303
null
null
611
null
17,300
2
null
16,067
6
null
The best way to plan for an eventual transition to compiled code is to write the performance sensitive portions as a module of simple functions in a [functional style](https://en.wikipedia.org/wiki/Functional_programming) (stateless and without side effects), which accept and return basic data types. This will provide ...
null
CC BY-SA 4.0
null
2008-08-20T01:45:05.390
2022-12-03T19:08:05.833
2022-12-03T19:08:05.833
4,751,173
99
null
17,295
2
null
17,170
202
null
There are two rules I follow: - - So when writing a function or method that takes a collection, write it not to take a List, but an IList<T>, an ICollection<T>, or IEnumerable<T>. The generic interfaces will still work even for heterogenous lists because System.Object can be a T too. Doing this will save you heada...
null
CC BY-SA 2.5
null
2008-08-20T01:33:16.293
2008-08-20T01:58:57.137
2008-08-20T01:58:57.137
1,954
1,954
null