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
4,238
2
null
3,942
4
null
I appreciate the desire to find free software. However, in this case, I would strongly recommend looking at all options, including commercial products. I tried to play with nProf (which is at version 0.1 I think) and didn't have much luck. Even so, performance profiling an application is a subtle business and is best a...
null
CC BY-SA 2.5
null
2008-08-07T01:01:16.177
2008-08-07T01:01:16.177
null
null
541
null
4,227
1
4,735,712
null
167
277,722
I'm using a `Dictionary<string, int>` where the `int` is a count of the key. Now, I need to access the last-inserted Key inside the Dictionary, but I do not know the name of it. The obvious attempt: ``` int LastCount = mydict[mydict.keys[mydict.keys.Count]]; ``` does not work, because `Dictionary.Keys` does not imp...
Accessing a Dictionary.Keys Key through a numeric index
CC BY-SA 3.0
0
2008-08-07T00:51:21.720
2020-01-03T07:03:49.040
2015-04-07T12:16:44.323
2,771,704
91
[ "c#", ".net", "dictionary" ]
4,234
1
4,260
null
15
6,916
So my company stores alot of data in a foxpro database and trying to get around the performance hit of touching it directly I was thinking of messaging anything that can be done asynchronously for a snappier user experience. I started looking at [ActiveMQ](http://activemq.apache.org/) but don't know how well C# will h...
What to use for Messaging with C#
CC BY-SA 2.5
0
2008-08-07T00:56:41.880
2019-12-27T09:31:14.673
2008-08-07T02:12:37.013
590
590
[ "c#", "messaging", "activemq" ]
4,231
2
null
4,221
2
null
I know that if you use a paging repeater or gridview with the linqdatasource it will automatically optimize the number of results returned, but I'm also pretty sure in the datasource wizard you can go to advanced options and limit it to ``` SELECT TOP 3 FROM ``` which should allow you to do what you need
null
CC BY-SA 3.0
null
2008-08-07T00:55:20.867
2016-02-07T17:32:31.760
2016-02-07T17:32:31.760
2,921,691
493
null
4,246
1
4,271
null
15
6,749
What is the best method for executing FTP commands from a SQL Server stored procedure? we currently use something like this: ``` EXEC master..xp_cmdshell 'ftp -n -s:d:\ftp\ftpscript.xmt 172.1.1.1' ``` The problem is that the command seems to succeed even if the FTP ended in error. Also, the use of `xp_cmdshell` requ...
What is best practice for FTP from a SQL Server 2005 stored procedure?
CC BY-SA 3.0
0
2008-08-07T01:09:04.820
2017-12-22T10:10:19.280
2017-12-22T10:10:19.280
3,804,420
162
[ "sql-server", "ftp" ]
4,243
2
null
4,230
7
null
The DataGrid was originally in .NET 1.0. The GridView was introduced (and replaced the DataGrid) in .NET 2.0. They provide nearly identical functionality.
null
CC BY-SA 2.5
null
2008-08-07T01:05:56.620
2008-08-07T01:05:56.620
null
null
423
null
4,247
2
null
4,242
47
null
Java autoboxing/unboxing doesn't go to the extent to allow you to dereference a primitive, so your compiler prevents it. Your compiler still knows `myInt` as a primitive. There's a paper about this issue at [jcp.org](http://jcp.org/aboutJava/communityprocess/jsr/tiger/autoboxing.html). Autoboxing is mainly useful dur...
null
CC BY-SA 3.0
null
2008-08-07T01:09:17.547
2012-05-23T14:14:20.383
2012-05-23T14:14:20.383
866,022
92
null
4,255
2
null
4,227
2
null
I don't know if this would work because I'm pretty sure that the keys aren't stored in the order they are added, but you could cast the KeysCollection to a List and then get the last key in the list... but it would be worth having a look. The only other thing I can think of is to store the keys in a lookup list and ad...
null
CC BY-SA 2.5
null
2008-08-07T01:15:55.350
2008-08-07T01:15:55.350
null
null
493
null
4,260
2
null
4,234
8
null
ActiveMQ works well with C# using the Spring.NET integrations and NMS. A post with some links to get you started in that direction [is here](http://thefreakparade.com/2008/04/15/two-message-exchange-patterns-using-activemq-and-nms-via-springnet/). Also consider using MSMQ (The System.Messaging namespace) or a .NET base...
null
CC BY-SA 2.5
null
2008-08-07T01:20:13.890
2008-08-08T19:59:13.000
2008-08-08T19:59:13.000
541
541
null
4,252
2
null
4,227
6
null
You could always do this: ``` string[] temp = new string[mydict.count]; mydict.Keys.CopyTo(temp, 0) int LastCount = mydict[temp[mydict.count - 1]] ``` But I wouldn't recommend it. There's no guarantee that the last inserted key will be at the end of the array. The ordering for Keys [on MSDN](https://learn.microsoft....
null
CC BY-SA 4.0
null
2008-08-07T01:13:22.377
2020-01-03T06:24:59.903
2020-01-03T06:24:59.903
5,407,188
429
null
4,249
2
null
4,164
2
null
Woo, another Debian nut! I think you need to be a bit more specific here, Forum != CMS. Is this for internal company or external customer use? What language(s) do you know/prefer? There's no point in recommending a Perl or PHP framework if your language of choice is Ruby. Do you need to plan for scalability? What's ...
null
CC BY-SA 2.5
null
2008-08-07T01:09:51.883
2008-08-07T01:09:51.883
null
null
592
null
4,256
2
null
4,242
27
null
Ditto on what Justin said, but you should do this instead: ``` Integer.toString(myInt); ``` It saves an allocation or two and is more readable.
null
CC BY-SA 2.5
null
2008-08-07T01:16:21.263
2008-08-13T01:43:32.960
2008-08-13T01:43:32.960
429
429
null
4,242
1
4,247
null
53
6,962
I want to convert a primitive to a string, and I tried: ``` myInt.toString(); ``` This fails with the error: ``` int cannot be dereferenced ``` Now, I get that primitives are not reference types (ie, not an Object) and so cannot have methods. However, Java 5 introduced autoboxing and unboxing (a la C#... which I...
Why doesn't Java autoboxing extend to method invocations of methods of the autoboxed types?
CC BY-SA 3.0
0
2008-08-07T01:05:15.420
2014-01-30T23:26:36.633
2012-05-23T14:28:15.333
131,433
122
[ "java", "autoboxing" ]
4,250
2
null
4,157
2
null
The appSettings isn't really meant for what you are trying to do. When your .NET application starts, it reads in the app.config file, and caches its contents in memory. For that reason, after you write to the app.config file, you'll have to somehow force the runtime to re-parse the app.config file so it can cache the ...
null
CC BY-SA 2.5
null
2008-08-07T01:10:36.720
2008-08-07T01:10:36.720
null
null
357
null
4,258
2
null
4,227
5
null
I think you can do something like this, the syntax might be wrong, havent used C# in a while To get the last item ``` Dictionary<string, int>.KeyCollection keys = mydict.keys; string lastKey = keys.Last(); ``` or use Max instead of Last to get the max value, I dont know which one fits your code better.
null
CC BY-SA 2.5
null
2008-08-07T01:18:25.657
2008-08-07T01:18:25.657
null
null
550
null
4,263
2
null
3,281
5
null
In Ruby 1.9: ``` weights.zip(data).map{|a,b| a*b}.reduce(:+) ``` In Ruby 1.8: ``` weights.zip(data).inject(0) {|sum,(w,d)| sum + w*d } ```
null
CC BY-SA 2.5
null
2008-08-07T01:22:36.540
2008-08-07T01:22:36.540
null
null
136
null
4,270
2
null
3,281
14
null
@Michiel de Mare Your Ruby 1.9 example can be shortened a bit further: ``` weights.zip(data).map(:*).reduce(:+) ``` Also note that in Ruby 1.8, if you require ActiveSupport (from Rails) you can use: ``` weights.zip(data).map(&:*).reduce(&:+) ```
null
CC BY-SA 2.5
null
2008-08-07T01:29:05.777
2008-08-07T01:29:05.777
null
null
582
null
4,277
2
null
4,225
3
null
Why not use a map of primitives (triangles, squares), distribute the starting points for the countries (the "capitals"), and then randomly expanding the countries by adding a random adjacent primitive to the country.
null
CC BY-SA 2.5
null
2008-08-07T01:40:05.740
2008-08-07T01:40:05.740
null
null
136
null
4,279
2
null
4,164
0
null
[Expression Engine](http://expressionengine.com/) is fantastic. It's free to download and try but you must purchase a license if you are making a profit with it.
null
CC BY-SA 2.5
null
2008-08-07T01:40:25.100
2008-12-25T01:21:08.267
null
null
40
null
4,271
2
null
4,246
5
null
If you're running SQL 2005 you could do this in a CLR integration assembly and use the FTP classes in the System.Net namespace to build a simple FTP client. You'd benefit from being able to trap and handle exceptions and reduce the security risk of having to use xp_cmdshell. Just some thoughts.
null
CC BY-SA 2.5
null
2008-08-07T01:29:43.200
2008-08-07T01:29:43.200
null
null
419
null
4,284
2
null
4,269
1
null
I don't know of any free SMS services, you usually buy bulk sms'seses and use an API to send them out. [Whitepages.com](http://developer.whitepages.com/docs/) has an API that will allow developers to reverse lookup a phone number. It reports the carrier on mobile number, however a lot of the time it's some non-existe...
null
CC BY-SA 2.5
null
2008-08-07T01:51:55.573
2008-08-07T01:51:55.573
null
null
30
null
4,269
1
null
null
76
28,773
What is the best way to programmatically send an SMS text message? Are there any free Web Service based SMS gateways? I know that if I happen to know the user's carrier (Sprint, AT&T, etc), I can send an [SMS by emailing an address](http://en.wikipedia.org/wiki/SMS_gateways) based on phone number + carrier. I would l...
Programmatic SMS
CC BY-SA 2.5
0
2008-08-07T01:28:03.190
2013-03-23T03:24:37.060
2010-09-23T01:11:13.547
164,901
357
[ "mobile", "sms" ]
4,262
2
null
4,208
6
null
Maybe you want to consider using [ProcessTamer](http://www.donationcoder.com/Software/Mouser/proctamer/index.html) that "automatize" the process of downgrading or upgrading process priority based in your settings. I've been using it for two years. It's very simple but really effective!
null
CC BY-SA 2.5
null
2008-08-07T01:21:06.837
2008-08-07T01:21:06.837
null
null
527
null
4,287
1
4,304
null
16
3,155
I have a process in erlang that is supposed to do something immediately after spawn, then send the result back to the parent when it is finished. How do I figure out the PID of the process that spawned it?
How Do You Determine The PID of the Parent of a Process
CC BY-SA 2.5
null
2008-08-07T01:54:12.107
2009-08-11T16:19:38.740
null
null
121
[ "erlang" ]
4,299
2
null
4,246
2
null
If you need to do FTP from within the database, then I would go with a .NET assembly as Kevin suggested. That would provide the most control over the process, plus you would be able to log meaningful error messages to a table for reporting. Another option would be to write a command line app that read the database fo...
null
CC BY-SA 2.5
null
2008-08-07T02:16:46.680
2008-08-07T02:16:46.680
null
null
206
null
4,285
2
null
4,269
8
null
Where I work we've been using [http://www.clickatell.com](http://www.clickatell.com) for sending out SMS - it looks like its about 6 or 7 cents a message. They just take http POST requests to send out a message. I don't know if you'll be able to find any good free gateways. We used to send out emails, but found they...
null
CC BY-SA 2.5
null
2008-08-07T01:52:47.243
2008-08-07T01:52:47.243
null
null
552
null
4,300
2
null
4,234
0
null
Sorry if this isn't what you are asking for... Have you considered some sort of cache behind the scenes that acts a bit like the "bucket system" when using asynchronous sockets in c/c++ using winsock? Basicly, it works by accepting requests, and sends an immediate response back to the web app, and when it finally gets...
null
CC BY-SA 2.5
null
2008-08-07T02:17:35.523
2008-08-07T02:17:35.523
null
null
522
null
4,290
2
null
709
3
null
I would say [MbUnit](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#.NET_programming_languages) also. I like being able to run a single test many times just by specifying inputs and the result is right above the test function. It is a horrible description of what I mean, so [here is a link that shows you...
null
CC BY-SA 4.0
null
2008-08-07T01:55:51.120
2020-07-30T10:41:26.787
2020-07-30T10:41:26.787
63,550
590
null
4,289
2
null
4,269
0
null
Supporting [Angus](https://stackoverflow.com/questions/4269/programmatic-sms#4285), I can vouch for [http://www.clickatell.com](http://www.clickatell.com). It was used at a company I used to work at. It was a very easy solution to setup and use and worked great. You just need to anticipate how many messages you intend ...
null
CC BY-SA 2.5
null
2008-08-07T01:55:17.050
2008-08-07T01:55:17.050
2017-05-23T12:09:33.837
-1
560
null
4,281
2
null
4,225
7
null
The best reference I've seen on them is [Computational Geometry: Algorithms and Applications](https://rads.stackoverflow.com/amzn/click/com/3540779736), which covers Voronoi diagrams, Delaunay triangulations (similar to Voronoi diagrams and each can be converted into the other), and other similar data structures. The...
null
CC BY-SA 2.5
null
2008-08-07T01:47:54.133
2008-08-07T01:47:54.133
null
null
422
null
4,303
1
4,310
null
60
8,221
Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get started with this practice?
Why should I practice Test Driven Development and how should I start?
CC BY-SA 2.5
0
2008-08-07T02:27:03.397
2017-02-02T13:41:28.337
null
null
358
[ "testing", "tdd" ]
4,304
2
null
4,287
15
null
You should pass self() to the child as one of the arguments to the entry function. ``` spawn_link(?MODULE, child, [self()]). ```
null
CC BY-SA 2.5
null
2008-08-07T02:27:32.740
2008-08-07T02:27:32.740
null
null
582
null
4,305
1
null
null
13
917
Are there any grid-hosting companies out there that offer .NET stacks? Something like MediaTemple - which won't host the worlds fastest websites, but for the price is far better than "shared hosting". I've used Rackspace's Mosso, but it sucked - it never felt like a normal .NET stack (caching was odd, site recompilati...
Grid Hosting for Windows
CC BY-SA 2.5
null
2008-08-07T02:27:58.560
2009-03-29T05:23:59.737
null
null
34
[ ".net", "hosting" ]
4,309
2
null
4,303
-1
null
In my opinion, the single greatest thing is that it clearly allows you to see if your code does what it is supposed to. This may seem obvious, but it is super easy to run astray of your original goals, as I have found out in the past :p
null
CC BY-SA 2.5
null
2008-08-07T02:32:38.380
2008-08-07T02:32:38.380
null
null
522
null
4,307
2
null
4,305
5
null
Try [gogrid.com](http://www.gogrid.com) they seem to have a very nice following in the cloud computing circles.
null
CC BY-SA 2.5
null
2008-08-07T02:30:02.190
2008-08-07T02:30:02.190
null
null
17
null
4,302
2
null
4,208
10
null
If you use [PowerShell](http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx), you could write a script that let you change the priority of a process. I found the following PowerShell function on the [Monad blog](http://monadblog.blogspot.com/2006/03/msh-how-to-change-processs-pri...
null
CC BY-SA 3.0
null
2008-08-07T02:24:34.980
2017-01-31T14:10:09.480
2017-01-31T14:10:09.480
247,702
206
null
4,306
1
4,311
null
59
57,167
I am working on a project that requires the manipulation of enormous matrices, specifically pyramidal summation for a copula calculation. In short, I need to keep track of a relatively small number of values (usually a value of 1, and in rare cases more than 1) in a sea of zeros in the matrix (multidimensional array...
What is the best way to create a sparse array in C++?
CC BY-SA 3.0
0
2008-08-07T02:29:58.180
2020-12-17T18:30:29.483
2017-03-13T15:33:36.390
1,387,346
522
[ "c++", "oop", "data-structures", "hash", "maps" ]
4,308
2
null
4,303
3
null
The benefits part has [recently been covered](https://stackoverflow.com/questions/2260/what-is-tdd), as for where to start....on a small enterprisey system where there aren't too many unknowns so the risks are low. If you don't already know a testing framework (like NUnit), start by learning that. Otherwise start by wr...
null
CC BY-SA 2.5
null
2008-08-07T02:30:19.133
2008-08-07T02:30:19.133
2017-05-23T12:10:31.100
-1
34
null
4,301
2
null
1,451
2
null
Honestly the ASP.NET Membership / Roles features would work perfectly for the scenario you described. Writing your own tables / procs / classes is a great exercise and you can get very nice control over minute details, but after doing this myself I've concluded it's better to just use the built in .NET stuff. A lot of ...
null
CC BY-SA 2.5
null
2008-08-07T02:23:18.460
2008-08-07T02:23:18.460
null
null
26
null
4,313
2
null
59
4
null
Try the following ``` var names = (from dr in dataTable.Rows select (string)dr["Name"]).Distinct().OrderBy(name => name); ``` this should work for what you need.
null
CC BY-SA 3.0
null
2008-08-07T02:35:28.637
2014-07-14T07:44:43.700
2014-07-14T07:44:43.700
2,354,564
17
null
4,314
1
4,322
null
45
11,351
Many people use Mock Objects when they are writing unit tests. What is a ? Why would I ever need one? Do I need a Mock Object Framework?
What is Object Mocking and when do I need it?
CC BY-SA 2.5
0
2008-08-07T02:37:07.807
2013-08-08T14:39:31.550
null
null
358
[ "testing", "mocking" ]
4,316
2
null
4,314
5
null
It allows you to test how one part of your project interacts with the rest, without building the entire thing and potentially missing a vital part. EDIT: Great example from wikipedia: It allows you to test out code beforehand, like a car designer uses a crash test dummy to test the behavior of a car during an accident...
null
CC BY-SA 2.5
null
2008-08-07T02:38:57.117
2008-08-07T02:38:57.117
null
null
522
null
4,315
2
null
4,227
4
null
I agree with the second part of Patrick's answer. Even if in some tests it seems to keep insertion order, the documentation (and normal behavior for dictionaries and hashes) explicitly states the ordering is unspecified. You're just asking for trouble depending on the ordering of the keys. Add your own bookkeeping (as...
null
CC BY-SA 3.0
null
2008-08-07T02:38:29.163
2011-09-11T16:57:02.567
2011-09-11T16:57:02.567
213,550
360
null
4,311
2
null
4,306
32
null
For C++, a map works well. Several million objects won't be a problem. 10 million items took about 4.4 seconds and about 57 meg on my computer. My test application is as follows: ``` #include <stdio.h> #include <stdlib.h> #include <map> class triple { public: int x; int y; int z; bool operator<(con...
null
CC BY-SA 3.0
null
2008-08-07T02:33:16.973
2017-03-13T15:34:11.190
2017-03-13T15:34:11.190
1,387,346
116
null
4,310
2
null
4,303
37
null
There are a lot of benefits: - - - - The best way to start is to just start. There is a great [book by Kent Beck](https://rads.stackoverflow.com/amzn/click/com/0321146530) all about Test Driven Development. Just start with new code, don't worry about old code... whenever you feel you need to refactor some code, wr...
null
CC BY-SA 3.0
null
2008-08-07T02:33:10.437
2011-05-18T09:41:18.487
2011-05-18T09:41:18.487
7,922
122
null
4,317
2
null
4,314
7
null
Object Mocking is a way to create a "virtual" or mocked object from an interface, abstract class, or class with virtual methods. It allows you to sort of wrap one of these in your own definition for testing purposes. It is useful for making an object that is relied on for a certain code block your are testing. A pop...
null
CC BY-SA 2.5
null
2008-08-07T02:40:06.117
2008-08-07T02:40:06.117
null
null
17
null
4,318
2
null
4,314
13
null
A mock object lets you test against just what you are writing, and abstract details such as accessing a resource (disk, a network service, etc). The mock then lets you pretend to be that external resource, or class or whatever. You don't really need a mock object framework, just extend the class of the functionality ...
null
CC BY-SA 2.5
null
2008-08-07T02:40:26.023
2008-08-07T02:47:28.787
2008-08-07T02:47:28.787
122
122
null
4,319
2
null
4,227
3
null
The way you worded the question leads me to believe that the int in the Dictionary contains the item's "position" on the Dictionary. Judging from the assertion that the keys aren't stored in the order that they're added, if this is correct, that would mean that keys.Count (or .Count - 1, if you're using zero-based) sho...
null
CC BY-SA 2.5
null
2008-08-07T02:40:52.747
2008-08-07T02:40:52.747
null
null
560
null
4,326
2
null
4,314
3
null
Another use is it will let you test against other parts of your system that aren't built yet. For example, if your class depends on some other class that is part of a feature that someone else is working on, you can just ask for a mostly complete interface, program to the interface and just mock the details as you exp...
null
CC BY-SA 2.5
null
2008-08-07T02:45:32.423
2008-08-07T02:45:32.423
null
null
122
null
4,312
2
null
4,303
2
null
1. You figure out how to compartmentalize your code 2. You figure out exactly what you want your code to do 3. You know how it supposed to act and, down the road, if refactoring breaks anything 4. Gets you in the habit of making sure your code always knows what it is supposed to do Just do it. Write a test case...
null
CC BY-SA 2.5
null
2008-08-07T02:34:05.660
2008-08-07T02:34:05.660
null
null
204
null
4,322
2
null
4,314
36
null
Object Mocking is used to keep dependencies out of your unit test. Sometimes you'll have a test like "SelectPerson" which will select a person from the database and return a Person object. To do this, you would normally need a dependency on the database, however with object mocking you can simulate the interaction wi...
null
CC BY-SA 3.0
null
2008-08-07T02:43:59.340
2013-02-28T21:01:36.893
2013-02-28T21:01:36.893
603,977
493
null
4,327
2
null
4,320
1
null
Like everything else it is environmental and depends on the use of the system. The question you need to ask your self is: 1. Will this be actively developed 2. Is this going to be used over the course of many years and expanded on 3. Is the expansion of the application unknown and thus infinite Really it comes do...
null
CC BY-SA 2.5
null
2008-08-07T02:46:16.090
2008-08-07T02:46:16.090
null
null
17
null
4,320
1
null
null
7
2,187
Is it "acceptable" to have an application without the BLL (Business Logic Layer) as the following? 1. SQL Server Data Storage & Stored Procedures 2. Data Link Layer (Strongly Typed Table Adapters) connecting to Stored Procs 3. Presentation Layer ASPX Pages with Code behind and ObjectDataSource for connection straigh...
ASP.Net 2.0 Application without Business Logic Layer?
CC BY-SA 3.0
null
2008-08-07T02:41:24.290
2015-12-15T06:02:03.333
2015-12-15T06:02:03.333
2,833,965
1,525,924
[ "asp.net", "business-logic-layer", "objectdatasource" ]
4,334
2
null
4,320
1
null
Acceptable? Depends who you ask and what your requirements are. Is this app an internal one-off used by you and a few other people? Maybe this is good enough. If it's meant to be a production ready enterprise application that will grow and be maintained over the years, then you probably want to invest more effort up-fr...
null
CC BY-SA 2.5
null
2008-08-07T02:49:53.850
2008-08-07T02:49:53.850
null
null
598
null
4,343
2
null
4,335
3
null
Without trying to sound too vague but I think Windows Network Load Balancing (NLB) should handle this for you.
null
CC BY-SA 2.5
null
2008-08-07T02:59:33.380
2008-08-07T02:59:33.380
null
null
419
null
4,331
2
null
4,320
4
null
It's acceptable as long as you understand the consequences. The main reason you'd have a BLL is to re-use that logic elsewhere throughout your application. If you have all that validation logic in the presentation code, you're really making it difficult to re-use elsewhere within your application.
null
CC BY-SA 2.5
null
2008-08-07T02:48:48.690
2008-08-07T02:48:48.690
null
null
493
null
4,335
1
13,097
null
20
3,737
Is there anyway to configure a WCF service with a failover endpoint if the primary endpoint dies? Kind of like being able to specify a failover server in a SQL cluster. Specifically I am using the TCP/IP binding for speed, but on the rare occurrence that the machine is not available I would like to redirect traffic to...
High availability
CC BY-SA 3.0
0
2008-08-07T02:50:13.320
2015-12-17T11:44:47.320
2015-12-17T11:44:47.320
5,550,041
20,207
[ "c#", ".net", "wcf", "soa" ]
4,332
2
null
4,208
68
null
If you want to set priority when launching a process you could use the built-in [START](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start) command: ``` START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELO...
null
CC BY-SA 4.0
null
2008-08-07T02:49:21.107
2019-09-05T15:11:06.767
2019-09-05T15:11:06.767
768,423
360
null
4,329
2
null
4,314
17
null
Several people have already answered the 'what', but here are a couple of quick 'whys' that I can think of: 1. Performance Because unit tests should be fast, testing a component that interacts with a network, a database, or other time-intensive resource does not need to pay the penalty if it's done using mock objects...
null
CC BY-SA 3.0
null
2008-08-07T02:47:58.207
2013-08-08T14:39:31.550
2013-08-08T14:39:31.550
684,803
235
null
4,346
2
null
4,034
43
null
If you're using the default view engines, then local resources work in the views. However, if you need to grab resource strings within a controller action, you can't get local resources, and have to use global resources. This makes sense when you think about it because local resources are local to an aspx page and in ...
null
CC BY-SA 2.5
null
2008-08-07T03:04:04.320
2008-08-07T03:04:04.320
null
null
598
null
4,347
1
4,597
null
26
4,395
I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?
Where is a good place to start programming GUIs for windows?
CC BY-SA 3.0
0
2008-08-07T03:06:19.870
2013-06-25T12:00:50.093
2013-06-25T12:00:50.093
1,904,007
522
[ "winapi", "qt", "mfc" ]
4,348
2
null
4,347
5
null
I don't know if I'd call it a good place to start, but if you want to be future ready, take a look at the [windows presentation foundation](http://windowsclient.net/) which is built entirely for the purpose of programming GUI's for windows
null
CC BY-SA 2.5
null
2008-08-07T03:08:35.920
2008-08-07T03:08:35.920
null
null
493
null
4,354
2
null
4,306
3
null
Hash tables have a fast insertion and look up. You could write a simple hash function since you know you'd be dealing with only integer pairs as the keys.
null
CC BY-SA 2.5
null
2008-08-07T03:13:15.457
2008-08-07T03:13:15.457
null
null
157
null
4,344
2
null
4,164
2
null
I've been obsessing over [TikiWiki](http://www.tikiwiki.org/) lately. Although it has "wiki" in the name, its full name is "TikiWiki CMS/Groupware" and it's an interesting piece of software. It has a real everything the kitchen sink feel. It includes support for wiki, blogs, articles, forums, and files out of the b...
null
CC BY-SA 2.5
null
2008-08-07T03:01:01.910
2008-08-07T03:01:01.910
null
null
430
null
4,370
2
null
4,347
3
null
My first experience writing simple GUI applications for Windows was with C# and Visual Studio. The GUI-building interface is a simple drag and drop deal that generates skeleton methods based on potential user actions. I only did fairly basic programming with this, but I imagine it would be an excellent place to start...
null
CC BY-SA 2.5
null
2008-08-07T03:47:41.987
2008-08-07T03:47:41.987
null
null
271
null
4,378
2
null
4,369
5
null
You could define a constant with the path to the root directory of your project, and then put that at the beginning of the path.
null
CC BY-SA 2.5
null
2008-08-07T04:04:55.103
2008-08-07T04:04:55.103
null
null
55
null
4,383
2
null
4,314
9
null
> Do I need a Mock Object Framework? Certainly not. Sometimes, writing mocks by hand can be quite tedious. But for simple things, it's not bad at all. Applying the principle of [Last Responsible Moment](http://www.codinghorror.com/blog/archives/000705.html) to mocking frameworks, you should only switch from hand-writ...
null
CC BY-SA 2.5
null
2008-08-07T04:14:57.207
2008-08-07T04:26:18.710
2008-08-07T04:26:18.710
308
308
null
4,374
2
null
4,287
0
null
You can use the BIF register to give the spawning / parent process a name (an atom) then refer back to the registered name from other processes. > FUNC() ->> %% Do something %% Then send message to parent parent ! MESSAGE....register(parent, self()), spawn(MODULE, FUNC, [ARGS]). See [Getting Started With Er...
null
CC BY-SA 2.5
null
2008-08-07T03:57:04.993
2008-08-07T04:04:28.520
2008-08-07T04:04:28.520
462
462
null
4,384
2
null
4,242
9
null
> seems like a shortcoming of the specification to me There are more shortcomings and this is a subtle topic. Check [this](http://kiranthakkar.blogspot.com/2007/05/method-overloading-with-new-features-of.html) out: ``` public class methodOverloading{ public static void hello(Integer x){ System.out.println(...
null
CC BY-SA 2.5
null
2008-08-07T04:16:20.480
2008-08-07T07:26:31.047
2008-08-07T07:26:31.047
122
198
null
4,388
2
null
4,369
6
null
have a look at [http://au.php.net/reserved.variables](http://au.php.net/reserved.variables) I think the variable you are looking for is: `$_SERVER["DOCUMENT_ROOT"]`
null
CC BY-SA 3.0
null
2008-08-07T04:25:22.473
2011-07-12T23:50:49.860
2011-07-12T23:50:49.860
114,770
202
null
4,385
2
null
4,369
155
null
This should work ``` $root = realpath($_SERVER["DOCUMENT_ROOT"]); include "$root/inc/include1.php"; ``` --- added imporvement by [aussieviking](https://stackoverflow.com/questions/4369/include-files-requiring-an-absolute-path#4388)
null
CC BY-SA 2.5
null
2008-08-07T04:20:47.647
2008-08-07T04:28:34.823
2017-05-23T11:47:20.273
-1
117
null
4,371
1
4,376
null
185
783,200
I lost my MySQL username and password. How do I retrieve it?
How do I retrieve my MySQL username and password?
CC BY-SA 2.5
0
2008-08-07T03:54:14.593
2022-11-19T17:58:13.727
2022-05-14T20:46:50.210
12,492,890
131
[ "mysql", "mysql-workbench" ]
4,391
2
null
4,314
1
null
Whether or not you a mocking framework is useful depends in part on the language of the code you're writing. With a static language, you need to put in extra effort in order to trick the compiler into accepting your mock objects as a replacement for the real thing. In a dynamically-typed language such as Python, Ruby...
null
CC BY-SA 2.5
null
2008-08-07T04:32:44.360
2008-08-07T04:32:44.360
null
null
533
null
4,363
1
4,386
null
41
10,806
Any suggestions? Using visual studio in C#. Are there any specific tools to use or methods to approach this? ### Update: Sorry, I should have been a little more specific. I am using ASP.Net 2.0 and was looking more for a tool like jUnit for Java. I took a look at NUnit and NUnitAsp and that looks very promising. An...
What is the best way to do unit testing for ASP.NET 2.0 web pages?
CC BY-SA 3.0
0
2008-08-07T03:23:45.983
2019-12-27T09:02:08.217
2020-06-20T09:12:55.060
-1
396
[ "c#", "asp.net", "visual-studio", "unit-testing" ]
4,399
2
null
4,363
4
null
There was a screencast series a year or so ago on Polymorphic Podcast that did a pretty good intro walkthrough of an MVP implementation in ASP.NET. Implemented this way, unit tests fall into place much more naturally. [http://polymorphicpodcast.com/shows/mv-patterns/](http://polymorphicpodcast.com/shows/mv-patterns/)...
null
CC BY-SA 2.5
null
2008-08-07T04:50:54.060
2008-08-07T04:50:54.060
null
null
404
null
4,393
1
4,401
null
175
255,226
How can I drop all tables whose names begin with a given string? I think this can be done with some dynamic SQL and the `INFORMATION_SCHEMA` tables.
Drop all tables whose names begin with a certain string
CC BY-SA 4.0
0
2008-08-07T04:41:37.713
2023-03-02T23:34:08.573
2019-08-15T16:12:55.273
369
369
[ "sql", "sql-server", "dynamic-sql" ]
4,394
2
null
4,393
139
null
``` SELECT 'DROP TABLE "' + TABLE_NAME + '"' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '[prefix]%' ``` This will generate a script. Adding clause to check existence of table before deleting: ``` SELECT 'IF OBJECT_ID(''' +TABLE_NAME + ''') IS NOT NULL BEGIN DROP TABLE [' + TABLE_NAME + '] END;' FROM IN...
null
CC BY-SA 3.0
null
2008-08-07T04:44:48.283
2017-07-06T16:13:20.867
2017-07-06T16:13:20.867
378,986
264
null
4,376
2
null
4,371
200
null
> Stop the MySQL process.Start the MySQL process with the --skip-grant-tables option.Start the MySQL console client with the -u root option. List all the users; ``` SELECT * FROM mysql.user; ``` Reset password; ``` UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]'; ``` --- But to > Sto...
null
CC BY-SA 2.5
null
2008-08-07T04:02:17.090
2008-08-07T05:29:18.427
2020-06-20T09:12:55.060
-1
264
null
4,401
2
null
4,393
174
null
You may need to modify the query to include the owner if there's more than one in the database. ``` DECLARE @cmd varchar(4000) DECLARE cmds CURSOR FOR SELECT 'drop table [' + Table_Name + ']' FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name LIKE 'prefix%' OPEN cmds WHILE 1 = 1 BEGIN FETCH cmds INTO @cmd IF @@f...
null
CC BY-SA 3.0
null
2008-08-07T04:53:29.857
2016-12-12T09:00:06.997
2016-12-12T09:00:06.997
488,438
533
null
4,369
1
4,385
null
99
142,691
I have a directory structure like the following; > script.phpinc/include1.php inc/include2.phpobjects/object1.php objects/object2.phpsoap/soap.php Now, I use those objects in both `script.php` and `/soap/soap.php`, I could move them, but I want the directory structure like that for a specific reason. When executi...
How to include PHP files that require an absolute path?
CC BY-SA 4.0
0
2008-08-07T03:46:47.713
2019-06-04T09:29:07.237
2019-06-04T09:29:07.237
6,556,397
264
[ "php" ]
4,386
2
null
4,363
34
null
Boy, that's a pretty general question. I'll do my best, but be prepared to see me miss by a mile. Assumptions 1. You are using ASP.NET, not plain ASP 2. You don't really want to test your web pages, but the logic behind them. Unit testing the actual .ASPX pages is rather painful, but there are frameworks out there ...
null
CC BY-SA 4.0
null
2008-08-07T04:23:38.000
2019-12-27T07:12:30.880
2019-12-27T07:12:30.880
5,407,188
308
null
4,400
2
null
4,393
3
null
[Xenph Yan](https://stackoverflow.com/users/264/xenph-yan)'s answer was far cleaner than mine but here is mine all the same. ``` DECLARE @startStr AS Varchar (20) SET @startStr = 'tableName' DECLARE @startStrLen AS int SELECT @startStrLen = LEN(@startStr) SELECT 'DROP TABLE ' + name FROM sysobjects WHERE type = 'U' ...
null
CC BY-SA 3.0
null
2008-08-07T04:53:09.483
2016-12-02T03:43:26.807
2017-05-23T12:18:17.147
-1
231
null
4,415
2
null
1,936
37
null
Keep in mind that TempData stores the form collection in session. If you don't like that behavior, you can implement the new ITempDataProvider interface and use some other mechanism for storing temp data. I wouldn't do that unless you know for a fact (via measurement and profiling) that the use of Session state is hurt...
null
CC BY-SA 2.5
null
2008-08-07T05:12:32.283
2008-08-07T05:12:32.283
null
null
598
null
4,416
1
4,427
null
5
893
I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename "wca.exe". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I can't find that file. I thought it would be in the latest .NET 3....
Where can I get the Windows Workflow "wca.exe" application?
CC BY-SA 2.5
null
2008-08-07T05:13:31.020
2010-10-28T20:01:03.287
2010-10-28T20:01:03.287
224,671
404
[ ".net-3.5" ]
4,422
2
null
4,219
3
null
I'd say it really depends on your needs. TFS is very nice, I've used it extensively, but it's very much aimed at the enterprise level, if you don't need all of those features it might not be necessary. If you do need those features (especially branching, scalability, work item tracking, etc.) they are worth every penny...
null
CC BY-SA 2.5
null
2008-08-07T05:28:18.743
2008-08-07T05:28:18.743
null
null
332
null
4,418
1
4,431
null
239
261,423
The firewall I'm behind is running Microsoft ISA server in NTLM-only mode. Hash anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method? ... or am I just being lazy? Note: rubysspi-1.2.4 does not work. This also works for "igem", part of the IronRuby project
How do I update Ruby Gems from behind a Proxy (ISA-NTLM)
CC BY-SA 3.0
0
2008-08-07T05:21:16.807
2020-06-19T06:19:38.423
2016-01-29T18:13:10.587
128,421
307
[ "ruby", "proxy", "rubygems", "ironruby" ]
4,408
2
null
4,369
46
null
You can use relative paths. Try `__FILE__`. This is a PHP constant which always returns the path/filename of the script it is in. So, in `soap.php`, you could do: ``` include dirname(__FILE__).'/../inc/include.php'; ``` > The full path and filename of the file. If used inside an include, the name of the includ...
null
CC BY-SA 3.0
null
2008-08-07T05:05:34.093
2017-09-09T01:01:54.793
2017-09-09T01:01:54.793
1,192,426
40
null
4,426
2
null
3,088
0
null
I recommend starting them off with C/C++. I find that it is a good foundation for just about every other language. Also, the different versions of BASIC can be pretty dodgy, at best, and have no real correlation to actual programming.
null
CC BY-SA 2.5
null
2008-08-07T05:35:26.933
2008-08-07T05:35:26.933
null
null
522
null
4,428
2
null
4,416
1
null
On my machine, with Visual Studio 2008 installed, it's in C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
null
CC BY-SA 2.5
null
2008-08-07T05:42:30.930
2008-08-07T05:42:30.930
null
null
9
null
4,413
2
null
2,232
32
null
Some things to think about when choosing between these mechanisms are: 1. Do you just want stdout or do you need stderr as well? Or even separated out? 2. How big is your output? Do you want to hold the entire result in memory? 3. Do you want to read some of your output while the subprocess is still running? 4. Do yo...
null
CC BY-SA 4.0
null
2008-08-07T05:10:35.627
2020-01-10T01:47:38.977
2020-01-10T01:47:38.977
128,421
528
null
4,425
2
null
3,088
5
null
This is a fantastic book which my little brothers used to learn: [http://pine.fm/LearnToProgram/](http://pine.fm/LearnToProgram/) Of course, the most important thing is to start on a real, useful program of some kind IMMEDIATELY after finishing the book.
null
CC BY-SA 2.5
null
2008-08-07T05:33:05.440
2008-08-07T05:33:05.440
null
null
574
null
4,427
2
null
4,416
1
null
Should be part of the .NET 3 SDK (and later version as well). If you've already installed this, the path might look something like C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\wca.exe More info on [Guy Burstein's blog](http://blogs.microsoft.co.il/blogs/bursteg/archive/2006/12/24/wca.aspx).
null
CC BY-SA 2.5
null
2008-08-07T05:40:18.733
2008-08-07T05:40:18.733
null
null
536
null
4,430
1
12,585
null
62
172,605
Is there available any tool for PHP which can be used to generate code for consuming a [web service](http://en.wikipedia.org/wiki/Web_service) based on its [WSDL](http://en.wikipedia.org/wiki/Web_Services_Description_Language)? Something comparable to clicking "Add Web Reference" in Visual Studio or the Eclipse plugin ...
How to easily consume a web service from PHP
CC BY-SA 3.0
0
2008-08-07T05:48:33.570
2018-06-11T15:35:59.133
2013-01-29T12:53:38.437
349
349
[ "php", "web-services", "visual-studio", "wsdl" ]
4,434
1
4,443
null
23
9,712
Let's say that there is a solution that contains two projects (Project1 and Project2). Project1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets set as a StartUp Project. I tried to find ...
Can I configure Visual Studio NOT to change StartUp Project every time I open a file from one of the projects?
CC BY-SA 3.0
null
2008-08-07T05:50:57.013
2023-03-03T21:37:54.367
2017-09-03T12:57:43.017
1,033,581
95
[ ".net", "visual-studio", "ide" ]
4,437
2
null
4,432
3
null
You could instead add the comma as the first thing inside your foreach. `if (sb.Length > 0) sb.Append(",");`
null
CC BY-SA 3.0
null
2008-08-07T05:54:00.157
2011-11-26T08:25:56.647
2011-11-26T08:25:56.647
388,388
404
null
4,438
2
null
4,432
0
null
How about tracking whether you are on the first item, and only add a comma the item if it is not the first one. ``` public string ReturnAsCSV(ContactList contactList) { StringBuilder sb = new StringBuilder(); bool isFirst = true; foreach (Contact c in contactList) { if (!isFirst) { // ...
null
CC BY-SA 3.0
null
2008-08-07T05:54:57.813
2016-02-07T14:34:02.843
2016-02-07T14:34:02.843
2,921,691
51
null
4,431
2
null
4,418
218
null
I wasn't able to get mine working from the command-line switch but I have been able to do it just by setting my `HTTP_PROXY` environment variable. (Note that case seems to be important). I have a batch file that has a line like this in it: ``` SET HTTP_PROXY=http://%USER%:%PASSWORD%@%SERVER%:%PORT% ``` I set the fou...
null
CC BY-SA 3.0
null
2008-08-07T05:49:00.557
2016-01-29T17:28:20.400
2016-01-29T17:28:20.400
128,421
358
null
4,441
2
null
4,432
21
null
You could use [LINQ to Objects](http://en.wikipedia.org/wiki/Language_Integrated_Query#LINQ_to_Objects): ``` string [] strings = contactList.Select(c => c.Name).ToArray(); string csv = string.Join(",", strings); ``` Obviously that could all be done in one line, but it's a bit clearer on two.
null
CC BY-SA 2.5
null
2008-08-07T05:56:15.957
2010-03-26T17:29:31.023
2010-03-26T17:29:31.023
40,015
489
null
4,443
2
null
4,434
18
null
The way to select a startup project is described in [Sara Ford's blog "Visual Studio Tip of the Day](http://blogs.msdn.com/saraford/default.aspx)" (highly recommended). She has a post there about [setting up StartUp projects](http://blogs.msdn.com/saraford/archive/2008/07/29/did-you-know-how-to-select-the-startup-proje...
null
CC BY-SA 2.5
null
2008-08-07T05:58:25.810
2009-02-20T14:58:54.607
2009-02-20T14:58:54.607
12,748
278
null
4,461
2
null
4,432
1
null
> I like the idea of adding the comma by checking if the container is empty, but doesn't that mean more processing as it needs to check the length of the string on each occurrence? You're prematurely optimizing, the performance hit would be negligible.
null
CC BY-SA 2.5
null
2008-08-07T06:25:57.503
2008-08-07T06:25:57.503
null
null
264
null