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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,556 | 2 | null | 36,475 | 0 | null | I'm guessing you have something resembling a "comments" table, with a foreign key to itself, pointing to the parent comment of each row. This makes the threaded comments into a tree structure with the thread starter as the tree root.
So we can rephrase the question as "What is the best way to select a tree structure f... | null | CC BY-SA 2.5 | null | 2008-08-31T01:46:00.497 | 2008-08-31T01:46:00.497 | null | null | 3,757 | null |
36,558 | 2 | null | 24,675 | 1 | null | Look into [mod_cache](http://httpd.apache.org/docs/2.0/mod/mod_cache.html), an output cache for the Apache web server, simillar to the output caching in ASP.NET.
Yes, I can see that it's still experimental but it will be final someday.
| null | CC BY-SA 2.5 | null | 2008-08-31T01:50:13.497 | 2008-08-31T01:50:13.497 | null | null | 1,796 | null |
36,545 | 2 | null | 36,534 | 10 | null | A reasonable setup supporting an "average" web application might evolve as follows:
1. Single combined application/database server
2. Separate database on a different machine
3. Second application server with DNS round-robin (poor man's load balancing) or, e.g. Perlbal
4. Second, replicated database server (for read ... | null | CC BY-SA 2.5 | null | 2008-08-31T01:36:08.150 | 2008-08-31T01:36:08.150 | null | null | 3,542 | null |
36,560 | 2 | null | 36,498 | 1 | null | If you want to invoke an email program, then see this article:
[How do I open the default mail program with a Subject and Body in a cross-platform way?](https://stackoverflow.com/questions/17373/how-do-i-open-the-default-mail-program-with-a-subject-and-body-in-a-cross-platf)
| null | CC BY-SA 2.5 | null | 2008-08-31T01:57:50.140 | 2008-08-31T01:57:50.140 | 2017-05-23T10:32:50.377 | -1 | 338 | null |
36,547 | 2 | null | 36,182 | 1 | null | @Ubiguch
It appears that `ST_DWithin` uses the spatial index, so that seems to cut down on the number of points to be queried pretty quickly.
```
navaid=> explain select internalid from waypoint where id != 'KROC' AND ST_DWithin(point, ST_GeomFromText('P... | null | CC BY-SA 3.0 | null | 2008-08-31T01:37:11.203 | 2016-07-13T09:18:28.663 | 2016-07-13T09:18:28.663 | 5,520,058 | 3,333 | null |
36,564 | 2 | null | 23,867 | 10 | null | Yes, typically Dispose is one of the places you want to ensure exceptions aren't thrown. However, based on this MSDN [forum thread](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=855018&SiteID=1) there were some historical reasons for this behavior. As such, the recommended pattern is the try{Close}/catch{Abort}... | null | CC BY-SA 2.5 | null | 2008-08-31T02:05:27.593 | 2008-08-31T02:05:27.593 | null | null | 1,559 | null |
36,567 | 1 | 38,203 | null | 5 | 3,243 | I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys.
| Beginner Digital Synth | CC BY-SA 2.5 | 0 | 2008-08-31T02:08:47.867 | 2019-10-17T09:26:52.600 | 2019-10-17T09:26:52.600 | -1 | null | [
"java",
"synthesizer"
] |
36,565 | 2 | null | 36,475 | 1 | null | This website lists some common techniques:
[http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/](http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/)
I'd do the "nested set" model, but have multiple roots (e.g. each "topic" is a new tree). It's very fast, simple to query, but complica... | null | CC BY-SA 2.5 | null | 2008-08-31T02:06:44.033 | 2008-08-31T02:06:44.033 | null | null | 2,590 | null |
36,569 | 2 | null | 21,027 | 6 | null | I guess you want what VSS calls Next(Previous)DocumentWindow. By default, it's on on my VSS 8. On they have `Next(Previous)DocumentWindowNav`. You can change key assignments via Tools/Options/Keyboard.
| null | CC BY-SA 3.0 | null | 2008-08-31T02:10:06.490 | 2015-09-07T14:50:35.093 | 2015-09-07T14:50:35.093 | 2,002,471 | 2,515 | null |
36,568 | 1 | 36,572 | null | 8 | 2,556 | I currently use [subversion](http://subversion.tigris.org/) for my version control via [AhnkSVN](http://ankhsvn.open.collab.net/) and Visual Studio. I recently started using [Tree Surgeon](http://www.codeplex.com/treesurgeon) to set up my projects. It creates a build script automatically using [NAnt](http://nant.sour... | Automated Builds | CC BY-SA 2.5 | 0 | 2008-08-31T02:09:49.800 | 2008-10-17T19:17:26.380 | 2008-08-31T15:42:54.057 | 1,820 | 1,405 | [
"svn",
"build-automation",
"nant"
] |
36,572 | 2 | null | 36,568 | 5 | null | You could use [CruiseControl.Net](http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET), which can do a build on every check in, nightly builds, or however you want to do it. A quick google search suggests CC.Net has some [integration with NAnt](http://ccnet.sourceforge.net/CCNET/NAnt%2... | null | CC BY-SA 2.5 | null | 2008-08-31T02:14:33.080 | 2008-08-31T02:14:33.080 | null | null | 3,750 | null |
36,575 | 1 | 36,591 | null | 1 | 190 | Add service reference to Amazon service fails, saying
> "Could not load file or assembly "System.Core, Version=3.5.0.0,...' or
one or more of it dependencies. The module was expected to contain an
assembly manifest."
This is in VS 2008, haven't installed SP1 on this machine yet.
Any ideas?
| Add service reference to Amazon service fails | CC BY-SA 3.0 | null | 2008-08-31T02:23:57.130 | 2023-02-15T15:33:08.213 | 2023-02-15T15:33:08.213 | 211,627 | 100 | [
"asp.net",
"amazon-web-services"
] |
36,576 | 2 | null | 36,563 | 0 | null | You can set the `Form.Opacity` property. It should do what you want.
| null | CC BY-SA 3.0 | null | 2008-08-31T02:28:03.763 | 2012-06-09T21:57:52.880 | 2012-06-09T21:57:52.880 | 1,140,579 | 100 | null |
36,563 | 1 | 36,577 | null | 2 | 1,906 | I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.
I'd really love for that form to be transparent and to have the transparency be user-configurable.
Is there any easy way to achieve this?
| Is there an easy way to do transparent forms in a VB .NET app? | CC BY-SA 2.5 | 0 | 2008-08-31T02:05:03.587 | 2012-06-09T21:57:52.880 | null | null | 305 | [
"vb.net",
"transparency"
] |
36,581 | 2 | null | 25,458 | 9 | null | It's bad enough that you have to be worried even about reflection done internally by the .NET libraries for performance-critical code.
Case in point: You should never use a member declared as "Object" in a lock (C#) / SyncLock (VB.NET) statement in high-performance code. Why? Because the CLR can't lock on a value ty... | null | CC BY-SA 3.0 | null | 2008-08-31T02:34:03.983 | 2014-05-05T16:39:25.983 | 2014-05-05T16:39:25.983 | 3,776 | 3,776 | null |
36,578 | 2 | null | 36,563 | 0 | null | Set `Form.Opacity = 0.0` on page load
I set something like what your talking about on an app about a year ago. Using a `While` loop with a small `Sleep` you can setup a nice fading effect.
| null | CC BY-SA 3.0 | null | 2008-08-31T02:29:42.060 | 2012-06-09T21:56:40.730 | 2012-06-09T21:56:40.730 | 1,140,579 | 2,066 | null |
36,574 | 2 | null | 36,568 | 1 | null | There's also [Draco.NET](http://draconet.sourceforge.net/), which was inspired by CruiseControl.NET and is a little more lightweight. See this [article](http://www.theserverside.net/tt/articles/showarticle.tss?id=ContinuousIntegration) for more information on both continuous integration solutions.
| null | CC BY-SA 2.5 | null | 2008-08-31T02:21:34.950 | 2008-08-31T02:21:34.950 | null | null | 2,783 | null |
36,577 | 2 | null | 36,563 | 4 | null | You could try using the [Opacity](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.opacity.aspx) property of the Form. Here's the relevant snippet from the MSDN page:
```
private Sub CreateMyOpaqueForm()
' Create a new form.
Dim form2 As New Form()
' Set the text displayed in the caption.
... | null | CC BY-SA 2.5 | null | 2008-08-31T02:29:41.843 | 2008-08-31T02:29:41.843 | null | null | 3,820 | null |
36,589 | 2 | null | 36,568 | 3 | null | CruiseControl.NET is your best option, in my opinion. It is fairly easy to extend with custom tasks if needed, works with both NAnt and MSBuild out of the box, and is very actively maintained.
| null | CC BY-SA 2.5 | null | 2008-08-31T02:43:23.213 | 2008-08-31T02:43:23.213 | null | null | 1,559 | null |
36,590 | 2 | null | 36,585 | 22 | null | > SELECT LEN(columnName) AS MyLength
FROM myTable
| null | CC BY-SA 2.5 | null | 2008-08-31T02:49:50.360 | 2008-08-31T02:49:50.360 | null | null | 3,153 | null |
36,587 | 2 | null | 33,403 | 2 | null | If you really want to see all the gory details of how List<> and Dictionary<,> are implemented, use the wonderfully useful [.NET Reflector](http://www.red-gate.com/products/reflector/).
See also the documentation for the excellent [C5 Generic Collection Library](http://www.itu.dk/research/c5/), which has very good imp... | null | CC BY-SA 2.5 | null | 2008-08-31T02:42:20.267 | 2008-08-31T02:42:20.267 | null | null | 3,776 | null |
36,597 | 2 | null | 36,563 | 0 | null | I don't know exactly what you mean by transparent, but if you use WPF you can set `AllowTransparency = True` on your form and then remove the form's style/border and then set the background to a color that has a zero alpha channel. Then, you can draw on the form all you want and the background will be see-through and t... | null | CC BY-SA 3.0 | null | 2008-08-31T03:02:17.800 | 2012-06-09T21:57:36.203 | 2012-06-09T21:57:36.203 | 1,140,579 | 3,641 | null |
36,605 | 1 | 36,612 | null | 8 | 6,743 | What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?
I am specifically trying to change the cursor in this instance to that of a pointer.
| IE 6 CSS Hover non Anchor Tag | CC BY-SA 2.5 | 0 | 2008-08-31T03:14:56.727 | 2016-01-14T19:08:38.617 | null | null | 3,821 | [
"css",
"internet-explorer-6"
] |
36,600 | 1 | 36,615 | null | 6 | 3,342 | We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.
Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix...
Any advice?
| Viewing DirectX application remotely | CC BY-SA 2.5 | null | 2008-08-31T03:05:52.457 | 2009-01-02T12:07:19.397 | 2008-08-31T03:23:22.977 | 1,448 | 3,569 | [
"directx",
"remote-desktop"
] |
36,592 | 2 | null | 36,585 | 1 | null | If you want to find out the max there should be a way for you to get the schema of the table. Normally you can do something like [SHOW COLUMNS](http://dev.mysql.com/doc/refman/5.0/en/show-columns.html) in SQL or a [DESCRIBE](http://dev.mysql.com/doc/refman/5.0/en/describe.html) style command. In a mysql shell that ca... | null | CC BY-SA 2.5 | null | 2008-08-31T02:51:48.187 | 2008-08-31T03:01:16.603 | 2008-08-31T03:01:16.603 | 792 | 792 | null |
36,610 | 2 | null | 36,605 | 1 | null | Another approach, depending on what the item is, is to add a non link anchor and set its display to block. Either put the anchor within or surrounding the item you want the pseudo hover behavior on.
| null | CC BY-SA 2.5 | null | 2008-08-31T03:26:57.883 | 2008-08-31T03:26:57.883 | null | null | 598 | null |
36,608 | 1 | 36,618 | null | 68 | 85,765 | I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.
Something like:
```
Record.find(:all).date.unique.count
```
but of course, that doesn't seem to work.
| How can I count the number of records that have a unique value in a particular field in ROR? | CC BY-SA 2.5 | 0 | 2008-08-31T03:19:33.157 | 2017-07-14T09:29:19.527 | null | null | 3,764 | [
"ruby-on-rails",
"ruby",
"activerecord"
] |
36,612 | 2 | null | 36,605 | 4 | null | I would say that the simplest method would be to add onmouseover/out Javascript functions.
| null | CC BY-SA 2.5 | null | 2008-08-31T03:30:09.810 | 2008-08-31T03:30:09.810 | null | null | 1,440,933 | null |
36,609 | 2 | null | 36,605 | 12 | null | I think the simplest way is to use the [hover.htc](http://www.xs4all.nl/~peterned/csshover.html) approach. You add the hover.htc file to your site, then reference it in your stylesheet:
```
body { behavior:url("csshover.htc"); }
```
If you want to keep things as clean as possible, you can use IE conditional comments... | null | CC BY-SA 3.0 | null | 2008-08-31T03:24:04.597 | 2016-01-14T19:08:38.617 | 2016-01-14T19:08:38.617 | 2,678,454 | 5 | null |
36,585 | 1 | 36,590 | null | 13 | 29,188 | I have a column which is of type nvarchar(max). How do I find the length of the string (or the number of bytes) for the column for each row in the table?
| What SQL-server function can I use to get the character or byte length of a nvarchar(max) column? | CC BY-SA 3.0 | null | 2008-08-31T02:39:15.797 | 2016-09-02T08:39:50.010 | 2016-09-02T08:39:50.010 | 649,952 | 1,208 | [
"sql",
"sql-server"
] |
36,615 | 2 | null | 36,600 | 2 | null | I think you can still use all of the normal D3D tools, but you won't be able to render to a surface associated with the screen. You'll have to render to a DIB (or some such) and Blt it with GDI to a normal window HDC. RDC/VNC/Citrix should all work with this technique.
Performance will definitely suffer - but that's g... | null | CC BY-SA 2.5 | null | 2008-08-31T03:39:53.280 | 2008-08-31T03:39:53.280 | null | null | 3,759 | null |
36,446 | 2 | null | 32,537 | 1 | null | You didn't say what OS you're using but on Linux I been using a tabbed window manager ([wmii](http://www.suckless.org/wmii/)) for a year or so and it has radically changed the way I use applications - consoles or otherwise.
I often have four or more consoles and other apps on a virtual desktop and with wmii I don't ha... | null | CC BY-SA 2.5 | null | 2008-08-30T22:59:18.383 | 2008-08-30T22:59:18.383 | null | null | 3,796 | null |
36,617 | 2 | null | 35,186 | 81 | null | Note that in the case of reflection, you get an `NoSuchMethodException`, while with non-reflective code, you get `NoSuchMethodError`. I tend to go looking in very different places when confronted with one versus the other.
| null | CC BY-SA 2.5 | null | 2008-08-31T03:45:40.083 | 2008-08-31T03:45:40.083 | null | null | 3,474 | null |
36,618 | 2 | null | 36,608 | 85 | null | What you're going for is the following SQL:
```
SELECT COUNT(DISTINCT date) FROM records
```
ActiveRecord has this built in:
```
Record.count('date', :distinct => true)
```
| null | CC BY-SA 2.5 | null | 2008-08-31T03:52:26.200 | 2008-08-31T03:52:26.200 | null | null | 2,518 | null |
36,620 | 2 | null | 36,605 | 1 | null |
> I actually already needed to swap the image anyhow
Make sure you take a look at [Image Sprites](http://www.alistapart.com/articles/sprites). Sometimes its much nicer to use one image and "shift" the image then to use two separate images and "toggle" or "swap" between them. In my experience its been much nice whe... | null | CC BY-SA 2.5 | null | 2008-08-31T03:57:10.960 | 2008-08-31T03:57:10.960 | null | null | 792 | null |
36,631 | 2 | null | 36,568 | 0 | null | You might want to consider CI-Factory. It's a continuous integration environment builder that uses CruiseControl.NET and a dozen other tools. There's an excellent screencast here: [http://www.dnrtv.com/default.aspx?showID=64](http://www.dnrtv.com/default.aspx?showID=64)
| null | CC BY-SA 2.5 | null | 2008-08-31T04:30:10.757 | 2008-08-31T04:30:10.757 | null | null | 3,759 | null |
36,629 | 2 | null | 36,475 | 2 | null |
Oracle has an extension to SELECT that allows easy tree-based retrieval.
This query will traverse a table where the nesting relationship is stored in and columns.
```
select * from my_table
start with parent = :TOP_ARTICLE
connect by prior child = parent;
```
[http://www.adp-gmbh.ch/ora/sql/connect_by.h... | null | CC BY-SA 2.5 | null | 2008-08-31T04:25:41.440 | 2008-09-02T07:22:44.290 | 2008-09-02T07:22:44.290 | 116 | 116 | null |
36,591 | 2 | null | 36,575 | 1 | null | This can happen if ASP.NET isn't installed. Go to Add/Remove Windows Components and look under IIS; make sure that ASP.NET is checked (meaning that it's installed.) That should clear up your problem!
| null | CC BY-SA 2.5 | null | 2008-08-31T02:50:00.030 | 2008-08-31T02:50:00.030 | null | null | 3,641 | null |
36,616 | 2 | null | 36,605 | 0 | null | I liked the mouseover/out best since I actually already needed to swap the image anyhow. I really should have thought of doing this with javascript to begin with.
Thanks for the quick answers.
@Joseph
Thanks for that link. I had never heard of this technique before and really like the idea.
I will definitely try ... | null | CC BY-SA 2.5 | null | 2008-08-31T03:40:40.253 | 2008-08-31T16:01:12.233 | 2008-08-31T16:01:12.233 | 3,821 | 3,821 | null |
36,633 | 2 | null | 36,475 | 4 | null | [Modified pre-order tree traversal](http://www.sitepoint.com/print/hierarchical-data-database) (or what Matt refers to as "nested set") is the way to go.
If you happen to be working in Django, there's a third-party app, [django-mptt](http://code.google.com/p/django-mptt/), that makes implementing MPTT in your models a... | null | CC BY-SA 2.5 | null | 2008-08-31T04:33:22.280 | 2008-08-31T04:33:22.280 | null | null | 3,207 | null |
36,634 | 2 | null | 36,108 | 271 | null | There are also some properties you can set to force a control to fill its available space when it would otherwise not do so. For example, you can say:
```
HorizontalContentAlignment="Stretch"
```
... to force the contents of a control to stretch horizontally. Or you can say:
```
HorizontalAlignment="Stretch"
```
... | null | CC BY-SA 2.5 | null | 2008-08-31T04:34:37.063 | 2008-08-31T04:34:37.063 | null | null | 615 | null |
36,636 | 1 | 7,464,475 | null | 525 | 177,915 | I asked a question about Currying and closures were mentioned.
What is a closure? How does it relate to currying?
| What is a 'Closure'? | CC BY-SA 3.0 | 0 | 2008-08-31T04:38:21.207 | 2022-09-15T01:36:15.240 | 2012-10-02T15:51:05.570 | 102,937 | 3,786 | [
"functional-programming",
"computer-science",
"terminology",
"glossary"
] |
36,625 | 2 | null | 36,621 | 1 | null | > Why isn't my custom error handler catching undefinedd functions? Are there other problems that this will cause?
At a guess, I'd say that undefined function errors travel through a different execution path than other error types. Perhaps the PHP designers could tell you more, except I doubt PHP is in any way designed... | null | CC BY-SA 2.5 | null | 2008-08-31T04:06:54.213 | 2008-08-31T04:06:54.213 | null | null | 3,560 | null |
36,588 | 2 | null | 36,567 | 2 | null | Check out [Frinika](http://frinika.sourceforge.net/). It's a full-featured music workstation implemented in Java (open source). Using the API, you can run midi events through the synthesizer, read the raw sound output, and write it to a WAV file (see source code link below).
Additional information:
- [Frinika Develop... | null | CC BY-SA 2.5 | null | 2008-08-31T02:42:42.590 | 2008-08-31T02:42:42.590 | null | null | 2,783 | null |
36,644 | 2 | null | 6,512 | 30 | null | A good summary is available in [Implementation Strategies for First-Class Continuations](http://link.springer.com/article/10.1023/A:1010016816429), an article by Clinger, Hartheimer, and Ost. I recommend looking at Chez Scheme's implementation in particular.
Stack copying isn't that complex and there are a number of ... | null | CC BY-SA 3.0 | null | 2008-08-31T05:02:30.977 | 2013-05-02T16:05:42.107 | 2013-05-02T16:05:42.107 | 13 | 2,659 | null |
36,641 | 2 | null | 36,636 | 32 | null | A closure is a function that can reference state in another function. For example, in Python, this uses the closure "inner":
```
def outer (a):
b = "variable in outer()"
def inner (c):
print a, b, c
return inner
# Now the return value from outer() can be saved for later
func = outer ("test")
func ... | null | CC BY-SA 4.0 | null | 2008-08-31T04:54:04.210 | 2019-11-16T02:08:48.537 | 2019-11-16T02:08:48.537 | 5,648,954 | 3,560 | null |
36,647 | 1 | 36,648 | null | 22 | 8,897 | Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?
| Unit tests in Python | CC BY-SA 2.5 | null | 2008-08-31T05:07:41.603 | 2016-03-06T17:53:06.583 | null | null | 577 | [
"python",
"unit-testing"
] |
36,621 | 1 | 36,705 | null | 13 | 11,596 | I'm taking the leap: my PHP scripts will ALL fail gracefully!
At least, that's what I'm hoping for...`
I don't want to wrap (practically) every single line in `try...catch` statements, so I think my best bet is to make a custom error handler for the beginning of my files.
I'm testing it out on a practice page:
```
... | How to catch undefined functions with set_error_handler in PHP | CC BY-SA 4.0 | 0 | 2008-08-31T03:57:29.947 | 2022-07-14T03:34:22.807 | 2019-10-01T16:03:20.627 | 5,581,565 | 1,615 | [
"php"
] |
36,648 | 2 | null | 36,647 | 25 | null | Python has several testing frameworks, including `unittest`, `doctest`, and `nose`. The most xUnit-like is `unittest`, which is documented on Python.org.
- [unittest documentation](https://docs.python.org/3/library/unittest.html)- [doctest documentation](https://docs.python.org/3/library/doctest.html)
| null | CC BY-SA 3.0 | null | 2008-08-31T05:09:33.813 | 2014-07-28T15:53:22.807 | 2014-07-28T15:53:22.807 | 637,552 | 3,560 | null |
36,650 | 2 | null | 3,927 | 3 | null | In the past, I’ve used the profiler that ships with [Visual Studio Team System](http://en.wikipedia.org/wiki/VSTS_Profiler).
| null | CC BY-SA 2.5 | null | 2008-08-31T05:12:31.653 | 2008-08-31T05:12:31.653 | null | null | 3,709 | null |
36,642 | 1 | null | null | 1 | 159 | I use asp.net 3.5 and have also begun looking at 3.5 sp1
I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_On... | Listing Items and Displaying Data Inline | CC BY-SA 2.5 | null | 2008-08-31T04:54:17.377 | 2016-12-20T05:27:16.143 | 2008-09-01T15:55:15.390 | 2,496 | 2,496 | [
"asp.net",
".net-3.5"
] |
36,653 | 2 | null | 36,647 | 0 | null | There is also [PyUnit](http://pyunit.sourceforge.net/) which might be what you're looking for.
| null | CC BY-SA 2.5 | null | 2008-08-31T05:35:50.053 | 2008-08-31T05:35:50.053 | null | null | 893 | null |
36,646 | 1 | 36,687 | null | 25 | 7,472 | Does anyone use [Phing](http://phing.info/trac/) to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic configuration variables, installs or reloads t... | Do you use Phing? | CC BY-SA 4.0 | 0 | 2008-08-31T05:04:34.950 | 2019-01-18T11:00:42.090 | 2019-01-18T11:00:42.090 | 567,854 | 577 | [
"php",
"deployment",
"build-process",
"build-automation",
"phing"
] |
36,654 | 2 | null | 36,647 | 2 | null | @Greg: PyUnit is included in the standard library as `unittest`
| null | CC BY-SA 2.5 | null | 2008-08-31T05:37:18.223 | 2008-08-31T05:37:18.223 | null | null | 3,560 | null |
36,657 | 2 | null | 36,656 | 6 | null | When you print the data use [nl2br()](http://www.php.net/manual/en/function.nl2br.php) to convert `\n` and `\r\n` into `<br>`
| null | CC BY-SA 3.0 | null | 2008-08-31T05:56:55.290 | 2012-10-05T14:10:55.420 | 2012-10-05T14:10:55.420 | 446,591 | 115 | null |
36,656 | 1 | 36,658 | null | 33 | 49,760 | I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains `ASCII art` and whatnot that I would like to preserve. When I print out the string on the `HTML page`, even if it does have the same formatting and everything since it is in `HTML`, the spacing... | How do I keep whitespace formatting using PHP/HTML? | CC BY-SA 4.0 | 0 | 2008-08-31T05:55:12.330 | 2020-01-21T23:17:32.880 | 2019-01-18T11:00:15.583 | 567,854 | 3,831 | [
"php",
"html",
"ascii"
] |
36,652 | 2 | null | 36,636 | 4 | null | In a normal situation, variables are bound by scoping rule: Local variables work only within the defined function. Closure is a way of breaking this rule temporarily for convenience.
```
def n_times(a_thing)
return lambda{|n| a_thing * n}
end
```
in the above code, `lambda(|n| a_thing * n}` is the closure because ... | null | CC BY-SA 2.5 | null | 2008-08-31T05:31:57.660 | 2008-08-31T05:31:57.660 | null | null | 3,827 | null |
36,649 | 2 | null | 4,458 | 2 | null | [Martin Fowler](http://www.martinfowler.com/dslwip/) is currently writing a book on DSL. Here is a [presentation](http://www.infoq.com/presentations/domain-specific-languages) he gave on the topic.
| null | CC BY-SA 2.5 | null | 2008-08-31T05:12:00.127 | 2008-08-31T05:12:00.127 | null | null | 577 | null |
36,666 | 2 | null | 26,452 | 3 | null | VS 2005/2008 Keybinding posters:
- [Visual C# 2008 Keybinding Reference Poster](http://www.microsoft.com/downloads/details.aspx?FamilyID=E5F902A8-5BB5-4CC6-907E-472809749973&displaylang=en)- [Visual C# 2005 Keyboard Shortcut Reference Poster](http://www.microsoft.com/downloads/details.aspx?familyid=C15D210D-A926-46A8-A... | null | CC BY-SA 2.5 | null | 2008-08-31T06:28:13.907 | 2008-11-03T18:15:26.517 | 2020-06-20T09:12:55.060 | -1 | 3,742 | null |
36,673 | 2 | null | 4,320 | 1 | null | It depends. If your business logic is in your click events and page loads, it is NOT acceptable.
It appears that your business logic is somewhere within the DAL (e.g., stored procedures and such), just as long as you are consistent, it's fine. As long as you are very, very sure that your clients will be using SQL Ser... | null | CC BY-SA 2.5 | null | 2008-08-31T07:28:39.003 | 2008-08-31T07:28:39.003 | null | null | 372 | null |
36,639 | 2 | null | 36,636 | 125 | null | I'll give an example (in JavaScript):
```
function makeCounter () {
var count = 0;
return function () {
count += 1;
return count;
}
}
var x = makeCounter();
x(); returns 1
x(); returns 2
...etc...
```
What this function, `makeCounter`, does is it returns a function, which we've called `x`, that will cou... | null | CC BY-SA 4.0 | null | 2008-08-31T04:49:37.310 | 2022-09-15T01:36:15.240 | 2022-09-15T01:36:15.240 | 1,402,846 | 658 | null |
36,667 | 2 | null | 23,270 | 2 | null | I could use a little more information to narrow down my answer, but here is what I have:
Internet Explorer has 5 different security zones be default: Local Machine Zone, Intranet, Internet, Trusted, and Restricted
These are determined in urlmon.dll (Url Moniker)
More information here: [http://msdn.microsoft.com/en-us/... | null | CC BY-SA 2.5 | null | 2008-08-31T06:29:06.977 | 2008-08-31T06:29:06.977 | null | null | 1,462,171 | null |
36,678 | 2 | null | 34,913 | 34 | null | Actually, although Thomas' code will work, it is more succint to use a lambda expression:
```
var totals =
from s in sites
group s by s.SiteID into grouped
select new
{
SiteID = grouped.Key,
Last30Sum = grouped.Sum( s => s.Last30 )
};
```
which uses the Sum extension method without the need for a nested LINQ... | null | CC BY-SA 3.0 | null | 2008-08-31T07:40:23.437 | 2012-10-04T07:12:54.830 | 2012-10-04T07:12:54.830 | 306,028 | 2,918 | null |
36,682 | 1 | 36,689 | null | 4 | 402 | Learning WPF nowadays. Found something new today with .Net dependency properties. What they bring to the table is
- - -
among others.
But my question here is why do they need to be declared as static in the containing class? The recommmended way is to then add instance 'wrapper' property for them. Why ?
edit:
@Ma... | Why do .Net WPF DependencyProperties have to be static members of the class | CC BY-SA 2.5 | 0 | 2008-08-31T08:08:35.570 | 2012-06-13T06:53:05.180 | 2008-08-31T13:37:02.127 | 1,695 | 1,695 | [
".net",
"wpf"
] |
36,684 | 2 | null | 36,533 | 8 | null | Citation from Vista [speech recognition blog](http://blogs.msdn.com/speech/archive/2007/09/01/windows-speech-recognition-language-support-in-windows-vista.aspx):
> In Windows Vista, Windows Speech
Recognition works in the current
language of the OS. That means that
in order to use another language for
speech ... | null | CC BY-SA 2.5 | null | 2008-08-31T08:11:57.620 | 2008-08-31T08:11:57.620 | null | null | 1,196 | null |
36,689 | 2 | null | 36,682 | 2 | null | I see 2 reasons behind that requirement:
1. You can't register same DP twice. To comply with this constraint you should use static variable, it will be initialized only one time thus you will register DP one time only.
2. DP should be registered before any class (which uses that DB) instance created
| null | CC BY-SA 2.5 | null | 2008-08-31T08:26:55.913 | 2008-08-31T08:43:16.047 | 2008-08-31T08:43:16.047 | 1,196 | 1,196 | null |
36,695 | 2 | null | 36,682 | 5 | null | I think the reason you need the static instance of a dependency property is really just because that's how they were designed. The static bit holds all the property metadata - its default value, its owner type (handy if it's an attached property) etc, its callback methods for when it changes - that sort of thing. Makes... | null | CC BY-SA 2.5 | null | 2008-08-31T08:44:35.763 | 2008-08-31T08:44:35.763 | null | null | 615 | null |
36,687 | 2 | null | 36,646 | 16 | null | From Federico Cargnelutti's [blog post](http://phpimpact.wordpress.com/2007/06/30/phing-php-project-build-system-based-on-apache-ant/):
> Features include file transformations (e.g. token
replacement, XSLT transformation,
Smarty template transformations), file
system operations, interactive build
support, SQL ... | null | CC BY-SA 2.5 | null | 2008-08-31T08:22:20.370 | 2008-08-31T08:22:20.370 | null | null | 1,811 | null |
36,693 | 1 | 155,600 | null | 13 | 16,020 | I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.
Setup:
- - - - - -
This is not working, but is not reporting any errors, just showing an empty image icon on the report surface. All other fields are displaying correctly.
Does anyone have a worki... | How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface | CC BY-SA 2.5 | 0 | 2008-08-31T08:42:17.797 | 2015-01-01T18:07:11.883 | 2008-09-10T00:13:43.690 | -1 | 2,918 | [
".net",
"image",
"reportviewer"
] |
36,700 | 2 | null | 36,502 | 0 | null | Perhaps it would be helpful to know why you want to do this and then try to help solve the original problem...
| null | CC BY-SA 2.5 | null | 2008-08-31T09:10:26.403 | 2008-08-31T09:10:26.403 | null | null | 2,925 | null |
36,686 | 2 | null | 35,870 | 0 | null | Thanks everyone for the answers.
@Tom, @Chris Upchurch: The coordinates are fairly close to each others, and they are in a relatively small area of about 800 sq km. I guess I can assume the surface to be flat. I need to process the requests over and over again, and the response should be faster enough for more web ... | null | CC BY-SA 2.5 | null | 2008-08-31T08:18:05.700 | 2008-08-31T08:18:05.700 | null | null | 3,725 | null |
36,699 | 2 | null | 36,636 | 66 | null | [Kyle's answer](https://stackoverflow.com/a/36639/370671) is pretty good. I think the only additional clarification is that the closure is basically a snapshot of the stack at the point that the lambda function is created. Then when the function is re-executed the stack is restored to that state before executing the fu... | null | CC BY-SA 3.0 | null | 2008-08-31T09:08:31.663 | 2014-10-23T13:35:13.377 | 2017-05-23T12:26:36.443 | -1 | 2,925 | null |
36,696 | 2 | null | 29,847 | 1 | null | Assuming the Item Ids are incrementally numbered:
```
--Declare a temp table to hold the last step for each item id
DECLARE @LastStepForEach TABLE (
Id int,
Status int,
BatchRef char(10),
ItemCount int)
--Loop counter
DECLARE @count INT;
SET @count = 0;
--Loop through all of the items
WHILE (@count < (SELECT MAX(Id)... | null | CC BY-SA 2.5 | null | 2008-08-31T08:52:31.640 | 2008-08-31T08:52:31.640 | null | null | 3,677 | null |
36,702 | 2 | null | 36,701 | 1 | null | I don't see the harm if you know that it's always going to be a simple struct and that you're never going to want to attach behaviour to it.
| null | CC BY-SA 2.5 | null | 2008-08-31T09:20:18.080 | 2008-08-31T09:20:18.080 | null | null | 1,450 | null |
36,698 | 2 | null | 35,490 | 17 | null | I have not used any of these libraries, but I may be able to give some hints.
1. MPI is a communication protocol while Spread and ØMQ are actual implementation.
2. MPI comes from "parallel" programming while Spread comes from "distributed" programming.
So, it really depends on whether you are trying to build a par... | null | CC BY-SA 2.5 | null | 2008-08-31T09:05:23.827 | 2008-08-31T09:05:23.827 | null | null | 3,827 | null |
36,707 | 1 | 36,714 | null | 780 | 348,631 | Are there good reasons why it's a better practice to have only one return statement in a function?
Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function?
| Should a function have only one return statement? | CC BY-SA 3.0 | 0 | 2008-08-31T09:26:55.660 | 2016-01-09T00:57:02.537 | 2013-02-21T02:11:01.117 | 1,829,458 | 381 | [
"language-agnostic",
"coding-style"
] |
36,701 | 1 | 36,734 | null | 198 | 356,748 | Is it completely against the Java way to create struct like objects?
```
class SomeData1 {
public int x;
public int y;
}
```
I can see a class with accessors and mutators being more Java like.
```
class SomeData2 {
int getX();
void setX(int x);
int getY();
void setY(int y);
private int... | Struct like objects in Java | CC BY-SA 2.5 | 0 | 2008-08-31T09:17:01.737 | 2019-01-11T04:31:00.327 | 2018-11-02T07:32:22.853 | 4,076,315 | 3,836 | [
"java",
"oop",
"struct"
] |
36,706 | 1 | 36,856 | null | 0 | 763 | How can I improve the look and feel of my Linux desktop to suit my programming needs?
I found Compiz and it makes switching between my workspaces (which is something I do all the time to make the most of my 13.3" screen laptop) easy and look great - so what else don't I know about that make my programming environment ... | How can I improve my programming experience on my Linux Desktop? | CC BY-SA 2.5 | null | 2008-08-31T09:26:51.450 | 2018-03-23T14:00:58.303 | 2008-09-02T04:55:15.533 | 305 | 2,362 | [
"linux",
"desktop",
"compiz"
] |
36,704 | 2 | null | 36,621 | 2 | null | From the [documentation](http://php.net/set_error_handler) (emphasis added):
> The following error types be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.
Calling un... | null | CC BY-SA 2.5 | null | 2008-08-31T09:22:12.223 | 2008-08-31T09:22:12.223 | null | null | 1,265 | null |
36,709 | 1 | 36,836 | null | 7 | 2,675 | Is there a good yacc/bison type LALR parser generator for .NET ?
| Is there a good yacc/bison type LALR parser generator for .NET? | CC BY-SA 3.0 | 0 | 2008-08-31T09:28:51.397 | 2018-08-11T21:03:37.663 | 2011-11-27T17:05:53.260 | 172,322 | 2,995 | [
".net",
"yacc",
"lalr"
] |
36,658 | 2 | null | 36,656 | 60 | null | use the <pre> tag (pre formatted), that will use a mono spaced font (for your art) and keep all the white space
```
<pre>
text goes here and here
and here and here Some out here
▄ ▄█▄ █▄ ▄
▄█▀█▓ ▄▓▀▀█▀ ▀▀▀█▓▀▀ ▀▀ ▄█▀█▓▀▀▀▀▀▓▄▀██▀▀
██ ██ ▀██▄▄ ▄█ ▀ ░▒ ░▒ ██ ██ ▄█... | null | CC BY-SA 2.5 | null | 2008-08-31T05:58:01.747 | 2008-08-31T06:03:18.723 | 2008-08-31T06:03:18.723 | 30 | 30 | null |
36,708 | 2 | null | 23,205 | 1 | null | If you're using Linux, try [Virtual Distributed Ethermet](http://vde.sourceforge.net/) (VDE).
VDE gives you virtualised switches/hubs and Ethernet cables. You can tune network characteristics such as latency, delay, MTU, errored bits per MB, bandwidth, duplicates, etc on individual cables - all in real time!
| null | CC BY-SA 2.5 | null | 2008-08-31T09:27:43.477 | 2008-08-31T09:27:43.477 | null | null | 3,796 | null |
36,711 | 2 | null | 36,707 | 10 | null | I would say you should have as many as required, or any that make the code cleaner (such as [guard clauses](http://www.refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html)).
I have personally never heard/seen any "best practices" say that you should have only one return statement.
For the most part,... | null | CC BY-SA 2.5 | null | 2008-08-31T09:30:18.977 | 2008-08-31T09:30:18.977 | null | null | 832 | null |
36,713 | 2 | null | 36,707 | 7 | null | One good reason I can think of is for code maintenance: you have a single point of exit. If you want to change the format of the result,..., it's just much simpler to implement. Also, for debugging, you can just stick a breakpoint there :)
Having said that, I once had to work in a library where the coding standards im... | null | CC BY-SA 2.5 | null | 2008-08-31T09:31:16.087 | 2008-08-31T09:31:16.087 | null | null | 2,638 | null |
36,716 | 2 | null | 36,709 | 3 | null | The [Gardens Point Parser Generator](http://plas.fit.qut.edu.au/gppg/) looks good, however I've not had a chance to try it myself.
| null | CC BY-SA 2.5 | null | 2008-08-31T09:31:50.250 | 2008-08-31T09:31:50.250 | null | null | 3,394 | null |
36,705 | 2 | null | 36,621 | 14 | null | `set_error_handler` is designed to handle errors with codes of: `E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE`. This is because `set_error_handler` is meant to be a method of reporting errors thrown by the error function `trigger_error`.
However, I did find this comment in the manual that may help you:
> "The follo... | null | CC BY-SA 2.5 | null | 2008-08-31T09:23:12.473 | 2008-08-31T09:23:12.473 | null | null | 2,025 | null |
36,714 | 2 | null | 36,707 | 741 | null | I often have several statements at the start of a method to return for "easy" situations. For example, this:
```
public void DoStuff(Foo foo)
{
if (foo != null)
{
...
}
}
```
... can be made more readable (IMHO) like this:
```
public void DoStuff(Foo foo)
{
if (foo == null) return;
...
... | null | CC BY-SA 3.0 | null | 2008-08-31T09:31:40.143 | 2015-03-11T20:40:44.757 | 2015-03-11T20:40:44.757 | 1,542,343 | 615 | null |
36,719 | 2 | null | 31,812 | 1 | null | In access I never figured out how to properly use the OLE object data type without real performance problems (and structural too -- lots of compact and repair jobs). The solution path I've always taken (mind you I haven't used Access in anger now for ) is to just store the blogs onto disk somewhere and store the file ... | null | CC BY-SA 2.5 | null | 2008-08-31T09:34:59.433 | 2008-08-31T09:34:59.433 | null | null | 2,995 | null |
36,721 | 2 | null | 36,709 | 5 | null | [SableCC](http://sablecc.org/) can generate c# code. It's pretty good but you need a few days to figure out how it all works, because the documentation ist not that great
| null | CC BY-SA 2.5 | null | 2008-08-31T09:35:38.027 | 2008-08-31T09:35:38.027 | null | null | 2,450 | null |
36,677 | 2 | null | 12,141 | 1 | null | > Truncate table T_DAT_STORE
T_DAT_STORE was the fact table of the department I work in. I think I was connected to the development database. Fortunately, we have a daily backup, which hasn't been used until that day, and the data was restored in six hours.
Since then I revise everything before a truncate, and period... | null | CC BY-SA 3.0 | null | 2008-08-31T07:38:55.640 | 2018-02-23T00:41:11.817 | 2018-02-23T00:41:11.817 | 8,270,343 | 518 | null |
36,725 | 2 | null | 36,707 | 6 | null | I've worked with terrible coding standards that forced a single exit path on you and the result is nearly always unstructured spaghetti if the function is anything but trivial -- you end up with lots of breaks and continues that just get in the way.
| null | CC BY-SA 2.5 | null | 2008-08-31T09:39:25.240 | 2008-08-31T09:39:25.240 | null | null | 2,995 | null |
36,715 | 1 | null | null | 0 | 5,135 | When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?
This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's bui... | How can I access a website configured with host headers in IIS on the local machine? | CC BY-SA 2.5 | null | 2008-08-31T09:31:50.050 | 2020-08-09T09:15:22.263 | 2008-08-31T10:00:19.327 | 1,521 | 1,521 | [
"iis",
"hostheaders"
] |
36,726 | 2 | null | 36,715 | 3 | null | Just an idea: Mapping the hostname to 127.0.0.1 in the hosts ($WINDOWS$\system32\drivers\etc) file may help. This way you should be able to pull up the local IIS site by typing the hostname as if it's a remote server
| null | CC BY-SA 2.5 | null | 2008-08-31T09:40:14.240 | 2008-08-31T09:40:14.240 | null | null | 227 | null |
36,728 | 2 | null | 36,715 | 0 | null | Maybe I am not understanding the question, but what's wrong with just typing in the URL for the website? If it's the matter of domain name resolution, you can point to the right DNS or put it in [hosts](http://en.wikipedia.org/wiki/Hosts_file) file.
| null | CC BY-SA 2.5 | null | 2008-08-31T09:43:10.427 | 2008-08-31T09:43:10.427 | null | null | 3,827 | null |
36,724 | 2 | null | 36,707 | 72 | null | [Structured programming](http://en.wikipedia.org/wiki/Structured_programming) says you should only ever have one return statement per function. This is to limit the complexity. Many people such as Martin Fowler argue that it is simpler to write functions with multiple return statements. He presents this argument in the... | null | CC BY-SA 2.5 | null | 2008-08-31T09:38:53.307 | 2009-09-05T10:56:54.637 | 2009-09-05T10:56:54.637 | 30,478 | 3,836 | null |
36,730 | 2 | null | 33,250 | 2 | null | AD does that sort of caching for you so don't worry about it unless performance becomes a problem. I have software doing this sort of thing all day long running on a corporate intranet that takes thousands of hits per hour and have never had to tune performance in this area.
| null | CC BY-SA 2.5 | null | 2008-08-31T09:46:56.720 | 2008-08-31T09:46:56.720 | null | null | 2,995 | null |
36,731 | 2 | null | 36,707 | 43 | null | I've seen it in coding standards for C++ that were a hang-over from C, as if you don't have RAII or other automatic memory management then you have to clean up for each return, which either means cut-and-paste of the clean-up or a goto (logically the same as 'finally' in managed languages), both of which are considered... | null | CC BY-SA 2.5 | null | 2008-08-31T09:48:38.933 | 2010-10-28T08:36:51.417 | 2010-10-28T08:36:51.417 | 1,527 | 1,527 | null |
36,732 | 2 | null | 36,707 | 62 | null | As Kent Beck notes when discussing guard clauses in [Implementation Patterns](http://www.amazon.co.uk/Implementation-Patterns-Addison-Wesley-Signature-Kent/dp/0321413091/) making a routine have a single entry and exit point ...
> "was to prevent the confusion possible
when jumping into and out of many
locations in... | null | CC BY-SA 2.5 | null | 2008-08-31T09:48:40.523 | 2008-08-31T09:48:40.523 | null | null | 1,348 | null |
36,733 | 1 | 36,777 | null | 7 | 4,044 | I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page.
Since they are coming from a variety of ways, I am just curious as to the way to the user back to the calling pag... | Redirecting users from edit page back to calling page | CC BY-SA 2.5 | 0 | 2008-08-31T09:49:18.010 | 2013-05-27T16:56:33.863 | 2008-08-31T11:43:11.030 | 1,768 | 1,768 | [
"asp.net",
"redirect"
] |
36,734 | 2 | null | 36,701 | 62 | null | This is a commonly discussed topic. The drawback of creating public fields in objects is that you have no control over the values that are set to it. In group projects where there are many programmers using the same code, it's important to avoid side effects. Besides, sometimes it's better to return a copy of field's o... | null | CC BY-SA 3.0 | null | 2008-08-31T09:50:48.210 | 2016-07-10T16:58:39.203 | 2016-07-10T16:58:39.203 | 6,565,511 | 3,666 | null |