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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,929 | 2 | null | 31,693 | 362 | null | I'll add my voice to the noise and take a stab at making things clear:
## C# Generics allow you to declare something like this.
```
List<Person> foo = new List<Person>();
```
and then the compiler will prevent you from putting things that aren't `Person` into the list.
Behind the scenes the C# compiler is just putt... | null | CC BY-SA 3.0 | null | 2008-08-28T09:50:26.127 | 2013-09-26T03:22:11.110 | 2020-06-20T09:12:55.060 | -1 | 234 | null |
31,949 | 2 | null | 31,885 | 9 | null | Here is instructions on how to connect to your MySQL database from Visual Studio:
> To make the connection in server
explorer you need to do the following:- first of all you need to install the MyODBC connector 3.51 (or latest) on
the development machine (NB. you can
find this at
[http://www.mysql.com/products... | null | CC BY-SA 2.5 | null | 2008-08-28T10:03:04.630 | 2008-08-28T10:03:04.630 | null | null | 2,257 | null |
31,953 | 2 | null | 31,913 | 1 | null | I've used [this](http://www.objectmentor.com/resources/articles/acv.pdf) ("acyclic visitor") to good effect; it makes adding new classes to the hierarchy possible without changing existing ones, to some extent.
| null | CC BY-SA 2.5 | null | 2008-08-28T10:06:48.740 | 2008-08-28T10:06:48.740 | null | null | 2,131 | null |
31,960 | 2 | null | 31,924 | 11 | null | Some tips:
Understand the JSF request [lifecycle](http://www.java-samples.com/showtutorial.php?tutorialid=470) and where your various pieces of code fit in it. Especially find out why your model values will not be updated if there are validation errors.
Choose a tag library and then stick with it. Take your time to de... | null | CC BY-SA 2.5 | null | 2008-08-28T10:10:08.560 | 2008-08-28T10:10:08.560 | null | null | 2,087 | null |
31,961 | 2 | null | 29,426 | 3 | null | [Visual Editor](http://www.eclipse.org/vep/WebContent/main.php) is a good choice.
It generates clean code, with no "layout" files beside of your sourcen using a simple but convenient pattern. It's very easy to patch the generated code and directly see the result.
There are some stability problems (some times, the pre... | null | CC BY-SA 2.5 | null | 2008-08-28T10:11:18.773 | 2008-08-28T10:11:18.773 | null | null | 2,965 | null |
31,950 | 2 | null | 25,661 | 1 | null | PyGame works much better when it can manage its own window, or even better, use the whole screen. GTK has flexible enough widgets to allow creation of a drawing area.
[This page](http://faq.pygtk.org/index.py?req=show&file=faq23.042.htp) may help, though, if you want to try it.
| null | CC BY-SA 2.5 | null | 2008-08-28T10:04:23.190 | 2008-08-28T10:04:23.190 | null | null | 2,774 | null |
31,980 | 2 | null | 31,935 | 2 | null | Have a look at [ScriptManager.RegisterStartupScript](http://msdn.microsoft.com/en-us/library/bb310408.aspx)
The idea is that you register a script to run on start up (I believe once the page has loaded). Your script should call a function that causes a post back through your UpdatePanel
| null | CC BY-SA 2.5 | null | 2008-08-28T10:23:33.677 | 2008-08-28T10:23:33.677 | null | null | 2,839 | null |
31,976 | 2 | null | 2,786 | 3 | null | Eclipse plugin for Mono is dead. On Linux use [MonoDevelop](http://www.monodevelop.com/Main_Page) or [X-Develop](http://www.omnicore.com/en/xdevelop.htm) if you like good commercial support (although MonoDevelop is closing on them fast feature-wise). On Windows [SharpDevelop](http://sharpdevelop.net/OpenSource/SD/) has... | null | CC BY-SA 2.5 | null | 2008-08-28T10:19:00.317 | 2008-08-28T10:19:00.317 | null | null | 3,205 | null |
31,942 | 2 | null | 13,109 | 40 | null | The technical answer is that the of the PHP language only allows subscript notation on the end of and not in general, which is how it works in most other languages. I've always viewed it as a deficiency in the language, because it is possible to have a grammar that resolves subscripts against any expression unambigu... | null | CC BY-SA 3.0 | null | 2008-08-28T09:58:36.653 | 2012-05-21T17:32:41.283 | 2012-05-21T17:32:41.283 | 2,774 | 2,774 | null |
31,983 | 2 | null | 31,882 | 2 | null | I posted a question which might help you as it discusses some of the issues:
[should-i-be-worried-about-obfuscating-my-net-code](https://stackoverflow.com/questions/12075/should-i-be-worried-about-obfuscating-my-net-code)
| null | CC BY-SA 2.5 | null | 2008-08-28T10:26:47.693 | 2010-06-23T09:07:27.927 | 2017-05-23T12:17:05.463 | -1 | 1,078 | null |
31,964 | 2 | null | 28,369 | 0 | null | Daniel,
[Jinja](http://jinja.pocoo.org/2/documentation/intro) implements a sandboxe environment that may or may not be useful to you. From what I remember, it doesn't yet "comprehend" list comprehensions.
[Sanbox info](http://jinja.pocoo.org/2/documentation/sandbox)
| null | CC BY-SA 2.5 | null | 2008-08-28T10:12:03.873 | 2008-08-28T10:12:03.873 | null | null | 2,774 | null |
31,984 | 2 | null | 31,919 | 4 | null | Yes private assemblies reset of the IIS. So you should just to new version to the application's Bin directory and refresh the page (e.g. by VS post build event as I did).
But there are some trade offs. You should decrease trust level in application web.config file:
```
<system.web>
...
<trust level="WSS_Med... | null | CC BY-SA 3.0 | null | 2008-08-28T10:27:21.170 | 2011-05-25T20:17:05.153 | 2011-05-25T20:17:05.153 | 2,313 | 2,313 | null |
31,986 | 2 | null | 31,885 | 4 | null | I found this during my research on Sqlite. I haven't had the chance to use it though. Let us know if this works for you.
[http://sqlite.phxsoftware.com/](http://sqlite.phxsoftware.com/)
> System.Data.SQLite is the original
SQLite database engine and a complete
ADO.NET 2.0 provider all rolled into a
single mixed mode... | null | CC BY-SA 2.5 | null | 2008-08-28T10:28:17.937 | 2008-08-28T10:28:17.937 | 2020-06-20T09:12:55.060 | -1 | 120 | null |
31,951 | 2 | null | 6,512 | 7 | null | The traditional way is to use `setjmp` and `longjmp`, though there are caveats.
Here's a [reasonably good explanation](https://web.archive.org/web/20090206042150/http://homepage.mac.com/sigfpe/Computing/continuations.html)
| null | CC BY-SA 3.0 | null | 2008-08-28T10:05:19.227 | 2016-01-31T14:08:37.140 | 2016-01-31T14:08:37.140 | 849,891 | 2,900 | null |
32,000 | 1 | 32,005 | null | 10 | 15,739 | I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace.
I'm using `SqlConnection` for my db link, I've already had success executing some reads, and I want to know the simplest way to insert data. I'm finding what seem to be pretty verbose me... | C# - SQLClient - Simplest INSERT | CC BY-SA 3.0 | 0 | 2008-08-28T10:37:39.367 | 2016-10-18T14:39:21.247 | 2013-06-25T20:08:13.677 | 426,671 | 1,344 | [
"c#",
"sql",
"sql-server",
"tsql"
] |
31,999 | 2 | null | 31,913 | 0 | null | For completeness's sake:
it's of course completely possible to write an own implementation of a multimethod pointer table for your objects and calculate the method addresses manually at run time. There's a [paper](http://www.research.att.com/~bs/multimethods.pdf) by Stroustrup on the topic of implementing multimethods... | null | CC BY-SA 2.5 | null | 2008-08-28T10:36:55.127 | 2008-08-28T10:36:55.127 | null | null | 1,968 | null |
32,005 | 2 | null | 32,000 | 19 | null | ```
using (var conn = new SqlConnection(yourConnectionString))
{
var cmd = new SqlCommand("insert into Foo values (@bar)", conn);
cmd.Parameters.AddWithValue("@bar", 17);
conn.Open();
cmd.ExecuteNonQuery();
}
```
| null | CC BY-SA 2.5 | null | 2008-08-28T10:48:25.767 | 2008-08-28T10:48:25.767 | null | null | 615 | null |
32,001 | 1 | 32,057 | null | 40 | 47,150 | I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal.
If, however, before X seconds has elapsed, I decide that the event should occur after Y ... | Resettable Java Timer | CC BY-SA 2.5 | 0 | 2008-08-28T10:38:03.687 | 2018-07-20T16:33:21.770 | 2008-08-28T11:24:17.337 | 142 | 142 | [
"java",
"timer"
] |
32,003 | 1 | 32,019 | null | 12 | 6,527 | Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like:
```
C:\> go home
D:\profiles\user\home\> go svn-project1
D:\projects\project1\svn\branch\src\>
```
I'm currently using a bunch of batch files, but editing ... | Tool for commandline "bookmarks" on windows? | CC BY-SA 3.0 | 0 | 2008-08-28T10:47:38.063 | 2017-05-04T12:34:49.463 | 2011-07-08T02:08:46.237 | 50,049 | 1,462 | [
"command-line"
] |
32,006 | 2 | null | 32,000 | 1 | null | ```
using (SqlConnection myConnection new SqlConnection("Your connection string"))
{
SqlCommand myCommand = new SqlCommand("INSERT INTO ... VALUES ...", myConnection);
myConnection.Open();
myCommand.ExecuteNonQuery();
}
```
| null | CC BY-SA 2.5 | null | 2008-08-28T10:50:37.027 | 2008-08-28T10:55:39.963 | 2008-08-28T10:55:39.963 | 1,196 | 1,196 | null |
32,007 | 2 | null | 32,003 | 3 | null | With PowerShell you could add the folders as variables in your profile.ps1 file, like:
```
$vids="C:\Users\mabster\Videos"
```
Then, like Unix, you can just refer to the variables in your commands:
```
cd $vids
```
Having a list of variable assignments in the one ps1 file is probably easier than maintaining separ... | null | CC BY-SA 2.5 | null | 2008-08-28T10:53:53.867 | 2008-08-28T10:53:53.867 | null | null | 615 | null |
32,008 | 2 | null | 32,001 | 1 | null | Do you need to schedule a recurring task? In that case I recommend you consider using [Quartz](http://opensymphony.com/quartz/).
| null | CC BY-SA 2.5 | null | 2008-08-28T10:54:30.247 | 2008-08-28T10:54:30.247 | null | null | 1,969 | null |
32,012 | 2 | null | 32,003 | 1 | null | Without Powershell you can do it like this:
```
C:\>set DOOMED=c:\windows
C:\>cd %DOOMED%
C:\WINDOWS>
```
| null | CC BY-SA 2.5 | null | 2008-08-28T10:57:01.753 | 2008-08-28T10:57:01.753 | null | null | 2,257 | null |
31,910 | 2 | null | 48 | 151 | null | I'm just doing the trick of `float`ing the buttons to the right.
This way the `Prev` button is left of the `Next` button, but the `Next` comes first in the HTML structure:
```
.f {
float: right;
}
.clr {
clear: both;
}
```
```
<form action="action" method="get">
<input type="text" name="abc">
<div id="buttons">... | null | CC BY-SA 4.0 | null | 2008-08-28T09:34:40.143 | 2021-09-18T20:14:07.203 | 2021-09-18T20:14:07.203 | 63,550 | 3,063 | null |
32,011 | 2 | null | 30,833 | 1 | null | @Jas, it's a special feature in Visual Studio. The procedure is outlined in [this blog entry, called "Sharing a Strong Name Key File Across Projects"](http://blogs.msdn.com/shawnfa/archive/2006/04/24/582278.aspx). The example is for sharing strong name key files, but will work for any kind of file.
Briefly, you right... | null | CC BY-SA 2.5 | null | 2008-08-28T10:56:44.860 | 2008-08-28T10:56:44.860 | null | null | 1,199 | null |
32,010 | 1 | 32,021 | null | 15 | 3,440 | [Source](http://twitter.com/codinghorror/statuses/901272685)
> RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable)
Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I ... | Is regex case insensitivity slower? | CC BY-SA 3.0 | 0 | 2008-08-28T10:55:17.950 | 2017-09-20T21:16:47.493 | 2017-09-20T21:16:47.493 | 6,053,654 | 1,384,652 | [
"regex",
"language-agnostic"
] |
32,015 | 2 | null | 31,840 | 45 | null | I recommend that you use the [Simple Logging Facade for Java](http://slf4j.org) (SLF4J). It supports different providers that include Log4J and can be used as a replacement for Apache Commons Logging.
| null | CC BY-SA 2.5 | null | 2008-08-28T10:58:36.993 | 2008-08-28T10:58:36.993 | null | null | 1,969 | null |
32,016 | 2 | null | 31,708 | 9 | null | I tend to prefer using the new Linq syntax:
```
myListView.DataSource = (
from rec in GetAllRecords().Values
where rec.Name == "foo"
select rec ).ToList();
myListView.DataBind();
```
Why are you getting a dictionary when you don't use the key? You're paying for that overhead.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:22:22.177 | 2008-08-28T11:22:22.177 | null | null | 905 | null |
32,014 | 2 | null | 32,003 | 0 | null | Environment variables?
```
set home=D:\profiles\user\home
set svn-project1=D:\projects\project1\svn\branch\src
cd %home%
```
On Unix I use this along with popd/pushd/cd - all the time.
| null | CC BY-SA 2.5 | null | 2008-08-28T10:58:30.363 | 2008-08-28T10:58:30.363 | null | null | 2,998 | null |
32,020 | 1 | 32,032 | null | 14 | 12,312 | I have been working on a web services related project for about the last year. Our team found [soapUI](http://www.soapui.org) near the start of our project and we have been (*) satisfied with it (the free version, that is).
My question is: are there other tools/clients/frameworks that you have used/currently use for ... | Is soapUI the best web services testing tool/client/framework? | CC BY-SA 2.5 | 0 | 2008-08-28T11:23:44.327 | 2013-09-05T17:32:19.237 | 2008-08-29T15:04:55.477 | 1,417 | 1,417 | [
"web-services",
"testing"
] |
32,017 | 2 | null | 28,196 | 0 | null | Thanks @Eric it works! Just a few code corrections for future reference:
- -
```
wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship
tr2
```
should be
```
wp_terms t3, wp_term_taxonomy tt3, wp_term_relationship
tr3
```
| null | CC BY-SA 2.5 | null | 2008-08-28T11:22:40.257 | 2008-08-28T11:22:40.257 | null | null | 1,011 | null |
31,991 | 2 | null | 30,972 | 1 | null | I'm pretty sure Windows has an API that developers can use to create new kinds of text input systems. I gather there are a wide variety of text input systems in use in non-Roman-derived markets, many of which are provided by third parties.
It's unclear if that's what you were really asking about, though, because you ... | null | CC BY-SA 2.5 | null | 2008-08-28T10:30:33.423 | 2008-08-28T10:30:33.423 | null | null | 714 | null |
32,026 | 2 | null | 32,003 | 4 | null | With just a Batch file, try this... (save as filename "go.bat")
```
@echo off
set BookMarkFolder=c:\data\cline\bookmarks\
if exist %BookMarkFolder%%1.lnk start %BookMarkFolder%%1.lnk
if exist %BookMarkFolder%%1.bat start %BookMarkFolder%%1.bat
if exist %BookMarkFolder%%1.vbs start %BookMarkFolder%%1.vbs
if exist %Book... | null | CC BY-SA 2.5 | null | 2008-08-28T11:34:45.687 | 2008-08-28T11:34:45.687 | null | null | 1,726 | null |
31,930 | 1 | 32,063 | null | 2 | 6,932 | I've developed my own delivery extension for Reporting Services 2005, to integrate this with our SaaS marketing solution.
It takes the subscription, and takes a snapshot of the report with a custom set of parameters. It then renders the report, sends an e-mail with a link and the report attached as XLS.
Everything wo... | Sending e-mail from a Custom SQL Server Reporting Services Delivery Extension | CC BY-SA 2.5 | 0 | 2008-08-28T09:50:48.183 | 2013-06-21T17:50:46.313 | null | null | 2,972 | [
"c#",
"reporting-services"
] |
32,002 | 2 | null | 29,822 | 1 | null | Is it a large system with many programmers? If so it might be worth checking that nowhere in the code is the logger having its config changed programatically.
In log4j, this can be done using the `LogManager` or `BasicConfigurator` classes. Also via the `PropertyConfigurator` and `DomConfigurator`. Just one rogue line... | null | CC BY-SA 2.5 | null | 2008-08-28T10:38:21.563 | 2008-08-28T10:52:12.547 | 2008-08-28T10:52:12.547 | 1,820 | 1,820 | null |
32,032 | 2 | null | 32,020 | 9 | null | I use soapUI, and it's generally pretty good. Be aware that it seems to leak memory, and eventually it will no longer save your project, so save regularly!
This is about the only hassle I have with it (other than the general ugliness that almost every Java application has!), and I can't live without it.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:36:36.370 | 2008-08-28T11:36:36.370 | null | null | 188 | null |
32,027 | 1 | 32,317 | null | 6 | 1,664 | I'm new to NAnt but have some experience with Ant and CruiseControl.
What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy is outlined by J.P Boodhoo [here.](http://blog.jpboodhoo.com/NAntStarterSeries.aspx)
So far... | NAnt and dual platform build - best way to build on Windows AND Mono/Linux | CC BY-SA 2.5 | 0 | 2008-08-28T11:35:12.473 | 2016-01-14T05:45:42.940 | null | null | 3,024 | [
".net",
"linux",
"build-process",
"mono",
"nant"
] |
32,036 | 2 | null | 32,034 | 26 | null | Yes, it is. The observer pattern is also called the publish/subscribe pattern, which is exactly what events allow you to do.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:38:45.850 | 2008-08-28T11:38:45.850 | null | null | 2,928 | null |
32,040 | 2 | null | 32,034 | 4 | null | That's right, events are an implementation of the observer pattern. I have read discussions , though, of people who still write their own, to give them either more flexibility, or maybe just to avoid the event-raising syntax.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:39:48.670 | 2008-08-28T11:39:48.670 | null | null | 3,381 | null |
32,028 | 2 | null | 28,369 | 3 | null | Depends on your definition of safe I suppose. A lot of the security depends on what you pass in and what you are allowed to pass in the context. For instance, if a file is passed in, I can open arbitrary files:
```
>>> names['f'] = open('foo', 'w+')
>>> safe_eval.safe_eval("baz = type(f)('baz', 'w+')", names)
>>> name... | null | CC BY-SA 3.0 | null | 2008-08-28T11:35:19.353 | 2012-11-03T18:04:37.997 | 2012-11-03T18:04:37.997 | 707,111 | 2,603 | null |
32,041 | 1 | 32,122 | null | 16 | 14,954 | Is it possible for the compiler to remove statements used for debugging purposes (such as logging) from production code? The debug statements would need to be marked somehow, maybe using annotations.
It's easy to set a property (debug = true) and check it at each debug statement, but this can reduce performance. It wo... | How to remove debug statements from production code in Java | CC BY-SA 2.5 | 0 | 2008-08-28T11:40:58.420 | 2014-05-08T12:44:30.607 | 2008-08-28T12:34:18.087 | 1,772 | 1,772 | [
"java",
"debugging",
"compiler-construction"
] |
32,021 | 2 | null | 32,010 | 21 | null | Yes, [A-Za-z] will be much faster than setting the `RegexOptions.IgnoreCase`, largely because of Unicode strings. But it's also much more limiting -- [A-Za-z] does match accented international characters, it's literally the A-Za-z ASCII set and nothing more.
I don't know if you saw Tim Bray's answer to my message, but... | null | CC BY-SA 2.5 | null | 2008-08-28T11:23:59.427 | 2008-08-28T11:23:59.427 | 2020-06-20T09:12:55.060 | -1 | 1 | null |
32,034 | 1 | 32,036 | null | 33 | 13,903 | After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the .NET Framework?
| In C#, isn't the observer pattern already implemented using Events? | CC BY-SA 2.5 | 0 | 2008-08-28T11:36:52.297 | 2016-02-24T10:50:19.637 | 2016-02-24T10:50:19.637 | 4,454,567 | 2,993 | [
"c#",
".net",
"design-patterns"
] |
32,043 | 2 | null | 11,500 | 1 | null | You could start looking at caching strategies. Static files like CSS (even compressed ones) and images (even optimized ones) should only need to be downloaded once by the browser for a period of time.
Scirpt combining for AJAX has already been mentioned, but I didn't notice reference to the ScriptReferenceProfiler MS... | null | CC BY-SA 2.5 | null | 2008-08-28T11:43:02.253 | 2008-08-28T11:43:02.253 | null | null | 2,756 | null |
32,044 | 1 | 32,125 | null | 74 | 38,289 | I have a tree structure in memory that I would like to render in HTML using a Django template.
```
class Node():
name = "node name"
children = []
```
There will be some object `root` that is a `Node`, and `children` is a list of `Node`s. `root` will be passed in the content of the template.
I have found [this]... | How can I render a tree structure (recursive) using a django template? | CC BY-SA 2.5 | 0 | 2008-08-28T11:43:10.287 | 2019-11-06T09:41:23.303 | null | null | 3,154 | [
"python",
"django"
] |
32,042 | 2 | null | 20,533 | 0 | null | I have installed both Smultron and Textwrangler, but find myself using Smultron most of the time.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:41:13.130 | 2008-08-28T11:41:13.130 | null | null | 719 | null |
32,049 | 2 | null | 31,935 | 0 | null | The ScriptManager.RegisterStartupScript allows a script to run on startup inside of an update panel. if you use the old ClientScript.RegisterStartupScript then the script you render will be outside the bounds of the udpate panel, and thus won't be executed during async page loads.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:47:41.350 | 2008-08-28T11:47:41.350 | null | null | 3,381 | null |
32,047 | 2 | null | 32,001 | 1 | null | I don't think it's possible to do it with `Timer/TimerTask`, but depending on what exactly you want to achieve you might be happy with using `java.util.concurrent.ScheduledThreadPoolExecutor`.
| null | CC BY-SA 2.5 | null | 2008-08-28T11:47:18.623 | 2008-08-28T11:47:18.623 | null | null | 2,844 | null |
32,035 | 2 | null | 32,003 | 2 | null | Another alternative approach you may want to consider could be to have a folder that contains symlinks to each of your projects or frequently-used directories. So you can do something like
Symlinks can be made on a NTFS disk using the [Junction](http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) tool
| null | CC BY-SA 2.5 | null | 2008-08-28T11:38:29.923 | 2008-08-28T11:38:29.923 | null | null | 1,820 | null |
32,061 | 2 | null | 17,333 | 3 | null | General-purpose comparison of floating-point numbers is generally meaningless. How to compare really depends on a problem at hand. In many problems, numbers are sufficiently discretized to allow comparing them within a given tolerance. Unfortunately, there are just as many problems, where such trick doesn't really work... | null | CC BY-SA 2.5 | null | 2008-08-28T11:55:52.627 | 2008-08-28T11:55:52.627 | null | null | null | null |
32,062 | 2 | null | 31,867 | 13 | null | People here seem to mistake Protected class inheritance and Protected methods.
FWIW, I've never seen anyone use protected class inheritance, and if I remember correctly I think Stroustrup even considered the "protected" level to be a mistake in c++. There's precious little you cannot do if you remove that protection l... | null | CC BY-SA 2.5 | null | 2008-08-28T11:57:18.053 | 2008-11-11T08:55:57.863 | 2008-11-11T08:55:57.863 | 2,973 | 2,973 | null |
32,046 | 2 | null | 32,041 | 0 | null | Use [Java Preprocessor](http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=63500)? (google foo low but this is a link to the old Joel forums discussing it)
| null | CC BY-SA 2.5 | null | 2008-08-28T11:46:19.123 | 2008-08-28T11:46:19.123 | null | null | 269 | null |
32,019 | 2 | null | 32,003 | 25 | null | What you are looking for is called DOSKEY
You can use the doskey command to create macros in the command interpreter. For example:
```
doskey mcd=mkdir "$*"$Tpushd "$*"
```
creates a new command "mcd" that creates a new directory and then changes to that directory (I prefer "pushd" to "cd" in this case because it... | null | CC BY-SA 2.5 | null | 2008-08-28T11:23:38.290 | 2008-08-28T11:23:38.290 | null | null | 1,948 | null |
32,057 | 2 | null | 32,001 | 50 | null | According to the [Timer](http://java.sun.com/javase/6/docs/api/java/util/Timer.html) documentation, in Java 1.5 onwards, you should prefer the [ScheduledThreadPoolExecutor](http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html) instead. (You may like to create this executor using [... | null | CC BY-SA 2.5 | null | 2008-08-28T11:52:00.717 | 2008-08-29T22:24:14.327 | 2008-08-29T22:24:14.327 | 13 | 13 | null |
32,070 | 2 | null | 32,059 | 2 | null | This might work:
```
select page.content, count(page-tag.tag-id) as tagcount
from page inner join page-tag on page-tag.page-id = page.id
group by page.content
having page-tag.tag-id in (1, 3, 8)
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:24:09.877 | 2008-08-28T13:01:34.357 | 2008-08-28T13:01:34.357 | 2,260 | 2,260 | null |
32,065 | 2 | null | 32,010 | 1 | null | If you can tolerate having numbers and underscores in that regex, you can e.g. use the \w modifier (Perl syntax). I believe some engines support [:alpha:], but that is not pure Perl. \w takes into account the locale you are in, and matches both uppercase and lowercase, and I bet it is faster than using [A-Z] while igno... | null | CC BY-SA 2.5 | null | 2008-08-28T11:59:31.713 | 2008-08-28T11:59:31.713 | null | null | 1,606 | null |
32,069 | 2 | null | 31,935 | 0 | null | Using Tom's approach with the startup script, you can then call:
> __doPostBack('UpdatePanelName', '');
| null | CC BY-SA 2.5 | null | 2008-08-28T12:24:09.517 | 2008-08-28T12:24:09.517 | null | null | 2,758 | null |
32,063 | 2 | null | 31,930 | 0 | null | What's at:
```
at MyDeliveryExtension.MailDelivery.SendMail(SubscriptionData data, Stream reportStream, String reportName, String smptServerHostname, Int32 smtpServerPort)
in C:\inetpub\wwwroot\CustomReporting\MyDeliveryExtension\MailDelivery.cs:line 48
at MyDeliveryExtension.MyDelivery.Deliver(Notification notif... | null | CC BY-SA 2.5 | null | 2008-08-28T11:57:23.917 | 2008-08-28T11:57:23.917 | null | null | 905 | null |
32,073 | 2 | null | 32,001 | 17 | null | If your `Timer` is only ever going to have one task to execute then I would suggest subclassing it:
```
import java.util.Timer;
import java.util.TimerTask;
public class ReschedulableTimer extends Timer
{
private Runnable task;
private TimerTask timerTask;
public void schedule(Runnable runnable, long del... | null | CC BY-SA 3.0 | null | 2008-08-28T12:25:23.693 | 2016-01-20T18:47:36.683 | 2016-01-20T18:47:36.683 | 2,207,971 | 3,154 | null |
32,077 | 2 | null | 32,041 | 0 | null | Java contains some sort of preprocessor of its own. It's called [APT](http://java.sun.com/j2se/1.5.0/docs/guide/apt/). It processes and generates code. At the moment I'm not sure how this should work (I haven't tried it). But it seems to be used for these kind of things.
| null | CC BY-SA 2.5 | null | 2008-08-28T12:28:02.080 | 2008-08-28T12:28:02.080 | null | null | 1,633 | null |
32,082 | 2 | null | 32,034 | 8 | null | Yes, it's identical.
A note: if you really want to understand events, I recommend learning the observer pattern and implementing it yourself a for a while. Once you fully understand it, stop doing it yourself and use the professional and well-documented implementation unless you have a real need to do otherwise.
| null | CC BY-SA 2.5 | null | 2008-08-28T12:30:39.063 | 2008-08-28T12:30:39.063 | null | null | 356 | null |
32,059 | 1 | 32,560 | null | 1 | 4,463 | Let's say I have four tables: `PAGE`, `USER`, `TAG`, and `PAGE-TAG`:
```
Table | Fields
------------------------------------------
PAGE | ID, CONTENT
TAG | ID, NAME
USER | ID, NAME
PAGE-TAG | ID, PAGE-ID, TAG-ID, USER-ID
```
And let's say I have four pages:
```
PAGE#1 'Content page 1' ... | How can I get the number of occurrences in a SQL IN clause? | CC BY-SA 3.0 | null | 2008-08-28T11:54:02.507 | 2015-08-04T10:03:11.607 | 2011-10-17T14:49:38.817 | 102,937 | 2,138 | [
"sql"
] |
32,085 | 1 | 32,092 | null | 11 | 14,258 | In XLST how would you find out the length of a node-set?
| Nodesets Length | CC BY-SA 3.0 | 0 | 2008-08-28T12:31:53.273 | 2014-03-21T16:07:16.333 | 2014-03-21T16:07:16.333 | 1,987,598 | null | [
"xml",
"xslt",
"nodesets"
] |
32,088 | 2 | null | 32,059 | 0 | null | In T-Sql:
```
select count(distinct name)
from page-tag
where tag-id in (1, 3, 8)
```
This will give you a count of the number of different tag names for your list of ids
| null | CC BY-SA 2.5 | null | 2008-08-28T12:32:46.423 | 2008-08-28T12:32:46.423 | null | null | 905 | null |
32,087 | 1 | 32,093 | null | 4 | 1,566 | I want to know what are the options to do some scripting jobs in windows platform.
I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools?
What other functionality does windows scripting tools offer?
Can everything that can be done using the Windows GUI be done usi... | What tools and languages are available for windows shell scripting? | CC BY-SA 2.5 | null | 2008-08-28T12:32:43.473 | 2019-04-20T01:56:01.273 | 2008-08-28T13:00:25.967 | 184 | 184 | [
"windows",
"scripting"
] |
32,067 | 2 | null | 32,041 | 10 | null | ```
public abstract class Config
{
public static final boolean ENABLELOGGING = true;
}
```
---
```
import static Config.*;
public class MyClass
{
public myMethod()
{
System.out.println("Hello, non-logging world");
if (ENABLELOGGING)
{
log("Hello, logging world.");... | null | CC BY-SA 2.5 | null | 2008-08-28T12:22:43.560 | 2008-08-28T12:22:43.560 | null | null | 974 | null |
31,990 | 2 | null | 12,936 | 1 | null | I use APC, and can attest that it can dramatically reduce the CPU and I/O load on an app server if you maintain a high cache-hit rate. It not only saves you from having to compile, it can save you from having to read the php files from disk at all. (i.e. the bytecodes are served directly from main memory, so it's super... | null | CC BY-SA 2.5 | null | 2008-08-28T10:30:32.473 | 2008-11-03T18:10:30.037 | null | null | 2,774 | null |
32,091 | 2 | null | 32,041 | -2 | null | To directly answer your question: I don't know.
But here is another solution to your problem:
In my mind, there are two statements that collide with each other here: "debug statements" and "production code".
What is the purpose of debug statements? Help to get rid of bugs while (unit) testing. If a piece of software... | null | CC BY-SA 2.5 | null | 2008-08-28T12:35:08.350 | 2008-08-28T12:35:08.350 | null | null | 2,386 | null |
32,092 | 2 | null | 32,085 | 13 | null | ```
<xsl:variable name="length" select="count(nodeset)"/>
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:35:44.950 | 2008-08-28T12:35:44.950 | null | null | 1,109 | null |
32,097 | 2 | null | 32,087 | 1 | null | It might be worth looking at the prerelease of version 2.0. A lot of stuff has changed:
[http://blogs.msdn.com/powershell/archive/2007/11/06/what-s-new-in-ctp-of-powershell-2-0.aspx](http://blogs.msdn.com/powershell/archive/2007/11/06/what-s-new-in-ctp-of-powershell-2-0.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-28T12:38:06.723 | 2008-08-28T12:38:06.723 | null | null | 986 | null |
32,058 | 1 | 32,508 | null | 15 | 13,086 | I have a simple web service operation like this one:
```
[WebMethod]
public string HelloWorld()
{
throw new Exception("HelloWorldException");
return "Hello World";
}
```
And then I have a client application that consumes the web service and then calls the operation. Obviously it will thro... | How do I extract the inner exception from a soap exception in ASP.NET? | CC BY-SA 2.5 | 0 | 2008-08-28T11:52:34.007 | 2015-05-17T08:52:43.247 | null | null | 3,379 | [
".net",
"asp.net",
"web-services",
"exception",
"soap"
] |
32,098 | 2 | null | 32,087 | 0 | null | [Windows Scripting Languages](http://www.mvps.org/scripting/languages/)
Also take a look at [PowerShell](http://en.wikipedia.org/wiki/Windows_PowerShell)
| null | CC BY-SA 2.5 | null | 2008-08-28T12:39:31.960 | 2008-08-28T12:39:31.960 | null | null | 1,196 | null |
32,094 | 2 | null | 32,034 | 22 | null | I would say yes, it was Anders Heljsberg's intent to make the observer pattern a first-class language feature with events in C#, based on his experience with Delphi. Anders makes this and other design intentions clear in an excellent interview on [Software Engineering Radio](http://www.se-radio.net/podcast/2008-05/epis... | null | CC BY-SA 2.5 | null | 2008-08-28T12:37:19.877 | 2008-08-28T12:37:19.877 | null | null | 470 | null |
32,099 | 2 | null | 32,087 | 0 | null | CScript ? I remember seeing something like that.
| null | CC BY-SA 2.5 | null | 2008-08-28T12:39:34.270 | 2008-08-28T12:39:34.270 | null | null | 1,695 | null |
32,095 | 2 | null | 32,059 | 0 | null | Agree with , bit confusing the question.
If you want the output listed in the question, the sql is as simple as:
```
select page.content, page-tag.tag-id
from page, page-tag
where page.id = page-tag.pag-id
and page-tag.tag-id in (1, 3, 8)
order by page-tag.tag-id desc
```
But if you want the tagcount, answered y... | null | CC BY-SA 2.5 | null | 2008-08-28T12:37:43.087 | 2008-08-28T12:37:43.087 | null | null | 2,385 | null |
32,101 | 2 | null | 14,530 | 5 | null | LINQ doesn't prohibit the use of stored procedures. I've used mixed mode with LINQ-SQL and [LINQ-storedproc](http://codebetter.com/blogs/david.hayden/archive/2008/02/19/linq-to-sql-and-stored-procedures-visual-studio-2008-and-repository-factory.aspx). Personally, I'm glad I don't have to write the stored procs....pwet-... | null | CC BY-SA 2.5 | null | 2008-08-28T12:39:55.017 | 2008-08-28T12:39:55.017 | null | null | 3,225 | null |
32,103 | 1 | 32,113 | null | 10 | 4,194 | in C# I'd like to invoke the label edit of a newly added item to a ListView.
basically, if I have a scenario, as soon as the new item is added, I want the text label to be in a user editable state.
Thanks!
| how do you programmatically invoke a listview label edit | CC BY-SA 3.0 | 0 | 2008-08-28T12:41:04.313 | 2017-03-08T10:57:17.603 | 2017-03-08T10:57:17.603 | 1,242,646 | 379 | [
"c#",
".net",
"winforms",
"user-interface"
] |
32,093 | 2 | null | 32,087 | 5 | null | I think [Windows PowerShell](http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx) from Microsoft is the current favourite for this sort of thing.
| null | CC BY-SA 2.5 | null | 2008-08-28T12:35:56.603 | 2008-08-28T12:35:56.603 | null | null | 3,154 | null |
32,106 | 2 | null | 32,087 | 0 | null | I have cygwin installed, so I can run bash shell scripts for my automatization needs. Besides, when I need stuff running moreless natively on Windows, I use a combination of batch + jscript (runs on cmdline if you have Visual Studio.Net installed, just call "cscript XXX.js").
| null | CC BY-SA 2.5 | null | 2008-08-28T12:42:22.250 | 2008-08-28T12:42:22.250 | null | null | 2,950 | null |
32,105 | 2 | null | 32,087 | 0 | null | Powershell is nice, but it's an extra thing you have to install. Not standard in almost any windows installation. So, if it's just for your own use, then powershell should be fine. If you need the scripts to run on the computers of the general population, for instance, as part of a piece of software you are producing... | null | CC BY-SA 2.5 | null | 2008-08-28T12:41:54.450 | 2008-08-28T12:41:54.450 | null | null | 1,862 | null |
32,108 | 2 | null | 32,100 | 7 | null | The easiest would be to get the second value from this result set in the application:
```
SELECT DISTINCT value
FROM Table
ORDER BY value DESC
LIMIT 2
```
But if you must select the second value using SQL, how about:
```
SELECT MIN(value)
FROM ( SELECT DISTINCT value
FROM Table
ORDER BY value DESC ... | null | CC BY-SA 4.0 | null | 2008-08-28T12:42:49.207 | 2021-12-03T14:29:20.007 | 2021-12-03T14:29:20.007 | 16,461,952 | 1,123 | null |
32,100 | 1 | 32,111 | null | 200 | 476,793 | What is the simplest SQL query to find the second largest integer value in a specific column?
There are maybe duplicate values in the column.
| What is the simplest SQL Query to find the second largest value? | CC BY-SA 3.0 | 0 | 2008-08-28T12:39:53.287 | 2021-12-03T14:37:41.020 | 2016-08-30T00:13:58.253 | 4,823,977 | 184 | [
"sql",
"puzzle"
] |
32,110 | 2 | null | 32,034 | 0 | null | Most modern languages have native support for some of the design patterns. It has been argued that languages are better the more patterns they support natively without the need to implement them explicitly, and that Lisp is excellent in this regard. Jeff had [something to say](http://www.codinghorror.com/blog/archives/... | null | CC BY-SA 2.5 | null | 2008-08-28T12:43:34.227 | 2008-08-28T12:43:34.227 | null | null | 1,968 | null |
32,111 | 2 | null | 32,100 | 362 | null | ```
SELECT MAX( col )
FROM table
WHERE col < ( SELECT MAX( col )
FROM table )
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:43:40.563 | 2008-08-28T12:43:40.563 | null | null | 2,590 | null |
32,113 | 2 | null | 32,103 | 10 | null | [found it!](http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.beginedit.aspx)
```
ListViewItem::BeginEdit();
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:44:05.287 | 2008-08-28T22:25:31.863 | 2008-08-28T22:25:31.863 | 379 | 379 | null |
32,081 | 2 | null | 13,589 | 2 | null | The Mootools sortables plugin does just that, and best of all, it's free ;)
[http://demos.mootools.net/Sortables](http://demos.mootools.net/Sortables)
| null | CC BY-SA 2.5 | null | 2008-08-28T12:30:02.403 | 2008-08-28T12:30:02.403 | null | null | 3,215 | null |
32,115 | 2 | null | 32,100 | 0 | null | This works in MS SQL:
```
select max([COLUMN_NAME]) from [TABLE_NAME] where [COLUMN_NAME] <
( select max([COLUMN_NAME]) from [TABLE_NAME] )
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:45:03.383 | 2009-09-16T00:18:50.890 | 2009-09-16T00:18:50.890 | 56,338 | 1,188 | null |
32,102 | 2 | null | 32,087 | 1 | null | How about installing a windows version of [Python](http://www.activestate.com/Products/activepython/index.mhtml), [Perl](http://www.activestate.com/Products/activeperl/index.mhtml) or your favorite language? These should offer all the functionality you need.
| null | CC BY-SA 2.5 | null | 2008-08-28T12:40:04.767 | 2008-08-28T12:40:04.767 | null | null | 2,386 | null |
32,119 | 2 | null | 32,100 | 0 | null | Something like this? I haven't tested it, though:
```
select top 1 x
from (
select top 2 distinct x
from y
order by x desc
) z
order by x
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:45:30.260 | 2008-08-28T12:45:30.260 | null | null | 56 | null |
32,109 | 2 | null | 32,100 | 20 | null | I suppose you can do something like:
```
SELECT *
FROM Table
ORDER BY NumericalColumn DESC
LIMIT 1 OFFSET 1
```
or
```
SELECT *
FROM Table ORDER BY NumericalColumn DESC
LIMIT (1, 1)
```
depending on your database server. Hint: SQL Server doesn't do LIMIT.
| null | CC BY-SA 4.0 | null | 2008-08-28T12:43:25.990 | 2021-12-03T14:28:00.637 | 2021-12-03T14:28:00.637 | 16,461,952 | 2,384 | null |
32,114 | 2 | null | 32,100 | 0 | null | ```
select top 1 MyIntColumn from MyTable
where
MyIntColumn <> (select top 1 MyIntColumn from MyTable order by MyIntColumn desc)
order by MyIntColumn desc
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:44:49.513 | 2009-09-16T00:18:25.617 | 2009-09-16T00:18:25.617 | 56,338 | 2,849 | null |
32,123 | 1 | 32,662 | null | 2 | 1,087 | Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories?
The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean."
| procmail lockfile utility and NFS | CC BY-SA 3.0 | 0 | 2008-08-28T12:46:26.593 | 2013-05-18T01:43:58.123 | 2013-05-18T01:43:58.123 | 1,012,641 | 2,974 | [
"unix",
"nfs",
"procmail",
"lockfile"
] |
32,122 | 2 | null | 32,041 | 24 | null | Two recommendations.
for real logging, use a modern logging package like log4j or java's own built in logging. Don't worry about performance so much, the logging level check is on the order of nanoseconds. (it's an integer comparison).
And if you have more than a single log statement, guard the whole block:
(log4j,... | null | CC BY-SA 2.5 | null | 2008-08-28T12:46:23.707 | 2008-08-28T12:46:23.707 | null | null | 758 | null |
32,127 | 2 | null | 32,087 | 1 | null | Batch files are the most portable, but doing complicated things can get hard (very hard).
Powershell is incredibly - um - powerful, but the installed domain at the moment is only slightly more than those people who like using powershell and servers they administer. If you control the machines you're scripting on and ... | null | CC BY-SA 2.5 | null | 2008-08-28T12:48:09.537 | 2008-08-28T12:48:09.537 | null | null | 3,198 | null |
32,124 | 2 | null | 32,087 | -1 | null | Yesterday I could have repaired this for you ;)
> What all are the tools/languages for
windows shell scripting?
Would read better as
> What tools and languages are available
for windows shell scripting?
| null | CC BY-SA 2.5 | null | 2008-08-28T12:46:49.930 | 2008-08-28T12:46:49.930 | null | null | 269 | null |
32,125 | 2 | null | 32,044 | 30 | null | I think the canonical answer is: "Don't".
What you should probably do instead is unravel the thing in your code, so it's just a matter of iterating over (in|de)dents in the template. I think I'd do it by appending indents and dedents to a list while recursing through the tree and then sending that "travelogue" list t... | null | CC BY-SA 2.5 | null | 2008-08-28T12:47:29.243 | 2008-08-28T12:47:29.243 | null | null | 1,421 | null |
32,141 | 2 | null | 31,535 | 0 | null | If your using java you may want to look at [tagsoup](http://tagsoup.info), which is a SAX-compliant parser for "[parsing] HTML as it is found in the wild".
| null | CC BY-SA 2.5 | null | 2008-08-28T12:53:47.090 | 2008-08-28T12:53:47.090 | null | null | 1,633 | null |
32,135 | 2 | null | 32,010 | 0 | null | If you're concerned about this, it may be worthwhile to set the case to all upper or all lower before you check.
For instance, in Perl:
```
$x = "abbCCDGBAdgfabv";
(lc $x) =~ /bad/;
```
May in some cases be better than
```
$x = "abbCCDGBAdgfabv";
$x =~ /bad/i;
```
| null | CC BY-SA 2.5 | null | 2008-08-28T12:51:35.177 | 2008-08-28T12:51:35.177 | null | null | 1,084 | null |
32,144 | 1 | 34,211 | null | 3 | 1,720 | I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not?
| Why can't SQL Server run on a Novell server? | CC BY-SA 2.5 | null | 2008-08-28T12:54:02.503 | 2008-11-23T03:20:41.770 | null | null | 470 | [
"sql-server",
"novell"
] |
32,138 | 2 | null | 31,854 | 1 | null | The answer depends on what the native definitions are that you are trying to marshal too. You haven't provided enough information for anyone to be able to really help.
A common thing that trips people up when marshalling strings in native arrays is that native arrays often use a fixed-size buffer for the string that ... | null | CC BY-SA 2.5 | null | 2008-08-28T12:52:00.480 | 2008-08-28T12:52:00.480 | null | null | 1,948 | null |