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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35,126 | 2 | null | 34,735 | 10 | null | I have a webpage about [rotary encoders and how to use them](http://www.ubasics.com/adam/electronics/doc/rotryenc.shtml), which you might find useful.
Unfortunately without more information I can't troubleshoot your particular problem.
Which microcontroller pins are connected to the encoder, and what is the code you... | null | CC BY-SA 3.0 | null | 2008-08-29T19:37:37.503 | 2012-05-07T08:54:52.770 | 2012-05-07T08:54:52.770 | 387,660 | 2,915 | null |
35,116 | 2 | null | 35,103 | 11 | null | A better solution is to store the MD5 in the configuration file. But instead of the MD5 being just of the configuration file, also include some secret "key" value, like a fixed guid, in the MD5.
```
write(MD5(SecretKey + ConfigFileText));
```
Then you simply remove that MD5 and rehash the file (including your secre... | null | CC BY-SA 2.5 | null | 2008-08-29T19:34:07.573 | 2009-07-29T18:11:31.110 | 2009-07-29T18:11:31.110 | 255 | 255 | null |
35,157 | 2 | null | 35,076 | 0 | null | It looks like using the Profiler is going to work. Once I've let it run for a while, I should have a good list of used tables. Anyone who doesn't use their tables every day can probably wait for them to be restored from backup. Thanks, folks.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:50:44.430 | 2008-08-29T19:50:44.430 | null | null | 3,344 | null |
35,142 | 2 | null | 34,981 | 11 | null | > Without her input, I started the Scrum practices (daily scrums, burndown charts and other things I've found that worked for me and my previous teams (ala H. Kniberg's cool wall chart). During out daily stand up she slinks by and ignores us as if we actually weren't standing right outside her door (we are actually). I... | null | CC BY-SA 2.5 | null | 2008-08-29T19:44:12.433 | 2008-08-29T19:44:12.433 | 2020-06-20T09:12:55.060 | -1 | 1,438 | null |
35,154 | 2 | null | 35,007 | 0 | null | I'm a java developer but I think this is the same for c#.
I never expose a private collection property because other parts of the program can change it without parent noticing, so that in the getter method I return an array with the objects of the collection and in the setter method I call a `clearAll()` over the coll... | null | CC BY-SA 3.0 | null | 2008-08-29T19:50:03.387 | 2013-04-26T12:41:33.487 | 2013-04-26T12:41:33.487 | 1,012,641 | 518 | null |
35,144 | 2 | null | 35,002 | 2 | null | One workaround might be, throw a new list of KeyValuePair from the Dictionary to keep the original unmodified.
```
var dict = new Dictionary<string, string>();
dict.Add("Hello", "World");
dict.Add("The", "Quick");
dict.Add("Brown", "Fox");
var dictCopy = dict.Select(
item => new KeyValuePair<string, string>(item... | null | CC BY-SA 2.5 | null | 2008-08-29T19:44:59.500 | 2008-08-29T19:44:59.500 | null | null | 3,055 | null |
35,136 | 2 | null | 35,106 | 3 | null | Well, I am currently using the following extension methods to serialize and deserialize objects:
```
using System.Web.Script.Serialization;
public static string ToJSON(this object objectToSerialize)
{
JavaScriptSerializer jss = new JavaScriptSerializer();
return jss.Serialize(objectToSerialize);
}
/// <typeparam... | null | CC BY-SA 2.5 | null | 2008-08-29T19:41:07.120 | 2008-08-29T19:41:07.120 | null | null | 1,790 | null |
35,162 | 2 | null | 35,070 | 9 | null | It is possible to remove registry keys using a .reg file, although I'm not sure how well it's documented. Here's how:
```
REGEDIT4
[-HKEY_CURRENT_USER\Software\<otherpath>]
```
The `-` in front of the key name tells `Regedit` that you want to remove the key.
To run this silently, type:
```
regedit /s "myfile.reg... | null | CC BY-SA 2.5 | null | 2008-08-29T19:53:11.507 | 2008-08-29T19:53:11.507 | null | null | 863 | null |
35,160 | 2 | null | 34,304 | 3 | null | First, we have check-in (smoke) tests that must run before code can be checked in. It's done automatically by running a job that runs the tests and then makes the check-in to source control upon successful test completion. Second, cruise control kicks off build and regression tests. The product is built then several se... | null | CC BY-SA 2.5 | null | 2008-08-29T19:52:31.697 | 2008-08-29T19:52:31.697 | null | null | 3,150 | null |
35,169 | 2 | null | 34,204 | 1 | null | Well... It looks like you have three options.
1. In your batch file, issue a tf get at each directory branch you want.
2. reorganize your solution so that all of the dependencies are under the same root path.
3. Use the visual way of right clicking on the loaded project and issuing the get command.
The only time i... | null | CC BY-SA 2.5 | null | 2008-08-29T19:55:29.100 | 2008-08-29T19:55:29.100 | null | null | 2,424 | null |
35,170 | 1 | 35,193 | null | 21 | 43,335 | What does it mean if a task is declared with the automatic keyword in Verilog?
```
task automatic do_things;
input [31:0] number_of_things;
reg [31:0] tmp_thing;
begin
// ...
end
endtask;
```
Note: This question is mostly because I'm curious if there are any hardware programmers on the site. :)
| Verilog automatic task | CC BY-SA 2.5 | 0 | 2008-08-29T19:56:47.427 | 2022-12-19T07:36:01.383 | null | null | 3,594 | [
"verilog"
] |
35,139 | 2 | null | 35,102 | 1 | null | The result of is:
> frame-parameter is a built-in
function.```
(frame-parameter FRAME PARAMETER)
```
Return FRAME's value for parameter
PARAMETER. If FRAME is nil, describe
the currently selected frame.
Also, have a look in the Elisp info manual for the node called ["Frame/Frame Parameters"](http://www.gnu.org... | null | CC BY-SA 3.0 | null | 2008-08-29T19:42:56.773 | 2013-01-23T21:39:37.310 | 2013-01-23T21:39:37.310 | 6,148 | 3,279 | null |
35,167 | 1 | 35,172 | null | 41 | 26,302 | I know that the following is true
```
int i = 17; //binary 10001
int j = i << 1; //decimal 34, binary 100010
```
But, if you shift too far, the bits fall off the end. Where this happens is a matter of the size of integer you are working with.
Is there a way to perform a shift so that the bits rotate around to the ... | Is there a way to perform a circular bit shift in C#? | CC BY-SA 2.5 | 0 | 2008-08-29T19:54:43.047 | 2021-03-12T01:23:58.083 | 2008-10-06T15:15:22.520 | 6,899 | 2,470 | [
"c#",
"bit-manipulation"
] |
35,176 | 2 | null | 34,973 | 1 | null | In native code, if the corruption always occurs in the same place in memory, you can use a [data breakpoint](http://msdn.microsoft.com/en-us/library/350dyxd0.aspx) to break the debugger when that memory is changed. Unfortunately, you cannot set a data breakpoint in the managed C++ environment, presumably because the GC... | null | CC BY-SA 3.0 | null | 2008-08-29T19:58:37.720 | 2011-08-19T18:29:21.770 | 2011-08-19T18:29:21.770 | 3,623 | 3,623 | null |
35,179 | 2 | null | 35,026 | 2 | null | The only way to change the instance name is to re-install - uninstall and install as default instance.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:59:57.403 | 2008-08-29T19:59:57.403 | null | null | 1,433 | null |
35,161 | 2 | null | 35,103 | 1 | null | I'd suggest you use a to encrypt your configuration file, wherever they are stored, inside the executable or not.
If I remember correctly, RSA is one the variants.
For the explanation of it, see [Public-key cryptography](http://en.wikipedia.org/wiki/Public-key_cryptography) on Wikipedia
Store the "reading" key in your... | null | CC BY-SA 2.5 | null | 2008-08-29T19:52:35.563 | 2008-08-29T19:58:10.310 | 2020-06-20T09:12:55.060 | -1 | 3,055 | null |
35,177 | 2 | null | 32,540 | 3 | null | MochiKit is great -- and was my first love, so-to-speak, as far as js libraries go. But I found that while MochiKit has very expressive syntax, it didn't feel nearly as comfortable to me as Prototype/Scriptaculous or jQuery did for me.
I think if you know or like python, then MochiKit is a good tool for you.
| null | CC BY-SA 2.5 | null | 2008-08-29T19:58:55.987 | 2008-08-29T19:58:55.987 | null | null | 3,381 | null |
35,183 | 2 | null | 33,409 | 0 | null | Are null and an empty string equivalent? If they are, I would include logic in my application (or maybe a trigger if the app is "out-of-the-box"?) to force the field to be either null or '', but not the other. If you went with '', then you could set the column to NOT NULL as well. Just a data-cleanliness thing.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:03:04.603 | 2008-08-29T20:03:04.603 | null | null | 1,372 | null |
35,185 | 1 | 35,271 | null | 40 | 23,770 | What would be the best algorithm for finding a number that occurs only once in a list which has all other numbers occurring exactly twice.
So, in the list of integers (lets take it as an array) each integer repeats exactly twice, except one. To find that one, what is the best algorithm.
| Finding a single number in a list | CC BY-SA 2.5 | 0 | 2008-08-29T20:03:58.063 | 2014-09-14T15:17:00.160 | 2008-09-25T14:38:14.367 | 3,848 | 380 | [
"algorithm",
"puzzle"
] |
35,186 | 1 | 35,210 | null | 228 | 491,362 | I'm getting a `NoSuchMethodError` error when running my Java program. What's wrong and how do I fix it?
| How do I fix a NoSuchMethodError? | CC BY-SA 3.0 | 0 | 2008-08-29T20:04:27.643 | 2022-10-15T22:47:00.517 | 2012-04-26T00:34:10.693 | 1,332,690 | 3,535 | [
"java",
"nosuchmethoderror"
] |
35,182 | 2 | null | 34,987 | 3 | null | Here's an example:
```
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
int main() {
const char* const list[] = {"zip", "zam", "bam"};
const size_t len = sizeof(list) / sizeof(list[0]);
for (size_t i = 0; i < len; ++i)
std::cout << list[i] << "\n";
const std::vecto... | null | CC BY-SA 3.0 | null | 2008-08-29T20:01:31.097 | 2015-12-23T19:35:13.373 | 2015-12-23T19:35:13.373 | 1,697 | 1,697 | null |
35,189 | 2 | null | 34,798 | 1 | null | Are you testing in Firefox or IE? We have a similar issue where the entire page refreshes in Firefox (but not IE). To get around it we use a hidden asp:button with the useSubmitBehavior="false" set.
```
<asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" Style="display: none" UseSubmitBehavior="false... | null | CC BY-SA 2.5 | null | 2008-08-29T20:06:00.447 | 2008-08-29T20:06:00.447 | null | null | 3,294 | null |
35,192 | 2 | null | 35,185 | 0 | null | You need to specify what you mean by "best" - to some, speed is all that matters and would qualify an answer as "best" - for others, they might forgive a few hundred milliseconds if the solution was more readable.
"Best" is subjective unless you are more specific.
---
That said:
Iterate through the numbers, for ... | null | CC BY-SA 2.5 | null | 2008-08-29T20:07:34.047 | 2008-08-29T20:07:34.047 | null | null | 1,790 | null |
35,187 | 2 | null | 35,186 | 15 | null | This is usually caused when using a build system like [Apache Ant](http://ant.apache.org) that only compiles java files when the java file is newer than the class file. If a method signature changes and classes were using the old version things may not be compiled correctly. The usual fix is to do a full rebuild (usu... | null | CC BY-SA 2.5 | null | 2008-08-29T20:04:36.910 | 2008-08-29T20:04:36.910 | null | null | 3,535 | null |
35,172 | 2 | null | 35,167 | 54 | null | If you know the size of type, you could do something like:
```
uint i = 17;
uint j = i << 1 | i >> 31;
```
... which would perform a circular shift of a 32 bit value.
As a generalization to circular shift left n bits, on a b bit variable:
```
/*some unsigned numeric type*/ input = 17;
var result = input << n | in... | null | CC BY-SA 3.0 | null | 2008-08-29T19:57:17.847 | 2014-02-05T16:43:53.623 | 2014-02-05T16:43:53.623 | 96 | 96 | null |
35,178 | 1 | null | null | 8 | 1,230 | I am working on a C++ code base that was recently moved from X/Motif to Qt. I am trying to write a Perl script that will replace all occurrences of Boolean (from X) with bool. The script just does a simple replacement.
```
s/\bBoolean\b/bool/g
```
There are a few conditions.
1) We have CORBA in our code and ... | Regex to replace Boolean with bool | CC BY-SA 2.5 | null | 2008-08-29T19:59:14.410 | 2008-09-18T18:13:00.860 | 2017-05-23T12:13:34.533 | -1 | 2,897 | [
"regex",
"perl"
] |
35,193 | 2 | null | 35,170 | 20 | null | It means that the task is re-entrant - items declared within the task are dynamically allocated rather than shared between different invocations of the task.
You see - some of us do Verilog... (ugh)
| null | CC BY-SA 2.5 | null | 2008-08-29T20:07:49.990 | 2008-08-29T20:07:49.990 | null | null | 987 | null |
35,197 | 2 | null | 35,076 | 1 | null | Another suggestion for tracking tables that have been written to is to use [Red Gate SQL Log Rescue](http://www.red-gate.com/products/SQL_Log_Rescue/index.htm) (free). This tool dives into the log of the database and will show you all inserts, updates and deletes. The list is fully searchable, too.
It doesn't meet y... | null | CC BY-SA 2.5 | null | 2008-08-29T20:10:51.293 | 2008-08-29T20:10:51.293 | null | null | 1,960 | null |
35,194 | 1 | 35,221 | null | 0 | 293 | Have you guys had any experiences (positive or negative) by placing your source code/solution on a network drive for Visual Studio 2005 or 2008? Please note I am not referring to placing your actual source control system on that drive, but rather your working folder.
Thanks
| Working in Visual Studio (2005 or 2008) on a networked drive | CC BY-SA 2.5 | null | 2008-08-29T20:08:23.373 | 2009-03-23T09:31:28.283 | 2009-03-23T09:31:28.283 | 14,444 | 2,343 | [
"visual-studio-2008",
"visual-studio-2005"
] |
35,198 | 2 | null | 35,178 | 0 | null | To fix condition 1 try:
```
s/[^:]\bBoolean\b(?!")/bool/g
```
The [^:] says to match any character other than ":".
| null | CC BY-SA 2.5 | null | 2008-08-29T20:11:28.967 | 2008-08-29T20:11:28.967 | null | null | 3,535 | null |
35,191 | 1 | 36,771 | null | 0 | 759 | When merging two code branches in Team Foundation Server I get the following error:
> The given key was not present in the dictionary.
Some files are checked out and show up in "Pending Changes", but no changes are actually made.
I have a workaround:
1. Attempt to merge (fails with error)
2. Get latest from tru... | Error using Team Foundation Server merge function | CC BY-SA 3.0 | null | 2008-08-29T20:07:31.300 | 2017-09-04T01:08:52.210 | 2017-09-04T01:08:52.210 | 7,256,341 | 3,675 | [
"tfs",
"merge"
] |
35,200 | 2 | null | 35,185 | 1 | null | I would say that using a sorting algorithm and then going through the sorted list to find the number is a good way to do it.
And now the problem is finding "the best" sorting algorithm. There are a lot of sorting algorithms, each of them with its strong and weak points, so this is quite a complicated question. The [Wi... | null | CC BY-SA 2.5 | null | 2008-08-29T20:11:31.743 | 2008-08-29T20:11:31.743 | null | null | 2,841 | null |
35,203 | 2 | null | 35,178 | 1 | null | ```
s/[^:]\bBoolean\b[^"]/bool/g
```
Edit: Rats, beaten again. +1 for beating me, good sir.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:12:20.620 | 2008-08-29T20:12:20.620 | null | null | 3,641 | null |
35,199 | 2 | null | 34,981 | 0 | null | Continue your efforts to involve the other developer. Remember you are the one who wants to make this change. Ask for help with problems you have. Invite them to the daily stand up meeting. I currently do the planning for the daily stand up and I make sure all the pigs and chickens are invited. If you are the lead on t... | null | CC BY-SA 2.5 | null | 2008-08-29T20:11:31.103 | 2008-08-29T20:11:31.103 | null | null | 3,034 | null |
35,195 | 2 | null | 35,185 | 11 | null |
HT= Hash Table
HT.clear()
go over the list in order
for each item you see
```
if(HT.Contains(item)) -> HT.Remove(item)
else
ht.add(item)
```
at the end, the item in the HT is the item you are looking for.
Note (credit @Jared Updike): This system will find all Odd instances of items.
---
: I don't see how ... | null | CC BY-SA 2.5 | null | 2008-08-29T20:08:56.290 | 2008-08-29T21:10:30.930 | 2008-08-29T21:10:30.930 | 350 | 350 | null |
35,208 | 1 | 35,226 | null | 1 | 455 | I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following?
| requiredfield validator is preventing another form from submitting | CC BY-SA 2.5 | null | 2008-08-29T20:14:19.210 | 2009-05-21T15:07:06.613 | null | null | 2,462 | [
"asp.net"
] |
35,201 | 2 | null | 34,506 | 9 | null | Here is one solution:
```
struct BaseData
{
const string my_word;
const int my_number;
};
class Base
{
public:
Base(const BaseData* apBaseData)
{
mpBaseData = apBaseData;
}
const string getMyWord()
{
return mpBaseData->my_word;
}
int getMyNumber()
{
return... | null | CC BY-SA 2.5 | null | 2008-08-29T20:11:52.930 | 2008-08-29T20:11:52.930 | null | null | 3,657 | null |
35,213 | 2 | null | 35,208 | 0 | null | You should be setting ValidationGroup property to a different value for each group of elements. Your validator's ValidationGroup must only be same with the control that submit its form.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:16:51.140 | 2008-08-29T20:16:51.140 | null | null | 31,505 | null |
35,204 | 2 | null | 35,185 | 0 | null | Seems like the best you could do is to iterate through the list, for every item add it to a list of "seen" items or else remove it from the "seen" if it's already there, and at the end your list of "seen" items will include the singular element. This is O(n) in regards to time and n in regards to space (in the worst ca... | null | CC BY-SA 2.5 | null | 2008-08-29T20:12:30.807 | 2008-08-29T20:24:39.903 | 2008-08-29T20:24:39.903 | 3,044 | 3,044 | null |
35,210 | 2 | null | 35,186 | 274 | null | Without any more information it is difficult to pinpoint the problem, but the root cause is that you most likely have compiled a class against a different version of the class that is missing a method, than the one you are using when running it.
Look at the stack trace ... If the exception appears when calling a metho... | null | CC BY-SA 2.5 | null | 2008-08-29T20:14:56.353 | 2008-08-29T20:14:56.353 | null | null | 2,935 | null |
35,220 | 2 | null | 35,178 | 3 | null | > s/[^:]\bBoolean\b(?!")/bool/g
This does not match strings where Boolean is at that the beginning of the line becuase [^:] is "match a character that is not :".
| null | CC BY-SA 2.5 | null | 2008-08-29T20:20:09.697 | 2008-08-29T20:20:09.697 | null | null | 2,897 | null |
35,221 | 2 | null | 35,194 | 1 | null | It works just fine. I have worked with source code from my "home" folder on many different systems (NFS, Samba, AD) and never had any problems. The only drawback is that you might experience somewhat longer compile times if your network is slow or there is much traffic on the network. Under normal circumstances this is... | null | CC BY-SA 2.5 | null | 2008-08-29T20:20:44.093 | 2008-08-29T20:20:44.093 | null | null | 1,709 | null |
35,211 | 1 | 37,315 | null | 9 | 3,429 | The compiler usually chokes when an event doesn't appear beside a `+=` or a `-=`, so I'm not sure if this is possible.
I want to be able to identify an event by using an Expression tree, so I can create an event watcher for a test. The syntax would look something like this:
```
using(var foo = new EventWatcher(target... | Identify an event via a Linq Expression tree | CC BY-SA 3.0 | 0 | 2008-08-29T20:15:50.580 | 2017-06-01T03:39:34.273 | 2017-06-01T03:31:32.037 | 3,641,067 | null | [
"c#",
"linq",
"expression-trees"
] |
35,219 | 1 | 38,231 | null | 6 | 1,028 | With , there is also a Search Feature and a Crawler. However, the Crawler is somewhat limited in that it only supports Basic Auth when crawling external sites and that there is no way to tell it to ignore no-index,no-follow attributes.
Now, there is a site i'd like to index, unfortunately this site uses it's own Authe... | Optimizing/Customizing Sharepoint Search Crawling | CC BY-SA 3.0 | null | 2008-08-29T20:19:31.677 | 2017-07-04T08:51:12.603 | 2017-07-04T08:51:12.603 | 5,423,108 | 91 | [
"c#",
".net",
"sharepoint"
] |
35,223 | 2 | null | 34,925 | 4 | null | In SP1 does the foo.Bar property get properly deserialized?
In pre SP1 you wouldn't be able to deserialize the object because the set method of the Bar property is private so the XmlSerializer doesn't have a way to set that value. I'm not sure how SP1 is pulling it off.
You could try adding this to your web.config/a... | null | CC BY-SA 2.5 | null | 2008-08-29T20:20:59.180 | 2008-08-29T20:20:59.180 | null | null | 3,543 | null |
35,224 | 1 | 35,883 | null | 14 | 30,988 | I have a Flex `ComboBox` that gets populated by a `dataprovider` all is well...
I would now like to add a default " -- select a item --" option at the 0 index, how can I do this and still use a `dataprovider`? I have not seen any examples of such, but I can't imagine this being hard...
| Flex ComboBox, default value and dataproviders | CC BY-SA 4.0 | 0 | 2008-08-29T20:21:13.827 | 2019-05-28T11:14:05.893 | 2019-05-28T11:14:05.893 | 5,377,805 | 1,638 | [
"apache-flex",
"data-binding",
"combobox"
] |
35,229 | 2 | null | 34,798 | 0 | null | I would leave the onClick and set it as the trigger for the updatePanel.
That's odd that it works in FF and not IE. That is opposite from the behavior we experience.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:24:35.830 | 2008-08-29T20:24:35.830 | null | null | 3,294 | null |
35,226 | 2 | null | 35,208 | 5 | null | Are you using ValidationGroups? Try assigning each control with a validation group as well as the validator that you want to use. Something like:
```
<asp:TextBox ID="txt1" ValidationGroup="Group1" ruant="server" />
<asp:RequiredFieldValidator ID="rfv1" ... ValidationGroup="Group1" />
```
Note, if a button doesn't... | null | CC BY-SA 2.5 | null | 2008-08-29T20:21:58.707 | 2008-08-29T20:34:41.330 | 2008-08-29T20:34:41.330 | 2,034 | 2,034 | null |
35,233 | 1 | 35,262 | null | 13 | 1,581 | I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists.
Conventional wisdom tends to suggest that you should never attempt a re-write from scratch ... | Rewrite or repair? | CC BY-SA 2.5 | 0 | 2008-08-29T20:27:11.160 | 2008-09-30T03:38:49.517 | null | null | 3,305 | [
"refactoring",
"url-rewriting"
] |
35,232 | 1 | 1,157,405 | null | 2 | 1,886 | I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules.
I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just ... | Would building an application using a Sql Server Database File (mdf) be a terrible idea? | CC BY-SA 2.5 | 0 | 2008-08-29T20:26:39.743 | 2009-07-21T05:21:03.020 | null | null | 1,249 | [
"asp.net",
"sql",
"mysql",
"sql-server"
] |
35,239 | 2 | null | 35,233 | 1 | null | It's not so black and white... it really depends on a lot of factors (the more important being "what does the person paying you want you to do")
Where I work we re-wrote a development framework, and on the other hand, we keep modifying some old systems that cannot be migrated (because of the client's technology and ti... | null | CC BY-SA 2.5 | null | 2008-08-29T20:29:50.263 | 2008-08-29T20:29:50.263 | null | null | 1,782 | null |
35,241 | 2 | null | 35,233 | 2 | null | Refactor unless it is very bad indeed.
[Joel has a lot to say on this...](http://www.joelonsoftware.com/articles/fog0000000069.html)
At the very least, rewrite the code with the old code in front of you and don't just start over from scratch. The old code may be terrible, but it is the way it is for a reason and if y... | null | CC BY-SA 2.5 | null | 2008-08-29T20:31:35.517 | 2008-08-29T20:31:35.517 | null | null | 3,044 | null |
35,242 | 2 | null | 35,233 | 5 | null | See Joel Spolsky's essay [Things You Should Never Do](http://www.joelonsoftware.com/articles/fog0000000069.html). In summary, when you rewrite you lose all the lessons you learned to make your current code work the way it needs to work.
See also: [Big Ball of Mud](http://www.laputan.org/mud/)
| null | CC BY-SA 2.5 | null | 2008-08-29T20:31:47.343 | 2008-08-29T20:38:06.050 | 2008-08-29T20:38:06.050 | 2,541 | 2,541 | null |
35,235 | 2 | null | 35,185 | -1 | null | You could simply put the elements in the set into a hash until you find a collision. In ruby, this is a one-liner.
```
def find_dupe(array)
h={}
array.detect { |e| h[e]||(h[e]=true; false) }
end
```
So, `find_dupe([1,2,3,4,5,1])` would return 1.
This is actually a common "trick" interview question though. It... | null | CC BY-SA 2.5 | null | 2008-08-29T20:27:34.250 | 2008-08-29T20:27:34.250 | null | null | 3,499 | null |
35,244 | 2 | null | 35,185 | 0 | null | Depends on how large/small/diverse the numbers are though. A radix sort might be applicable which would reduce the sorting time of the O(N log N) solution by a large degree.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:33:14.610 | 2008-08-29T20:33:14.610 | null | null | 3,055 | null |
35,240 | 1 | null | null | 47 | 44,872 | I used the jQuery Form plugin for asynchronous form submission. For forms that contain files, it copies the form to a hidden iframe, submits it, and copies back the iframe's contents. The problem is that I can't figure out how to find what HTTP status code was returned by the server. For example, if the server returns ... | Retrieving HTTP status code from loaded iframe with Javascript | CC BY-SA 2.5 | 0 | 2008-08-29T20:31:27.577 | 2015-03-16T02:13:22.177 | 2008-09-18T18:44:13.233 | 3,560 | 3,560 | [
"jquery",
"ajax",
"http",
"forms",
"iframe"
] |
35,237 | 2 | null | 34,611 | 5 | null | [A blog post covering several of the alternatives](http://codeboje.de/2d-game-engines-python/), including [PyGame](http://www.pygame.org/), [PyCap](http://www.farbs.org/pycap.html), [SpriteCraft](http://www.suda-chen.biz/?page_id=9), and [ika](http://ika.sourceforge.net/). I have also seen [pyglet](http://www.pyglet.or... | null | CC BY-SA 2.5 | null | 2008-08-29T20:28:41.203 | 2008-08-29T20:28:41.203 | null | null | 3,623 | null |
35,218 | 2 | null | 4,219 | 48 | null | I'm surprised that someone who has used Subversion in the past would even have a want/need for TFS source control.
My experience with TFS (2005) has been pretty horrible. I've read all kinds of whitepapers & guidance as to how to properly structure your source for various development needs.
Our simple situation, whe... | null | CC BY-SA 2.5 | null | 2008-08-29T20:19:31.413 | 2010-02-03T08:17:13.553 | 2010-02-03T08:17:13.553 | 24,995 | 3,381 | null |
35,245 | 2 | null | 33,174 | 1 | null | Just a small comment. Never ever go to the database direct. If there is no way to do it via published and supported API's, then there is no way to do it. End of story. This applies even to when you are "just reading data", as this can still cause significant issues.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:34:09.130 | 2008-08-29T20:34:09.130 | null | null | 897 | null |
35,247 | 2 | null | 35,194 | 1 | null | Some folks in our company do that with their external dependencies, and they get occasional build errors, usually because a library or header can't be retrieved. When they rebuild again it all works. Of course the speed and traffic-level of your network would have a major effect on this.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:34:22.190 | 2008-08-29T20:34:22.190 | null | null | 3,114 | null |
35,246 | 2 | null | 35,232 | 0 | null | I don't understand... what do you mean by "having an MDF file in App_Data"? You need a proper SQL Server installation for that to work. You can always use the free SQL Server Express for developing the application, and then move the database to the proper SQL Server once you are done. Check [here](http://www.microsoft.... | null | CC BY-SA 2.5 | null | 2008-08-29T20:34:19.957 | 2008-08-29T20:34:19.957 | null | null | 2,384 | null |
35,243 | 2 | null | 35,233 | 10 | null | Just clean up the code a little bit every time you work with it. If there isn't one already, setup a unit testing framework. All new code should get tests written. Any old code you fix as a result of bugs, try to slide in tests too.
As the cleanups progress, you'll be able to sweep more and more of the nasty code i... | null | CC BY-SA 2.5 | null | 2008-08-29T20:32:40.943 | 2008-08-29T20:32:40.943 | null | null | 1,244 | null |
35,250 | 2 | null | 19,746 | 15 | null | Essentially this is the same issue as people had with WebForms and trying to compile their UserControl ASCX files into a DLL. I found this [http://www.codeproject.com/KB/aspnet/ASP2UserControlLibrary.aspx](http://www.codeproject.com/KB/aspnet/ASP2UserControlLibrary.aspx) that might work for you too.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:34:48.740 | 2008-08-29T20:34:48.740 | null | null | 3,046 | null |
35,257 | 2 | null | 35,248 | 4 | null | Please don't use ActiveX... I am so sick of sites that are only viewable in IE.
My actual preference, as a user, in these situations is to download a lightweight .exe file that downloads the file for you.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:38:09.060 | 2008-08-29T20:38:09.060 | null | null | 3,044 | null |
35,258 | 2 | null | 35,248 | 0 | null | @travis
Unfortunately It has to be over HTTP inside the users browser.
I'll update the question to be more clear about that.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:38:29.200 | 2008-08-29T20:38:29.200 | null | null | 3,543 | null |
35,256 | 1 | null | null | 2 | 372 | How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently?
How do you roll out changes to schema and code in such a scenario?
| Managing multiple identical databases efficiently? | CC BY-SA 3.0 | 0 | 2008-08-29T20:37:42.260 | 2016-10-10T14:24:39.287 | 2016-10-10T14:24:39.287 | 1,544,886 | 137 | [
"database"
] |
35,249 | 2 | null | 35,233 | 2 | null | One reason for rewriting at one of my previous jobs was an inability to find developers with enough experience to work on the original code base.
The decision was made to first clean up the underlying database structure, then rewrite in something that would make it easier to find full-time employees and/or contractor... | null | CC BY-SA 2.5 | null | 2008-08-29T20:34:42.483 | 2008-08-29T20:34:42.483 | null | null | 305 | null |
35,264 | 2 | null | 35,248 | 2 | null | Can you split the files into pieces and then rejoin them after the download?
| null | CC BY-SA 2.5 | null | 2008-08-29T20:41:19.753 | 2008-08-29T20:41:19.753 | null | null | 2,598 | null |
35,261 | 2 | null | 35,224 | 1 | null | The way I've dealt with this in the past is to create a new collection to serve as the data provider for the combobox, and then I listen for changes to the original source (using an `mx.BindingUtils.ChangeWatcher`). When I get such a notification, I recreate my custom data provider.
I wish I knew a better way to appr... | null | CC BY-SA 2.5 | null | 2008-08-29T20:39:14.157 | 2008-08-29T20:39:14.157 | null | null | 863 | null |
35,252 | 2 | null | 35,248 | 6 | null | [bittorrent](http://www.bittorrent.com/)?
There have been a few web-based versions already ([bitlet](http://www.bitlet.org/), [w3btorrent](http://torrentfreak.com/w3btorrent-a-bittorrent-client-for-your-web-server/)), and [Azureus](http://azureus.sourceforge.net/) was built using java, so it's definitely possible.
Ed... | null | CC BY-SA 2.5 | null | 2008-08-29T20:35:39.220 | 2008-08-29T20:40:45.747 | 2008-08-29T20:40:45.747 | 1,414 | 1,414 | null |
35,251 | 2 | null | 35,233 | 3 | null | It is rare for a re-write of anything complex to succeed. It's tempting, but a low percentage strategy.
Get legacy code under unit tests and refactor it, and/or completely replace small portions of it incrementally when opportune.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:35:18.677 | 2008-08-29T20:58:23.923 | 2008-08-29T20:58:23.923 | 60 | 60 | null |
35,265 | 2 | null | 35,256 | 1 | null | It's kinda difficult for us. We have a custom program that writes a lot of the sql code for the different databases for us. Essentially it writes the code once and then copies it over and over again along with placing the change database commands etc. It also makes sure that the primary key identities etc are in sync... | null | CC BY-SA 2.5 | null | 2008-08-29T20:41:30.783 | 2008-08-29T20:41:30.783 | null | null | 1,942 | null |
35,262 | 2 | null | 35,233 | 10 | null | It really depends on how bad it is.
If it's a small system, and you fully understand it, then a rewrite is not crazy.
On the other hand, if it's a giant legacy monster with ten million lines of undocumented mystery code, then you're really going to have a hard time with a full rewrite.
Points to consider:
- -
I w... | null | CC BY-SA 2.5 | null | 2008-08-29T20:39:23.800 | 2008-08-29T20:39:23.800 | null | null | 672 | null |
35,266 | 2 | null | 35,256 | 1 | null | Use a code generator / scripting language to implement the original schema and updates to it over time.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:41:40.110 | 2008-08-29T20:41:40.110 | null | null | 1,244 | null |
35,276 | 2 | null | 35,232 | 0 | null | It appears that I was misunderstanding how mdf files are accessed through .net. There is no MS SQL Server available on the server, so it looks like I'm screwed.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:44:48.247 | 2008-08-29T20:44:48.247 | null | null | 1,249 | null |
35,268 | 2 | null | 35,232 | 1 | null | More likely you'd put an Access database in App_Data. If you're using a MSSQL MDF file, you'll definitely still need either MSSQL or MSSQL-Express.
Your question is confusing, however. You seem to interchanging data access, ORM and the actual database. You can use SubSonic with MySQL, but you cannot use LINQ to SQL... | null | CC BY-SA 2.5 | null | 2008-08-29T20:42:01.343 | 2008-08-29T20:42:01.343 | null | null | 1,960 | null |
35,278 | 2 | null | 35,233 | 2 | null | There is a new book coming out, [Brownfield Application Development in .NET](http://www.manning.com/baley/) by Baley and Belcham. The first chapter is free, and talks about these issues from a mostly platform agnostic perspective.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:46:40.567 | 2008-08-29T20:46:40.567 | null | null | 1,960 | null |
35,280 | 2 | null | 35,248 | 0 | null | @levand
The problem only exist in IE (it works in Firefox) so while ActiveX would only work on IE, IE is the only one we need the work around for.
@travis - interesting idea. Not sure if it will work for what I need but I'll keep it in mind. I'm hoping to find something to integrate with the existing site instead of... | null | CC BY-SA 2.5 | null | 2008-08-29T20:50:19.140 | 2008-08-29T20:50:19.140 | null | null | 3,543 | null |
35,248 | 1 | null | null | 13 | 7,723 | Internet Explorer has a file download limit of 4GB (2 GB on IE6). Firefox does not have this problem (haven't tested safari yet)
(More info here: [http://support.microsoft.com/kb/298618](http://support.microsoft.com/kb/298618))
I am working on a site that will allow the user to download very large files (up to and ex... | Large File Download | CC BY-SA 4.0 | 0 | 2008-08-29T20:34:35.543 | 2022-04-15T02:15:03.807 | 2019-05-26T04:16:48.767 | 1,722,709 | 3,543 | [
"java",
"flash",
"silverlight",
"browser",
"large-files"
] |
35,277 | 2 | null | 35,232 | 1 | null | One of the few differences between SQL Server Express and the "full" SQL Server is the ability to automatically attach to MDF files - what Microsoft call "[xcopy deployment](http://msdn.microsoft.com/en-us/library/ms165716.aspx)".
SQL Server Express is free (as in beer) so unless you have no administrator rights on t... | null | CC BY-SA 2.5 | null | 2008-08-29T20:44:48.373 | 2008-08-29T20:44:48.373 | null | null | 3,546 | null |
35,271 | 2 | null | 35,185 | 139 | null | The fastest (O(n)) and most memory efficient (O(1)) way is with the XOR operation.
In C:
```
int arr[] = {3, 2, 5, 2, 1, 5, 3};
int num = 0, i;
for (i=0; i < 7; i++)
num ^= arr[i];
printf("%i\n", num);
```
This prints "1", which is the only one that occurs once.
This works because the first time you hit a n... | null | CC BY-SA 2.5 | null | 2008-08-29T20:43:57.017 | 2008-09-25T17:09:07.887 | 2008-09-25T17:09:07.887 | 658 | 658 | null |
35,281 | 2 | null | 4,219 | 8 | null | Here is a open source version of VisualSVN called [Ankhsvn](http://ankhsvn.open.collab.net/).
Its much better now that collabnet has taken it over.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:51:50.540 | 2010-05-27T19:26:31.803 | 2010-05-27T19:26:31.803 | 1,231 | 1,231 | null |
35,289 | 2 | null | 35,248 | 0 | null | @jjnguy
I'm looking for a java applet or ActiveX component that will do that for me. These are non-technical users so we really just want to have them click download and the full file ends up in the specified location
| null | CC BY-SA 2.5 | null | 2008-08-29T20:57:10.947 | 2008-08-29T20:57:10.947 | null | null | 3,543 | null |
35,287 | 2 | null | 4,661 | 2 | null | > Doesn't using multiple open-id providers sort of undermine the point of open id?
No. Say you are using a Yahoo OpenID, but you decide to move to Google instead. Multiple OpenIDs per account allows you to associate your account with the Google OpenID, then deauthorize the Yahoo OpenID.
| null | CC BY-SA 2.5 | null | 2008-08-29T20:56:04.913 | 2008-08-29T20:56:04.913 | null | null | 3,560 | null |
35,284 | 1 | null | null | 83 | 76,885 | Given the following interaction:
```
$ git add foo
$ git commit -m "Initial import of 'foo'"
$ rm foo # This could be any destructive action on foo, like editing it.
```
How do I restore 'foo' in my working copy? I'm looking for something like:
```
$ git <magic> foo
Restored foo to revision <blah>.
```
| How do I restore files to previous states in git? | CC BY-SA 2.5 | 0 | 2008-08-29T20:54:55.383 | 2013-03-18T07:47:14.910 | null | null | 2,603 | [
"git"
] |
35,288 | 2 | null | 215,718 | 359 | null | ```
git checkout -- foo
```
That will reset `foo` to HEAD. You can also:
```
git checkout HEAD^ foo
```
for one revision back, etc.
| null | CC BY-SA 3.0 | null | 2008-08-29T20:56:12.433 | 2013-03-18T07:47:14.910 | 2013-03-18T07:47:14.910 | 893 | 893 | null |
35,292 | 1 | null | null | 12 | 1,311 | I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files.
Currently log files are written locally to the disk on each blade but we could also consider publishing logging informati... | Log files in massively distributed systems | CC BY-SA 2.5 | null | 2008-08-29T21:00:03.780 | 2014-04-24T15:12:39.617 | 2012-06-21T05:47:21.980 | 1,060,350 | 3,305 | [
"distributed-computing",
"hpc"
] |
35,293 | 2 | null | 35,248 | 0 | null | @ceejayoz
I totally agree but its part of the requirement for our client. There will be FTP access but each user will have the option of downloading via HTTP or FTP. There are some users that will be behind corporate firewalls that don't permit FTP
I have seen other sites do this in the past (MSDN, Adobe) so I was ... | null | CC BY-SA 2.5 | null | 2008-08-29T21:03:34.473 | 2008-08-29T21:03:34.473 | null | null | 3,543 | null |
35,296 | 2 | null | 35,248 | 0 | null | I say click-once installed download manager, similar to msdn.
But becoming a CDN without a more optimized protocol for the job is no easy task. I can't imagine a business model that can be worthwhile enough to have such large file downloads as a core competency unless you are doing something like msdn. If you create a... | null | CC BY-SA 2.5 | null | 2008-08-29T21:07:34.747 | 2008-08-29T21:07:34.747 | null | null | 1,220 | null |
35,286 | 1 | 35,386 | null | 3 | 1,077 | I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:
```
set FILENAME=%~f1
sed 's/Some Pattern/%FILENAME%/' inputfile
```
(Note: `%~f1` - expands `%1` to a Fully qualified path name - `C:\utils\MyFile.txt`)
I found that the backslashes in `%FILENAME%` are just esca... | DOS filename escaping for use with *nix commands | CC BY-SA 3.0 | null | 2008-08-29T20:56:02.807 | 2013-11-20T09:34:04.423 | 2013-11-20T09:34:04.423 | 2,865,114 | 2,541 | [
"scripting",
"shell",
"dos"
] |
35,298 | 2 | null | 35,292 | 3 | null | First, synchronize all clocks in the system using NTP.
Second, if you are collecting the logs in a single location (like the UDP appender you mention) make sure the logs have enough information to actually help. I would include at least the server that generated the log, the time it happened, and the message. If the... | null | CC BY-SA 2.5 | null | 2008-08-29T21:09:17.767 | 2008-08-29T21:09:17.767 | null | null | 3,535 | null |
35,297 | 2 | null | 4,670 | 3 | null | I've had the best luck with Bazaar, followed by Mercurial. Never could get Git to work correctly. A quick search shows that Git still requires clunky emulation layers like Cygwin/MSYS, and I can't find any integration tools like TortoiseBzr for Git.
With Mercurial in Windows, I had several minor issues (insensitive pa... | null | CC BY-SA 2.5 | null | 2008-08-29T21:08:16.040 | 2008-08-29T21:08:16.040 | null | null | 3,560 | null |
35,291 | 2 | null | 35,248 | 7 | null | @levand:
> My actual preference, as a user, in these situations is to download a lightweight .exe file that downloads the file for you.
That's a dealbreaker for many, many sites. Users either are or extremely reluctant to download .exe files from websites and run them willy-nilly. Even if they're not always that ca... | null | CC BY-SA 2.5 | null | 2008-08-29T20:59:55.170 | 2008-08-29T20:59:55.170 | null | null | 1,902,010 | null |
35,300 | 2 | null | 34,981 | 1 | null | I'm not sure Scrum is the central issue here; I'm guessing she feels threatened by the new guy bringing in a lot of new ideas and stirring things up. I've been in that situation before as the new person bringing in a new perspective on things, and sometimes it's just difficult to immediately bring those existing peopl... | null | CC BY-SA 2.5 | null | 2008-08-29T21:10:56.530 | 2008-08-29T21:10:56.530 | null | null | 637 | null |
35,303 | 2 | null | 35,301 | 36 | null | One is a "bitwise or".
> 10011b | 01000b => 11011b
The other is a logic or.
> true or false => true
| null | CC BY-SA 4.0 | null | 2008-08-29T21:13:20.083 | 2018-08-21T11:19:48.967 | 2018-08-21T11:19:48.967 | 558,486 | 1,244 | null |
35,301 | 1 | 35,314 | null | 368 | 195,834 | I have always used `||` (two pipes) in OR expressions, both in C# and PHP. Occasionally I see a single pipe used: `|`. What is the difference between those two usages? Are there any caveats when using one over the other or are they interchangeable?
| What is the difference between the | and || or operators? | CC BY-SA 3.0 | 0 | 2008-08-29T21:11:17.543 | 2020-07-18T12:15:33.783 | 2013-07-23T08:05:47.590 | 578,288 | 3,238 | [
"c#",
"php",
"operators"
] |
35,299 | 2 | null | 28,723 | 1 | null | I'm now using [ModelBinder](https://stackoverflow.com/questions/34709/how-do-you-use-the-new-modelbinder-classes-in-aspnet-mvc-preview-5#34725) so that my action method can look (basically) like:
```
public ActionResult Insert(Contact contact)
{
if (this.ViewData.ModelState.IsValid)
{
... | null | CC BY-SA 2.5 | null | 2008-08-29T21:09:42.947 | 2008-08-29T21:09:42.947 | 2017-05-23T10:32:50.377 | -1 | 3,046 | null |
35,307 | 2 | null | 35,232 | 11 | null | Take a look at Microsoft SQL Server Compact Edition. I believe you can work with MDF files without having to run a server. All code runs in process. I believe it has some limitations but it may work for you and I think it's free.
| null | CC BY-SA 2.5 | null | 2008-08-29T21:15:51.120 | 2008-09-02T02:50:45.380 | 2008-09-02T02:50:45.380 | 2,768 | 2,768 | null |
35,295 | 2 | null | 24,196 | 0 | null | "We don't like the common GUI toolkits or widgets. We want something that has more of the look of a game than of a dialog box."
You realize that Trolltech's QT has a style sheet language for widgets? Take a look at their white paper, specifically page 60
[http://trolltech.com/pdf/qt43-whitepaper-us.pdf](http://troll... | null | CC BY-SA 2.5 | null | 2008-08-29T21:05:30.007 | 2008-08-29T21:05:30.007 | null | null | 1,244 | null |
35,302 | 2 | null | 31,559 | 16 | null | Others will probably pitch in with technical answers (e.g. the query syntax, use of caching, ease or otherwise of mapping to an existing database structure) -- but if you have an established ORM layer the answer is probably
"Why change"?
I've used XPO successfully for years in an established commercial product with ... | null | CC BY-SA 2.5 | null | 2008-08-29T21:12:46.450 | 2008-08-29T21:12:46.450 | null | null | 3,546 | null |