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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34,999 | 2 | null | 34,868 | 23 | null | Some notes that I also found useful:
- Keep your default values on the right side.```
function whatever($var1, $var2, $var3="constant", $var4="another")
```
- The default value of the argument must be a constant expression. It can't be a variable or a function call.
| null | CC BY-SA 3.0 | null | 2008-08-29T18:46:33.103 | 2017-04-06T17:29:31.270 | 2017-04-06T17:29:31.270 | 1,218,980 | 2,687 | null |
35,003 | 2 | null | 5,727 | 1 | null | Post office box number.
It's a piece of information that allows you to access something else.
(And if you do arithmetic on post office box numbers, you may have a problem, because the letter goes in the wrong box. And if somebody moves to another state -- with no forwarding address -- then you have a dangling pointer... | null | CC BY-SA 2.5 | null | 2008-08-29T18:47:30.713 | 2008-08-29T18:47:30.713 | null | null | 3,525 | null |
35,006 | 2 | null | 34,987 | 22 | null | > Problems - no way to get the number of strings automatically (that i know of).
There is a bog-standard way of doing this, which lots of people (including MS) define macros like `arraysize` for:
```
#define arraysize(ar) (sizeof(ar) / sizeof(ar[0]))
```
| null | CC BY-SA 3.0 | null | 2008-08-29T18:48:07.187 | 2015-12-22T19:19:26.110 | 2015-12-22T19:19:26.110 | 3,552,770 | 987 | null |
34,987 | 1 | null | null | 91 | 422,439 | I am trying to iterate over all the elements of a static array of strings in the best possible way. I want to be able to declare it on one line and easily add/remove elements from it without having to keep track of the number. Sounds really simple, doesn't it?
Possible non-solutions:
```
vector<string> v;
v.push_back... | How to declare an array of strings in C++? | CC BY-SA 3.0 | 0 | 2008-08-29T18:41:35.830 | 2019-10-28T13:31:58.140 | 2015-12-22T19:18:47.693 | 3,552,770 | 779 | [
"c++",
"arrays"
] |
35,001 | 2 | null | 34,981 | 2 | null | I think the key would be to help her understand why you are doing Scrum in the first place. I guess you have your reasons, so why not tell her? You are likely to get resistance towards any change if the people involved don't understand why there is change or what they will benefit from it. If you can explain your reaso... | null | CC BY-SA 2.5 | null | 2008-08-29T18:47:17.577 | 2008-08-29T18:47:17.577 | null | null | 1,709 | null |
34,998 | 2 | null | 34,981 | 14 | null | While Scrum other agile methodologies like it embody a lot of good practices, sometimes giving it a name and making it (as many bloggers have commented on) a "religion" that must be adopted in the workplace is rather offputting to a lot of people, including myself.
It depends on what your options and commitments are, ... | null | CC BY-SA 2.5 | null | 2008-08-29T18:46:28.297 | 2008-08-29T18:46:28.297 | null | null | 3,044 | null |
35,008 | 2 | null | 30,379 | 1 | null | Distributed File System (DFS) is good for content, especially if each server (or a number of servers) host a replica synced up with File Replication Service (FRS). So if you've got two servers, each has a complete replica, so one going down doesn't mean the site goes down.
If all servers in your 'cluster' will host a ... | null | CC BY-SA 2.5 | null | 2008-08-29T18:49:28.680 | 2008-08-29T18:49:28.680 | null | null | 3,660 | null |
35,002 | 1 | 35,666 | null | 73 | 25,369 |
Something along the lines of :
```
Collections.unmodifiableMap(myMap);
```
And just to clarify, I am not looking to stop the keys / values themselves from being changed, just the structure of the Dictionary. I want something that fails fast and loud if any of IDictionary's mutator methods are called (`Add, Remo... | Does C# have a way of giving me an immutable Dictionary? | CC BY-SA 2.5 | 0 | 2008-08-29T18:47:23.117 | 2022-03-30T06:46:03.197 | 2008-08-29T18:57:00.317 | 1,853 | 1,853 | [
"c#",
"java",
".net",
"collections",
"dictionary"
] |
35,011 | 1 | 35,057 | null | 21 | 12,747 | I've got a whole directory of dll's I need to register to the GAC. I'd like to avoid registering each file explicitly- but it appears that gacutil has no "register directory" option. Anyone have a fast/simple solution?
| Register Multiple Assemblies to the GAC in Vista | CC BY-SA 2.5 | 0 | 2008-08-29T18:50:51.360 | 2023-02-03T11:51:06.493 | null | null | 667 | [
".net",
"gac",
"gacutil"
] |
35,012 | 2 | null | 34,926 | 14 | null | Thanx to Daniel, but I needed it to be done inline ... here's the solution:
`= System.Text.RegularExpressions.Regex.Replace(StringWithHTMLtoStrip, "<[^>]+>","")`
Here are the links:
[http://weblogs.asp.net/rosherove/archive/2003/05/13/6963.aspx](http://weblogs.asp.net/rosherove/archive/2003/05/13/6963.aspx)
[http://... | null | CC BY-SA 3.0 | null | 2008-08-29T18:50:57.727 | 2012-06-09T22:01:13.270 | 2012-06-09T22:01:13.270 | 1,140,579 | 3,661 | null |
35,018 | 2 | null | 35,007 | 0 | null | If you're simply looking to expose a collection on your instance, then using a getter/setter to a private member variable seems like the most sensible solution to me (your first proposed option).
| null | CC BY-SA 2.5 | null | 2008-08-29T18:52:57.410 | 2008-08-29T18:52:57.410 | null | null | 2,696 | null |
35,015 | 2 | null | 34,975 | 1 | null | The philosophy that we follow at work is to keep the trunk in a state where you can push at any time without drastic harm to the site. This is not to say that the trunk will always be in a perfect state. There will of course be bugs in it. But the point is to never, ever leave it broken drastically.
If you have a feat... | null | CC BY-SA 2.5 | null | 2008-08-29T18:52:40.747 | 2008-08-29T18:52:40.747 | null | null | 1,797 | null |
35,017 | 1 | 35,051 | null | 2 | 2,036 | I need a database that could be stored network drive and would allow multiple users (up to 20) to use it without any server software.
I'm considering MS Access or Berkeley DB.
Can you share your experience with file databases?
Which one did you use, did you have any problems with it?
| File database suggestion with support for multiple concurrent users | CC BY-SA 3.0 | null | 2008-08-29T18:52:54.397 | 2017-07-20T16:03:54.480 | 2017-07-20T16:03:54.480 | 1,033,581 | 1,534 | [
"database",
"ms-access",
"concurrency",
"berkeley-db"
] |
35,024 | 2 | null | 34,879 | 9 | null | I like:
```
foreach(DictionaryEntry entry in hashtable)
{
Console.WriteLine(entry.Key + ":" + entry.Value);
}
```
| null | CC BY-SA 2.5 | null | 2008-08-29T18:55:10.087 | 2010-09-22T12:27:03.867 | 2010-09-22T12:27:03.867 | 54,501 | 632 | null |
35,007 | 1 | 38,410 | null | 48 | 24,339 | Every time I create an object that has a collection property I go back and forth on the best way to do it?
1. public property with a getter that returns a reference to private variable
2. explicit get_ObjList and set_ObjList methods that return and create new or cloned objects every time
3. explicit get_ObjList that ... | How to expose a collection property? | CC BY-SA 2.5 | 0 | 2008-08-29T18:48:17.390 | 2015-10-02T19:57:45.717 | 2008-09-16T15:05:40.703 | 2,582 | 2,582 | [
"c#",
".net",
"architecture"
] |
35,019 | 2 | null | 33,590 | 2 | null | Okay... so no-one's tried Astra, or people just avoid Flash questions.
After a lot of guess work it turns out I needed to cast the series to a PieSeries and then work with those member functions, as the ISeries was useless on it's own.
```
myPieChart.dataTipFunction =
function (item:Object, index:int, series:ISeri... | null | CC BY-SA 2.5 | null | 2008-08-29T18:53:02.870 | 2008-08-29T18:53:02.870 | null | null | 459 | null |
35,016 | 2 | null | 34,975 | 0 | null | For Subversion, I agree with Ryan Duffield's comment. The chapter he refers to provides a good analyses on which system to use.
The reason I asked is that Perforce provides a completely different way to create branches from SVN or CVS. Plus, there are all the DVCSs that give it's own philosophy on branching. Your b... | null | CC BY-SA 2.5 | null | 2008-08-29T18:52:44.617 | 2008-08-29T18:52:44.617 | null | null | 3,467 | null |
35,021 | 2 | null | 31,826 | 1 | null | I think there are too many variables involved to come up with a simple complexity metric unless you make a lot of assumptions.
A simple SAX style parser should be linear in terms of document size and flat for memory.
Something like XPath would be impossible to describe in terms of just the input document since the c... | null | CC BY-SA 2.5 | null | 2008-08-29T18:54:05.707 | 2008-08-29T18:54:05.707 | null | null | 3,631 | null |
35,025 | 2 | null | 7,252 | 2 | null |
1. Make code coverage part of the reviews.
2. Make "write a test that exposes the bug" a prerequisite to fixing a bug.
3. Require a certain level of coverage before code can be checked in.
4. Find a good book on test-driven development and use it to show how test-first can speed development.
| null | CC BY-SA 2.5 | null | 2008-08-29T18:55:24.813 | 2008-08-29T18:55:24.813 | null | null | 3,525 | null |
35,035 | 2 | null | 35,017 | 2 | null | Access can be a bitch. Ive been in the position where i had to go around and tell 20-50 people to close access so I could go to "design mode" to change the design of the forms and maybe a column. No fun at all. (Old access, and it might just be a bad setup)
| null | CC BY-SA 2.5 | null | 2008-08-29T18:58:04.730 | 2008-08-29T18:58:04.730 | null | null | 86 | null |
35,027 | 2 | null | 34,977 | 0 | null | Try this loop:
```
{
extern char byte_stream[];
int bytes = offset_in_packet;
int n = length_of_packet; /* Under 4 billion, so this can be represented in 32 bits. */
int t; /* 32-bit number used for temporary storage. */
int i;
unsigned char curByte;
for (i = 0; i < 4; i++) {
t = ... | null | CC BY-SA 2.5 | null | 2008-08-29T18:55:45.997 | 2008-08-29T18:55:45.997 | null | null | 3,641 | null |
35,030 | 2 | null | 29,496 | 2 | null | We use a script like the following. Gzip is from the cygwin project. I'm sure you could modify the syntax to use a zip tool instead. The "skip" argument is the number of files to not archive off -- we keep 11 days in the 'current' directory.
```
@echo off
setlocal
For /f "skip=11 delims=/" %%a in ('Dir D:\logs\W3SVC1\... | null | CC BY-SA 2.5 | null | 2008-08-29T18:56:50.347 | 2008-08-29T18:56:50.347 | null | null | 3,660 | null |
35,034 | 2 | null | 34,868 | 56 | null | > The default value of the argument must be a constant expression. It can't be a variable or a function call.
If you need this functionality however:
```
function foo($foo, $bar = false)
{
if(!$bar)
{
$bar = $foo;
}
}
```
Assuming `$bar` isn't expected to be a boolean of course.
| null | CC BY-SA 2.5 | null | 2008-08-29T18:57:57.537 | 2008-08-29T18:57:57.537 | null | null | 2,025 | null |
35,036 | 2 | null | 34,977 | 0 | null | I'm not sure I understand your question. What exactly are you trying to count? If I understand correctly you're trying to find the Most Significant non-zero byte.
You're probably better off using a loop like this:
```
int i;
int write_zeros = 0;
for (i = 3; i >=0 ; --i) {
t = (n >> (8 * i)) & 0xff;
... | null | CC BY-SA 2.5 | null | 2008-08-29T18:58:34.663 | 2008-08-29T18:58:34.663 | null | null | 1,084 | null |
35,038 | 2 | null | 35,026 | 21 | null | As far as I know, no. One reason is the folder structure on the hard drive; they will have a name like MSSQL10.[instancename]
| null | CC BY-SA 3.0 | null | 2008-08-29T18:59:18.953 | 2017-08-10T10:24:48.880 | 2017-08-10T10:24:48.880 | 366,904 | 740 | null |
35,037 | 1 | 35,052 | null | 1 | 2,393 | I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links:
```
<A HREF="path to file">filename</A>
```
The filenames can be complicated:
```
LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf
```
What is the correct way to link to this file on a Linux/Apache s... | How to convert complex filename into HTML link? | CC BY-SA 4.0 | 0 | 2008-08-29T18:58:55.583 | 2019-01-03T06:16:46.780 | 2019-01-03T06:16:46.780 | 10,757,987 | 2,703 | [
"php",
"html"
] |
35,026 | 1 | 35,038 | null | 149 | 112,265 | I need to convert a named instance of SQL server 2005, to a default instance.
Is there a way to do this without a reinstall?
---
The problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of us. I am looking for the path of lea... | SQL Server, convert a named instance to default instance? | CC BY-SA 3.0 | 0 | 2008-08-29T18:55:35.123 | 2017-08-10T10:24:48.880 | 2012-11-05T16:34:20.463 | 419 | 1,220 | [
"sql-server",
"sql-server-2005",
"named-instance"
] |
35,045 | 2 | null | 35,002 | 2 | null | I don't think so. There is a way to create a read-only List and read only Collection, but I don't think there's a built in read only Dictionary. System.ServiceModel has a ReadOnlyDictinoary implementation, but its internal. Probably wouldn't be too hard to copy it though, using Reflector, or to simply create your own f... | null | CC BY-SA 2.5 | null | 2008-08-29T19:02:09.180 | 2008-08-29T19:02:09.180 | null | null | 9 | null |
35,029 | 2 | null | 25 | 19 | null | DISCLAIMER: I am not a C++ programmer, however I know C really well. I
adapated these calls from some C code I have.
Also markdown put these strange _ as my underscores.
You should just be able to write an abstraction class around the C sockets with something like this:
```
class my_sock {
private int sock;
... | null | CC BY-SA 2.5 | null | 2008-08-29T18:56:19.723 | 2008-08-29T18:56:19.723 | null | null | 3,663 | null |
35,049 | 1 | null | null | 3 | 1,602 | How can I call a custom action dll written in managed code (.net) from an installer without using an unmanaged intermediary?
| custom action dll in managed code | CC BY-SA 2.5 | null | 2008-08-29T19:02:48.477 | 2008-10-10T03:12:01.277 | null | null | 1,807 | [
".net",
"installation"
] |
35,044 | 2 | null | 34,975 | 3 | null | We branch when a release is ready for final QA. If any issues are discovered during the QA process, the bugs are fixed in the branch, validated and then merged to the trunk. Once the branch passes QA we tag it as a release. Any hotfixes for that release are also done to the branch, validated, merged to the trunk and... | null | CC BY-SA 2.5 | null | 2008-08-29T19:02:08.917 | 2008-08-29T19:02:08.917 | null | null | null | null |
35,048 | 2 | null | 35,037 | 0 | null | [URL encoding](http://en.wikipedia.org/wiki/Url_encoding). I think it's `urlencode()` in PHP.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:02:45.217 | 2008-08-29T19:02:45.217 | null | null | 1,709 | null |
35,046 | 2 | null | 35,037 | 0 | null | [urlencode()](http://se.php.net/manual/en/function.urlencode.php) should probably do what you want.
: urlencode() works fine on swedish characters.
```
<?php
echo urlencode("åäö");
?>
```
converts to:
```
%E5%E4%F6
```
| null | CC BY-SA 2.5 | null | 2008-08-29T19:02:30.333 | 2008-08-29T19:10:03.793 | 2008-08-29T19:10:03.793 | 1,993 | 1,993 | null |
35,042 | 2 | null | 34,493 | 0 | null | > Unfortunately, the arguments of
INDIRECT are usually more complex than
that. Here's an actual formula from
one of the sheets, not the most
complex formula we have:`=IF(INDIRECT("'"&$B$5&"'!"&$O5&"1")="","",INDIRECT("'"&$B$5&"'!"&$O5&"1"))`
hm, you could write a simple parser by ignoring most of the character... | null | CC BY-SA 2.5 | null | 2008-08-29T19:01:03.613 | 2008-08-29T19:01:03.613 | null | null | 3,445 | null |
35,051 | 2 | null | 35,017 | 5 | null | I would suggest [SQLite](http://www.sqlite.org/index.html) because the entire database is stored in a single file, and it quite safely handles multiple users accessing it at the same time. There are several different libraries that you can use for your client application and there is no server software needed.
One of ... | null | CC BY-SA 2.5 | null | 2008-08-29T19:03:04.717 | 2008-08-29T19:03:04.717 | null | null | 3,641 | null |
35,056 | 2 | null | 35,050 | 3 | null | [Wikipedia](http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks)?
| null | CC BY-SA 2.5 | null | 2008-08-29T19:04:57.053 | 2008-08-29T19:04:57.053 | null | null | null | null |
35,052 | 2 | null | 35,037 | 3 | null | You can use [rawurlencode()](http://php.net/manual/en/function.rawurlencode.php) to convert a string according to the RFC 1738 spec.
This function replaces all non-alphanumeric characters by their associated code.
The difference with [urlencode()](http://php.net/manual/en/function.urlencode.php) is that spaces are enc... | null | CC BY-SA 2.5 | null | 2008-08-29T19:03:17.617 | 2008-08-29T19:03:17.617 | null | null | 1,074 | null |
35,050 | 1 | 35,054 | null | 4 | 5,581 | After the suggestion to use a library for [my ajax needs](https://stackoverflow.com/questions/34486/what-more-is-needed-for-ajax-than-this-function) I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart.
Thus, can anybody
A) Give a rundown of the difference... | Comparison of Javascript libraries | CC BY-SA 3.0 | 0 | 2008-08-29T19:03:01.347 | 2015-08-24T09:15:05.693 | 2017-05-23T11:52:11.833 | -1 | 1,384,652 | [
"javascript",
"comparison"
] |
35,047 | 1 | null | null | 15 | 4,255 | Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live along with the code that uses the revised ... | Migrating database changes from development to live | CC BY-SA 4.0 | 0 | 2008-08-29T19:02:34.170 | 2019-01-18T11:03:49.643 | 2019-01-18T11:03:49.643 | 567,854 | 137 | [
"php",
"mysql",
"schema",
"migration"
] |
35,058 | 2 | null | 35,037 | 0 | null | [rawurlencode](http://php.net/manual/en/function.rawurlencode.php) will encode "exotic" characters in a URL.
| null | CC BY-SA 3.0 | null | 2008-08-29T19:06:04.053 | 2011-11-13T12:10:08.533 | 2011-11-13T12:10:08.533 | 447,356 | 3,542 | null |
35,057 | 2 | null | 35,011 | 37 | null | GACUTIL doesn't register DLLs -- not in the "COM" sense. Unlike in COM, GACUTIL copies the file to an opaque directory under %SYSTEMROOT%\assembly and that's where they run from. It wouldn't make sense to ask GACUTIL "register a folder" (not that you can do that with RegSvr32 either).
You can use a batch FOR command s... | null | CC BY-SA 2.5 | null | 2008-08-29T19:05:44.880 | 2008-08-29T19:05:44.880 | null | null | 2,230 | null |
35,062 | 2 | null | 35,050 | 3 | null | Stackoverflow uses jquery I think, and I hear that jquery is all the rage
| null | CC BY-SA 2.5 | null | 2008-08-29T19:07:14.270 | 2008-08-29T19:07:14.270 | null | null | 86 | null |
35,061 | 2 | null | 35,047 | 2 | null | Symfony has a plugin called sfMigrationsLight that handles basic migrations. CakePHP also has migrations.
For whatever reason, migration support has never really been a high priority for most of the PHP frameworks and ORMs out there.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:07:11.850 | 2008-08-29T19:07:11.850 | null | null | 2,884 | null |
35,066 | 2 | null | 35,050 | 2 | null | We are starting to use jQuery where I work. I'm not big on JavaScript, but everyone else likes it a lot. I don't know if that helps at all...
| null | CC BY-SA 2.5 | null | 2008-08-29T19:07:57.403 | 2008-08-29T19:07:57.403 | null | null | 572 | null |
35,063 | 2 | null | 35,017 | 6 | null | I really don't think that file-based databases can scale past half a dozen users. The last time I had an Access database (admittedly this was quite a while ago) I had to work really hard to get it to work for 8-9 people.
It is really much easier to install Ubuntu on an old junk computer with PostgreSQL or MySQL. That'... | null | CC BY-SA 2.5 | null | 2008-08-29T19:07:23.537 | 2008-08-29T19:07:23.537 | null | null | 619 | null |
35,067 | 2 | null | 35,017 | 2 | null | [Ayende](http://www.ayende.com/Blog/Default.aspx) was recently trying to make a similar decision, and tried a bunch of so-called embedded databases. Hopefully his [observations](http://www.ayende.com/Blog/archive/2008/07/11/Observations-on-Embedded-databases.aspx) can help you.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:08:20.350 | 2008-08-29T19:08:20.350 | null | null | 2,696 | null |
35,068 | 2 | null | 34,977 | 4 | null | You should really use a fixed-width field for your length.
- - -
| null | CC BY-SA 2.5 | null | 2008-08-29T19:08:24.687 | 2008-08-29T19:08:24.687 | null | null | 773 | null |
35,054 | 2 | null | 35,050 | 10 | null | To answer B:
[Comparison of JavaScript frameworks](http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks)
---
Although everyone and their mom is apparently riding the [jQuery](http://jquery.com/) bandwagon (I use [MochiKit](http://www.mochikit.com)), there are many libraries which provide the same fun... | null | CC BY-SA 2.5 | null | 2008-08-29T19:04:05.667 | 2008-08-29T19:33:07.547 | 2008-08-29T19:33:07.547 | 1,790 | 1,790 | null |
35,072 | 2 | null | 35,050 | 4 | null | jQuery, easy to learn, easy to use, small footprint, active plugin developer community. Can't go wrong with jQuery.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:10:19.753 | 2008-08-29T19:10:19.753 | null | null | 648 | null |
35,065 | 2 | null | 35,007 | 3 | null | I usually go for this, a public getter that returns System.Collections.ObjectModel.ReadOnlyCollection:
```
public ReadOnlyCollection<SomeClass> Collection
{
get
{
return new ReadOnlyCollection<SomeClass>(myList);
}
}
```
And public methods on the object to modify the collection.
```
Clear();
Ad... | null | CC BY-SA 2.5 | null | 2008-08-29T19:07:44.893 | 2008-08-29T19:07:44.893 | null | null | 1,143 | null |
35,064 | 2 | null | 35,011 | 11 | null | Here is the script you would put into a batch file to register all of the files in the current directory with Gacutil. You don't need to put it in a batch file (you can just copy/paste it to a Command Prompt) to do it.
```
FOR %1 IN (*) DO Gacutil /i %1
```
Edit: Bah, sorry I was late. I didn't see the previous post... | null | CC BY-SA 2.5 | null | 2008-08-29T19:07:26.967 | 2008-08-29T19:14:24.160 | 2008-08-29T19:14:24.160 | 3,641 | 3,641 | null |
35,070 | 1 | 35,162 | null | 6 | 4,508 | What's the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at the start and end of testing.
Or, if there's a better way to unit test against the registry...
| programmatically merge .reg file into win32 registry | CC BY-SA 3.0 | 0 | 2008-08-29T19:09:47.353 | 2012-06-13T17:15:59.730 | 2012-06-13T17:15:59.730 | 851,273 | 1,683 | [
"unit-testing",
"registry"
] |
35,073 | 2 | null | 35,050 | 4 | null | For what its worth [jQuery's](http://jquery.com/) website redesign launched this morning (Friday August 29, 2008). Good fun fact. And of course +1 to its mention.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:10:40.767 | 2008-08-29T19:10:40.767 | null | null | 792 | null |
35,077 | 2 | null | 35,037 | 1 | null | The urlencode() function will convert spaces into plus signs (+), so it won't work. The rawurlencode does the trick. Thanks.
Be sure to convert each part of the path separately, otherwise path/file will be converted into path%2Ffile. (which was what I missed)
| null | CC BY-SA 2.5 | null | 2008-08-29T19:13:48.013 | 2008-08-29T19:13:48.013 | null | null | 2,703 | null |
35,075 | 2 | null | 34,345 | 0 | null | There aren't any time limits in the question so I suggest that prisoners should decide to take 1 hour per box and open them in the order presented. If the second prisoner is allowed into the room after 2 hours then he knows that the first prisoner found his own number in box 2. Therefore he knows to skip box 2 in his s... | null | CC BY-SA 2.5 | null | 2008-08-29T19:12:44.303 | 2008-08-29T19:12:44.303 | null | null | null | null |
35,080 | 2 | null | 31,875 | 18 | null | The one time I wrote a singleton in Python I used a class where all the member functions had the classmethod decorator.
```
class Foo:
x = 1
@classmethod
def increment(cls, y=1):
cls.x += y
```
| null | CC BY-SA 4.0 | null | 2008-08-29T19:15:02.393 | 2021-05-24T00:16:16.697 | 2021-05-24T00:16:16.697 | 2,326,961 | 1,447 | null |
35,084 | 2 | null | 15,496 | 12 | null | It's not exactly hidden, but reflection is incredibly useful and powerful. It is great to use a simple Class.forName("...").newInstance() where the class type is configurable. It's easy to write this sort of factory implementation.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:17:46.897 | 2008-08-29T19:17:46.897 | null | null | 3,535 | null |
35,076 | 1 | 35,100 | null | 2 | 1,499 | I'm working with a SQL Server 2000 database that likely has a few dozen tables that are no longer accessed. I'd like to clear out the data that we no longer need to be maintaining, but I'm not sure how to identify which tables to remove.
The database is shared by several different applications, so I can't be 100% con... | Strategy for identifying unused tables in SQL Server 2000? | CC BY-SA 2.5 | null | 2008-08-29T19:13:14.350 | 2008-10-17T21:28:30.610 | 2008-10-14T05:54:41.450 | 1,786 | 3,344 | [
"sql",
"database",
"sql-server-2000"
] |
35,082 | 2 | null | 34,798 | 0 | null | Is the Modal Window popped up using the IE Modal window? Or is it a DIV that you are showing?
If it is an IE Modal Pop up you need to ensure you have
```
<base target="_self" />
```
To make sure the post back are to the modal page.
If it is a DIV make sure you have your XHTML correct or it might not know what to... | null | CC BY-SA 2.5 | null | 2008-08-29T19:16:30.863 | 2008-08-29T19:16:30.863 | null | null | 2,469 | null |
35,083 | 2 | null | 34,975 | 54 | null | Here is the method I've used in the past with good success:
/trunk - bleeding edge. Next major release of the code. May or may not work at any given time.
/branches/1.0, 1.1, etc. Stable maintenance branches of the code. Used to fix bugs, stabilize new releases. If a maintenance branch, it should compile (if app... | null | CC BY-SA 2.5 | null | 2008-08-29T19:17:18.520 | 2008-08-29T19:17:18.520 | null | null | 2,884 | null |
35,081 | 2 | null | 35,050 | 1 | null | I've been using [Prototype](http://www.prototypejs.org/) + [Scriptaculous](http://script.aculo.us/).
They have good API documentation and work great for me! The biggest benefits are:
- - - -
| null | CC BY-SA 2.5 | null | 2008-08-29T19:15:17.713 | 2008-08-29T19:15:17.713 | null | null | 237 | null |
35,087 | 2 | null | 35,076 | 0 | null | If you have lastupdate columns you can check for the writes, there is really no easy way to check for reads. You could run profiler, save the trace to a table and check in there
What I usually do is rename the table by prefixing it with an underscrore, when people start to scream I just rename it back
| null | CC BY-SA 2.5 | null | 2008-08-29T19:19:26.953 | 2008-08-29T19:19:26.953 | null | null | 740 | null |
35,059 | 2 | null | 35,002 | 27 | null | As far as I know, there is not. But maybe you can copy some code (and learn a lot) from these articles:
- [Immutability in C# Part One: Kinds of Immutability](https://learn.microsoft.com/en-us/archive/blogs/ericlippert/immutability-in-c-part-one-kinds-of-immutability)- [Immutability in C# Part Two: A Simple Immutable ... | null | CC BY-SA 4.0 | null | 2008-08-29T19:06:19.403 | 2020-05-13T04:35:22.547 | 2020-05-13T04:35:22.547 | 2,691,058 | 31,505 | null |
35,092 | 2 | null | 35,070 | 2 | null | I looked into it by checking out my file associations.
It seems that a .reg file is just called as the first parameter to the `regedit.exe` executable on Windows.
So you can just say `regedit.exe "mytest.reg"`. What I'm not sure of is how to get rid of the dialog box that pops up that asks for your confirmation.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:21:20.023 | 2008-08-29T19:21:20.023 | null | null | 1,074 | null |
35,091 | 2 | null | 35,049 | 0 | null | There is support for exactly this in .NET/Windows Installer
Create an assembly using VS.NET.
Add an installer class to the project - select 'Add - New Item'. Select intaller class.
This class derives from System.Configuration.Install.Installer. It has a number of virtual methods such as Install(). This will be called ... | null | CC BY-SA 2.5 | null | 2008-08-29T19:20:58.153 | 2008-08-29T22:57:40.363 | 2008-08-29T22:57:40.363 | 2,768 | 2,768 | null |
35,094 | 2 | null | 35,076 | 0 | null | If by not used, you mean your application has no more references to the tables in question and you are using dynamic sql, you could do a search for the table names in your app, if they don't exist blow them away.
I've also outputted all sprocs, functions, etc. to a text file and done a search for the table names. If ... | null | CC BY-SA 2.5 | null | 2008-08-29T19:22:59.550 | 2008-08-29T19:22:59.550 | null | null | 1,865 | null |
35,093 | 2 | null | 34,981 | 4 | null | Simple. Don't talk about scrum. Don't use scrum on her. Instead take the underlying principles of scrum (e.g. the purpose as opposed to the application) and create different approaches that accommodate her way of working but have subtle tints of scrum.
All humans are different and a lot of programmers dislike scrum. I... | null | CC BY-SA 2.5 | null | 2008-08-29T19:22:30.660 | 2008-08-29T19:22:30.660 | null | null | 1,143 | null |
35,088 | 2 | null | 7,252 | 1 | null | On your source repository : use hooks before each commits (pre-commit hook for SVN for example)
In that hook, check for the existence of at least one use case for each method. Use a convention for unit test organisation that you could easily enforce via a pre-commit hook.
On an integration server compile everything a... | null | CC BY-SA 2.5 | null | 2008-08-29T19:19:31.150 | 2008-08-29T19:19:31.150 | null | null | 3,673 | null |
35,098 | 2 | null | 35,070 | 1 | null | Use the Win32 API function ShellExecute() or ShellExecuteEx(). If the comment is 'open' it should merge the .reg file. I haven't tested it, but it should work.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:24:06.773 | 2008-08-29T19:24:06.773 | null | null | 2,768 | null |
35,099 | 2 | null | 35,002 | 1 | null | "Out of the box" there is not a way to do this. You can create one by deriving your own Dictionary class and implementing the restrictions you need.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:24:53.307 | 2008-08-29T19:24:53.307 | null | null | 1,559 | null |
35,095 | 2 | null | 34,975 | 3 | null | We use the wild, wild, west style of git-branches. We have some branches that have well-known names defined by convention, but in our case, tags are actually more important for us to meet our corporate process policy requirements.
I saw below that you use Subversion, so I'm thinking you probably should check out the ... | null | CC BY-SA 2.5 | null | 2008-08-29T19:23:20.160 | 2008-08-29T19:23:20.160 | null | null | 3,279 | null |
35,089 | 2 | null | 34,209 | 4 | null | The `core` attribute isn't used anymore.
From [Brian Rosner's Blog](http://oebfare.com/blog/2008/jul/20/newforms-admin-migration-and-screencast/):
> You can safely just remove any and all `core` arguments. They are no longer used. now provides a nice delete checkbox for exisiting instances in inlines.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:20:47.373 | 2010-06-01T10:52:30.990 | 2010-06-01T10:52:30.990 | 73,603 | 444 | null |
35,085 | 2 | null | 24,901 | 22 | null | The [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html#Preincrement_and_Predecrement) says:
> Use prefix form (++i) of the increment and decrement operators with
iterators and other template objects. When a variable is incremented (++i or i++) or decremented (--i or
i--) and the value of the exp... | null | CC BY-SA 4.0 | null | 2008-08-29T19:18:21.700 | 2020-12-19T17:29:52.017 | 2020-12-19T17:29:52.017 | 7,184,815 | 3,373 | null |
35,100 | 2 | null | 35,076 | 5 | null | MSSQL2000 won't give you that kind of information. But a way you can identify what tables ARE used (and then deduce which ones are not) is to use the SQL Profiler, to save all the queries that go to a certain database. Configure the profiler to record the results to a new table, and then check the queries saved there t... | null | CC BY-SA 2.5 | null | 2008-08-29T19:25:05.553 | 2008-08-29T19:25:05.553 | null | null | 3,399 | null |
35,096 | 2 | null | 34,896 | 2 | null | Perl has a taint option which considers all user input "tainted" until it's been checked with a regular expression. Tainted data can be used and passed around, but it taints any data that it comes in contact with until untainted. For instance, if user input is appended to another string, the new string is also tainte... | null | CC BY-SA 2.5 | null | 2008-08-29T19:23:26.850 | 2008-08-29T19:23:26.850 | null | null | 1,438 | null |
35,109 | 2 | null | 35,103 | -2 | null | just make a const string that holds the md5 hash and compile it into your app ... your app can then just refer to this const string when validating the configuration file
| null | CC BY-SA 2.5 | null | 2008-08-29T19:30:25.853 | 2008-08-29T19:30:25.853 | null | null | 3,433 | null |
35,110 | 2 | null | 34,916 | 5 | null | I hear you, I've followed the Pylons mailing list for a while looking for something similar. There have been some attempts in the past (see [AdminPylon](http://adminpylon.devjavu.com/) and [Restin](http://code.google.com/p/restin/)) but none have really kept up with SQLAlchemy's rapidly developing orm api.
Since DBSpr... | null | CC BY-SA 2.5 | null | 2008-08-29T19:30:29.173 | 2008-08-29T19:30:29.173 | null | null | 199 | null |
35,102 | 1 | 35,139 | null | 5 | 379 | In emacs, I've read the following code snippet in `simple.el`:
```
(frame-parameter frame 'buried-buffer-list)
```
What is the exact meaning of the `'buried-buffer-list` parameter?
What it is used for?
| What is the role of the buried-buffer-list frame parameter in Emacs | CC BY-SA 3.0 | null | 2008-08-29T19:27:17.980 | 2013-01-23T21:39:37.310 | 2013-01-23T21:33:16.973 | 6,148 | 3,673 | [
"emacs",
"elisp"
] |
35,106 | 1 | 35,125 | null | 11 | 1,933 | I've found [ScriptingJsonSerializationSection](http://msdn.microsoft.com/en-us/library/system.web.configuration.scriptingjsonserializationsection.scriptingjsonserializationsection.aspx) but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on ... | Is there a built in way in .Net AJAX to manually serialize an object to a JSON string? | CC BY-SA 2.5 | 0 | 2008-08-29T19:28:50.583 | 2012-06-09T21:59:59.633 | 2008-08-29T19:49:55.557 | 1,414 | 1,414 | [
"asp.net",
"vb.net",
"json",
"serialization",
".net-2.0"
] |
35,108 | 2 | null | 15,496 | 144 | null | How about which have been in place since JDK 1.5? It is pretty poorly publicised, as it is an unsexy addition, but as I understand it, is absolutely necessary for generics to work.
Essentially, the compiler now allows a subclass to narrow the return type of an overridden method to be a subclass of the original met... | null | CC BY-SA 2.5 | null | 2008-08-29T19:29:40.940 | 2008-08-29T19:44:26.257 | 2008-08-29T19:44:26.257 | 1,853 | 1,853 | null |
35,101 | 2 | null | 35,050 | 3 | null | I have to put in another vote for [jQuery](http://jquery.com/). It is dead-simple to use and makes your javascript much cleaner.
As an example, if you want to add an onclick event to all the divs inside an element with id "clickdivs", you just do this:
```
function clickedme(event) {
alert('Someone clicked me!');
}... | null | CC BY-SA 2.5 | null | 2008-08-29T19:25:14.820 | 2008-08-29T19:25:14.820 | null | null | 619 | null |
35,103 | 1 | 35,116 | null | 9 | 1,378 | I'd like to bind a configuration file to my executable. I'd like to do this by storing an MD5 hash of the file inside the executable. This should keep anyone but the executable from modifying the file.
Essentially if someone modifies this file outside of the program the program should fail to load it again.
EDIT: The... | How do I store information in my executable in .Net | CC BY-SA 3.0 | 0 | 2008-08-29T19:27:18.667 | 2011-11-18T03:08:09.310 | 2011-11-18T03:08:09.310 | 102,937 | 2,191 | [
"c#",
".net"
] |
35,114 | 2 | null | 35,050 | 3 | null | Related thread here, with some good contributions:
[What JavaScript library would you choose for a new project and why?](https://stackoverflow.com/questions/913/what-javascript-library-would-you-choose-for-a-new-project-and-why)
| null | CC BY-SA 2.5 | null | 2008-08-29T19:32:48.140 | 2008-08-29T19:32:48.140 | 2017-05-23T12:01:23.407 | -1 | 137 | null |
35,112 | 2 | null | 35,049 | 0 | null | I wish I knew more about your specific situation, but as general piece of advice, you might look into C++/CLI for issues involving unmanaged/managed interoperability:
[C++: The Most Powerful Language for .NET Framework Programming](http://msdn.microsoft.com/en-us/library/ms379617%28VS.80%29.aspx#vs05cplus_topic12)
I ... | null | CC BY-SA 2.5 | null | 2008-08-29T19:31:01.733 | 2008-08-29T19:31:01.733 | null | null | 2,543 | null |
35,111 | 2 | null | 25,807 | 11 | null | @John: Your snippet doesn't work -- you are returning the of the base classes (which are also known as metaclasses). You really just want `cls.__bases__`:
```
class A: pass
class B: pass
class C(A, B): pass
c = C() # Instance
assert C.__bases__ == (A, B) # Works
assert c.__class__.__bases__ == (A, B) # Works
def m... | null | CC BY-SA 2.5 | null | 2008-08-29T19:30:31.763 | 2009-02-16T09:50:34.273 | 2009-02-16T09:50:34.273 | 3,594 | 3,594 | null |
35,119 | 2 | null | 31,834 | 4 | null | Is this link related?
[http://blenderartists.org/forum/showthread.php?t=77794](http://blenderartists.org/forum/showthread.php?t=77794)
To generate terrain (height map) the algorithm is pretty simple (fractal plasma), something like this algorithm (Java):
[http://www.sinc.stonybrook.edu/stu/jseyster/plasma/](http://w... | null | CC BY-SA 2.5 | null | 2008-08-29T19:35:20.397 | 2008-08-29T19:35:20.397 | null | null | 2,543 | null |
35,125 | 2 | null | 35,106 | 11 | null | This should do the trick
```
Dim jsonSerialiser As New System.Web.Script.Serialization.JavaScriptSerializer
Dim jsonString as String = jsonSerialiser.Serialize(yourObject)
```
| null | CC BY-SA 2.5 | null | 2008-08-29T19:37:28.363 | 2008-08-29T19:37:28.363 | null | null | 3,543 | null |
35,124 | 2 | null | 15,496 | 4 | null | Functors are pretty cool. They are pretty close to a function pointer, which everyone is usually quick to say is impossible in Java.
[Functors in Java](http://chaoticjava.com/posts/functors-in-java-and-beyond/)
| null | CC BY-SA 2.5 | null | 2008-08-29T19:36:48.253 | 2008-08-29T19:36:48.253 | null | null | 12,081 | null |
35,118 | 2 | null | 33,457 | 1 | null | Looks like the docs are wrong (and have continued to be wrong for the last 3+ years!). I found this snippet with [Reflector](http://www.red-gate.com/products/reflector/) in [Microsoft.SqlServer.Management.Common.ConnectionManager](http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.common.connectionm... | null | CC BY-SA 2.5 | null | 2008-08-29T19:35:04.123 | 2008-08-29T19:35:04.123 | null | null | 2,199 | null |
35,128 | 2 | null | 35,106 | 6 | null | I think what you're looking for is this class:
`System.ServiceModel.Web.DataContractJsonSerializer`
Here's an example from Rick Strahl: [DataContractJsonSerializer in .NET 3.5](http://www.west-wind.com/WebLog/posts/218001.aspx)
| null | CC BY-SA 3.0 | null | 2008-08-29T19:37:45.850 | 2012-06-09T21:59:59.633 | 2012-06-09T21:59:59.633 | 1,140,579 | 3,046 | null |
35,131 | 2 | null | 35,120 | 2 | null | I know this doesn't directly answer your question, but what if you do all of the clipping on the client side to crop the image, then send the server the original image and the coordinates for clipping. Then on the server side, which will probably more suited for image manipulation like this (e.g. PHP it's very easy) yo... | null | CC BY-SA 2.5 | null | 2008-08-29T19:38:18.377 | 2008-08-29T19:38:18.377 | null | null | 3,641 | null |
35,117 | 2 | null | 35,103 | 1 | null | Out of pure curiosity, what's your reasoning for never wanting to load the file if it's been changed?
Why not just keep all of the configuration information compiled in the executable? Why bother with an external file at all?
I just read your edit about this being a credit card info program. That poses a very int... | null | CC BY-SA 2.5 | null | 2008-08-29T19:34:46.980 | 2008-08-29T19:50:18.783 | 2008-08-29T19:50:18.783 | 305 | 305 | null |
35,123 | 1 | 159,454 | null | 13 | 11,859 | What did I do wrong?
Here is an excerpt from my code:
```
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
ScrolledComposite scrollBox = new ScrolledComposite(parent, SWT.V_SCROLL);
scrollBox.setExpandHorizontal(true);
mParent = new Composite(scrollBox, SWT.NONE);
scroll... | Prevent SWT ScrolledComposite from eating part of it's children | CC BY-SA 3.0 | 0 | 2008-08-29T19:36:33.920 | 2017-11-23T19:53:26.360 | 2017-11-22T12:03:56.590 | 452,775 | 3,657 | [
"java",
"eclipse",
"swt",
"rcp"
] |
35,120 | 1 | 35,705 | null | 4 | 4,489 | Is it possible to do image processing in silverlight 2.0?
What I want to do is take an image, crop it, and then send the new cropped image up to the server. I know I can fake it by clipping the image, but that only effects the rendering of the image. I want to create a new image.
After further research I have answe... | Image processing in Silverlight 2 | CC BY-SA 2.5 | null | 2008-08-29T19:35:44.327 | 2009-05-13T18:13:17.007 | 2017-05-23T10:27:42.823 | -1 | 580 | [
"silverlight"
] |
35,132 | 2 | null | 35,106 | 2 | null | In the System.Web.Extensions assembly, version 3.5.0.0, there's a [JavaScriptSerializer](http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx) class that should handle what you want.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:38:32.090 | 2008-08-29T19:38:32.090 | null | null | 3 | null |
35,133 | 2 | null | 35,106 | 1 | null | Try
```
System.Web.Script.Serialization.JavaScriptSerializer
```
or Check out [JSON.org](http://www.json.org/) there is a whole list of libraries written to do exactly what you want.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:39:06.377 | 2008-08-29T19:39:06.377 | null | null | 3,294 | null |
35,134 | 2 | null | 35,106 | 4 | null | Since the JavaScriptSerializer class is technically being deprecated, I believe [DataContractJsonSerializer](http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer.aspx) is the preferable way to go if you're using 3.0+.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:40:49.260 | 2008-08-29T19:40:49.260 | null | null | 60 | null |
35,138 | 2 | null | 34,896 | 6 | null | The most important thing is to always be consistent in when you escape. Accidental double sanitizing is lame and not sanitizing is dangerous.
For SQL, just make sure your database access library supports bind variables which automatically escapes values. Anyone who manually concatenates user input onto SQL strings sho... | null | CC BY-SA 2.5 | null | 2008-08-29T19:42:08.320 | 2008-08-29T19:42:08.320 | null | null | 3,674 | null |
35,143 | 2 | null | 34,717 | 1 | null | It looks like you can't embed `<object>` tags in a richtext field. I'm getting nothing when I do it.
| null | CC BY-SA 3.0 | null | 2008-08-29T19:44:42.120 | 2015-09-01T09:44:09.460 | 2015-09-01T09:44:09.460 | 1,245,190 | 1,753 | null |
35,151 | 2 | null | 34,798 | 3 | null | Make sure you have the following set on the UpdatePanel:
ChildrenAsTriggers=false and UpdateMode=Conditional
| null | CC BY-SA 2.5 | null | 2008-08-29T19:49:08.787 | 2008-08-29T19:49:08.787 | null | null | 3,675 | null |