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
18,521
2
null
18,505
1
null
I used this in a program where I needed to simulate clicks and mouse movements; [Global Mouse and Keyboard Library](http://www.codeproject.com/KB/system/globalmousekeyboardlib.aspx)
null
CC BY-SA 2.5
null
2008-08-20T18:28:09.990
2008-08-20T18:28:09.990
null
null
1,130,097
null
18,523
2
null
18,465
15
null
The `Convert.ToXXX()` methods are for objects that might be of the correct or similar type, while `.Parse()` and `.TryParse()` are specifically for strings: ``` //o is actually a boxed int object o = 12345; //unboxes it int castVal = (int) 12345; //o is a boxed enum object o = MyEnum.ValueA; //this will get the und...
null
CC BY-SA 2.5
null
2008-08-20T18:28:41.983
2008-08-20T18:28:41.983
null
null
905
null
18,535
2
null
18,450
2
null
> Do you know how good Mono 2.0 preview's support is for Windows Forms 2.0? From the little bit that I've played with it, it seemed relatively complete and almost usable. It just didn't quite look right in some places and is still a little hit or miss overall. It amazed me that it worked as well as it did with some ...
null
CC BY-SA 2.5
null
2008-08-20T18:36:50.623
2008-08-20T18:36:50.623
null
null
1,432
null
18,530
2
null
3,748
99
null
File store. Facebook engineers had a great talk about it. One take away was to know the practical limit of files in a directory. [Needle in a Haystack: Efficient Storage of Billions of Photos](http://perspectives.mvdirona.com/2008/06/30/FacebookNeedleInAHaystackEfficientStorageOfBillionsOfPhotos.aspx)
null
CC BY-SA 2.5
null
2008-08-20T18:35:15.900
2008-08-20T18:35:15.900
null
null
1,293
null
18,533
1
18,539
null
21
9,621
I've found myself increasingly unsatisfied with the DataSet/DataTable/DataRow paradigm in .Net, mostly because it's often a couple of steps more complicated than what I really want to do. In cases where I'm binding to controls, DataSets are fine. But in other cases, there seems to be a fair amount of mental overhead....
C#: What Else Do You Use Besides DataSet
CC BY-SA 2.5
0
2008-08-20T18:36:02.310
2021-07-06T15:48:31.517
2008-09-09T22:13:42.683
-1
111
[ "c#", ".net", "sql", "dataset" ]
18,524
1
18,529
null
117
233,750
I have a list of integers, `List<Integer>` and I'd like to convert all the integer objects into Strings, thus finishing up with a new `List<String>`. Naturally, I could create a new `List<String>` and loop through the list calling `String.valueOf()` for each integer, but I was wondering if there was a better (read: ) ...
Converting List<Integer> to List<String>
CC BY-SA 3.0
0
2008-08-20T18:29:48.410
2022-11-17T16:35:30.393
2017-11-02T22:27:53.883
6,074,376
916
[ "java", "string", "collections", "integer" ]
18,529
2
null
18,524
83
null
As far as I know, iterate and instantiate is the only way to do this. Something like (for others potential help, since I'm sure you know how to do this): ``` List<Integer> oldList = ... /* Specify the size of the list up front to prevent resizing. */ List<String> newList = new ArrayList<>(oldList.size()); for (Intege...
null
CC BY-SA 4.0
null
2008-08-20T18:34:07.197
2020-04-15T18:23:14.630
2020-04-15T18:23:14.630
1,505,487
1,432
null
18,539
2
null
18,533
21
null
Since .NET 3.5 came out, I've exclusively used LINQ. It's really that good; I don't see any reason to use any of those old crutches any more. As great as LINQ is, though, I think any ORM system would allow you to do away with that dreck.
null
CC BY-SA 2.5
null
2008-08-20T18:38:04.177
2008-08-20T18:38:04.177
null
null
1,975,282
null
18,525
2
null
18,465
3
null
I'm a big fan of [TryParse](http://msdn.microsoft.com/en-us/library/f02979c7.aspx), since it saves you a lot of headache of error catching when there's a chance the value you're going to parse is not of the appropriate type. My order is usually: - - -
null
CC BY-SA 2.5
null
2008-08-20T18:30:46.253
2008-08-20T18:37:23.680
2008-08-20T18:37:23.680
111
111
null
18,538
1
5,645,413
null
119
78,842
I'd like some sorthand for this: ``` Map rowToMap(row) { def rowMap = [:]; row.columns.each{ rowMap[it.name] = it.val } return rowMap; } ``` given the way the GDK stuff is, I'd expect to be able to do something like: ``` Map rowToMap(row) { row.columns.collectMap{ [it.name,it.val] } } ``` but I ha...
shortcut for creating a Map from a List in groovy?
CC BY-SA 2.5
0
2008-08-20T18:37:51.370
2017-03-09T08:06:40.983
2008-08-20T22:27:36.357
2,031
2,031
[ "java", "collections", "groovy", "expandometaclass" ]
18,543
2
null
104
5
null
I found [.Net Memory Profiler](http://memprofiler.com/) a very good help when finding memory leaks in .Net. It's not free like the Microsoft CLR Profiler, but is faster and more to the point in my opinion. A
null
CC BY-SA 2.5
null
2008-08-20T18:39:25.953
2008-08-20T18:39:25.953
null
null
1,242
null
18,544
2
null
18,505
1
null
To be honest I've never had an issue bringing a window to the foreground on XP/Vista/2003/2000. You need to make sure you do the following: 1. Check if IsIconic (minimized) 2. If #1 results in true then call ShowWindow passing SW_RESTORE 3. Then call SetForegroundWindow I've never had problems that I can think o...
null
CC BY-SA 2.5
null
2008-08-20T18:40:18.460
2008-08-20T18:40:18.460
null
null
1,627
null
18,547
2
null
18,524
2
null
@Jonathan: I could be mistaken, but I believe that String.valueOf() in this case will call the String.valueOf(Object) function rather than getting boxed to String.valueOf(int). String.valueOf(Object) just returns "null" if it is null or calls Object.toString() if non-null, which shouldn't involve boxing (although obvi...
null
CC BY-SA 2.5
null
2008-08-20T18:42:01.483
2008-08-20T18:42:01.483
null
null
1,432
null
18,541
2
null
18,450
1
null
I would imagine then if you have an application with some 3rd party components you may be stuffed. I doubt a lot of vendors will develop with Mono in mind Example: [http://community.devexpress.com/forums/p/55085/185853.aspx](http://community.devexpress.com/forums/p/55085/185853.aspx)
null
CC BY-SA 2.5
null
2008-08-20T18:38:48.950
2008-08-20T18:38:48.950
null
null
922
null
18,554
2
null
18,291
1
null
We tried to use DUnit with Delphi 5, but it didn't work well. Specially if you are implementing COM interfaces, we found many dependencies to setup all the test infrastructure. I don't know if the test support has improved in newer versions.
null
CC BY-SA 2.5
null
2008-08-20T18:44:29.870
2008-08-20T18:44:29.870
null
null
2,015
null
18,558
2
null
18,524
9
null
Instead of using String.valueOf I'd use .toString(); it avoids some of the auto boxing described by @johnathan.holland The javadoc says that valueOf returns the same thing as Integer.toString(). ``` List<Integer> oldList = ... List<String> newList = new ArrayList<String>(oldList.size()); for (Integer myInt : oldList...
null
CC BY-SA 2.5
null
2008-08-20T18:45:13.113
2008-09-15T18:24:58.267
2008-09-15T18:24:58.267
1,310
1,310
null
18,546
2
null
18,533
4
null
We've moved away from datasets and built our own ORM objects loosely based on [CSLA](http://www.lhotka.net). You can get the same job done with either a DataSet or LINQ or ORM but re-using it is (we've found) a lot easier. 'Less code make more happy'.
null
CC BY-SA 2.5
null
2008-08-20T18:41:34.263
2008-08-20T18:41:34.263
null
null
2,009
null
18,563
2
null
18,035
4
null
"There are some gotchas in terms of p/invoke calls not always working across 32/64, as well as Managed DirectX not working well under 64-bit, but on the whole I think its something people are going to be doing more as time goes by." This is caused, in .net, by having the AnyCPU flag set. AnyCPU on an x64 machine will...
null
CC BY-SA 2.5
null
2008-08-20T18:48:20.610
2008-08-20T18:48:20.610
null
null
580
null
18,573
2
null
3,748
4
null
I once worked on an image processing application. We stored the uploaded images in a directory that was something like /images/[today's date]/[id number]. But we also extracted the metadata (exif data) from the images and stored that in the database, along with a timestamp and such.
null
CC BY-SA 2.5
null
2008-08-20T18:51:56.110
2008-08-20T18:51:56.110
null
null
572
null
18,569
2
null
3,748
1
null
The reason we store images in our tables is because each table (or set of tables per range of work) is temporary and dropped at the end of the workflow. If there was any sort of long term storage we'd definitely opt for storing file paths. It should also be noted that we work with a client/server application inter...
null
CC BY-SA 2.5
null
2008-08-20T18:49:45.553
2008-08-20T18:49:45.553
null
null
2,009
null
18,574
2
null
18,533
1
null
Pre linq I used DataReader to fill List of my own custom domain objects, but post linq I have been using L2S to fill L2S entities, or L2S to fill domain objects. Once I get a bit more time to investigate I suspect that Entity Framework objects will be my new favourite solution!
null
CC BY-SA 2.5
null
2008-08-20T18:52:02.647
2008-08-20T18:52:02.647
null
null
1,075
null
18,555
2
null
18,533
1
null
I use them extensively but I don't make use of any of the "advanced" features that Microsoft was really pushing when the framework first came out. I'm basically just using them as Lists of Hashtables, which I find perfectly useful. I have not seen good results when people have tried to make complex typed DataSets, or...
null
CC BY-SA 2.5
null
2008-08-20T18:44:33.117
2008-08-20T18:44:33.117
null
null
1,219
null
18,549
2
null
3,748
7
null
I'm not sure how much of a "real world" example this is, but I currently have an application out there that stores details for a trading card game, including the images for the cards. Granted the record count for the database is only 2851 records to date, but given the fact that certain cards have are released multiple...
null
CC BY-SA 2.5
null
2008-08-20T18:42:14.400
2008-08-20T18:42:14.400
null
null
71
null
18,579
2
null
18,524
2
null
I think using Object.toString() for any purpose other than debugging is probably a really bad idea, even though in this case the two are functionally equivalent (assuming the list has no nulls). Developers are free to change the behavior of any toString() method without any warning, including the toString() methods of...
null
CC BY-SA 2.5
null
2008-08-20T18:53:35.527
2008-08-20T18:53:35.527
null
null
1,471
null
18,584
1
18,718
null
1
7,331
> [How do I calculate someone's age in C#?](https://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c) Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) "dd/...
Exact age calculation
CC BY-SA 3.0
0
2008-08-20T18:59:03.377
2012-05-26T23:50:05.027
2017-05-23T12:28:00.033
-1
1,130,097
[ "c#" ]
18,595
2
null
18,524
9
null
The source for String.valueOf shows this: ``` public static String valueOf(Object obj) { return (obj == null) ? "null" : obj.toString(); } ``` Not that it matters much, but I would use toString.
null
CC BY-SA 2.5
null
2008-08-20T19:03:11.637
2008-08-20T19:03:11.637
null
null
212
null
18,581
2
null
18,533
3
null
I was fed up with DataSets in .Net 1.1, at least they optimised it so that it doesn't slow as exponentially for large sets any more. It was always a rather bloated model - I haven't seen many apps that use most of its features. SqlDataReader was good, but I used to wrap it in an `IEnumerable<T>` where the T was some ...
null
CC BY-SA 2.5
null
2008-08-20T18:55:33.120
2008-08-20T18:55:33.120
null
null
905
null
18,603
2
null
18,584
1
null
> Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) "dd/mm/yyyy" and it calculated 33 and I'm 32 actually still, doesn't it better to calculate the exact age? My guess would be th...
null
CC BY-SA 2.5
null
2008-08-20T19:10:28.903
2008-08-20T19:10:28.903
null
null
1,818
null
18,606
1
18,647
null
9
17,607
Is there a method of accessing an Exchange server that does not have `IMAP` or `POP3` enabled without Outlook? It does not appear that Outlook Express supports Exchange (only `IMAP and POP3`).
Accessing an Exchange Server without Outlook
CC BY-SA 3.0
0
2008-08-20T19:11:32.723
2016-08-02T13:06:07.507
2016-08-02T13:06:07.507
4,311,889
572
[ "email", "outlook", "exchange-server", "email-client" ]
18,611
2
null
12,268
0
null
I think you have your answer right here: [Reflector sold to Red Gate](http://blog.lutzroeder.com/2008/08/future-of-net-reflector.html)
null
CC BY-SA 2.5
null
2008-08-20T19:13:25.323
2008-08-20T19:13:25.323
null
null
51
null
18,585
1
19,056
null
4
4,961
### Update: Solved, with code [I got it working, see my answer below for the code...](https://stackoverflow.com/questions/18585/why-cant-you-bind-the-size-of-a-windows-form-to-applicationsettings#19056) ### Original Post As Tundey pointed out in [his answer](https://stackoverflow.com/questions/18421/best-way-to-b...
Why can't you bind the Size of a windows form to ApplicationSettings?
CC BY-SA 2.5
0
2008-08-20T18:59:35.187
2010-12-11T21:24:47.210
2020-06-20T09:12:55.060
-1
229
[ "c#", "visual-studio", "data-binding", ".net-2.0" ]
18,610
2
null
18,584
0
null
Actually, because of leap years, your code would be off. Since the timespan object has no TotalYears property the best way to get it would be this Pardon the VB.Net ``` Dim myAge AS Integer = DateTime.Now.year - BirthDate.year If Birthdate.month < DateTime.Now.Month _ OrElse BirthDate.Month = DateTime.Now.Month AndA...
null
CC BY-SA 2.5
null
2008-08-20T19:12:59.630
2008-08-20T19:12:59.630
null
null
1,862
null
18,607
2
null
18,449
18
null
As of PHP 5.1.0 you can use [date_default_timezone_set()](http://www.php.net/manual/en/function.date-default-timezone-set.php) function to set the default timezone used by all date/time functions in a script. For MySql (quoted from [MySQL Server Time Zone Support](http://dev.mysql.com/doc/refman/4.1/en/time-zone-supp...
null
CC BY-SA 2.5
null
2008-08-20T19:11:36.513
2008-08-20T19:16:56.877
2008-08-20T19:16:56.877
1,926
1,926
null
18,601
1
18,771
null
27
6,302
Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests. The cause of this pain point generally revolves around the hassle of writing UI automation mid-devel...
Best practice for integrating TDD with web application development?
CC BY-SA 2.5
0
2008-08-20T19:07:51.593
2012-11-14T15:37:46.717
2009-09-26T16:45:12.610
1,288
1,473,493
[ "unit-testing", "tdd" ]
18,602
2
null
18,449
12
null
Store everything as UTC. You can do conversions at the client level, or on the server side using client settings. [php - date](http://us.php.net/date) [mysql - utc-timestamp](http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_utc-timestamp)
null
CC BY-SA 2.5
null
2008-08-20T19:09:18.890
2008-08-20T19:09:18.890
null
null
1,976
null
18,608
1
18,616
null
4
846
I've got a group of inter-related classes that are all overridden together to create a particular implementation. I'm wondering if it is a good idea to enclose the interrelated subclasses in a namespace. For example purposes, consider the following namespaces and classes: ``` namespace Protocol { public abstract cl...
Is it a bad idea to expose inheritance hierarchy in namespace structure?
CC BY-SA 2.5
null
2008-08-20T19:12:05.077
2008-09-23T21:52:37.520
null
null
327
[ "c#", "oop", "inheritance", "naming", "convention" ]
18,617
1
18,623
null
83
210,262
How do you configure tomcat to bind to a single ip address (localhost) instead of all addresses?
How do you configure tomcat to bind to a single ip address (localhost) instead of all addresses?
CC BY-SA 2.5
0
2008-08-20T19:16:20.810
2020-03-04T10:12:21.437
null
null
1,310
[ "tomcat" ]
18,615
2
null
18,601
4
null
I layer out the application and at least unit test from the presenter/controller (whichever is your preference, mvc/mvp) to the data layer. That way I have good test coverage over most of the code that is written. I have looked at FitNesse, Watin and Selenium as options to automate the UI testing but I haven't got aro...
null
CC BY-SA 2.5
null
2008-08-20T19:16:02.527
2008-08-20T19:16:02.527
null
null
1,911
null
18,614
1
null
null
4
744
What is the the best way to write a form to submit some data in ASP.NET MVC? Is it as [Scott Guthrie](http://en.wikipedia.org/wiki/Scott_Guthrie) demonstrates here? Are there better approaches? Perhaps with less using of strings? ![alt text](https://i.stack.imgur.com/yehPg.png)
What is the best way to write a form in ASP.NET MVC?
CC BY-SA 3.0
0
2008-08-20T19:16:01.060
2019-04-01T20:07:42.353
2019-04-01T20:07:42.353
100,297
230
[ "asp.net-mvc", "forms" ]
18,612
2
null
1,237
4
null
A more complete discussion of the pitfalls of using a regex to find matching tags can be found at: [http://faq.perl.org/perlfaq4.html#How_do_I_find_matchi](http://faq.perl.org/perlfaq4.html#How_do_I_find_matchi). In particular, be aware that nesting tags really need a full-fledged parser in order to be interpreted cor...
null
CC BY-SA 2.5
null
2008-08-20T19:14:19.237
2008-08-20T19:14:19.237
null
null
1,438
null
18,619
2
null
9,033
7
null
You type "prop" and then press [TAB] twice, it generates useful code for your properties and can speed your typing. I know this works in VS 2005 (I use it) but I don´t know in previous versions.
null
CC BY-SA 3.0
null
2008-08-20T19:17:16.330
2011-11-16T06:37:17.683
2011-11-16T06:37:17.683
331,508
1,130,097
null
18,616
2
null
18,608
6
null
I think you are perhaps worrying too much! Does it make sense logically? Do you know where to find your code within the namespaces? I would much rather see a codebase like the above with a small number of classes, relevant to the name with a hierarchy, than one large namespace where everything is interrelated.. Reme...
null
CC BY-SA 2.5
null
2008-08-20T19:16:07.907
2008-08-20T19:24:42.550
2008-08-20T19:24:42.550
832
832
null
18,622
2
null
18,606
0
null
You can use [Thunderbird](http://www.mozilla.com/en-US/thunderbird/) to [access Exchange e-mail and contact lists](http://www.downloadsquad.com/2007/03/30/howto-thunderbird-and-ms-exchange-server/). Edit - Oops, this uses IMAP, didn't answer the question.
null
CC BY-SA 2.5
null
2008-08-20T19:19:24.233
2008-08-20T19:35:42.463
2008-08-20T19:35:42.463
5
5
null
18,626
2
null
18,449
0
null
I save all my dates as a bigint due to having had issues with the dateTime type before. I save the result of the time() PHP function into it, now they count as being in the same timezone :)
null
CC BY-SA 2.5
null
2008-08-20T19:22:07.987
2008-08-20T19:22:07.987
null
null
1,384,652
null
18,623
2
null
18,617
146
null
Several connectors are configured, and each connector has an optional "address" attribute where you can set the IP address. 1. Edit tomcat/conf/server.xml. 2. Specify a bind address for that connector: <Connector port="8080" protocol="HTTP/1.1" address="127.0.0.1" connectionTimeout="20000" red...
null
CC BY-SA 2.5
null
2008-08-20T19:19:46.370
2011-03-09T02:01:24.940
2011-03-09T02:01:24.940
59,087
1,310
null
18,625
2
null
18,608
0
null
If this were me, I would define 2 namespaces: ``` Protocol ``` and ``` Protocol.Driver ``` Dividing the namespace like this separates your "library code" vs your "executable / test code." I also create my namespaces to match the directory structure; it will give logic to your programs structure and codefiles. (ma...
null
CC BY-SA 2.5
null
2008-08-20T19:20:35.167
2008-08-20T19:20:35.167
null
null
1,638
null
18,627
2
null
18,450
4
null
We've been using it for a project here at work that needed to run on Linux but reuse some .NET libraries that we built in Managed C++. I've been very surprised at how well it has worked out. Our main executable is being written in C# and we can just reference our Managed C++ binaries with no issue. The only differen...
null
CC BY-SA 2.5
null
2008-08-20T19:23:30.027
2008-08-20T19:23:30.027
null
null
2,179
null
18,638
2
null
18,632
18
null
I use "tail -f" under cygwin.
null
CC BY-SA 2.5
null
2008-08-20T19:27:36.553
2008-08-20T19:27:36.553
null
null
2,179
null
18,624
2
null
18,601
2
null
This is a good question, one that I will be subscribing too :) I am still relatively new to web dev, and I too am looking at a lot of code that is largely untested. For me, I keep the UI (normally only a few lines of code) and test the crap out of everything else. At least I can then have some confidence that everyt...
null
CC BY-SA 2.5
null
2008-08-20T19:19:53.407
2008-08-20T19:19:53.407
null
null
832
null
18,630
2
null
18,533
0
null
I just build my business objects from scratch, and almost never use the `DataTable` and especially not the `DataSet` anymore, except to initially populate the business objects. The advantages to building your own are testability, type safety and IntelliSense, extensibility (try adding to a `DataSet`) and readability (...
null
CC BY-SA 4.0
null
2008-08-20T19:24:43.330
2021-07-06T15:48:31.517
2021-07-06T15:48:31.517
5,405,967
785
null
18,641
2
null
18,606
0
null
I know thunderbird and eudora have support for SimpleMAPI so they can talk to an exchange server but the command set of what they can do is rather basic (you need Extended MAPI support for the whole set) afaik Outlook is the only windows client with full support for Extended MAPI.
null
CC BY-SA 2.5
null
2008-08-20T19:29:52.633
2008-08-20T19:29:52.633
null
null
238
null
18,637
2
null
18,632
3
null
I have used [FileSystemWatcher](http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx) for monitoring of text files for a component I recently built. There may be better options (I never found anything in my research) but that seemed to do the trick nicely :) Crap, my bad, you're actually after a t...
null
CC BY-SA 2.5
null
2008-08-20T19:26:36.183
2008-08-20T19:26:36.183
null
null
832
null
18,640
2
null
18,632
6
null
FileSystemWatcher works a treat, although you do have to be a little careful about duplicate events firing - [1st link from Google](http://blogs.msdn.com/ahamza/archive/2006/02/04/FileSystemWatcher-Duplicate-Events.aspx) - but bearing that in mind can produce great results.
null
CC BY-SA 2.5
null
2008-08-20T19:29:27.143
2008-08-20T19:29:27.143
null
null
377
null
18,632
1
18,635
null
75
110,219
For debugging purposes in a somewhat closed system, I have to output text to a file. Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?
How to monitor a text file in realtime
CC BY-SA 3.0
0
2008-08-20T19:25:07.153
2019-11-27T04:10:39.327
2015-12-29T18:11:39.157
-1
2,011
[ "monitoring", "text-files" ]
18,635
2
null
18,632
36
null
- [Tail for Win32](http://tailforwin32.sourceforge.net/)- [Apache Chainsaw](http://logging.apache.org/chainsaw/index.html)[log4net logs](http://logging.apache.org/log4net/release/howto/chainsaw.html)
null
CC BY-SA 2.5
null
2008-08-20T19:26:25.013
2008-08-20T19:32:57.227
2008-08-20T19:32:57.227
5
5
null
18,654
2
null
18,035
2
null
Another advantage of 64 bit: All the registers associated with the microprocessors are 64-bit. This enables High- precision computations and 64-bit arithmetic to be performed in fewer clock-cycles as compared to 32-bit microprocessors. In certain cases like 64-bit multiplication, it is twice as fast.
null
CC BY-SA 2.5
null
2008-08-20T19:37:52.630
2008-08-20T19:37:52.630
null
null
1,964
null
18,647
2
null
18,606
5
null
The only way I can think of is if the Exchange server has Outlook Web Access (OWA) turned on. You can test this by trying the server name in your browser like so: [http://server/exchange](http://server/exchange). If you mean programmatically then the recommended way is to use [WebDAV](http://www.codeproject.com/KB/vb/...
null
CC BY-SA 2.5
null
2008-08-20T19:32:05.420
2009-05-27T08:50:28.313
2009-05-27T08:50:28.313
33
1,908
null
18,660
2
null
18,655
26
null
One reason - separating your domain model from your database model. What I do is use Test Driven Development so I write my UI and Model layers first and the Data layer is mocked, so the UI and model is build around domain specific objects, then later I map these objects to what ever technology I'm using the the Data ...
null
CC BY-SA 2.5
null
2008-08-20T19:43:19.777
2009-04-01T15:06:16.147
2009-04-01T15:06:16.147
230
230
null
18,663
2
null
17,532
2
null
Rob, you are right. The approach I mentioned is kind of a hybrid. The advantage of having ascx files around is that on every project I've seen, designers would feel most comfortable with editing actual markup and with the ascx you and a designer can work separately. If you don't plan on actual CSS/markup/design changes...
null
CC BY-SA 2.5
null
2008-08-20T19:44:35.810
2008-08-20T19:44:35.810
null
null
1,801
null
18,667
2
null
18,632
0
null
I second "tail -f" in cygwin. I assume that Tail for Win32 will accomplish the same thing.
null
CC BY-SA 2.5
null
2008-08-20T19:45:48.727
2008-08-20T19:45:48.727
null
null
2,109
null
18,648
2
null
18,632
2
null
Yor can use the FileSystemWatcher in System.Diagnostics. From MSDN: public class Watcher { ``` public static void Main() { Run(); } [PermissionSet(SecurityAction.Demand, Name="FullTrust")] public static void Run() { string[] args = System.Environment.GetCommandLineArgs(); // If a directory is not specifie...
null
CC BY-SA 2.5
null
2008-08-20T19:32:09.930
2008-08-20T19:32:09.930
null
null
1,130,097
null
18,661
1
null
null
4
8,153
Is it possible to get UI text from an external application in C#. In particular, is there a way to read Unicode text from a label (I assume it's a normal Windows label control) from an external Win32 app that was written by a 3rd party? The text is visible, but not selectable by mouse in the UI. I assume there is so...
Getting UI text from external app in C#
CC BY-SA 2.5
0
2008-08-20T19:43:24.473
2012-06-14T22:34:33.400
2008-08-22T06:13:12.377
611
838
[ "c#", "winapi", "interop" ]
18,670
2
null
18,632
19
null
When using [Windows PowerShell](http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx) you can do the following: ``` Get-Content someFile.txt -wait ```
null
CC BY-SA 2.5
null
2008-08-20T19:48:59.810
2008-08-20T19:48:59.810
null
null
1,242
null
18,664
2
null
18,632
0
null
[FileMon](http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx) is a free stand alone tool that can detect all kinds of file access. You can filter out any unwanted. It does not show you the data that has actually changed though.
null
CC BY-SA 2.5
null
2008-08-20T19:44:38.777
2008-08-20T19:44:38.777
null
null
1,242
null
18,669
2
null
18,614
2
null
I don't really like strings in my code, as it isn't possible to refactor. A nice way is to use Linq Expressions. If you get passed a model as ViewData you can use the following statement: ``` <%= ShowDropDownBox(viewData => viewData.Name); %> ... public static string ShowDropDownList<T>(this HtmlHelper html, Expressi...
null
CC BY-SA 2.5
null
2008-08-20T19:47:21.250
2008-08-20T19:47:21.250
null
null
2,078
null
18,675
1
21,743
null
1
824
I am creating a program that will be installed using the .net installer project. The program writes to settings files to its directory in the Program Files dir. It believe there are some active directory settings that will prevent the application from righting to that directory if a limited user is running the program....
I/O permission settings using .net installer
CC BY-SA 2.5
null
2008-08-20T19:52:41.127
2009-03-10T03:51:02.143
2009-03-10T03:51:02.143
5,640
1,632
[ ".net", "installation", "active-directory", "io" ]
18,684
2
null
18,676
4
null
``` Public Function RandomNumber(ByVal n As Integer) As Integer 'initialize random number generator Dim r As New Random(System.DateTime.Now.Millisecond) Return r.Next(1, n) End Function ```
null
CC BY-SA 2.5
null
2008-08-20T19:59:43.340
2010-04-20T18:46:59.107
2010-04-20T18:46:59.107
1,288
1,288
null
18,674
2
null
18,585
2
null
One of the reason I imagine size binding is not allowed is because the screen may change between sessions. Loading the size back when the resolution has reduced could result in the title bar being beyond the limits of the screen. You also need to be wary of multiple monitor setups, where monitors may no longer be ava...
null
CC BY-SA 2.5
null
2008-08-20T19:52:06.713
2008-08-20T19:52:06.713
null
null
770
null
18,671
1
6,000,355
null
254
346,737
Anyone know a quick easy way to migrate a SQLite3 database to MySQL?
Quick easy way to migrate SQLite3 to MySQL?
CC BY-SA 2.5
0
2008-08-20T19:49:13.337
2020-08-25T08:15:42.030
null
null
534
[ "mysql", "sqlite", "migration" ]
18,680
2
null
18,676
66
null
To get a random integer value between 1 and N (inclusive) you can use the following. ``` CInt(Math.Ceiling(Rnd() * n)) + 1 ```
null
CC BY-SA 3.0
null
2008-08-20T19:55:53.693
2014-12-01T22:12:35.750
2014-12-01T22:12:35.750
225
1,862
null
18,659
2
null
18,585
1
null
Well I have had a quick play with this and you are correct, while there is no way to directly the size of the form to AppSettings, you can add your own values and change the size on load. I would perhaps recommend that if this is a common feature, you subclass Form and make it automatically prob the App.Config for th...
null
CC BY-SA 2.5
null
2008-08-20T19:41:37.097
2008-08-20T19:41:37.097
null
null
832
null
18,685
1
18,693
null
34
31,646
Can anyone tell me how I can display a status message like "12 seconds ago" or "5 minutes ago" etc in a web page?
How to display "12 minutes ago" etc in a PHP webpage?
CC BY-SA 2.5
0
2008-08-20T19:59:57.490
2016-01-15T14:49:50.647
2012-04-30T11:23:31.697
729,768
184
[ "php" ]
18,672
2
null
18,632
8
null
Tail is the best answer so far. If you don't use Windows, you probably already have tail. If you do use Windows, you can get a whole slew of Unix command line tools from [here](http://unxutils.sourceforge.net/). Unzip them and put them somewhere in your PATH. Then just do this at the command prompt from the same fol...
null
CC BY-SA 4.0
null
2008-08-20T19:50:19.620
2019-11-27T04:10:39.327
2019-11-27T04:10:39.327
10,854,998
null
null
18,691
2
null
4,508
1
null
You should be able to make an unmanaged DLL that performs the operations you want using MAPI, and then invoke that DLL from your managed code. I wouldn't write a straight MAPI wrapper, but something that performs all of the functionality you require of MAPI contained in that unmanaged DLL. That would probably be the ...
null
CC BY-SA 2.5
null
2008-08-20T20:01:35.723
2008-08-20T20:01:35.723
null
null
2,134
null
18,690
2
null
18,632
16
null
I use [BareTail](http://www.baremetalsoft.com/baretail/) for doing this on Windows. It's free and has some nice features, such as tabs for tailing multiple files and configurable highlighting.
null
CC BY-SA 2.5
null
2008-08-20T20:01:16.223
2008-08-20T20:01:16.223
null
null
1,450
null
18,655
1
null
null
141
15,690
I really need to see some honest, thoughtful debate on the merits of the currently accepted design paradigm. I am not convinced that entity objects should exist. By entity objects I mean the typical things we tend to build for our applications, like "Person", "Account", "Order", etc. My current design philosophy is...
Why do we need entity objects?
CC BY-SA 3.0
0
2008-08-20T19:37:53.597
2016-06-18T16:18:54.843
2016-06-18T16:18:54.843
229,044
1,219
[ "sql", "database", "orm", "entities" ]
18,676
1
18,680
null
65
367,072
I need to generate a random integer between 1 and n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomness - just an old-fashioned random number. How would I do that?
Random integer in VB.NET
CC BY-SA 3.0
0
2008-08-20T19:54:00.407
2021-05-04T14:43:04.103
2015-05-16T22:05:29.897
63,550
225
[ "vb.net", "random" ]
18,696
1
18,714
null
3
2,454
Our company is currently writing a GUI automation testing tool for compact framework applications. We have initially searched many tools but none of them was right for us. By using the tool you can record test-cases and group them together to test-suites. For every test-suite there is generated an application, which ...
GUI Automation testing - Window handle questions
CC BY-SA 2.5
0
2008-08-20T20:03:28.840
2009-12-04T18:13:37.587
2009-12-04T18:13:37.587
3,619
2,078
[ "ui-automation", "window-handles", "gui-testing" ]
18,697
2
null
18,585
1
null
I agree with Rob Cooper's answer. But I think Martin makes a very good point. Nothing like having users open your application and the app is off-screen! So in reality, you'll want to combine both answers and bear in mind the current screen dimensions before setting your form's size.
null
CC BY-SA 2.5
null
2008-08-20T20:04:16.903
2008-08-20T20:04:16.903
null
null
1,453
null
18,693
2
null
18,685
73
null
Here is the php code for the same: ``` function time_since($since) { $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * 24 * 30 , 'month'), array(60 * 60 * 24 * 7, 'week'), array(60 * 60 * 24 , 'day'), array(60 * 60 , 'hour'), array(60 , 'minute'), ...
null
CC BY-SA 2.5
null
2008-08-20T20:02:48.933
2008-08-20T20:02:48.933
null
null
184
null
18,698
2
null
18,661
5
null
You could do it if that unicode text is actually a window with a caption by sending a [WM_GETTEXT](http://msdn.microsoft.com/en-us/library/ms632627.aspx) message. ``` [DllImport("user32.dll")] public static extern int SendMessage (IntPtr hWnd, int msg, int Param, System.Text.StringBuilder text); System.Text.StringBu...
null
CC BY-SA 3.0
null
2008-08-20T20:04:35.967
2012-06-07T20:57:12.417
2012-06-07T20:57:12.417
804,898
1,242
null
18,687
2
null
18,676
37
null
Use [System.Random](http://msdn.microsoft.com/en-us/library/system.random.aspx): ``` Dim MyMin As Integer = 1, MyMax As Integer = 5, My1stRandomNumber As Integer, My2ndRandomNumber As Integer ' Create a random number generator Dim Generator As System.Random = New System.Random() ' Get a random number >= MyMin and <=...
null
CC BY-SA 3.0
null
2008-08-20T20:00:03.107
2014-02-01T19:42:07.760
2014-02-01T19:42:07.760
317
317
null
18,714
2
null
18,696
1
null
If the Automated GUI testing tool has knowledge about the framework the application is written in it could use that information to make better or more advanced scripts. [TestComplete](http://www.automatedqa.com/products/testcomplete/index.asp) for example knows about Borland's VCL and WinForms. If you test applications...
null
CC BY-SA 2.5
null
2008-08-20T20:17:00.303
2008-08-20T20:17:00.303
null
null
1,242
null
18,717
1
18,723
null
134
44,538
As far as I know, foreign keys (FK) are used to aid the programmer to manipulate data in the correct way. Suppose a programmer is actually doing this in the right manner already, then do we really need the concept of foreign keys? Are there any other uses for foreign keys? Am I missing something here?
Are foreign keys really necessary in a database design?
CC BY-SA 2.5
0
2008-08-20T20:18:08.757
2022-04-05T06:44:45.427
2016-09-30T04:34:45.633
116
184
[ "database", "oracle", "foreign-keys" ]
18,695
2
null
18,167
2
null
Create testing stored procedures on server B that reference the data on server A via the linked server. e.g. if your regular sproc references a table on Server B say: ``` databaseA.dbo.tableName ``` then use the linked servername to reference the same database/table on server A: ``` linkedServerName.databaseA.dbo....
null
CC BY-SA 2.5
null
2008-08-20T20:02:57.310
2008-08-20T20:02:57.310
null
null
1,874
null
18,705
1
19,071
null
0
318
I need to be able to create basic MS Project items (tasks, projects, resources, etc.) programmatically from my app to my Project Server 2003 install, and haven't found any good examples. Can anyone point me to some good references or have some sample code of connecting to the server and creating these items?
How to create Projects/Tasks for Project Server 2003 via C#?
CC BY-SA 4.0
null
2008-08-20T20:09:45.393
2022-06-28T06:34:16.990
2022-06-28T06:34:16.990
10,530,657
829
[ "c#", "project-server" ]
18,726
2
null
18,632
1
null
Just a shameless plug to tail onto the answer, but I have a free web based app called [Hacksaw](http://www.codeplex.com/hacksaw) used for viewing log4net files. I've put in an auto refresh options so you can give yourself near real time updates without having to refresh the browser all the time.
null
CC BY-SA 2.5
null
2008-08-20T20:21:36.470
2008-08-20T20:21:36.470
null
null
71
null
18,719
1
null
null
9
22,160
As part of our databuild run a 3rd party program (3D Studio Max) to export a number of assets. Unfortunately if a user is not currently logged in, or the machine is locked, then Max does not run correctly. This can be solved for freshly booted machines by using a method such as TweakUI for automatic login. However whe...
How can I prevent a server from becoming locked after a Remote Desktop session
CC BY-SA 2.5
0
2008-08-20T20:18:32.470
2009-03-09T17:30:37.097
2009-03-09T17:30:37.097
1,043
1,043
[ "windows-server-2008", "build-automation", "windows-server-2003" ]
18,728
2
null
18,717
64
null
Foreign keys can also help the programmer write less code using things like `ON DELETE CASCADE`. This means that if you have one table containing users and another containing orders or something, then deleting a user could automatically delete all orders that point to that user.
null
CC BY-SA 4.0
null
2008-08-20T20:22:36.530
2018-09-18T06:47:33.613
2018-09-18T06:47:33.613
7,032,856
893
null
18,732
2
null
18,717
10
null
Without a foreign key how do you tell that two records in different tables are related? I think what you are referring to is referential integrity, where the child record is not allowed to be created without an existing parent record etc. These are often known as foreign key constraints - but are not to be confused wi...
null
CC BY-SA 2.5
null
2008-08-20T20:24:15.513
2008-08-20T20:24:15.513
null
null
1,908
null
18,723
2
null
18,717
109
null
Foreign keys help enforce referential integrity at the data level. They also improve performance because they're normally indexed by default.
null
CC BY-SA 2.5
null
2008-08-20T20:19:33.997
2008-08-20T20:19:33.997
null
null
1,450
null
18,718
2
null
18,584
0
null
If you were born on January 12th 1975, you would be 33 years old today. If you were born on December 1st 1975, you would be 32 years old today. If you read the note by the birthday field when editing your profile you'll see it says "YYYY/MM/DD", I'm sure it will try to interpret dates of other formats but it looks li...
null
CC BY-SA 2.5
null
2008-08-20T20:18:23.547
2008-08-20T20:18:23.547
null
null
332
null
18,702
1
18,750
null
1
286
I often use webservice this way ``` public void CallWebservice() { mywebservice web = new mywebservice(); web.call(); } ``` but sometimes I do this ``` private mywebservice web; public Constructor() { web = new mywebservice(); } public void CallWebservice() { web.call(); } ``` The second approac...
Webservice alive forever
CC BY-SA 3.0
null
2008-08-20T20:07:34.057
2013-02-16T14:52:14.073
2013-02-16T14:52:14.073
1,448,360
1,130,097
[ "web-services" ]
18,740
2
null
18,719
3
null
There is a separate terminal service connection available called the 'console' connection. You can connect to this space using mstsc /console /v:servername. Use mstsc /? for full command line options. This allows you to connect, open up the terminal services manager and boot the bad sessions.
null
CC BY-SA 2.5
null
2008-08-20T20:28:24.147
2008-08-20T20:28:24.147
null
null
1,908
null
18,733
2
null
18,524
1
null
You can't avoid the "boxing overhead"; Java's faux generic containers can only store Objects, so your ints must be boxed into Integers. In principle it could avoid the downcast from Object to Integer (since it's pointless, because Object is good enough for both String.valueOf and Object.toString) but I don't know if t...
null
CC BY-SA 2.5
null
2008-08-20T20:25:49.673
2008-08-20T20:25:49.673
null
null
2,131
null
18,730
2
null
18,717
48
null
I can't imagine designing a database without foreign keys. Without them, eventually you are bound to make a mistake and corrupt the integrity of your data. They are not , strictly speaking, but the benefits are huge. I'm fairly certain that [FogBugz](http://en.wikipedia.org/wiki/FogBugz) does not have foreign key con...
null
CC BY-SA 4.0
null
2008-08-20T20:24:09.350
2018-09-18T07:04:58.137
2018-09-18T07:04:58.137
7,032,856
1,219
null
18,734
2
null
18,524
3
null
Not core Java, and not generic-ified, but the popular Jakarta commons collections library has some useful abstractions for this sort of task. Specifically, have a look at the collect methods on [CollectionUtils](http://commons.apache.org/collections/api-release/org/apache/commons/collections/CollectionUtils.html) So...
null
CC BY-SA 2.5
null
2008-08-20T20:26:04.213
2008-08-20T20:26:04.213
null
null
1,853
null
18,735
2
null
18,717
1
null
You can view foreign keys as a constraint that, - - -
null
CC BY-SA 3.0
null
2008-08-20T20:26:21.607
2013-08-10T19:27:48.037
2013-08-10T19:27:48.037
63,550
1,311
null
18,750
2
null
18,702
1
null
The classes generated by Visual Studio for webservices are just proxies with little state so creating them is pretty cheap. I wouldn't worry about memory consumption for them. If what you are looking for is a way to call the webmethod in one line you can simply do this: ``` new mywebservice().call() ``` Cheers
null
CC BY-SA 2.5
null
2008-08-20T20:32:34.777
2008-08-20T20:32:34.777
null
null
2,148
null
18,756
2
null
18,505
4
null
Check out the section "How to steal focus on 2K/XP" at [http://www.codeproject.com/KB/dialog/dlgboxtricks.aspx](http://www.codeproject.com/KB/dialog/dlgboxtricks.aspx), as this is exactly what you need. I wouldn't go the taskbar route as the taskbar could be hidden or simply not there.
null
CC BY-SA 2.5
null
2008-08-20T20:33:53.900
2008-08-20T20:33:53.900
null
null
645
null