question_id int64 4 6.31M | answer_id int64 7 6.31M | title stringlengths 9 150 | question_body stringlengths 0 28.8k | answer_body stringlengths 60 27.2k | question_text stringlengths 40 28.9k | combined_text stringlengths 124 39.6k | tags listlengths 1 6 | question_score int64 0 26.3k | answer_score int64 0 28.8k | view_count int64 15 14M | answer_count int64 0 182 | favorite_count int64 0 32 | question_creation_date stringdate 2008-07-31 21:42:52 2011-06-10 18:12:18 | answer_creation_date stringdate 2008-07-31 22:17:57 2011-06-10 18:14:17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,163 | 31,170 | Forcing the Solution Explorer to select the file in the editor in visual studio 2005 | In Visual Studio 2005, whenever I would view a file in the main editor, the Solution Explorer would find and highlight that file. Some time ago, this stopped working and the Solution Explorer would do nothing. This has become quite a pain since following a chain of "Go To Definition"s can lead you all over your solutio... | Click on the Tools → Options menu. Select the Projects and Solutions → General option page. Make sure "Track active item in Solution Explorer" is checked. That should do it. | Forcing the Solution Explorer to select the file in the editor in visual studio 2005 In Visual Studio 2005, whenever I would view a file in the main editor, the Solution Explorer would find and highlight that file. Some time ago, this stopped working and the Solution Explorer would do nothing. This has become quite a p... | TITLE:
Forcing the Solution Explorer to select the file in the editor in visual studio 2005
QUESTION:
In Visual Studio 2005, whenever I would view a file in the main editor, the Solution Explorer would find and highlight that file. Some time ago, this stopped working and the Solution Explorer would do nothing. This ha... | [
"visual-studio"
] | 43 | 63 | 10,337 | 6 | 0 | 2008-08-27T20:22:53.960000 | 2008-08-27T20:24:56.687000 |
31,192 | 31,217 | Migrating from ASP Classic to .NET and pain mitigation | We're in the process of redesigning the customer-facing section of our site in.NET 3.5. It's been going well so far, we're using the same workflow and stored procedures, for the most part, the biggest changes are the UI, the ORM (from dictionaries to LINQ), and obviously the language. Most of the pages to this point ha... | Believe me, I know exactly where you are coming from.. I am currently migrating a large app from ASP classic to.NET.. And I am still learning ASP.NET!:S (yes, I am terrified!). The main things I have kept in my mind is this: I dont stray too far from the current design (i.e. no massive "lets rip ALL of this out and mak... | Migrating from ASP Classic to .NET and pain mitigation We're in the process of redesigning the customer-facing section of our site in.NET 3.5. It's been going well so far, we're using the same workflow and stored procedures, for the most part, the biggest changes are the UI, the ORM (from dictionaries to LINQ), and obv... | TITLE:
Migrating from ASP Classic to .NET and pain mitigation
QUESTION:
We're in the process of redesigning the customer-facing section of our site in.NET 3.5. It's been going well so far, we're using the same workflow and stored procedures, for the most part, the biggest changes are the UI, the ORM (from dictionaries... | [
"asp.net",
"asp-classic",
"migration"
] | 5 | 6 | 1,885 | 8 | 0 | 2008-08-27T20:32:18.307000 | 2008-08-27T20:40:31 |
31,201 | 31,218 | How do you get a reference to the enclosing class from an anonymous inner class in Java? | I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class. Is there a better way to do this? | I just found this recently. Use OuterClassName.this. class Outer { void foo() { new Thread() { public void run() { Outer.this.bar(); } }.start(); } void bar() { System.out.println("BAR!"); } } Updated If you just want the object itself (instead of invoking members), then Outer.this is the way to go. | How do you get a reference to the enclosing class from an anonymous inner class in Java? I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class. Is there a better way to do this? | TITLE:
How do you get a reference to the enclosing class from an anonymous inner class in Java?
QUESTION:
I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class. Is there a better way to do this?
ANSWER:
I just found this recently. Use Ou... | [
"java",
"oop"
] | 52 | 95 | 17,056 | 3 | 0 | 2008-08-27T20:36:14.723000 | 2008-08-27T20:40:40.300000 |
31,215 | 31,220 | Constructors with the same argument type | I have a Person object with two constructors - one takes an int (personId), the other a string (logonName). I would like another constructor that takes a string (badgeNumber). I know this can't be done, but seems it might be a common situation. Is there a graceful way of handling this? I suppose this would apply to any... | You might consider using custom types. For example, create LogonName and BadgeNumber classes. Then your function declarations look like... public Person(LogonName ln) { this.Load(ln.ToString()); }
public Person(BadgeNumber bn) { //load logic here... } Such a solution might give you a good place to keep the business lo... | Constructors with the same argument type I have a Person object with two constructors - one takes an int (personId), the other a string (logonName). I would like another constructor that takes a string (badgeNumber). I know this can't be done, but seems it might be a common situation. Is there a graceful way of handlin... | TITLE:
Constructors with the same argument type
QUESTION:
I have a Person object with two constructors - one takes an int (personId), the other a string (logonName). I would like another constructor that takes a string (badgeNumber). I know this can't be done, but seems it might be a common situation. Is there a grace... | [
"c#",
".net",
"oop"
] | 7 | 7 | 3,588 | 13 | 0 | 2008-08-27T20:39:51.517000 | 2008-08-27T20:41:16.210000 |
31,221 | 31,437 | Response.Redirect using ~ Path | I have a method that where I want to redirect the user back to a login page located at the root of my web application. I'm using the following code: Response.Redirect("~/Login.aspx?ReturnPath=" + Request.Url.ToString()); This doesn't work though. My assumption was that ASP.NET would automatically resolve the URL into t... | I think you need to drop the "~/" and replace it with just "/", I believe / is the root STOP RIGHT THERE!:-) unless you want to hardcode your web app so that it can only be installed at the root of a web site. "~/" is the correct thing to use, but the reason that your original code didn't work as expected is that Resol... | Response.Redirect using ~ Path I have a method that where I want to redirect the user back to a login page located at the root of my web application. I'm using the following code: Response.Redirect("~/Login.aspx?ReturnPath=" + Request.Url.ToString()); This doesn't work though. My assumption was that ASP.NET would autom... | TITLE:
Response.Redirect using ~ Path
QUESTION:
I have a method that where I want to redirect the user back to a login page located at the root of my web application. I'm using the following code: Response.Redirect("~/Login.aspx?ReturnPath=" + Request.Url.ToString()); This doesn't work though. My assumption was that A... | [
"c#",
"asp.net",
"response.redirect"
] | 34 | 77 | 75,256 | 3 | 0 | 2008-08-27T20:41:23.357000 | 2008-08-28T00:40:27.633000 |
31,226 | 35,517 | Lightweight rich-text XML format? | I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever. When searching for existing standards to ... | As you are sure about needing to represent the presentational side of things, it may be worth looking at the XSL-FO W3C Recommendation. This is a full-blown page description language and the (deeply unfashionable) other half of the better-known XSLT. Clearly the whole thing is anything but "lightwight", but if you just... | Lightweight rich-text XML format? I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever. When se... | TITLE:
Lightweight rich-text XML format?
QUESTION:
I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or... | [
"xml",
"standards"
] | 5 | 5 | 2,261 | 5 | 0 | 2008-08-27T20:42:22.230000 | 2008-08-30T00:36:55.490000 |
31,237 | 31,288 | Passing around sets of data | A question that has pondered me for the last while. I am primarily a.net developer who dabbles in Objective-C for iPhone and Mac. How do you go about sending "datasets" between methods in objective-c. For example in C# you can populate a custom class with data and pass it around in a List of type custom class. EG if yo... | You're on the right track. Cocoa's collection classes — which all have mutable an immutable variants — are: NSArray: ordered, can contain an object multiple times NSDictionary: unordered, mapping from keys to values, keys are copied NSSet: unordered, can contain an object only once NSCountedSet: unordered, can contain ... | Passing around sets of data A question that has pondered me for the last while. I am primarily a.net developer who dabbles in Objective-C for iPhone and Mac. How do you go about sending "datasets" between methods in objective-c. For example in C# you can populate a custom class with data and pass it around in a List of... | TITLE:
Passing around sets of data
QUESTION:
A question that has pondered me for the last while. I am primarily a.net developer who dabbles in Objective-C for iPhone and Mac. How do you go about sending "datasets" between methods in objective-c. For example in C# you can populate a custom class with data and pass it a... | [
"objective-c",
"cocoa",
"macos",
"sqlite"
] | 8 | 25 | 2,951 | 1 | 0 | 2008-08-27T20:45:36.620000 | 2008-08-27T21:03:04.880000 |
31,249 | 31,260 | How do I set ItemTemplate dynamically in WPF? | Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code. How do I do this? I assume I need to find the resource somewhere. myTreeViewControl.ItemTemplate =?? | If the template is defined in your section directly: myTreeViewControl.ItemTemplate = this.Resources["SomeTemplate"] as DataTemplate; If it's somewhere deep within your window, like in a section or something, I think this'll work: myTreeViewControl.ItemTemplate = this.FindResource("SomeTemplate") as DataTemplate; And i... | How do I set ItemTemplate dynamically in WPF? Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code. How do I do this? I assume I need to find the resource somewhere. myTreeViewControl.ItemTemplate =?? | TITLE:
How do I set ItemTemplate dynamically in WPF?
QUESTION:
Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code. How do I do this? I assume I need to find the resource somewhere. myTreeViewControl.ItemTemplate =??
ANSWER:
If the template is defined in your s... | [
"wpf",
"itemtemplate"
] | 9 | 12 | 5,480 | 2 | 0 | 2008-08-27T20:48:17.893000 | 2008-08-27T20:51:01.443000 |
31,285 | 68,525 | VMWare Tools for Ubuntu Hardy | I am using VMWare tools for Ubuntu Hardy, but for some reason vmware-install.pl finds fault with my LINUX headers. The error message says that the "address space size" doesn't match. To try and remediate, I have resorted to vmware-any-any-update117, and am now getting the following error instead: In file included from ... | Check out this link as it helped me install the tools in one of my vms. http://diamondsw.dyndns.org/Home/Et_Cetera/Entries/2008/4/25_Linux_2.6.24_and_VMWare.html | VMWare Tools for Ubuntu Hardy I am using VMWare tools for Ubuntu Hardy, but for some reason vmware-install.pl finds fault with my LINUX headers. The error message says that the "address space size" doesn't match. To try and remediate, I have resorted to vmware-any-any-update117, and am now getting the following error i... | TITLE:
VMWare Tools for Ubuntu Hardy
QUESTION:
I am using VMWare tools for Ubuntu Hardy, but for some reason vmware-install.pl finds fault with my LINUX headers. The error message says that the "address space size" doesn't match. To try and remediate, I have resorted to vmware-any-any-update117, and am now getting the... | [
"ubuntu",
"vmware",
"virtualization",
"vmware-tools"
] | 2 | 1 | 952 | 4 | 0 | 2008-08-27T21:01:11.950000 | 2008-09-16T01:24:39.757000 |
31,287 | 31,624 | Using Virtual PC for Web Development with Oracle | Is anyone using Virtual PC to maintain multiple large.NET 1.1 and 2.0 websites? Are there any lessons learned? I used Virtual PC recently with a small WinForms app and it worked great, but then everything works great with WinForms. ASP.NET development hogs way more resources, requires IIS to be running, requires a ridi... | I've used VirtualPCs for a few years for development of some fairly hefty web apps without much problem. Lots of RAM is important. I keep my VPCs on an external USB drive and they perform great from there. This gives me the flexibility to take the drive with me if I need to do work somewhere else... just install VPC on... | Using Virtual PC for Web Development with Oracle Is anyone using Virtual PC to maintain multiple large.NET 1.1 and 2.0 websites? Are there any lessons learned? I used Virtual PC recently with a small WinForms app and it worked great, but then everything works great with WinForms. ASP.NET development hogs way more resou... | TITLE:
Using Virtual PC for Web Development with Oracle
QUESTION:
Is anyone using Virtual PC to maintain multiple large.NET 1.1 and 2.0 websites? Are there any lessons learned? I used Virtual PC recently with a small WinForms app and it worked great, but then everything works great with WinForms. ASP.NET development h... | [
"performance",
"virtual-pc"
] | 0 | 1 | 476 | 5 | 0 | 2008-08-27T21:02:03.337000 | 2008-08-28T03:38:45.317000 |
31,296 | 31,391 | Fast SQL Server 2005 script generation | It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining about the speed, but I haven't seen much offered in the wa... | See the Database Publishing Wizard that is part of the SQL Server Hosting Toolkit. It generates a single SQL file for both schema and data. | Fast SQL Server 2005 script generation It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining about the speed, bu... | TITLE:
Fast SQL Server 2005 script generation
QUESTION:
It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining a... | [
"sql-server",
"scripting"
] | 2 | 3 | 1,033 | 4 | 0 | 2008-08-27T21:08:15.537000 | 2008-08-28T00:16:14.383000 |
31,297 | 31,730 | Cannot access a webservice from mobile device | I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2. The device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it calls the method from the web service and execute... | This looks like a network issue, unless there's an odd bug in.Net CF that doesn't allow you to traverse subnets in certain situations (I can find no evidence of such a thing from googling). Can you get any support from the network/IT team? Also, have you tried it from a different subnet? I.e. not the same as the XP mac... | Cannot access a webservice from mobile device I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2. The device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it cal... | TITLE:
Cannot access a webservice from mobile device
QUESTION:
I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2. The device obtains from the wireless network the IP 192.168.5.118 and the progra... | [
"mobile"
] | 1 | 0 | 1,502 | 3 | 0 | 2008-08-27T21:08:24.383000 | 2008-08-28T06:43:41.363000 |
31,303 | 31,481 | Checklist for Database Schema Upgrades | Having to upgrade a database schema makes installing a new release of software a lot trickier. What are the best practices for doing this? I'm looking for a checklist or timeline of action items, such as 8:30 shut down apps 8:45 modify schema 9:15 install new apps 9:30 restart db etc, showing how to minimize risk and d... | I have a lot of experience with this. My application is highly iterative, and schema changes happen frequently. I do a production release roughly every 2 to 3 weeks, with 50-100 items cleared from my FogBugz list for each one. Every release we've done over the last few years has required schema changes to support new f... | Checklist for Database Schema Upgrades Having to upgrade a database schema makes installing a new release of software a lot trickier. What are the best practices for doing this? I'm looking for a checklist or timeline of action items, such as 8:30 shut down apps 8:45 modify schema 9:15 install new apps 9:30 restart db ... | TITLE:
Checklist for Database Schema Upgrades
QUESTION:
Having to upgrade a database schema makes installing a new release of software a lot trickier. What are the best practices for doing this? I'm looking for a checklist or timeline of action items, such as 8:30 shut down apps 8:45 modify schema 9:15 install new app... | [
"database",
"installation",
"version-control"
] | 11 | 5 | 1,411 | 5 | 0 | 2008-08-27T21:11:20.913000 | 2008-08-28T01:39:40.673000 |
31,312 | 287,822 | Problems passing special chars with observe_field | I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.? => causes the variable not to be found in the ... | This is an escaping issue (as stated by others). You'll want to change your observe_field:with statement to something like::with => "'postbody=' + encodeURIComponent(value)" Then in your controller: def textile_to_html text = URI.unescape(params['postbody'])... | Problems passing special chars with observe_field I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special char... | TITLE:
Problems passing special chars with observe_field
QUESTION:
I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type ce... | [
"ruby-on-rails",
"ajax"
] | 1 | 3 | 465 | 3 | 0 | 2008-08-27T21:17:17.717000 | 2008-11-13T18:43:57.747000 |
31,324 | 31,418 | How do I add a constant column value during data transfer from CSV to SQL? | I am reading in CSV file and translating it to an SQL Table. The kicker is that one of the columns in the table is of data type ID that needs to be set to a constant (in this case 2). I am not sure how to do this. | You can use a Derived Column Transformation in which you'll create a new output column and set its value to 2. You can then use that column when outputting to SQL. | How do I add a constant column value during data transfer from CSV to SQL? I am reading in CSV file and translating it to an SQL Table. The kicker is that one of the columns in the table is of data type ID that needs to be set to a constant (in this case 2). I am not sure how to do this. | TITLE:
How do I add a constant column value during data transfer from CSV to SQL?
QUESTION:
I am reading in CSV file and translating it to an SQL Table. The kicker is that one of the columns in the table is of data type ID that needs to be set to a constant (in this case 2). I am not sure how to do this.
ANSWER:
You ... | [
"sql-server",
"ssis",
"csv"
] | 14 | 26 | 24,722 | 1 | 0 | 2008-08-27T23:33:35.813000 | 2008-08-28T00:30:25.550000 |
31,340 | 31,398 | How do threads work in Python, and what are common Python-threading specific pitfalls? | I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something, but it seems like the official documentation isn't very thorough on the subject, and I haven't been able to find a good write-up. From what I can tel... | Yes, because of the Global Interpreter Lock (GIL) there can only run one thread at a time. Here are some links with some insights about this: http://www.artima.com/weblogs/viewpost.jsp?thread=214235 http://smoothspan.wordpress.com/2007/09/14/guido-is-right-to-leave-the-gil-in-python-not-for-multicore-but-for-utility-co... | How do threads work in Python, and what are common Python-threading specific pitfalls? I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something, but it seems like the official documentation isn't very thorou... | TITLE:
How do threads work in Python, and what are common Python-threading specific pitfalls?
QUESTION:
I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something, but it seems like the official documentation... | [
"python",
"multithreading"
] | 95 | 54 | 48,986 | 7 | 0 | 2008-08-27T23:44:47.843000 | 2008-08-28T00:19:50.320000 |
31,343 | 31,347 | Do you need the .NET 1.0 framework to target the .NET 1.0 framework? | I have a bunch of.NET frameworks installed on my machine. I know that with the Java JDK, I can use the 6.0 version to target 5.0 and earlier. Can I do something similar with the.NET framework - target 1.0 and 2.0 with the 3.0 framework? | Visual Studio 2008 was the first to support targeting older versions of.NET. Unfortunately, it supports only.NET 2 and up. In other words, you'll need.NET framework SDK 1 or 1.1 to do this. | Do you need the .NET 1.0 framework to target the .NET 1.0 framework? I have a bunch of.NET frameworks installed on my machine. I know that with the Java JDK, I can use the 6.0 version to target 5.0 and earlier. Can I do something similar with the.NET framework - target 1.0 and 2.0 with the 3.0 framework? | TITLE:
Do you need the .NET 1.0 framework to target the .NET 1.0 framework?
QUESTION:
I have a bunch of.NET frameworks installed on my machine. I know that with the Java JDK, I can use the 6.0 version to target 5.0 and earlier. Can I do something similar with the.NET framework - target 1.0 and 2.0 with the 3.0 framewo... | [
".net"
] | 2 | 2 | 630 | 3 | 0 | 2008-08-27T23:46:21.633000 | 2008-08-27T23:48:44.607000 |
31,346 | 31,454 | What's the best way to display a video with rounded corners in Silverlight? | The MediaElement doesn't support rounded corners (radiusx, radiusy). Should I use a VideoBrush on a Rectangle with rounded corners? | Yeah - In a way you're both asking and answering the question yourself... But that is one of the two options I can think of. The reasons that might be a problem is that you lose some of the features/control you get from the MediaElement control. Another option is to do this: Add your MediaElement to your page. Draw a R... | What's the best way to display a video with rounded corners in Silverlight? The MediaElement doesn't support rounded corners (radiusx, radiusy). Should I use a VideoBrush on a Rectangle with rounded corners? | TITLE:
What's the best way to display a video with rounded corners in Silverlight?
QUESTION:
The MediaElement doesn't support rounded corners (radiusx, radiusy). Should I use a VideoBrush on a Rectangle with rounded corners?
ANSWER:
Yeah - In a way you're both asking and answering the question yourself... But that is... | [
"silverlight"
] | 4 | 2 | 1,253 | 4 | 0 | 2008-08-27T23:48:36.837000 | 2008-08-28T01:09:58.077000 |
31,366 | 31,725 | Find and Replace with Unique | I am performing a find and replace on the line feed character ( ) and replacing it with the paragraph close and paragraph open tags using the following code: This almost works perfectly, except that I really need it to de-dup the line feeds as the paragraphs tend to be separated by 2 or more resulting in. Is it possibl... | disable-output-escaping isn't evil in itself, but there are only few cases where you should use it and this isn't one of them. In XSLT you work with trees, not markup string. Here's an XSTL 1.0 solution: | Find and Replace with Unique I am performing a find and replace on the line feed character ( ) and replacing it with the paragraph close and paragraph open tags using the following code: This almost works perfectly, except that I really need it to de-dup the line feeds as the paragraphs tend to be separated by 2 or mor... | TITLE:
Find and Replace with Unique
QUESTION:
I am performing a find and replace on the line feed character ( ) and replacing it with the paragraph close and paragraph open tags using the following code: This almost works perfectly, except that I really need it to de-dup the line feeds as the paragraphs tend to be sep... | [
"xml",
"xslt"
] | 4 | 5 | 12,205 | 3 | 0 | 2008-08-27T23:55:28.600000 | 2008-08-28T06:38:45.697000 |
31,380 | 32,509 | Is there a reason to use BufferedReader over InputStreamReader when reading all characters? | I currently use the following function to do a simple HTTP GET. public static String download(String url) throws java.io.IOException { java.io.InputStream s = null; java.io.InputStreamReader r = null; //java.io.BufferedReader b = null; StringBuilder content = new StringBuilder(); try { s = (java.io.InputStream)new URL(... | In this case, I would do as you are doing (use a byte array for buffering and not one of the stream buffers). There are exceptions, though. One place you see buffers (output this time) is in the servlet API. Data isn't written to the underlying stream until flush() is called, allowing you to buffer output but then dump... | Is there a reason to use BufferedReader over InputStreamReader when reading all characters? I currently use the following function to do a simple HTTP GET. public static String download(String url) throws java.io.IOException { java.io.InputStream s = null; java.io.InputStreamReader r = null; //java.io.BufferedReader b ... | TITLE:
Is there a reason to use BufferedReader over InputStreamReader when reading all characters?
QUESTION:
I currently use the following function to do a simple HTTP GET. public static String download(String url) throws java.io.IOException { java.io.InputStream s = null; java.io.InputStreamReader r = null; //java.io... | [
"java",
"performance",
"http",
"io",
"buffer"
] | 5 | 4 | 16,012 | 4 | 0 | 2008-08-28T00:07:06.980000 | 2008-08-28T15:03:31.053000 |
31,394 | 31,401 | Java: Programatic Way to Determine Current Windows User | I see many similar questions, however I want to find the Username of the currently logged in user using Java. Its probably something like: System.getProperty(current.user); But, I'm not quite sure. | You're actually really close. This is what you're looking for: System.getProperty("user.name") | Java: Programatic Way to Determine Current Windows User I see many similar questions, however I want to find the Username of the currently logged in user using Java. Its probably something like: System.getProperty(current.user); But, I'm not quite sure. | TITLE:
Java: Programatic Way to Determine Current Windows User
QUESTION:
I see many similar questions, however I want to find the Username of the currently logged in user using Java. Its probably something like: System.getProperty(current.user); But, I'm not quite sure.
ANSWER:
You're actually really close. This is w... | [
"java",
"windows"
] | 11 | 32 | 14,900 | 3 | 0 | 2008-08-28T00:17:21.730000 | 2008-08-28T00:20:44.013000 |
31,408 | 31,452 | Where can I find a good ASP.NET MVC sample? | I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. Any good links besides Scott's Northwind traders sample? | CodeCampServer - Built with ASP.NET MVC, pretty light and small project. No cruft at all. @lomaxx - Just FYI, most of what Troy Goode wrote is now part of ASP.NET MVC as of Preview 4. | Where can I find a good ASP.NET MVC sample? I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. Any good links besides Scott... | TITLE:
Where can I find a good ASP.NET MVC sample?
QUESTION:
I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. Any good l... | [
"c#",
"asp.net",
"asp.net-mvc"
] | 11 | 11 | 3,090 | 8 | 0 | 2008-08-28T00:23:38.937000 | 2008-08-28T01:07:02.703000 |
31,410 | 31,427 | Visual Studio 2008 debugging issue | I'm working in VS 2008 and have three projects in one solution. I'm debugging by attaching to a.net process invoked by a third party app (SalesLogix, a CRM app). Once it has attached to the process and I attempt to set a breakpoint in one of the projects, it doesn't set a breakpoint in that file. It actually switches t... | I saw this functionality in older versions of VS.Net (2003 I think). It may still exist in current versions, but I haven't encountered it. Seems that files with the same name, even in different directories confuse VS.Net, and it ends up setting a break point in a file with the same name. May only happen if the classes ... | Visual Studio 2008 debugging issue I'm working in VS 2008 and have three projects in one solution. I'm debugging by attaching to a.net process invoked by a third party app (SalesLogix, a CRM app). Once it has attached to the process and I attempt to set a breakpoint in one of the projects, it doesn't set a breakpoint i... | TITLE:
Visual Studio 2008 debugging issue
QUESTION:
I'm working in VS 2008 and have three projects in one solution. I'm debugging by attaching to a.net process invoked by a third party app (SalesLogix, a CRM app). Once it has attached to the process and I attempt to set a breakpoint in one of the projects, it doesn't ... | [
"c#",
"visual-studio-2008",
"debugging"
] | 4 | 4 | 1,413 | 2 | 0 | 2008-08-28T00:25:47.870000 | 2008-08-28T00:34:39.363000 |
31,412 | 31,421 | Proprietary plug-ins for GPL programs: what about interpreted languages? | I am developing a GPL-licensed application in Python and need to know if the GPL allows my program to use proprietary plug-ins. This is what the FSF has to say on the issue: If a program released under the GPL uses plug-ins, what are the requirements for the licenses of a plug-in? It depends on how the program invokes ... | he distinction between fork/exec and dynamic linking, besides being kind of artificial, I don't think its artificial at all. Basically they are just making the division based upon the level of integration. If the program has "plugins" which are essentially fire and forget with no API level integration, then the resulti... | Proprietary plug-ins for GPL programs: what about interpreted languages? I am developing a GPL-licensed application in Python and need to know if the GPL allows my program to use proprietary plug-ins. This is what the FSF has to say on the issue: If a program released under the GPL uses plug-ins, what are the requireme... | TITLE:
Proprietary plug-ins for GPL programs: what about interpreted languages?
QUESTION:
I am developing a GPL-licensed application in Python and need to know if the GPL allows my program to use proprietary plug-ins. This is what the FSF has to say on the issue: If a program released under the GPL uses plug-ins, what... | [
"python",
"plugins",
"open-source",
"licensing",
"interpreted-language"
] | 9 | 7 | 2,538 | 3 | 0 | 2008-08-28T00:26:35.390000 | 2008-08-28T00:33:04.157000 |
31,415 | 31,432 | Quick way to find a value in HTML (Java) | Using regular expressions, what is the simplest way to fetch a websites HTML and find the value inside this tag (or any attribute's value for that matter): [snip] [snip] | Depends on how sophisticated of an Http request you need to build (authentication, etc). Here's one simple way I've seen used in the past. StringBuilder html = new StringBuilder(); java.net.URL url = new URL("http://www.google.com/"); BufferedReader input = null; try { input new BufferedReader( new InputStreamReader(ur... | Quick way to find a value in HTML (Java) Using regular expressions, what is the simplest way to fetch a websites HTML and find the value inside this tag (or any attribute's value for that matter): [snip] [snip] | TITLE:
Quick way to find a value in HTML (Java)
QUESTION:
Using regular expressions, what is the simplest way to fetch a websites HTML and find the value inside this tag (or any attribute's value for that matter): [snip] [snip]
ANSWER:
Depends on how sophisticated of an Http request you need to build (authentication,... | [
"java",
"html",
"regex"
] | 0 | 10 | 12,154 | 7 | 0 | 2008-08-28T00:28:36.553000 | 2008-08-28T00:38:16.360000 |
31,424 | 87,823 | NHIbernate: Difference between Restriction.In and Restriction.InG | When creating a criteria in NHibernate I can use Restriction.In() or Restriction.InG() What is the difference between them? | InG is the generic equivalent of In (for collections) The signatures of the methods are as follows (only the ICollection In overload is shown): In(string propertyName, ICollection values) vs. InG (string propertyName, ICollection values) Looking at NHibernate's source code (trunk) it seems that they both copy the colle... | NHIbernate: Difference between Restriction.In and Restriction.InG When creating a criteria in NHibernate I can use Restriction.In() or Restriction.InG() What is the difference between them? | TITLE:
NHIbernate: Difference between Restriction.In and Restriction.InG
QUESTION:
When creating a criteria in NHibernate I can use Restriction.In() or Restriction.InG() What is the difference between them?
ANSWER:
InG is the generic equivalent of In (for collections) The signatures of the methods are as follows (onl... | [
"c#",
"nhibernate",
"orm"
] | 4 | 11 | 6,309 | 2 | 0 | 2008-08-28T00:33:45.840000 | 2008-09-17T21:24:53.310000 |
31,446 | 33,041 | Detach an entity from JPA/EJB3 persistence context | What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'? The reason why I want to do this is becuase I want to modify the data within the bea... | Unfortunately, there's no way to disconnect one object from the entity manager in the current JPA implementation, AFAIR. EntityManager.clear() will disconnect all the JPA objects, so that might not be an appropriate solution in all the cases, if you have other objects you do plan to keep connected. So your best bet wou... | Detach an entity from JPA/EJB3 persistence context What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'? The reason why I want to do this ... | TITLE:
Detach an entity from JPA/EJB3 persistence context
QUESTION:
What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'? The reason why ... | [
"java",
"orm",
"jpa"
] | 60 | 17 | 80,160 | 15 | 0 | 2008-08-28T00:53:21.860000 | 2008-08-28T18:39:55.213000 |
31,462 | 31,463 | How to fetch HTML in Java | Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String? | I'm currently using this: String content = null; URLConnection connection = null; try { connection = new URL("http://www.google.com").openConnection(); Scanner scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\\Z"); content = scanner.next(); scanner.close(); }catch ( Exception ex ) { ex.printSt... | How to fetch HTML in Java Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String? | TITLE:
How to fetch HTML in Java
QUESTION:
Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String?
ANSWER:
I'm currently using this: String content = null; URLConnection connection = null; try { connection = new URL("http://www.google.com").openConnection(); ... | [
"java",
"html",
"screen-scraping"
] | 35 | 47 | 76,710 | 6 | 0 | 2008-08-28T01:20:18.100000 | 2008-08-28T01:21:00.797000 |
31,465 | 31,486 | Stackoverflow Style Notifications in asp.net Ajax | When you get a badge or aren't logged in to stack overflow there's a groovy little notification bar at the top of the page that lets you know there's something going on. I know the SOflow team use JQuery, but I was wondering if anyone knew of an implementation of the same style of notification system in asp.net AJAX. O... | I like it to. div tag with a fade. http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/UsingAnimations.aspx | Stackoverflow Style Notifications in asp.net Ajax When you get a badge or aren't logged in to stack overflow there's a groovy little notification bar at the top of the page that lets you know there's something going on. I know the SOflow team use JQuery, but I was wondering if anyone knew of an implementation of the sa... | TITLE:
Stackoverflow Style Notifications in asp.net Ajax
QUESTION:
When you get a badge or aren't logged in to stack overflow there's a groovy little notification bar at the top of the page that lets you know there's something going on. I know the SOflow team use JQuery, but I was wondering if anyone knew of an implem... | [
"asp.net",
"asp.net-ajax",
"notification-bar"
] | 11 | 8 | 4,331 | 2 | 0 | 2008-08-28T01:24:10.697000 | 2008-08-28T01:42:26.813000 |
31,466 | 31,470 | Does Amazon S3 download fail sometimes? | We just added an autoupdater in our software and got some bug report saying that the autoupdate wouldn't complete properly because the downloaded file's sha1 checksum wasn't matching. We're hosted on Amazon S3... That's either something wrong with my code or something wrong with S3. I reread my code for suspicious stuf... | Other than the downtime a few weeks ago. None that I heard of. They did a good job considering the one time it was down was because of an obscure server error that cascaded throughout the cloud. They was very open about it and resolve it as soon as they found out.(it happened during a weekend, iirc) So they are pretty ... | Does Amazon S3 download fail sometimes? We just added an autoupdater in our software and got some bug report saying that the autoupdate wouldn't complete properly because the downloaded file's sha1 checksum wasn't matching. We're hosted on Amazon S3... That's either something wrong with my code or something wrong with ... | TITLE:
Does Amazon S3 download fail sometimes?
QUESTION:
We just added an autoupdater in our software and got some bug report saying that the autoupdate wouldn't complete properly because the downloaded file's sha1 checksum wasn't matching. We're hosted on Amazon S3... That's either something wrong with my code or som... | [
"download",
"amazon-s3"
] | 6 | 4 | 10,822 | 7 | 0 | 2008-08-28T01:25:52.313000 | 2008-08-28T01:29:30.650000 |
31,480 | 31,485 | How stable is WPF? | How stable is WPF not in terms of stability of a WPF program, but in terms of the 'stability' of the API itself. Let me explain: Microsoft is notorious for changing its whole methodology around with new technology. Like with the move from silverlight 1 to silverlight 2. With WPF, I know that MS changed a bunch of stuff... | MS do have a history of "fire and movement" with regards to introducing new technology into their development stack, but they also have a strong history of maintaining support for the older stuff, and backwards-compatibility. WPF seems to be getting stuff added to it with each new release of the framework but the thing... | How stable is WPF? How stable is WPF not in terms of stability of a WPF program, but in terms of the 'stability' of the API itself. Let me explain: Microsoft is notorious for changing its whole methodology around with new technology. Like with the move from silverlight 1 to silverlight 2. With WPF, I know that MS chang... | TITLE:
How stable is WPF?
QUESTION:
How stable is WPF not in terms of stability of a WPF program, but in terms of the 'stability' of the API itself. Let me explain: Microsoft is notorious for changing its whole methodology around with new technology. Like with the move from silverlight 1 to silverlight 2. With WPF, I ... | [
".net",
"wpf"
] | 6 | 12 | 599 | 3 | 0 | 2008-08-28T01:38:47.073000 | 2008-08-28T01:42:15.457000 |
31,496 | 31,505 | How do I check the active solution configuration Visual Studio built with at runtime? | I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime? | You can use precompiler directives within Visual Studio. The #if directive will allow you to determine if you are going to include code or not based on your custom solution configuration. | How do I check the active solution configuration Visual Studio built with at runtime? I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime? | TITLE:
How do I check the active solution configuration Visual Studio built with at runtime?
QUESTION:
I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime?
ANSWER:
You can use precompiler directives within Visual Studio. The ... | [
"visual-studio"
] | 12 | 9 | 11,536 | 4 | 0 | 2008-08-28T01:56:34.377000 | 2008-08-28T02:02:07.717000 |
31,497 | 31,522 | Where do I use delegates? | What are some real world places that call for delegates? I'm curious what situations or patterns are present where this method is the best solution. No code required. | A delegate is a named type that defines a particular kind of method. Just as a class definition lays out all the members for the given kind of object it defines, the delegate lays out the method signature for the kind of method it defines. Based on this statement, a delegate is a function pointer and it defines what th... | Where do I use delegates? What are some real world places that call for delegates? I'm curious what situations or patterns are present where this method is the best solution. No code required. | TITLE:
Where do I use delegates?
QUESTION:
What are some real world places that call for delegates? I'm curious what situations or patterns are present where this method is the best solution. No code required.
ANSWER:
A delegate is a named type that defines a particular kind of method. Just as a class definition lays... | [
"oop",
"design-patterns",
"delegates"
] | 112 | 36 | 49,856 | 8 | 0 | 2008-08-28T01:58:53.810000 | 2008-08-28T02:12:21.983000 |
31,498 | 31,513 | Best way to test if a generic type is a string? (C#) | I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call default(T) on an object, it returns null. For various reasons we nee... | Keep in mind that default(string) is null, not string.Empty. You may want a special case in your code: if (typeof(T) == typeof(String)) return (T)(object)String.Empty; | Best way to test if a generic type is a string? (C#) I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call default(T) on a... | TITLE:
Best way to test if a generic type is a string? (C#)
QUESTION:
I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you ca... | [
"c#",
"generics"
] | 109 | 199 | 105,624 | 5 | 0 | 2008-08-28T02:00:00.920000 | 2008-08-28T02:08:18.670000 |
31,500 | 31,520 | Do indexes work with "IN" clause | If I have a query like: Select EmployeeId From Employee Where EmployeeTypeId IN (1,2,3) and I have an index on the EmployeeTypeId field, does SQL server still use that index? | Yeah, that's right. If your Employee table has 10,000 records, and only 5 records have EmployeeTypeId in (1,2,3), then it will most likely use the index to fetch the records. However, if it finds that 9,000 records have the EmployeeTypeId in (1,2,3), then it would most likely just do a table scan to get the correspondi... | Do indexes work with "IN" clause If I have a query like: Select EmployeeId From Employee Where EmployeeTypeId IN (1,2,3) and I have an index on the EmployeeTypeId field, does SQL server still use that index? | TITLE:
Do indexes work with "IN" clause
QUESTION:
If I have a query like: Select EmployeeId From Employee Where EmployeeTypeId IN (1,2,3) and I have an index on the EmployeeTypeId field, does SQL server still use that index?
ANSWER:
Yeah, that's right. If your Employee table has 10,000 records, and only 5 records hav... | [
"sql",
"indexing"
] | 69 | 37 | 40,589 | 6 | 0 | 2008-08-28T02:00:09.970000 | 2008-08-28T02:11:32.827000 |
31,535 | 31,546 | Best way to fetch a varying HTML tag | I'm trying to fetch some HTML from various blogs and have noticed that different providers use the same tag in different ways. For example, here are two major providers that use the meta name generator tag differently: Blogger: (content first, name later and, yes, single quotes!) WordPress: (name first, content later) ... | The answer is: don't use regular expressions. Seriously. Use a SGML parser, or an XML parser if you happen to know it's valid XML (probably almost never true). You will absolutely screw up and waste tons of time trying to get it right. Just use what's already available. | Best way to fetch a varying HTML tag I'm trying to fetch some HTML from various blogs and have noticed that different providers use the same tag in different ways. For example, here are two major providers that use the meta name generator tag differently: Blogger: (content first, name later and, yes, single quotes!) Wo... | TITLE:
Best way to fetch a varying HTML tag
QUESTION:
I'm trying to fetch some HTML from various blogs and have noticed that different providers use the same tag in different ways. For example, here are two major providers that use the meta name generator tag differently: Blogger: (content first, name later and, yes, ... | [
"html",
"regex",
"language-agnostic"
] | 5 | 14 | 542 | 8 | 0 | 2008-08-28T02:23:12.770000 | 2008-08-28T02:31:40.643000 |
31,561 | 31,603 | Keeping CL and Scheme straight in your head | Depending on my mood I seem to waffle back and forth between wanting a Lisp-1 and a Lisp-2. Unfortunately beyond the obvious name space differences, this leaves all kinds of amusing function name/etc problems you run into. Case in point, trying to write some code tonight I tried to do (map #'function listvar) which, of... | Map is more general than mapcar, for example you could do the following rather than using mapcar: (map 'list #'function listvar) How do I keep scheme and CL separate in my head? I guess when you know both languages well enough you just know what works in one and not the other. Despite the syntactic similarities they ar... | Keeping CL and Scheme straight in your head Depending on my mood I seem to waffle back and forth between wanting a Lisp-1 and a Lisp-2. Unfortunately beyond the obvious name space differences, this leaves all kinds of amusing function name/etc problems you run into. Case in point, trying to write some code tonight I tr... | TITLE:
Keeping CL and Scheme straight in your head
QUESTION:
Depending on my mood I seem to waffle back and forth between wanting a Lisp-1 and a Lisp-2. Unfortunately beyond the obvious name space differences, this leaves all kinds of amusing function name/etc problems you run into. Case in point, trying to write some... | [
"lisp",
"scheme",
"clisp"
] | 2 | 5 | 536 | 4 | 0 | 2008-08-28T02:41:53.987000 | 2008-08-28T03:24:20.437000 |
31,566 | 31,573 | Query to list all tables that contain a specific column with SQL Server 2005 | Question as stated in the title. | http://blog.sqlauthority.com/2008/08/06/sql-server-query-to-find-column-from-all-tables-of-database/ USE AdventureWorks GO SELECT t.name AS table_name,SCHEMA_NAME(schema_id) AS schema_name,c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE c.name LIKE '%EmployeeID%' O... | Query to list all tables that contain a specific column with SQL Server 2005 Question as stated in the title. | TITLE:
Query to list all tables that contain a specific column with SQL Server 2005
QUESTION:
Question as stated in the title.
ANSWER:
http://blog.sqlauthority.com/2008/08/06/sql-server-query-to-find-column-from-all-tables-of-database/ USE AdventureWorks GO SELECT t.name AS table_name,SCHEMA_NAME(schema_id) AS schema... | [
"sql-server-2005"
] | 4 | 2 | 2,663 | 1 | 0 | 2008-08-28T02:50:38.147000 | 2008-08-28T02:55:57.323000 |
31,567 | 31,638 | How to properly cast objects created through reflection | I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple interface library consisting of the IPlugin and IHost interfaces, a plugin imp... | I'm just guessing here because from your code it's not obvious where do you have definition of IPlugin interface but if you can't cast in your host application then you are probably having IPlugin interface in your host assembly and then at the same time in your plugin assembly. This won't work. The easiest thing is to... | How to properly cast objects created through reflection I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple interface library cons... | TITLE:
How to properly cast objects created through reflection
QUESTION:
I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple inte... | [
"c#",
".net",
"reflection"
] | 10 | 4 | 12,621 | 7 | 0 | 2008-08-28T02:50:55.510000 | 2008-08-28T03:46:33.257000 |
31,572 | 31,768 | Broadcast like UDP with the reliability of TCP | I'm working on a.net solution that is run completely inside a single network. When users make a change to the system, I want to launch an announcement and have everyone else hear it and act accordingly. Is there a way that we can broadcast out messages like this (like UDP will let you do) while keeping guaranteed deliv... | Almost all games have a need for the fast-reacting properties (and to a lesser extent, the connectionless properties) of UDP and the reliability of TCP. What they do is they build their own reliable protocol on top of UDP. This gives them the ability to just burst packets to whereever and optionally make them reliable,... | Broadcast like UDP with the reliability of TCP I'm working on a.net solution that is run completely inside a single network. When users make a change to the system, I want to launch an announcement and have everyone else hear it and act accordingly. Is there a way that we can broadcast out messages like this (like UDP ... | TITLE:
Broadcast like UDP with the reliability of TCP
QUESTION:
I'm working on a.net solution that is run completely inside a single network. When users make a change to the system, I want to launch an announcement and have everyone else hear it and act accordingly. Is there a way that we can broadcast out messages li... | [
".net",
"networking",
"tcp",
"udp"
] | 19 | 15 | 12,114 | 16 | 0 | 2008-08-28T02:55:23.347000 | 2008-08-28T07:16:35.153000 |
31,581 | 31,833 | How scalable is System.Threading.Timer? | I'm writing an app that will need to make use of Timer s, but potentially very many of them. How scalable is the System.Threading.Timer class? The documentation merely say it's "lightweight", but doesn't explain further. Do these timers get sucked into a single thread (or very small threadpool) that processes all the c... | I say this in response to a lot of questions: Don't forget that the (managed) source code to the framework is available. You can use this tool to get it all: http://www.codeplex.com/NetMassDownloader Unfortunately, in this specific case, a lot of the implementation is in native code, so you don't get to look at it... T... | How scalable is System.Threading.Timer? I'm writing an app that will need to make use of Timer s, but potentially very many of them. How scalable is the System.Threading.Timer class? The documentation merely say it's "lightweight", but doesn't explain further. Do these timers get sucked into a single thread (or very sm... | TITLE:
How scalable is System.Threading.Timer?
QUESTION:
I'm writing an app that will need to make use of Timer s, but potentially very many of them. How scalable is the System.Threading.Timer class? The documentation merely say it's "lightweight", but doesn't explain further. Do these timers get sucked into a single ... | [
"c#",
".net",
"multithreading",
"timer"
] | 26 | 29 | 10,327 | 4 | 0 | 2008-08-28T03:01:10.773000 | 2008-08-28T08:12:24.270000 |
31,584 | 37,005 | Design: Java and returning self-reference in setter methods | For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the Builder pattern in Effective Java that is kinda the same). Basically, all setter methods return the object itself so then you can use code like this: myClass.setInt(1).setString("... | @pek Chained invocation is one of proposals for Java 7. It says that if a method return type is void, it should implicitly return this. If you're interested in this topic, there is a bunch of links and a simple example on Alex Miller's Java 7 page. | Design: Java and returning self-reference in setter methods For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the Builder pattern in Effective Java that is kinda the same). Basically, all setter methods return the object itself so th... | TITLE:
Design: Java and returning self-reference in setter methods
QUESTION:
For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the Builder pattern in Effective Java that is kinda the same). Basically, all setter methods return the o... | [
"java"
] | 22 | 15 | 20,520 | 11 | 0 | 2008-08-28T03:03:53.467000 | 2008-08-31T18:14:27.953000 |
31,592 | 31,609 | How to get the libraries you need into the bin folder when using IoC/DI | I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL layer to interfaces that are now being loaded by DI. Once the project is developed & deployed all the.bin files will be in the same location, but for while I'm developing in Visual Studio, the only ways I can see of getting t... | Could you set the build output path of the concrete DAL project to be the bin folder of the dependent project? | How to get the libraries you need into the bin folder when using IoC/DI I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL layer to interfaces that are now being loaded by DI. Once the project is developed & deployed all the.bin files will be in the same location, but for whi... | TITLE:
How to get the libraries you need into the bin folder when using IoC/DI
QUESTION:
I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL layer to interfaces that are now being loaded by DI. Once the project is developed & deployed all the.bin files will be in the same loc... | [
"visual-studio",
"dependency-injection",
"inversion-of-control",
"castle-windsor"
] | 1 | 1 | 222 | 2 | 0 | 2008-08-28T03:09:28.790000 | 2008-08-28T03:31:14.523000 |
31,627 | 31,631 | Alternative to VSS for a one man show (army of one?) | I've been programming for 10+ years now for the same employer and only source code control we've ever used is VSS. (Sorry - That's what they had when I started). There's only ever been a few of us; two right now and we usually work alone, so VSS has worked ok for us. So, I have two questions: 1) Should we switch to som... | I'd probably go with Subversion, if I were you. I'm a total Git fanatic at this point, but Subversion certainly has some advantages: simplicity abundance of interoperable tools active and supportive community portable Has really nice Windows shell integration integrates with visual studio (I think - but surely through ... | Alternative to VSS for a one man show (army of one?) I've been programming for 10+ years now for the same employer and only source code control we've ever used is VSS. (Sorry - That's what they had when I started). There's only ever been a few of us; two right now and we usually work alone, so VSS has worked ok for us.... | TITLE:
Alternative to VSS for a one man show (army of one?)
QUESTION:
I've been programming for 10+ years now for the same employer and only source code control we've ever used is VSS. (Sorry - That's what they had when I started). There's only ever been a few of us; two right now and we usually work alone, so VSS has... | [
"version-control",
"visual-sourcesafe"
] | 12 | 28 | 2,555 | 16 | 0 | 2008-08-28T03:40:16.250000 | 2008-08-28T03:44:07.753000 |
31,672 | 67,624 | Learning FORTRAN In the Modern Era | I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with "performance enhancing improvements". Does anyone have ... | You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school. Common FORTRAN-isms I deal with, that hurt readability are: Common blocks Implicit variables Two or three... | Learning FORTRAN In the Modern Era I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with "performance enhanci... | TITLE:
Learning FORTRAN In the Modern Era
QUESTION:
I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with "p... | [
"fortran"
] | 80 | 88 | 15,766 | 10 | 0 | 2008-08-28T04:36:25.570000 | 2008-09-15T22:29:44.433000 |
31,693 | 31,929 | What are the differences between Generics in C# and Java... and Templates in C++? | I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that.NET has better implementations etc. etc. So, what are the main differences between C++, C#, Java in generics? Pros/cons of each? | I'll add my voice to the noise and take a stab at making things clear: C# Generics allow you to declare something like this. List foo = new List (); and then the compiler will prevent you from putting things that aren't Person into the list. Behind the scenes the C# compiler is just putting List into the.NET dll file, ... | What are the differences between Generics in C# and Java... and Templates in C++? I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that.NET has better implementations etc. etc. So, what are the main differences between C++, C#, Java in generics? Pros/cons of each? | TITLE:
What are the differences between Generics in C# and Java... and Templates in C++?
QUESTION:
I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that.NET has better implementations etc. etc. So, what are the main differences between C++, C#, Java in generics? Pr... | [
"c#",
"java",
"c++",
"generics",
"templates"
] | 203 | 362 | 60,668 | 13 | 0 | 2008-08-28T05:08:06.663000 | 2008-08-28T09:50:26.127000 |
31,701 | 34,140 | How to control layer ordering in Virtual Earth | I have a mapping application that needs to draw a path, and then display icons on top of the path. I can't find a way to control the order of virtual earth layers, other than the order in which they are added. Does anyone know how to change the z index of Virtual Earth shape layers, or force a layer to the front? | I think the easiest way is to iterate through the shapes in your VEShapeLayer and use the VEShape.SetZIndex method. | How to control layer ordering in Virtual Earth I have a mapping application that needs to draw a path, and then display icons on top of the path. I can't find a way to control the order of virtual earth layers, other than the order in which they are added. Does anyone know how to change the z index of Virtual Earth sha... | TITLE:
How to control layer ordering in Virtual Earth
QUESTION:
I have a mapping application that needs to draw a path, and then display icons on top of the path. I can't find a way to control the order of virtual earth layers, other than the order in which they are added. Does anyone know how to change the z index of... | [
"javascript",
"virtual-earth"
] | 4 | 2 | 603 | 2 | 0 | 2008-08-28T05:17:19.730000 | 2008-08-29T07:49:01.260000 |
31,708 | 31,710 | How can I convert IEnumerable<T> to List<T> in C#? | I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView (WebForms). Simplified code: Dictionary dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == "foo"); myListView.DataBind(); I thought that would work but in fact it throws a System.Inv... | Try this: var matches = dict.Values.Where(rec => rec.Name == "foo").ToList(); Be aware that that will essentially be creating a new list from the original Values collection, and so any changes to your dictionary won't automatically be reflected in your bound control. | How can I convert IEnumerable<T> to List<T> in C#? I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView (WebForms). Simplified code: Dictionary dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == "foo"); myListView.DataBind(); I thought... | TITLE:
How can I convert IEnumerable<T> to List<T> in C#?
QUESTION:
I am using LINQ to query a generic dictionary and then use the result as the datasource for my ListView (WebForms). Simplified code: Dictionary dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == "foo"); myListView.Dat... | [
"c#",
"linq",
"generics",
"listview"
] | 17 | 29 | 54,449 | 5 | 0 | 2008-08-28T05:21:26.943000 | 2008-08-28T05:23:15.067000 |
31,711 | 31,788 | How to plot a long path with Virtual Earth | The obvious way to plot a path with virtual earth (VEMap.GetDirections) is limited to 25 points. When trying to plot a vehicle's journey this is extremely limiting. How can I plot a by-road journey of more than 25 points on a virtual earth map? | According to this you need to call VEMap.GetDirections every 25 points until you reach the end of the route and then plot a custom shape of the complete route. | How to plot a long path with Virtual Earth The obvious way to plot a path with virtual earth (VEMap.GetDirections) is limited to 25 points. When trying to plot a vehicle's journey this is extremely limiting. How can I plot a by-road journey of more than 25 points on a virtual earth map? | TITLE:
How to plot a long path with Virtual Earth
QUESTION:
The obvious way to plot a path with virtual earth (VEMap.GetDirections) is limited to 25 points. When trying to plot a vehicle's journey this is extremely limiting. How can I plot a by-road journey of more than 25 points on a virtual earth map?
ANSWER:
Accor... | [
"javascript",
"virtual-earth"
] | 3 | 1 | 414 | 1 | 0 | 2008-08-28T05:23:30.120000 | 2008-08-28T07:28:09.430000 |
31,722 | 33,500 | Anyone have a diff algorithm for rendered HTML? | I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the rendered HTML. To clarify, I want to be able to see the side-by-side diffs as rendered output. So if I delete a paragraph, the si... | There's another nice trick you can use to significantly improve the look of a rendered HTML diff. Although this doesn't fully solve the initial problem, it will make a significant difference in the appearance of your rendered HTML diffs. Side-by-side rendered HTML will make it very difficult for your diff to line up ve... | Anyone have a diff algorithm for rendered HTML? I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the rendered HTML. To clarify, I want to be able to see the side-by-side diffs as ren... | TITLE:
Anyone have a diff algorithm for rendered HTML?
QUESTION:
I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the rendered HTML. To clarify, I want to be able to see the side-by... | [
"javascript",
"html",
"diff"
] | 91 | 17 | 39,236 | 12 | 0 | 2008-08-28T06:33:37.863000 | 2008-08-28T22:00:34.093000 |
31,790 | 31,798 | How many ServiceContracts can a WCF service have? | How many ServiceContracts can a WCF service have? Specifically, since a ServiceContract is an attribute to an interface, how many interfaces can I code into one WCF web service? Is it a one-to-one? Does it make sense to separate the contracts across multiple web services? | You can have a service implement all the service contracts you want. I mean, I don't know if there is a limit, but I don't think there is. That's a neat way to separate operations that will be implemented by the same service in several conceptually different service contract interfaces. | How many ServiceContracts can a WCF service have? How many ServiceContracts can a WCF service have? Specifically, since a ServiceContract is an attribute to an interface, how many interfaces can I code into one WCF web service? Is it a one-to-one? Does it make sense to separate the contracts across multiple web service... | TITLE:
How many ServiceContracts can a WCF service have?
QUESTION:
How many ServiceContracts can a WCF service have? Specifically, since a ServiceContract is an attribute to an interface, how many interfaces can I code into one WCF web service? Is it a one-to-one? Does it make sense to separate the contracts across mu... | [
"wcf",
"web-services"
] | 10 | 1 | 16,714 | 4 | 0 | 2008-08-28T07:28:17.857000 | 2008-08-28T07:36:29.363000 |
31,794 | 31,796 | Help accessing application settings using ConfigurationManager | In.net frameworks 1.1, I use System.Configuration.ConfigurationSettings.AppSettings["name"]; for application settings. But in.Net 2.0, it says ConfigurationSettings is obsolete and to use ConfigurationManager instead. So I swapped it out with this: System.Configuration.ConfigurationManager.AppSettings["name"]; The prob... | You have to reference the System.configuration assembly (note the lowercase) I don't know why this assembly is not added by default to new projects on Visual Studio, but I find myself having the same problem every time I start a new project. I always forget to add the reference. | Help accessing application settings using ConfigurationManager In.net frameworks 1.1, I use System.Configuration.ConfigurationSettings.AppSettings["name"]; for application settings. But in.Net 2.0, it says ConfigurationSettings is obsolete and to use ConfigurationManager instead. So I swapped it out with this: System.C... | TITLE:
Help accessing application settings using ConfigurationManager
QUESTION:
In.net frameworks 1.1, I use System.Configuration.ConfigurationSettings.AppSettings["name"]; for application settings. But in.Net 2.0, it says ConfigurationSettings is obsolete and to use ConfigurationManager instead. So I swapped it out w... | [
"c#",
".net",
".net-2.0"
] | 6 | 9 | 2,659 | 5 | 0 | 2008-08-28T07:31:48.580000 | 2008-08-28T07:33:35.317000 |
31,799 | 31,810 | Preventing XML Serialization of IEnumerable and ICollection<T> & Inherited Types | NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on XML Serialization and Inherited Types, I began integrating that code into my application I am working on, stupidly thinking all will go well.. I ran into problems with a couple of classes I have that implement IEnumerable and ICollection The pro... | you can get around this problem by getting hold of the System.RunTime.Serialization dll (it's a.net 3.x assembly) and referencing it from your.net 2.0 application. This works because the.net 3.0 binaries are compiled to run on the.net 2.0 CLR. By doing this, you get access to the DataContractSerliazer which I've used t... | Preventing XML Serialization of IEnumerable and ICollection<T> & Inherited Types NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on XML Serialization and Inherited Types, I began integrating that code into my application I am working on, stupidly thinking all will go well.. I ran into problems w... | TITLE:
Preventing XML Serialization of IEnumerable and ICollection<T> & Inherited Types
QUESTION:
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on XML Serialization and Inherited Types, I began integrating that code into my application I am working on, stupidly thinking all will go well.. I r... | [
"xml",
"inheritance",
"serialization",
".net-2.0"
] | 4 | 4 | 3,347 | 3 | 0 | 2008-08-28T07:36:40.020000 | 2008-08-28T07:45:11.467000 |
31,800 | 31,825 | How to respond to an alternate URI in a RESTful web service | I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send an HTTP 3xx redirect to the canonical URI? Is HTTP 303 (see also) the most ap... | I'd personally plump for returning the resource rather than faffing with a redirect, although I suspect that's only because my subcoscious is telling me redirects are slower. However, if you were to decide to use a redirect I'd think a 302 or 307 might be more appropiate than a 303, although the w3.org has details of t... | How to respond to an alternate URI in a RESTful web service I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send an HTTP 3xx redir... | TITLE:
How to respond to an alternate URI in a RESTful web service
QUESTION:
I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send... | [
"language-agnostic",
"http",
"rest"
] | 4 | 4 | 485 | 3 | 0 | 2008-08-28T07:36:46.383000 | 2008-08-28T07:59:53.457000 |
31,818 | 31,820 | How to find out which Service Pack is installed on SQL Server? | How can I find out which Service Pack is installed on my copy of SQL Server? | From TechNet: Determining which version and edition of SQL Server Database Engine is running -- SQL Server 2000/2005 SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
-- SQL Server 6.5/7.0 SELECT @@VERSION | How to find out which Service Pack is installed on SQL Server? How can I find out which Service Pack is installed on my copy of SQL Server? | TITLE:
How to find out which Service Pack is installed on SQL Server?
QUESTION:
How can I find out which Service Pack is installed on my copy of SQL Server?
ANSWER:
From TechNet: Determining which version and edition of SQL Server Database Engine is running -- SQL Server 2000/2005 SELECT SERVERPROPERTY('productversio... | [
"sql-server"
] | 13 | 21 | 45,837 | 2 | 0 | 2008-08-28T07:54:27.467000 | 2008-08-28T07:56:15.760000 |
31,826 | 31,841 | Algorithmic complexity of XML parsers/validators | I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of nodes... | If I was faced with that problem and couldn't find anything on google I would probably try to do it my self. Some "back-of-an-evelope" stuff to get a feel for where it is going. But it would kinda need me to have an idea of how to do a xml parser. For non algorithmical benchmarks take a look here: http://www.xml.com/pu... | Algorithmic complexity of XML parsers/validators I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... we... | TITLE:
Algorithmic complexity of XML parsers/validators
QUESTION:
I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are... | [
"xml",
"algorithm",
"performance"
] | 15 | 3 | 1,972 | 4 | 0 | 2008-08-28T08:01:12.690000 | 2008-08-28T08:21:00.880000 |
31,849 | 32,086 | Capturing Cmd-C (or Ctrl-C) keyboard event from modular Flex application in browser or AIR | It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first. Is there a way to tell the browser or OS to let the event through? For example, on an AdvancedDataGrid I hav... | I did a test where I listened for key up events on the stage and noticed that (on my Mac) I could capture control-c, control-v, etc. just fine, but anything involving command (the key) wasn't captured until I released the command key, and then ctrlKey was false (even though the docs says that ctrlKey should be true f... | Capturing Cmd-C (or Ctrl-C) keyboard event from modular Flex application in browser or AIR It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first. Is there a way to... | TITLE:
Capturing Cmd-C (or Ctrl-C) keyboard event from modular Flex application in browser or AIR
QUESTION:
It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first.... | [
"apache-flex",
"air"
] | 3 | 2 | 10,553 | 4 | 0 | 2008-08-28T08:34:09.087000 | 2008-08-28T12:32:06.563000 |
31,865 | 31,896 | Good reasons for not letting the browser launch local applications | I know this might be a no-brainer, but please read on. I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context. We use Citrix for home-office, and people really like it. Now, they would like the same kind of environment at wo... | We use Citrix for home-office, and people really like it. Now, they would like the same kind of environment at work, a nice page where every important application/document/folder is nicely arranged and classified in an orderly fashion I haven't used Citrix very many times, but what's it got to do with executing local a... | Good reasons for not letting the browser launch local applications I know this might be a no-brainer, but please read on. I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context. We use Citrix for home-office, and people real... | TITLE:
Good reasons for not letting the browser launch local applications
QUESTION:
I know this might be a no-brainer, but please read on. I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context. We use Citrix for home-offic... | [
"security",
"internet-explorer",
"activex",
"intranet"
] | 1 | 4 | 3,265 | 3 | 0 | 2008-08-28T08:50:20.933000 | 2008-08-28T09:14:14.247000 |
31,867 | 32,062 | Are there any examples where we *need* protected inheritance in C++? | While I've seen rare cases where private inheritance was needed, I've never encountered a case where protected inheritance is needed. Does someone have an example? | People here seem to mistake Protected class inheritance and Protected methods. FWIW, I've never seen anyone use protected class inheritance, and if I remember correctly I think Stroustrup even considered the "protected" level to be a mistake in c++. There's precious little you cannot do if you remove that protection le... | Are there any examples where we *need* protected inheritance in C++? While I've seen rare cases where private inheritance was needed, I've never encountered a case where protected inheritance is needed. Does someone have an example? | TITLE:
Are there any examples where we *need* protected inheritance in C++?
QUESTION:
While I've seen rare cases where private inheritance was needed, I've never encountered a case where protected inheritance is needed. Does someone have an example?
ANSWER:
People here seem to mistake Protected class inheritance and ... | [
"c++",
"oop",
"inheritance"
] | 14 | 13 | 1,970 | 3 | 0 | 2008-08-28T08:52:55.843000 | 2008-08-28T11:57:18.053000 |
31,868 | 34,274 | Upload a file to SharePoint through the built-in web services | What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes? Following the two initial answers... We definitely need to use the Web Service layer as we will be making these calls from remote client applications. The WebDAV method woul... | Example of using the WSS "Copy" Web service to upload a document to a library... public static void UploadFile2007(string destinationUrl, byte[] fileData) { // List of desination Urls, Just one in this example. string[] destinationUrls = { Uri.EscapeUriString(destinationUrl) };
// Empty Field Information. This can be ... | Upload a file to SharePoint through the built-in web services What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes? Following the two initial answers... We definitely need to use the Web Service layer as we will be making these... | TITLE:
Upload a file to SharePoint through the built-in web services
QUESTION:
What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes? Following the two initial answers... We definitely need to use the Web Service layer as we wi... | [
"sharepoint",
"wss"
] | 31 | 17 | 65,878 | 7 | 0 | 2008-08-28T08:53:00.507000 | 2008-08-29T09:44:37.397000 |
31,870 | 31,873 | Using an HTML entity in XSLT (e.g. ) | What is the best way to include an html entity in XSLT? this one returns a XsltParseError | You can use CDATA section or you can describe in local DTD: ]> or just use instead of | Using an HTML entity in XSLT (e.g. ) What is the best way to include an html entity in XSLT? this one returns a XsltParseError | TITLE:
Using an HTML entity in XSLT (e.g. )
QUESTION:
What is the best way to include an html entity in XSLT? this one returns a XsltParseError
ANSWER:
You can use CDATA section or you can describe in local DTD: ]> or just use instead of | [
"xslt"
] | 68 | 128 | 65,148 | 11 | 0 | 2008-08-28T08:55:34.697000 | 2008-08-28T09:02:13.060000 |
31,871 | 34,373 | WSACancelBlockingCall exception | Ok, I have a strange exception thrown from my code that's been bothering me for ages. System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall at System.Net.Sockets.Socket.Accept() at System.Net.Sockets.TcpListener.AcceptTcpClient() MSDN isn't terribly helpful on this:... | Is it possible that the serverSocket is being closed from another thread? That will cause this exception. | WSACancelBlockingCall exception Ok, I have a strange exception thrown from my code that's been bothering me for ages. System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall at System.Net.Sockets.Socket.Accept() at System.Net.Sockets.TcpListener.AcceptTcpClient() MSDN... | TITLE:
WSACancelBlockingCall exception
QUESTION:
Ok, I have a strange exception thrown from my code that's been bothering me for ages. System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall at System.Net.Sockets.Socket.Accept() at System.Net.Sockets.TcpListener.Acce... | [
"c#",
"multithreading",
"sockets",
"socketexception"
] | 54 | 55 | 110,779 | 6 | 0 | 2008-08-28T08:59:07.527000 | 2008-08-29T11:14:51.233000 |
31,875 | 31,887 | Is there a simple, elegant way to define singletons? | There seem to be many ways to define singletons in Python. Is there a consensus opinion on Stack Overflow? | I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its variables would be bound to the module, which could not be instantiated repeatedly anyway. If you do wish to use a class, there is no way of creating private classes or private constructors in Python, so y... | Is there a simple, elegant way to define singletons? There seem to be many ways to define singletons in Python. Is there a consensus opinion on Stack Overflow? | TITLE:
Is there a simple, elegant way to define singletons?
QUESTION:
There seem to be many ways to define singletons in Python. Is there a consensus opinion on Stack Overflow?
ANSWER:
I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its variables would be... | [
"python",
"design-patterns",
"singleton"
] | 536 | 435 | 465,960 | 21 | 0 | 2008-08-28T09:03:09.827000 | 2008-08-28T09:10:12.743000 |
31,882 | 31,983 | (Why) should I use obfuscation? | It seems to me obfuscation is an idea that falls somewhere in the "security by obscurity" or "false sense of protection" camp. To protect intellectual property, there's copyright; to prevent security issues from being found, there's fixing those issues. In short, I regard it as a technical solution to a social problem.... | I posted a question which might help you as it discusses some of the issues: should-i-be-worried-about-obfuscating-my-net-code | (Why) should I use obfuscation? It seems to me obfuscation is an idea that falls somewhere in the "security by obscurity" or "false sense of protection" camp. To protect intellectual property, there's copyright; to prevent security issues from being found, there's fixing those issues. In short, I regard it as a technic... | TITLE:
(Why) should I use obfuscation?
QUESTION:
It seems to me obfuscation is an idea that falls somewhere in the "security by obscurity" or "false sense of protection" camp. To protect intellectual property, there's copyright; to prevent security issues from being found, there's fixing those issues. In short, I rega... | [
".net",
"security",
"obfuscation"
] | 7 | 2 | 3,323 | 8 | 0 | 2008-08-28T09:08:43.730000 | 2008-08-28T10:26:47.693000 |
31,885 | 31,949 | Does Visual Studio Server Explorer support custom database providers? | I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux). Is there a way to leverage t... | Here is instructions on how to connect to your MySQL database from Visual Studio: To make the connection in server explorer you need to do the following: first of all you need to install the MyODBC connector 3.51 (or latest) on the development machine (NB. you can find this at http://www.mysql.com/products/connector/od... | Does Visual Studio Server Explorer support custom database providers? I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use ... | TITLE:
Does Visual Studio Server Explorer support custom database providers?
QUESTION:
I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my h... | [
"c#",
"mysql",
"visual-studio",
"oracle",
"sqlite"
] | 13 | 9 | 13,255 | 4 | 0 | 2008-08-28T09:09:58.983000 | 2008-08-28T10:03:04.630000 |
31,924 | 31,960 | What are the best practices for JSF? | I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development. | Some tips: Understand the JSF request lifecycle and where your various pieces of code fit in it. Especially find out why your model values will not be updated if there are validation errors. Choose a tag library and then stick with it. Take your time to determine your needs and prototype different libraries. Mixing dif... | What are the best practices for JSF? I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development. | TITLE:
What are the best practices for JSF?
QUESTION:
I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development.
ANSWER:
Some tips: Understand the JSF request lifecycle and where your various pieces of code fit in it. Es... | [
"java",
"jsf"
] | 11 | 11 | 11,292 | 8 | 0 | 2008-08-28T09:47:18.270000 | 2008-08-28T10:10:08.560000 |
31,930 | 32,063 | Sending e-mail from a Custom SQL Server Reporting Services Delivery Extension | I've developed my own delivery extension for Reporting Services 2005, to integrate this with our SaaS marketing solution. It takes the subscription, and takes a snapshot of the report with a custom set of parameters. It then renders the report, sends an e-mail with a link and the report attached as XLS. Everything work... | What's at: at MyDeliveryExtension.MailDelivery.SendMail(SubscriptionData data, Stream reportStream, String reportName, String smptServerHostname, Int32 smtpServerPort) in C:\inetpub\wwwroot\CustomReporting\MyDeliveryExtension\MailDelivery.cs:line 48
at MyDeliveryExtension.MyDelivery.Deliver(Notification notification) ... | Sending e-mail from a Custom SQL Server Reporting Services Delivery Extension I've developed my own delivery extension for Reporting Services 2005, to integrate this with our SaaS marketing solution. It takes the subscription, and takes a snapshot of the report with a custom set of parameters. It then renders the repor... | TITLE:
Sending e-mail from a Custom SQL Server Reporting Services Delivery Extension
QUESTION:
I've developed my own delivery extension for Reporting Services 2005, to integrate this with our SaaS marketing solution. It takes the subscription, and takes a snapshot of the report with a custom set of parameters. It then... | [
"c#",
"reporting-services"
] | 2 | 0 | 7,050 | 5 | 0 | 2008-08-28T09:50:48.183000 | 2008-08-28T11:57:23.917000 |
31,931 | 31,939 | What's the simplest way to decrement a date in Javascript by 1 day? | I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly. That is, if I have a date of 'Today', I want to get the date for 'Yesterday'. It always seems to take more code than necessary when I do this, so I'm wondering if there's any simpler way. What's the simplest way of doin... | var d = new Date();
d.setDate(d.getDate() - 1);
console.log(d); | What's the simplest way to decrement a date in Javascript by 1 day? I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly. That is, if I have a date of 'Today', I want to get the date for 'Yesterday'. It always seems to take more code than necessary when I do this, so I'm w... | TITLE:
What's the simplest way to decrement a date in Javascript by 1 day?
QUESTION:
I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly. That is, if I have a date of 'Today', I want to get the date for 'Yesterday'. It always seems to take more code than necessary when I... | [
"javascript",
"browser",
"date"
] | 24 | 36 | 15,085 | 7 | 0 | 2008-08-28T09:50:48.370000 | 2008-08-28T09:56:01.370000 |
31,935 | 32,784 | ASP.NET AJAX: Firing an UpdatePanel after the page load is complete | I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want to call a code-behind function to update the UpdatePanel. Any ideas as to what combina... | Use a timer control that will be fired after a certain number of milliseconds (for page to load). In the timer tick event refresh the update panel. | ASP.NET AJAX: Firing an UpdatePanel after the page load is complete I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want to call a code-beh... | TITLE:
ASP.NET AJAX: Firing an UpdatePanel after the page load is complete
QUESTION:
I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want ... | [
"asp.net",
"javascript",
"asp.net-ajax"
] | 9 | 1 | 25,655 | 8 | 0 | 2008-08-28T09:53:22.140000 | 2008-08-28T16:49:36.197000 |
32,000 | 32,005 | C# - SQLClient - Simplest INSERT | I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace. I'm using SqlConnection for my db link, I've already had success executing some reads, and I want to know the simplest way to insert data. I'm finding what seem to be pretty verbose method... | using (var conn = new SqlConnection(yourConnectionString)) { var cmd = new SqlCommand("insert into Foo values (@bar)", conn); cmd.Parameters.AddWithValue("@bar", 17); conn.Open(); cmd.ExecuteNonQuery(); } | C# - SQLClient - Simplest INSERT I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace. I'm using SqlConnection for my db link, I've already had success executing some reads, and I want to know the simplest way to insert data. I'm finding what... | TITLE:
C# - SQLClient - Simplest INSERT
QUESTION:
I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace. I'm using SqlConnection for my db link, I've already had success executing some reads, and I want to know the simplest way to insert data... | [
"c#",
"sql",
"sql-server",
"t-sql"
] | 10 | 20 | 17,223 | 3 | 0 | 2008-08-28T10:37:39.367000 | 2008-08-28T10:48:25.767000 |
32,001 | 32,057 | Resettable Java Timer | I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal. If, however, before X seconds has elapsed, I decide that the event should occur after Y se... | According to the Timer documentation, in Java 1.5 onwards, you should prefer the ScheduledThreadPoolExecutor instead. (You may like to create this executor using Executors.newSingleThreadScheduledExecutor() for ease of use; it creates something much like a Timer.) The cool thing is, when you schedule a task (by calling... | Resettable Java Timer I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal. If, however, before X seconds has elapsed, I decide that the event s... | TITLE:
Resettable Java Timer
QUESTION:
I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal. If, however, before X seconds has elapsed, I decid... | [
"java",
"timer"
] | 40 | 50 | 47,939 | 8 | 0 | 2008-08-28T10:38:03.687000 | 2008-08-28T11:52:00.717000 |
32,003 | 32,019 | Tool for commandline "bookmarks" on windows? | Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like: C:\> go home D:\profiles\user\home\> go svn-project1 D:\projects\project1\svn\branch\src\> I'm currently using a bunch of batch files, but editing them by han... | What you are looking for is called DOSKEY You can use the doskey command to create macros in the command interpreter. For example: doskey mcd=mkdir "$*"$Tpushd "$*" creates a new command "mcd" that creates a new directory and then changes to that directory (I prefer "pushd" to "cd" in this case because it lets me use "... | Tool for commandline "bookmarks" on windows? Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like: C:\> go home D:\profiles\user\home\> go svn-project1 D:\projects\project1\svn\branch\src\> I'm currently using a ... | TITLE:
Tool for commandline "bookmarks" on windows?
QUESTION:
Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like: C:\> go home D:\profiles\user\home\> go svn-project1 D:\projects\project1\svn\branch\src\> I'm ... | [
"command-line"
] | 12 | 25 | 7,140 | 8 | 0 | 2008-08-28T10:47:38.063000 | 2008-08-28T11:23:38.290000 |
32,010 | 32,021 | Is regex case insensitivity slower? | Source RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable) Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incur a similar penalty with /[a-zA-z]/ as I will with /[a... | Yes, [A-Za-z] will be much faster than setting the RegexOptions.IgnoreCase, largely because of Unicode strings. But it's also much more limiting -- [A-Za-z] does not match accented international characters, it's literally the A-Za-z ASCII set and nothing more. I don't know if you saw Tim Bray's answer to my message, bu... | Is regex case insensitivity slower? Source RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable) Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incur a similar penalt... | TITLE:
Is regex case insensitivity slower?
QUESTION:
Source RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable) Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incu... | [
"regex",
"language-agnostic"
] | 15 | 22 | 3,948 | 3 | 0 | 2008-08-28T10:55:17.950000 | 2008-08-28T11:23:59.427000 |
32,020 | 32,032 | Is soapUI the best web services testing tool/client/framework? | I have been working on a web services related project for about the last year. Our team found soapUI near the start of our project and we have been mostly (*) satisfied with it (the free version, that is). My question is: are there other tools/clients/frameworks that you have used/currently use for web services testing... | I use soapUI, and it's generally pretty good. Be aware that it seems to leak memory, and eventually it will no longer save your project, so save regularly! This is about the only hassle I have with it (other than the general ugliness that almost every Java application has!), and I can't live without it. | Is soapUI the best web services testing tool/client/framework? I have been working on a web services related project for about the last year. Our team found soapUI near the start of our project and we have been mostly (*) satisfied with it (the free version, that is). My question is: are there other tools/clients/frame... | TITLE:
Is soapUI the best web services testing tool/client/framework?
QUESTION:
I have been working on a web services related project for about the last year. Our team found soapUI near the start of our project and we have been mostly (*) satisfied with it (the free version, that is). My question is: are there other t... | [
"web-services",
"testing"
] | 14 | 9 | 12,326 | 5 | 0 | 2008-08-28T11:23:44.327000 | 2008-08-28T11:36:36.370000 |
32,027 | 32,317 | NAnt and dual platform build - best way to build on Windows AND Mono/Linux | I'm new to NAnt but have some experience with Ant and CruiseControl. What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy is outlined by J.P Boodhoo here. So far so good if I only want to run on Windows, but I want ... | This shouldn't be a particularly difficult excercise. We do some fairly similar stuff on one of my projects since half of it runs on Java using Ant to run relevant targets, and the other half is.Net (C#) for the UI. The projects get run on windows machines for development, but the servers (Java) run linux, but in the U... | NAnt and dual platform build - best way to build on Windows AND Mono/Linux I'm new to NAnt but have some experience with Ant and CruiseControl. What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy is outlined by J.P... | TITLE:
NAnt and dual platform build - best way to build on Windows AND Mono/Linux
QUESTION:
I'm new to NAnt but have some experience with Ant and CruiseControl. What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy ... | [
".net",
"linux",
"build-process",
"mono",
"nant"
] | 6 | 8 | 1,726 | 4 | 0 | 2008-08-28T11:35:12.473000 | 2008-08-28T13:47:12.423000 |
32,034 | 32,036 | In C#, isn't the observer pattern already implemented using Events? | After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the.NET Framework? | Yes, it is. The observer pattern is also called the publish/subscribe pattern, which is exactly what events allow you to do. | In C#, isn't the observer pattern already implemented using Events? After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the.NET Framework? | TITLE:
In C#, isn't the observer pattern already implemented using Events?
QUESTION:
After reading the Head First Design Patterns book and using a number of other design patterns, I'm trying to understand the Observer pattern. Isn't this already implemented using Events in the.NET Framework?
ANSWER:
Yes, it is. The o... | [
"c#",
".net",
"design-patterns"
] | 33 | 26 | 14,223 | 8 | 0 | 2008-08-28T11:36:52.297000 | 2008-08-28T11:38:45.850000 |
32,041 | 32,122 | How to remove debug statements from production code in Java | Is it possible for the compiler to remove statements used for debugging purposes (such as logging) from production code? The debug statements would need to be marked somehow, maybe using annotations. It's easy to set a property (debug = true) and check it at each debug statement, but this can reduce performance. It wou... | Two recommendations. First: for real logging, use a modern logging package like log4j or java's own built in logging. Don't worry about performance so much, the logging level check is on the order of nanoseconds. (it's an integer comparison). And if you have more than a single log statement, guard the whole block: (log... | How to remove debug statements from production code in Java Is it possible for the compiler to remove statements used for debugging purposes (such as logging) from production code? The debug statements would need to be marked somehow, maybe using annotations. It's easy to set a property (debug = true) and check it at e... | TITLE:
How to remove debug statements from production code in Java
QUESTION:
Is it possible for the compiler to remove statements used for debugging purposes (such as logging) from production code? The debug statements would need to be marked somehow, maybe using annotations. It's easy to set a property (debug = true)... | [
"java",
"debugging",
"compiler-construction"
] | 16 | 24 | 15,712 | 8 | 0 | 2008-08-28T11:40:58.420000 | 2008-08-28T12:46:23.707000 |
32,044 | 32,125 | How can I render a tree structure (recursive) using a django template? | I have a tree structure in memory that I would like to render in HTML using a Django template. class Node(): name = "node name" children = [] There will be some object root that is a Node, and children is a list of Node s. root will be passed in the content of the template. I have found this one discussion of how this ... | I think the canonical answer is: "Don't". What you should probably do instead is unravel the thing in your view code, so it's just a matter of iterating over (in|de)dents in the template. I think I'd do it by appending indents and dedents to a list while recursing through the tree and then sending that "travelogue" lis... | How can I render a tree structure (recursive) using a django template? I have a tree structure in memory that I would like to render in HTML using a Django template. class Node(): name = "node name" children = [] There will be some object root that is a Node, and children is a list of Node s. root will be passed in the... | TITLE:
How can I render a tree structure (recursive) using a django template?
QUESTION:
I have a tree structure in memory that I would like to render in HTML using a Django template. class Node(): name = "node name" children = [] There will be some object root that is a Node, and children is a list of Node s. root wil... | [
"python",
"django"
] | 76 | 29 | 40,772 | 10 | 0 | 2008-08-28T11:43:10.287000 | 2008-08-28T12:47:29.243000 |
32,058 | 32,508 | How do I extract the inner exception from a soap exception in ASP.NET? | I have a simple web service operation like this one: [WebMethod] public string HelloWorld() { throw new Exception("HelloWorldException"); return "Hello World"; } And then I have a client application that consumes the web service and then calls the operation. Obviously it will throw an exception:-) try { hwservicens.Ser... | Unfortunately I don't think this is possible. The exception you are raising in your web service code is being encoded into a Soap Fault, which then being passed as a string back to your client code. What you are seeing in the SoapException message is simply the text from the Soap fault, which is not being converted bac... | How do I extract the inner exception from a soap exception in ASP.NET? I have a simple web service operation like this one: [WebMethod] public string HelloWorld() { throw new Exception("HelloWorldException"); return "Hello World"; } And then I have a client application that consumes the web service and then calls the o... | TITLE:
How do I extract the inner exception from a soap exception in ASP.NET?
QUESTION:
I have a simple web service operation like this one: [WebMethod] public string HelloWorld() { throw new Exception("HelloWorldException"); return "Hello World"; } And then I have a client application that consumes the web service an... | [
".net",
"asp.net",
"web-services",
"exception",
"soap"
] | 16 | 6 | 13,462 | 3 | 0 | 2008-08-28T11:52:34.007000 | 2008-08-28T15:03:21.397000 |
32,059 | 32,560 | How can I get the number of occurrences in a SQL IN clause? | Let's say I have four tables: PAGE, USER, TAG, and PAGE-TAG: Table | Fields ------------------------------------------ PAGE | ID, CONTENT TAG | ID, NAME USER | ID, NAME PAGE-TAG | ID, PAGE-ID, TAG-ID, USER-ID And let's say I have four pages: PAGE#1 'Content page 1' tagged with tag#1 by user1, tagged with tag#1 by user2... | OK, so the key difference between this and kristof's answer is that you only want a count of 1 to show against page 1, because it has been tagged only with one tag from the set (even though two separate users both tagged it). I would suggest this: SELECT page.ID, page.content, count(*) AS uniquetags FROM ( SELECT DISTI... | How can I get the number of occurrences in a SQL IN clause? Let's say I have four tables: PAGE, USER, TAG, and PAGE-TAG: Table | Fields ------------------------------------------ PAGE | ID, CONTENT TAG | ID, NAME USER | ID, NAME PAGE-TAG | ID, PAGE-ID, TAG-ID, USER-ID And let's say I have four pages: PAGE#1 'Content pa... | TITLE:
How can I get the number of occurrences in a SQL IN clause?
QUESTION:
Let's say I have four tables: PAGE, USER, TAG, and PAGE-TAG: Table | Fields ------------------------------------------ PAGE | ID, CONTENT TAG | ID, NAME USER | ID, NAME PAGE-TAG | ID, PAGE-ID, TAG-ID, USER-ID And let's say I have four pages: ... | [
"sql"
] | 1 | 1 | 4,493 | 6 | 0 | 2008-08-28T11:54:02.507000 | 2008-08-28T15:19:27.257000 |
32,087 | 32,093 | What tools and languages are available for windows shell scripting? | I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools? What other functionality does windows scripting tools offer? Can everything that can be done using the Windows GUI be done usi... | I think Windows PowerShell from Microsoft is the current favourite for this sort of thing. | What tools and languages are available for windows shell scripting? I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools? What other functionality does windows scripting tools offe... | TITLE:
What tools and languages are available for windows shell scripting?
QUESTION:
I want to know what are the options to do some scripting jobs in windows platform. I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools? What other functionality does windows sc... | [
"windows",
"scripting"
] | 4 | 5 | 1,776 | 12 | 0 | 2008-08-28T12:32:43.473000 | 2008-08-28T12:35:56.603000 |
32,100 | 32,111 | What is the simplest SQL Query to find the second largest value? | What is the simplest SQL query to find the second largest integer value in a specific column? There are maybe duplicate values in the column. | SELECT MAX( col ) FROM table WHERE col < ( SELECT MAX( col ) FROM table ) | What is the simplest SQL Query to find the second largest value? What is the simplest SQL query to find the second largest integer value in a specific column? There are maybe duplicate values in the column. | TITLE:
What is the simplest SQL Query to find the second largest value?
QUESTION:
What is the simplest SQL query to find the second largest integer value in a specific column? There are maybe duplicate values in the column.
ANSWER:
SELECT MAX( col ) FROM table WHERE col < ( SELECT MAX( col ) FROM table ) | [
"sql",
"puzzle"
] | 207 | 373 | 494,621 | 46 | 0 | 2008-08-28T12:39:53.287000 | 2008-08-28T12:43:40.563000 |
32,123 | 32,662 | procmail lockfile utility and NFS | Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories? The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean." | I've used it. My company had an very NFS-intensive infrastructure at one point (less so now) and many Perl sysadmin tools dating back to the mid 90s. We wrapped lockfile in a perl module so that we could do consistent locking across NFS mounts. For that matter, our home directories were NFS mounted and we used procmail... | procmail lockfile utility and NFS Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories? The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean." | TITLE:
procmail lockfile utility and NFS
QUESTION:
Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories? The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean."
ANSWER:
I've used it. My company had an very NFS-intensive infrastructure at ... | [
"unix",
"nfs",
"procmail",
"lockfile"
] | 2 | 2 | 1,111 | 1 | 0 | 2008-08-28T12:46:26.593000 | 2008-08-28T15:58:44.383000 |
32,144 | 34,211 | Why can't SQL Server run on a Novell server? | I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not? | NOW I see your problem! Sorry dude! Yes, VERY easy. Kinda. SQL Server used to be able to talk IPX (the netware protocol) but I think Netware will now talk TCPIP, and you can run IPX and TCP/IP on the same network without an issue - windows clients can run both at the same time, 99% of routers handle all protocols etc. ... | Why can't SQL Server run on a Novell server? I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not? | TITLE:
Why can't SQL Server run on a Novell server?
QUESTION:
I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not?
ANSWER:
NOW I see your problem! Sorry dude! Yes, VERY easy. Kinda. SQL Server used to be able to talk IPX (t... | [
"sql-server",
"novell"
] | 3 | 3 | 1,782 | 13 | 0 | 2008-08-28T12:54:02.503000 | 2008-08-29T09:05:03.527000 |
32,149 | 33,168 | Does anyone have a good Proper Case algorithm | Does anyone have a trusted Proper Case or PCase algorithm (similar to a UCase or Upper)? I'm looking for something that takes a value such as "GEORGE BURDELL" or "george burdell" and turns it into "George Burdell". I have a simple one that handles the simple cases. The ideal would be to have something that can handle t... | Unless I've misunderstood your question I don't think you need to roll your own, the TextInfo class can do it for you. using System.Globalization;
CultureInfo.InvariantCulture.TextInfo.ToTitleCase("GeOrGE bUrdEll") Will return "George Burdell. And you can use your own culture if there's some special rules involved. Up... | Does anyone have a good Proper Case algorithm Does anyone have a trusted Proper Case or PCase algorithm (similar to a UCase or Upper)? I'm looking for something that takes a value such as "GEORGE BURDELL" or "george burdell" and turns it into "George Burdell". I have a simple one that handles the simple cases. The idea... | TITLE:
Does anyone have a good Proper Case algorithm
QUESTION:
Does anyone have a trusted Proper Case or PCase algorithm (similar to a UCase or Upper)? I'm looking for something that takes a value such as "GEORGE BURDELL" or "george burdell" and turns it into "George Burdell". I have a simple one that handles the simp... | [
"algorithm",
"string"
] | 26 | 17 | 14,213 | 13 | 0 | 2008-08-28T12:55:58.193000 | 2008-08-28T19:18:49.037000 |
32,151 | 32,176 | Best way to export html to Word without having MS Word installed? | Is there a way to export a simple HTML page to Word (.doc format, not.docx) without having Microsoft Word installed? | If you have only simple HTML pages as you said, it can be opened with Word. Otherwise, there are some libraries which can do this, but I don't have experience with them. My last idea is that if you are using ASP.NET, try to add application/msword to the header and you can save it as a Word document (it won't be a real ... | Best way to export html to Word without having MS Word installed? Is there a way to export a simple HTML page to Word (.doc format, not.docx) without having Microsoft Word installed? | TITLE:
Best way to export html to Word without having MS Word installed?
QUESTION:
Is there a way to export a simple HTML page to Word (.doc format, not.docx) without having Microsoft Word installed?
ANSWER:
If you have only simple HTML pages as you said, it can be opened with Word. Otherwise, there are some librarie... | [
"html",
"ms-word"
] | 16 | 12 | 42,163 | 10 | 0 | 2008-08-28T12:57:11.840000 | 2008-08-28T13:03:33.900000 |
32,168 | 32,224 | C++ cast syntax styles | A question related to Regular cast vs. static_cast vs. dynamic_cast: What cast syntax style do you prefer in C++? C-style cast syntax: (int)foo C++-style cast syntax: static_cast (foo) constructor syntax: int(foo) They may not translate to exactly the same instructions (do they?) but their effect should be the same (ri... | It's best practice never to use C-style casts for three main reasons: as already mentioned, no checking is performed here. The programmer simply cannot know which of the various casts is used which weakens strong typing the new casts are intentionally visually striking. Since casts often reveal a weakness in the code, ... | C++ cast syntax styles A question related to Regular cast vs. static_cast vs. dynamic_cast: What cast syntax style do you prefer in C++? C-style cast syntax: (int)foo C++-style cast syntax: static_cast (foo) constructor syntax: int(foo) They may not translate to exactly the same instructions (do they?) but their effect... | TITLE:
C++ cast syntax styles
QUESTION:
A question related to Regular cast vs. static_cast vs. dynamic_cast: What cast syntax style do you prefer in C++? C-style cast syntax: (int)foo C++-style cast syntax: static_cast (foo) constructor syntax: int(foo) They may not translate to exactly the same instructions (do they?... | [
"c++",
"coding-style",
"casting"
] | 39 | 61 | 19,177 | 10 | 0 | 2008-08-28T13:01:41.720000 | 2008-08-28T13:16:18.267000 |
32,173 | 32,473 | Disable asp.net radiobutton with javascript | I'm trying to disable a bunch of controls with JavaScript (so that they post back values). All the controls work fine except for my radio buttons as they lose their value. In the below code which is called via a recursive function to disable all child controls the Second else (else if (control is RadioButton )) is neve... | I found 2 ways to get this to work, the below code correctly distinguishes between the RadioButton and Checkbox controls. private static void DisableControl(WebControl control) { Type controlType = control.GetType();
if (controlType == typeof(CheckBox)) { ((CheckBox)control).InputAttributes.Add("disabled", "disabled")... | Disable asp.net radiobutton with javascript I'm trying to disable a bunch of controls with JavaScript (so that they post back values). All the controls work fine except for my radio buttons as they lose their value. In the below code which is called via a recursive function to disable all child controls the Second else... | TITLE:
Disable asp.net radiobutton with javascript
QUESTION:
I'm trying to disable a bunch of controls with JavaScript (so that they post back values). All the controls work fine except for my radio buttons as they lose their value. In the below code which is called via a recursive function to disable all child contro... | [
"c#",
"javascript",
"asp.net"
] | 3 | 3 | 6,980 | 2 | 0 | 2008-08-28T13:03:20.857000 | 2008-08-28T14:49:10.340000 |
32,175 | 32,196 | Installing a .NET service using InstallUtil | I'm trying to install a.NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog asking the user for the credentials for a user. I'm trying to int... | I think I may have found it. In the service itself, the automatically created ServiceProcessInstaller component has a property "Account" which can be set to "LocalService", "LocalSystem", "NetworkService" or "User". It was defaulting to "User" which must have displayed the prompt. | Installing a .NET service using InstallUtil I'm trying to install a.NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog asking the user for t... | TITLE:
Installing a .NET service using InstallUtil
QUESTION:
I'm trying to install a.NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog ask... | [
".net",
"windows-services",
"installutil"
] | 38 | 46 | 33,421 | 5 | 0 | 2008-08-28T13:03:25.240000 | 2008-08-28T13:07:36.167000 |
32,198 | 32,242 | How do you minimize the number of threads used in a tcp server application? | I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc. Let's assume for the purposes of this question that the requests are relatively long-lived (several minutes) and that the traffic i... | The modern approach is to make use of the operating system to multiplex many network sockets for you, freeing your application to only processing active connections with traffic. Whenever you open a socket it's associated it with a selector. You use a single thread to poll that selector. Whenever data arrives, the sele... | How do you minimize the number of threads used in a tcp server application? I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc. Let's assume for the purposes of this question that the... | TITLE:
How do you minimize the number of threads used in a tcp server application?
QUESTION:
I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc. Let's assume for the purposes of this... | [
"multithreading",
"sockets",
"tcp",
"udp"
] | 4 | 6 | 3,516 | 4 | 0 | 2008-08-28T13:07:57.307000 | 2008-08-28T13:23:31.200000 |
32,227 | 39,350 | Data model for a extensible web form | Suppose that I have a form that contains three 10 fields: field1..field10. I store the form data in one or more database tables, probably using 10 database columns. Now suppose a few months later that I want to add 3 more fields. And in the future I may add/delete fields from this form based on changing requirements. I... | Unless you have a really good reason to do this, then this generally is a bad idea. It makes it very difficult to optimize and scale the database. If you absolutely must do it, then Travis's suggestion is fine for small tables, but its not really going to scale that well. | Data model for a extensible web form Suppose that I have a form that contains three 10 fields: field1..field10. I store the form data in one or more database tables, probably using 10 database columns. Now suppose a few months later that I want to add 3 more fields. And in the future I may add/delete fields from this f... | TITLE:
Data model for a extensible web form
QUESTION:
Suppose that I have a form that contains three 10 fields: field1..field10. I store the form data in one or more database tables, probably using 10 database columns. Now suppose a few months later that I want to add 3 more fields. And in the future I may add/delete ... | [
"database-design",
"forms"
] | 2 | 1 | 1,581 | 4 | 0 | 2008-08-28T13:17:20.263000 | 2008-09-02T12:09:06.970000 |
32,231 | 32,297 | Adaptive Database | Are there any rapid Database protoyping tools that don't require me to declare a database schema, but rather create it based on the way I'm using my entities. For example, assuming an empty database (pseudo code): user1 = new User() // Creates the user table with a single id column user1.firstName = "Allain" // alters ... | Google's Application Engine works like this. When you download the toolkit you get a local copy of the database engine for testing. | Adaptive Database Are there any rapid Database protoyping tools that don't require me to declare a database schema, but rather create it based on the way I'm using my entities. For example, assuming an empty database (pseudo code): user1 = new User() // Creates the user table with a single id column user1.firstName = "... | TITLE:
Adaptive Database
QUESTION:
Are there any rapid Database protoyping tools that don't require me to declare a database schema, but rather create it based on the way I'm using my entities. For example, assuming an empty database (pseudo code): user1 = new User() // Creates the user table with a single id column u... | [
"database",
"orm"
] | 3 | 2 | 523 | 6 | 0 | 2008-08-28T13:18:23.567000 | 2008-08-28T13:39:17.120000 |
32,241 | 32,429 | Algorithm to format text to Pascal or camel casing | Using this question as the base is there an alogrithm or coding example to change some text to Pascal or Camel casing. For example: mynameisfred becomes Camel: myNameIsFred Pascal: MyNameIsFred | I found a thread with a bunch of Perl guys arguing the toss on this question over at http://www.perlmonks.org/?node_id=336331. I hope this isn't too much of a non-answer to the question, but I would say you have a bit of a problem in that it would be a very open-ended algorithm which could have a lot of 'misses' as wel... | Algorithm to format text to Pascal or camel casing Using this question as the base is there an alogrithm or coding example to change some text to Pascal or Camel casing. For example: mynameisfred becomes Camel: myNameIsFred Pascal: MyNameIsFred | TITLE:
Algorithm to format text to Pascal or camel casing
QUESTION:
Using this question as the base is there an alogrithm or coding example to change some text to Pascal or Camel casing. For example: mynameisfred becomes Camel: myNameIsFred Pascal: MyNameIsFred
ANSWER:
I found a thread with a bunch of Perl guys argui... | [
"algorithm",
"coding-style",
"camelcasing",
"pascalcasing"
] | 8 | 3 | 3,501 | 2 | 0 | 2008-08-28T13:23:07.863000 | 2008-08-28T14:34:55.863000 |
32,243 | 32,302 | Can PNG image transparency be preserved when using PHP's GDlib imagecopyresampled? | The following PHP code snippet uses GD to resize a browser-uploaded PNG to 128x128. It works great, except that the transparent areas in the original image are being replaced with a solid color- black in my case. Even though imagesavealpha is set, something isn't quite right. What's the best way to preserve the transpa... | imagealphablending( $targetImage, false ); imagesavealpha( $targetImage, true ); did it for me. Thanks ceejayoz. note, the target image needs the alpha settings, not the source image. Edit: full replacement code. See also answers below and their comments. This is not guaranteed to be be perfect in any way, but did achi... | Can PNG image transparency be preserved when using PHP's GDlib imagecopyresampled? The following PHP code snippet uses GD to resize a browser-uploaded PNG to 128x128. It works great, except that the transparent areas in the original image are being replaced with a solid color- black in my case. Even though imagesavealp... | TITLE:
Can PNG image transparency be preserved when using PHP's GDlib imagecopyresampled?
QUESTION:
The following PHP code snippet uses GD to resize a browser-uploaded PNG to 128x128. It works great, except that the transparent areas in the original image are being replaced with a solid color- black in my case. Even t... | [
"php",
"png",
"transparency",
"gd",
"alpha"
] | 112 | 215 | 102,021 | 11 | 0 | 2008-08-28T13:23:33.320000 | 2008-08-28T13:41:12.640000 |
32,246 | 32,263 | how to get the googlebot to get the correct GEOIPed content? | OK. This problem is doing my head in. And I don't know if there even IS a definitive answer. We have a website, lets call it mycompany.com. It's a UK-based site, with UK based content. Google knows about it, and we have done a load of SEO on it. All is well. Except, we are about to relaunch my company, the GLOBAL brand... | As long as Google can find mycompany.com/uk and mycompany.com/au, it'll index all three versions of the site. Your domain's Google juice should apply to all three URLs just fine if they're on the same domain. | how to get the googlebot to get the correct GEOIPed content? OK. This problem is doing my head in. And I don't know if there even IS a definitive answer. We have a website, lets call it mycompany.com. It's a UK-based site, with UK based content. Google knows about it, and we have done a load of SEO on it. All is well. ... | TITLE:
how to get the googlebot to get the correct GEOIPed content?
QUESTION:
OK. This problem is doing my head in. And I don't know if there even IS a definitive answer. We have a website, lets call it mycompany.com. It's a UK-based site, with UK based content. Google knows about it, and we have done a load of SEO on... | [
"seo",
"bots",
"google-search"
] | 0 | 2 | 235 | 5 | 0 | 2008-08-28T13:24:09.013000 | 2008-08-28T13:29:38.330000 |
32,260 | 32,336 | Sending email in .NET through Gmail | Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show. Is it possible to do it? | Be sure to use System.Net.Mail, not the deprecated System.Web.Mail. Doing SSL with System.Web.Mail is a gross mess of hacky extensions. using System.Net; using System.Net.Mail;
var fromAddress = new MailAddress("from@gmail.com", "From Name"); var toAddress = new MailAddress("to@example.com", "To Name"); const string f... | Sending email in .NET through Gmail Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show. Is it possible to do it? | TITLE:
Sending email in .NET through Gmail
QUESTION:
Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show. Is it possible to do it?
ANSWER:
Be sure to use System.Net.Mail, not the deprecat... | [
"c#",
".net",
"email",
"smtp",
"gmail"
] | 964 | 1,168 | 663,584 | 26 | 0 | 2008-08-28T13:28:38.147000 | 2008-08-28T14:08:03.307000 |
32,280 | 33,552 | Passing null to a method | I am in the middle of reading the excellent Clean Code One discussion is regarding passing nulls into a method. public class MetricsCalculator { public double xProjection(Point p1, Point p2) { return (p2.x - p1.x) * 1.5; } }... calculator.xProjection(null, new Point(12,13)); It represents different ways of handling thi... | Both the use of assertions and the throwing of exceptions are valid approaches here. Either mechanism can be used to indicate a programming error, not a runtime error, as is the case here. Assertions have the advantage of performance as they are typically disabled on production systems. Exceptions have the advantage of... | Passing null to a method I am in the middle of reading the excellent Clean Code One discussion is regarding passing nulls into a method. public class MetricsCalculator { public double xProjection(Point p1, Point p2) { return (p2.x - p1.x) * 1.5; } }... calculator.xProjection(null, new Point(12,13)); It represents diffe... | TITLE:
Passing null to a method
QUESTION:
I am in the middle of reading the excellent Clean Code One discussion is regarding passing nulls into a method. public class MetricsCalculator { public double xProjection(Point p1, Point p2) { return (p2.x - p1.x) * 1.5; } }... calculator.xProjection(null, new Point(12,13)); I... | [
"java",
"null",
"assert"
] | 21 | 4 | 47,405 | 16 | 0 | 2008-08-28T13:34:40.313000 | 2008-08-28T22:26:27.197000 |
32,282 | 32,290 | How can test I regular expressions using multiple RE engines? | How can I test the same regex against different regular expression engines? | The most powerful free online regexp testing tool is by far http://regex101.com/ - lets you select the RE engine (PCRE, JavaScript, Python), has a debugger, colorizes the matches, explains the regexp on the fly, can create permalinks to the regex playground. Other online tools: http://regexpal.com/ - powered by the XRe... | How can test I regular expressions using multiple RE engines? How can I test the same regex against different regular expression engines? | TITLE:
How can test I regular expressions using multiple RE engines?
QUESTION:
How can I test the same regex against different regular expression engines?
ANSWER:
The most powerful free online regexp testing tool is by far http://regex101.com/ - lets you select the RE engine (PCRE, JavaScript, Python), has a debugger... | [
"regex",
"testing"
] | 85 | 75 | 49,836 | 29 | 0 | 2008-08-28T13:34:55.510000 | 2008-08-28T13:37:34.410000 |
32,332 | 37,542 | Why don't the std::fstream classes take a std::string? | This isn't a design question, really, though it may seem like it. (Well, okay, it's kind of a design question). What I'm wondering is why the C++ std::fstream classes don't take a std::string in their constructor or open methods. Everyone loves code examples so: #include #include #include int main() { std::string filen... | By taking a C string the C++03 std::fstream class reduced dependency on the std::string class. In C++11, however, the std::fstream class does allow passing a std::string for its constructor parameter. Now, you may wonder why isn't there a transparent conversion from a std:string to a C string, so a class that expects a... | Why don't the std::fstream classes take a std::string? This isn't a design question, really, though it may seem like it. (Well, okay, it's kind of a design question). What I'm wondering is why the C++ std::fstream classes don't take a std::string in their constructor or open methods. Everyone loves code examples so: #i... | TITLE:
Why don't the std::fstream classes take a std::string?
QUESTION:
This isn't a design question, really, though it may seem like it. (Well, okay, it's kind of a design question). What I'm wondering is why the C++ std::fstream classes don't take a std::string in their constructor or open methods. Everyone loves co... | [
"c++",
"stl",
"file-io",
"stdstring"
] | 36 | 26 | 27,567 | 10 | 0 | 2008-08-28T14:07:00.207000 | 2008-09-01T06:53:24.820000 |
32,333 | 161,268 | How can I program defensively in Ruby? | Here's a perfect example of the problem: Classifier gem breaks Rails. ** Original question: ** One thing that concerns me as a security professional is that Ruby doesn't have a parallel of Java's package-privacy. That is, this isn't valid Ruby: public module Foo public module Bar # factory method for new Bar implementa... | Check out Immutable by Garry Dolley. You can prevent redefinition of individual methods. | How can I program defensively in Ruby? Here's a perfect example of the problem: Classifier gem breaks Rails. ** Original question: ** One thing that concerns me as a security professional is that Ruby doesn't have a parallel of Java's package-privacy. That is, this isn't valid Ruby: public module Foo public module Bar ... | TITLE:
How can I program defensively in Ruby?
QUESTION:
Here's a perfect example of the problem: Classifier gem breaks Rails. ** Original question: ** One thing that concerns me as a security professional is that Ruby doesn't have a parallel of Java's package-privacy. That is, this isn't valid Ruby: public module Foo ... | [
"ruby",
"security",
"defensive-programming"
] | 5 | 1 | 1,141 | 9 | 0 | 2008-08-28T14:07:15.197000 | 2008-10-02T07:57:17.693000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.