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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56,568 | 201,180 | performing datetime related operations in PHP | How do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? I personally started to pass some of these operations to my postgresql dbms as typically I would only need to issue one sql statement to obtain an answer, however, to do it ... | PHP5+'s DateTime object is useful because it is leap time and daylight savings aware, but it needs some extension to really solve the problem. I wrote the following to solve a similar problem. The find_WeekdaysFromThisTo() method is brute-force, but it works reasonably quickly if your time span is less than 2 years. $t... | performing datetime related operations in PHP How do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? I personally started to pass some of these operations to my postgresql dbms as typically I would only need to issue one sql sta... | TITLE:
performing datetime related operations in PHP
QUESTION:
How do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? I personally started to pass some of these operations to my postgresql dbms as typically I would only need to... | [
"php",
"sql",
"postgresql",
"datetime"
] | 7 | 2 | 3,793 | 12 | 0 | 2008-09-11T13:48:27.873000 | 2008-10-14T13:39:41.900000 |
56,574 | 56,617 | Don't repeat yourself vs Internationalisation | A while back I was reading the W3C article on ' Re-using Strings in Scripted Content ', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code. To take their example, we might have some code like this... pr... | I'd try to keep complete sentences in the language resource. As you said you might need different words in different contexts. But a bigger problem is that the order of sentences might be different in different languages. So building up strings from words can cause problems. Just store The printer is on The printer is ... | Don't repeat yourself vs Internationalisation A while back I was reading the W3C article on ' Re-using Strings in Scripted Content ', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code. To take their ex... | TITLE:
Don't repeat yourself vs Internationalisation
QUESTION:
A while back I was reading the W3C article on ' Re-using Strings in Scripted Content ', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code... | [
"internationalization"
] | 12 | 16 | 633 | 6 | 0 | 2008-09-11T13:50:00.020000 | 2008-09-11T14:02:44.453000 |
56,589 | 56,749 | Can you query different databases on the same server using 1 NHibernate Session? | Does a new SessionFactor y and Session object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for calls to the 2 different databases? | ok so this doesn't answer your question directly but it might offer an insight as to why you should create multiple session objects for each datastore. This article explains how you can implement a thread safe lazy singleton for each type of Session you need so that you only have one session per datastore but it's shar... | Can you query different databases on the same server using 1 NHibernate Session? Does a new SessionFactor y and Session object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I have to create a new... | TITLE:
Can you query different databases on the same server using 1 NHibernate Session?
QUESTION:
Does a new SessionFactor y and Session object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I ha... | [
"asp.net",
"nhibernate"
] | 1 | 1 | 1,083 | 2 | 0 | 2008-09-11T13:53:31.573000 | 2008-09-11T14:48:07.697000 |
56,591 | 56,711 | Double Quotes in Oracle Column Aliases | Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieved from another table of user generated ... | Can you just put another character instead of double quotes and replace that with double quotes in the code? Something like this: SELECT table1.Col1 AS "This is |not| an alias" FROM table1 Then just replace | with ". I know it's a hack, but I can't think of any better solution... And what you are doing there is a hack ... | Double Quotes in Oracle Column Aliases Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieve... | TITLE:
Double Quotes in Oracle Column Aliases
QUESTION:
Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actual... | [
"oracle",
"alias",
"quotes"
] | 5 | 4 | 35,574 | 5 | 0 | 2008-09-11T13:53:57.093000 | 2008-09-11T14:39:39.200000 |
56,615 | 56,619 | Does IE7 have a "developer mode" or plugin like Firefox/Chrome/Safari? | Possible Duplicate: Debugging JavaScript in IE7 Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for "Inspect Element". Does IE7 have anything similar for troubleshooting layout/html/css issues? | Yes - The Internet Explorer Developer Toolbar Download details: Internet Explorer Developer Toolbar | Does IE7 have a "developer mode" or plugin like Firefox/Chrome/Safari? Possible Duplicate: Debugging JavaScript in IE7 Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for "Inspect Element". Does IE7... | TITLE:
Does IE7 have a "developer mode" or plugin like Firefox/Chrome/Safari?
QUESTION:
Possible Duplicate: Debugging JavaScript in IE7 Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for "Inspect ... | [
"html",
"css",
"browser",
"internet-explorer-7"
] | 45 | 45 | 52,613 | 10 | 0 | 2008-09-11T14:01:34.797000 | 2008-09-11T14:03:20.347000 |
56,630 | 56,759 | How can I get a fixed-position menu like slashdot's comment filtration menu | Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is about to scroll off the page, it will switch to fixed position, and stay on you... | Okay, I figured it out. I will post it here in case it help anyone else. This solution uses prototype, and an internal library that gives me the registerEvent, getElementX and getElementY functions, which do what you would think. var MenuManager = Class.create({ initialize: function initialize(menuElt) { this.menu = $(... | How can I get a fixed-position menu like slashdot's comment filtration menu Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is abo... | TITLE:
How can I get a fixed-position menu like slashdot's comment filtration menu
QUESTION:
Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its or... | [
"javascript",
"css"
] | 3 | 4 | 3,030 | 3 | 0 | 2008-09-11T14:09:01.737000 | 2008-09-11T14:51:27.207000 |
56,638 | 56,674 | How to convert from PRTime to .NET datetime | I want to convert a number that is in PRTime format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a DateTime. Note that this is slightly different than the usual "number of milliseconds since 1/1/1970". | Dim prTimeInMillis As UInt64 prTimeInMillis = prTime/1000
Dim prDateTime As New DateTime(1970, 1, 1) prDateTime = prDateTime.AddMilliseconds(prTimeInMillis) | How to convert from PRTime to .NET datetime I want to convert a number that is in PRTime format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a DateTime. Note that this is slightly different than the usual "number of milliseconds ... | TITLE:
How to convert from PRTime to .NET datetime
QUESTION:
I want to convert a number that is in PRTime format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a DateTime. Note that this is slightly different than the usual "numbe... | [
".net",
"firefox",
"datetime"
] | 0 | 2 | 1,291 | 2 | 0 | 2008-09-11T14:11:35.257000 | 2008-09-11T14:26:12.977000 |
56,644 | 56,650 | How do I detect if a Windows server is available after a reboot? | I want to automate a Windows 2000+ server reboot process using Task Scheduler or similar tool to remotely reboot a server and wait for it to come back up. I can issue shutdown or psshutdown to remotely reboot, but I want something better than sleep to wait for it to come back. I need to verify it is back online within ... | Your remote restart script could start the server, wait n minutes, then query your RFC service. You could also have a local script on the server do the same thing. | How do I detect if a Windows server is available after a reboot? I want to automate a Windows 2000+ server reboot process using Task Scheduler or similar tool to remotely reboot a server and wait for it to come back up. I can issue shutdown or psshutdown to remotely reboot, but I want something better than sleep to wai... | TITLE:
How do I detect if a Windows server is available after a reboot?
QUESTION:
I want to automate a Windows 2000+ server reboot process using Task Scheduler or similar tool to remotely reboot a server and wait for it to come back up. I can issue shutdown or psshutdown to remotely reboot, but I want something better... | [
"windows",
"system-administration",
"reboot"
] | 5 | 2 | 8,123 | 7 | 0 | 2008-09-11T14:14:59.837000 | 2008-09-11T14:18:16.613000 |
56,648 | 57,643 | What's the Best Way to Shuffle an NSMutableArray? | If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.) Update: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there is an -[NSMutableArray shuffledArray] method that ... | You don't need the swapObjectAtIndex method. exchangeObjectAtIndex:withObjectAtIndex: already exists. | What's the Best Way to Shuffle an NSMutableArray? If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.) Update: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there ... | TITLE:
What's the Best Way to Shuffle an NSMutableArray?
QUESTION:
If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.) Update: As noted by @Mukesh, as of iOS 10+ and ma... | [
"objective-c",
"cocoa",
"shuffle"
] | 193 | 74 | 79,077 | 12 | 0 | 2008-09-11T14:16:43.530000 | 2008-09-11T21:03:24.333000 |
56,654 | 58,802 | How do I access performance counters from C# in Windows XP Embedded? | I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here? | It looks like this is what I was missing: http://msdn.microsoft.com/en-us/library/aa939695.aspx | How do I access performance counters from C# in Windows XP Embedded? I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I c... | TITLE:
How do I access performance counters from C# in Windows XP Embedded?
QUESTION:
I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present ... | [
"c#",
".net",
"windows-xp-embedded"
] | 1 | 0 | 2,681 | 2 | 0 | 2008-09-11T14:19:35.910000 | 2008-09-12T12:19:45.893000 |
56,655 | 155,368 | Arithmetic underflow or overflow exception during debugging | This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the.NET runtime and calls into.NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly random locations and points of our code: Arithmetic overflow or underflow. The sta... | a debug version of a linked dll could be compiled with signaling nan support, see http://blogs.msdn.com/oldnewthing/archive/2008/07/02/8679191.aspx for an example of this problem. that heisenbug was caused by uninitialized variables, here there could be a linked dll enabling the snan feature of the cpu and forgetting t... | Arithmetic underflow or overflow exception during debugging This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the.NET runtime and calls into.NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly random locations and p... | TITLE:
Arithmetic underflow or overflow exception during debugging
QUESTION:
This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the.NET runtime and calls into.NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly rand... | [
"visual-studio",
"debugging",
"exception",
"random"
] | 10 | 1 | 2,574 | 2 | 0 | 2008-09-11T14:19:49.857000 | 2008-09-30T22:26:17.793000 |
56,657 | 57,099 | Copying a directory that is version controlled | I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a coworker recently about doing it in SVN. I think it... | In Subversion, every.svn folder has whatever is necessary for the containing folder. And since all local paths are stored as relative, you are safe while copying whole or partial trees outside the original checkout tree. They will continue to function in their new homes. I frequently copy subtrees from my trunk outside... | Copying a directory that is version controlled I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a cowo... | TITLE:
Copying a directory that is version controlled
QUESTION:
I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was... | [
"svn",
"version-control",
"dvcs",
"bazaar"
] | 3 | 6 | 612 | 10 | 0 | 2008-09-11T14:20:26.203000 | 2008-09-11T17:01:22.620000 |
56,658 | 56,663 | How do I specify in HTML or CSS the absolute minimum width of a table cell | Summary What's the best way to ensure a table cell cannot be less than a certain minimum width. Example I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space. Browser compatibility I possib... | This CSS should suffice: td { min-width: 100px; } However, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal). Edit: As for an IE6 (and before) solution, there isn't one that works reliably under all circumstances, as far as I know. Using the nowrap HT... | How do I specify in HTML or CSS the absolute minimum width of a table cell Summary What's the best way to ensure a table cell cannot be less than a certain minimum width. Example I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available s... | TITLE:
How do I specify in HTML or CSS the absolute minimum width of a table cell
QUESTION:
Summary What's the best way to ensure a table cell cannot be less than a certain minimum width. Example I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there i... | [
"html",
"css",
"html-table"
] | 51 | 62 | 87,191 | 7 | 0 | 2008-09-11T14:21:32.177000 | 2008-09-11T14:22:49.317000 |
56,659 | 56,807 | Custom Counter Creation Through Web Application | I have a.NET 3.5 web application for which I have implemented a class called CalculationsCounterManager (code below). This class has some shared/static members that manage the creation and incrementing of two custom performance counters that monitor data calls to a SQL Server database. Execution of these data calls dri... | Yes, it’s not possible. You can’t add privileges to the worker process without opening the server up to potential security / DOS problems in a production environment. An installer (like a MSI) usually runs with elevated permissions, and installs / uninstalls the performance counter categories and counters as well as ot... | Custom Counter Creation Through Web Application I have a.NET 3.5 web application for which I have implemented a class called CalculationsCounterManager (code below). This class has some shared/static members that manage the creation and incrementing of two custom performance counters that monitor data calls to a SQL Se... | TITLE:
Custom Counter Creation Through Web Application
QUESTION:
I have a.NET 3.5 web application for which I have implemented a class called CalculationsCounterManager (code below). This class has some shared/static members that manage the creation and incrementing of two custom performance counters that monitor data... | [
".net"
] | 2 | 3 | 506 | 1 | 0 | 2008-09-11T14:21:33.753000 | 2008-09-11T15:03:51.093000 |
56,672 | 56,755 | How do you profile your code? | I hope not everyone is using Rational Purify. So what do you do when you want to measure: time taken by a function peak memory usage code coverage At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to excel. phew...) What would you recommend? Pointing t... | You probably want different tools for performance profiling and code coverage. For profiling I prefer Shark on MacOSX. It is free from Apple and very good. If your app is vanilla C you should be able to use it, if you can get hold of a Mac. For profiling on Windows you can use LTProf. Cheap, but not great: http://succe... | How do you profile your code? I hope not everyone is using Rational Purify. So what do you do when you want to measure: time taken by a function peak memory usage code coverage At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to excel. phew...) What w... | TITLE:
How do you profile your code?
QUESTION:
I hope not everyone is using Rational Purify. So what do you do when you want to measure: time taken by a function peak memory usage code coverage At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to exce... | [
"c",
"profiling"
] | 11 | 4 | 12,985 | 8 | 0 | 2008-09-11T14:25:17.987000 | 2008-09-11T14:50:10.797000 |
56,677 | 2,164,298 | Is there a way to parser a SQL query to pull out the column names and table names? | I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new SQL parsing program is trickier than is se... | I actually ended up using a tool called SQL Pretty Printer. You can purchase a desktop version, but I just used the free online application. Just copy the query into the text box, set the Output to "List DB Object" and click the Format SQL button. It work great using around 150 different (and complex) SQL queries. | Is there a way to parser a SQL query to pull out the column names and table names? I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table ... | TITLE:
Is there a way to parser a SQL query to pull out the column names and table names?
QUESTION:
I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each... | [
"sql",
"parsing"
] | 8 | 12 | 14,074 | 7 | 0 | 2008-09-11T14:27:19.260000 | 2010-01-29T18:44:08.817000 |
56,680 | 56,929 | Is a Flex debugger included in the sdk? | I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs and compiling with ant). If not, how do... | A debugger called fdb is included in the Flex SDK. Here's some documentation on how to use it: Adobe DevCenter: Debugging Client-Side Code in Flex Applications Flex 3 Help: Using the Command-Line Debugger | Is a Flex debugger included in the sdk? I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs... | TITLE:
Is a Flex debugger included in the sdk?
QUESTION:
I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I hav... | [
"apache-flex"
] | 6 | 6 | 1,879 | 2 | 0 | 2008-09-11T14:29:34.777000 | 2008-09-11T15:39:48.290000 |
56,682 | 56,768 | How to see if a subfile of a directory has changed | In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? If it matters, I am using an NTFS volume. I would ultimately like to ... | This article should help. Basically, you create one or more notification object such as: HANDLE dwChangeHandles[2]; dwChangeHandles[0] = FindFirstChangeNotification( lpDir, // directory to watch FALSE, // do not watch subtree FILE_NOTIFY_CHANGE_FILE_NAME); // watch file name changes
if (dwChangeHandles[0] == INVALID_H... | How to see if a subfile of a directory has changed In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? If it matters, I a... | TITLE:
How to see if a subfile of a directory has changed
QUESTION:
In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? ... | [
"c++",
"windows",
"filesystems",
"ntfs"
] | 7 | 6 | 7,485 | 8 | 0 | 2008-09-11T14:30:19.270000 | 2008-09-11T14:54:57.993000 |
56,684 | 56,728 | How can I get rid of Windows Update reboot prompt? | I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described here to prevent Windows forcibly rebooting my machine, which is ... | Not sure if it is the same for vista, but worth a try. On Windows XP, you can modify a group policy setting to change how frequently it re-prompts you. (start -> run type gpedit.msc) Look under Computer Configuration/Administrative Templates/Windows Components/Windows Update The setting you want is called Re-Prompt for... | How can I get rid of Windows Update reboot prompt? I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described here to preve... | TITLE:
How can I get rid of Windows Update reboot prompt?
QUESTION:
I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack descr... | [
"windows",
"windows-vista",
"windows-update"
] | 12 | 12 | 8,800 | 8 | 0 | 2008-09-11T14:30:41.467000 | 2008-09-11T14:43:15.400000 |
56,687 | 56,701 | How do I ensure that RMI uses only a specific set of ports? | In our application, we are using RMI for client-server communication in very different ways: Pushing data from the server to the client to be displayed. Sending control information from the client to the server. Callbacks from those control messages code paths that reach back from the server to the client (sidebar note... | You can do this with a custom RMI Socket Factory. The socket factories create the sockets for RMI to use at both the client and server end so if you write your own you've got full control over the ports used. The client factories are created on the server, Serialized and then sent down to the client which is pretty nea... | How do I ensure that RMI uses only a specific set of ports? In our application, we are using RMI for client-server communication in very different ways: Pushing data from the server to the client to be displayed. Sending control information from the client to the server. Callbacks from those control messages code paths... | TITLE:
How do I ensure that RMI uses only a specific set of ports?
QUESTION:
In our application, we are using RMI for client-server communication in very different ways: Pushing data from the server to the client to be displayed. Sending control information from the client to the server. Callbacks from those control m... | [
"java",
"rmi"
] | 10 | 4 | 18,699 | 4 | 0 | 2008-09-11T14:31:47.317000 | 2008-09-11T14:36:40.987000 |
56,692 | 56,735 | Random weighted choice | Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0;
public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their weights. What do you think of the code be... | Your algorithm is nearly correct. However, the test should be < instead of <=: if (randomNumber < broker.Weight) This is because 0 is inclusive in the random number while totalWeight is exclusive. In other words, a broker with weight 0 would still have a small chance of being selected – not at all what you want. This a... | Random weighted choice Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0;
public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their weights. What do y... | TITLE:
Random weighted choice
QUESTION:
Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0;
public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their ... | [
"c#",
"algorithm",
"random"
] | 66 | 44 | 54,625 | 11 | 0 | 2008-09-11T14:34:11.053000 | 2008-09-11T14:45:27.440000 |
56,698 | 57,832 | Best way to get a list of differences between 2 of the same objects | I would like to generate a list of differences between 2 instances of the the same object. Object in question: public class Step { [DataMember] public StepInstanceInfo InstanceInfo { get; set; }
[DataMember] public Collection AdHocRules { get; set; }
[DataMember] public Collection StepDocs {...}
[DataMember] public ... | You'll need a separate object, like StepDiff with collections for removed and added items. The easiest way to do something like this is to copy the collections from each of the old and new objects, so that StepDiff has collectionOldStepDocs and collectionNewStepDocs. Grab the shorter collection and iterate through it a... | Best way to get a list of differences between 2 of the same objects I would like to generate a list of differences between 2 instances of the the same object. Object in question: public class Step { [DataMember] public StepInstanceInfo InstanceInfo { get; set; }
[DataMember] public Collection AdHocRules { get; set; }
... | TITLE:
Best way to get a list of differences between 2 of the same objects
QUESTION:
I would like to generate a list of differences between 2 instances of the the same object. Object in question: public class Step { [DataMember] public StepInstanceInfo InstanceInfo { get; set; }
[DataMember] public Collection AdHocRu... | [
"c#",
"oop"
] | 2 | 2 | 690 | 2 | 0 | 2008-09-11T14:36:08.287000 | 2008-09-11T22:41:59.853000 |
56,707 | 58,166 | Java Right Click does not make a selection. What is the easiest way to solve this globally? | Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point applications depend on it. Any advice on doing this on a global scale? Perhaps on the L&F? | Using the Glass Pane will do the trick. Here's a tutorial on how to use the glass pane to get the right click button and redispatch it to the right component. As the glass pane is not a solution in this case, I suggest you take a look at the Toolkit class. Specificaly the addAWTEventListener method. You can add a globa... | Java Right Click does not make a selection. What is the easiest way to solve this globally? Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point applications depend ... | TITLE:
Java Right Click does not make a selection. What is the easiest way to solve this globally?
QUESTION:
Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point ap... | [
"java",
"swing"
] | 7 | 3 | 1,337 | 1 | 0 | 2008-09-11T14:38:25.333000 | 2008-09-12T02:09:23.537000 |
56,708 | 141,197 | Objective-C for Windows | What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know I can write assemb... | Expanding on the two previous answers, if you just want Objective-C but not any of the Cocoa frameworks, then gcc will work on any platform. You can use it through Cygwin or get MinGW. However, if you want the Cocoa frameworks, or at least a reasonable subset of them, then GNUStep and Cocotron are your best bets. Cocot... | Objective-C for Windows What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I... | TITLE:
Objective-C for Windows
QUESTION:
What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a dif... | [
"objective-c",
"windows",
"winapi",
"gcc",
"cygwin"
] | 233 | 149 | 214,762 | 14 | 0 | 2008-09-11T14:38:42.883000 | 2008-09-26T18:42:43.120000 |
56,709 | 56,720 | User does not have permission to run DBCC DBREINDEX | I get the following error message in SQL Server 2005: User ' ' does not have permission to run DBCC DBREINDEX for object ' '. Which minimum role do I have to give to user in order to run the command? | You will need to be a member of the db_ddladmin or the db_owner role AFAIK | User does not have permission to run DBCC DBREINDEX I get the following error message in SQL Server 2005: User ' ' does not have permission to run DBCC DBREINDEX for object ' '. Which minimum role do I have to give to user in order to run the command? | TITLE:
User does not have permission to run DBCC DBREINDEX
QUESTION:
I get the following error message in SQL Server 2005: User ' ' does not have permission to run DBCC DBREINDEX for object ' '. Which minimum role do I have to give to user in order to run the command?
ANSWER:
You will need to be a member of the db_dd... | [
"sql-server-2005",
"security"
] | 6 | 10 | 15,942 | 3 | 0 | 2008-09-11T14:39:32.303000 | 2008-09-11T14:41:39.757000 |
56,715 | 56,736 | Best way to query disk space on remote server | I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cimv2" Dim oMS As New ManagementScope(sNameSpace, oConn)
Dim oQuer... | Why not just make your WMI query only pull back where name='Y'? So: Dim oQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3 AND name='Y'") | Best way to query disk space on remote server I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cimv2" Dim oMS As New... | TITLE:
Best way to query disk space on remote server
QUESTION:
I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cim... | [
"vb.net",
"wmi"
] | 5 | 9 | 14,120 | 1 | 0 | 2008-09-11T14:40:12.413000 | 2008-09-11T14:45:31.853000 |
56,722 | 56,743 | Automated processing of an Email in Java | Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process it and save it to a folder. Any informati... | Email -> mailserver ->[something] -> file-on-disk. File on disk is pretty easy to parse, use JavaMail. The [something] could be: listener for smtp connections (overkill)! Pop3 / imap client Maildir /Mailbox | Automated processing of an Email in Java Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process ... | TITLE:
Automated processing of an Email in Java
QUESTION:
Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the at... | [
"java",
"email",
"lotus-notes"
] | 5 | 10 | 6,924 | 9 | 0 | 2008-09-11T14:41:45.327000 | 2008-09-11T14:46:37.203000 |
56,723 | 3,710,737 | Display blanks instead of 0 or 0.0 in a BIRT report | When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank when... | Just an FYI, after working with this for a while longer, I have found that it is just easier to use Visibility rules. The one big advantage is that you can easily configure different visibility for different output formats. So for PDF it may be best to use blanks, but for Excel you may want the 0 values. | Display blanks instead of 0 or 0.0 in a BIRT report When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in case... | TITLE:
Display blanks instead of 0 or 0.0 in a BIRT report
QUESTION:
When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for... | [
"eclipse",
"reporting",
"birt"
] | 2 | 1 | 3,547 | 2 | 0 | 2008-09-11T14:41:46.777000 | 2010-09-14T16:11:56.057000 |
56,729 | 58,180 | How to call the AllocateAndInitializeSid function from C#? | Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code? I found this: BOOL WINAPI AllocateAndInitializeSid( __in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, __in BYTE nSubAuthorityCount, __in DWORD dwSubAuthority0, __in DWORD dwSubAuthority1, __in DWORD dwS... | Using P/Invoke Interop Assistant: [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct SidIdentifierAuthority {
/// BYTE[6] [System.Runtime.InteropServices.MarshalAsAttribute( System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 6, A... | How to call the AllocateAndInitializeSid function from C#? Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code? I found this: BOOL WINAPI AllocateAndInitializeSid( __in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, __in BYTE nSubAuthorityCount, __in DWORD ... | TITLE:
How to call the AllocateAndInitializeSid function from C#?
QUESTION:
Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code? I found this: BOOL WINAPI AllocateAndInitializeSid( __in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, __in BYTE nSubAuthority... | [
"c#",
".net",
"winapi"
] | 4 | 3 | 2,083 | 3 | 0 | 2008-09-11T14:43:18.550000 | 2008-09-12T02:20:06.037000 |
56,737 | 56,815 | Is DocumentBuilder.parse() thread safe? | Is the standard Java 1.6 javax.xml.parsers.DocumentBuilder class thread safe? Is it safe to call the parse() method from several threads in parallel? The JavaDoc doesn't mention the issue, but the JavaDoc for the same class in Java 1.4 specifically says that it isn't meant to be concurrent; so can I assume that in 1.6 ... | Even though DocumentBuilder.parse appears not to mutate the builder it does on the Sun JDK default implementation (based on Apache Xerces). Eccentric design decision. What can you do? I guess use a ThreadLocal: private static final ThreadLocal builderLocal = new ThreadLocal () { @Override protected DocumentBuilder init... | Is DocumentBuilder.parse() thread safe? Is the standard Java 1.6 javax.xml.parsers.DocumentBuilder class thread safe? Is it safe to call the parse() method from several threads in parallel? The JavaDoc doesn't mention the issue, but the JavaDoc for the same class in Java 1.4 specifically says that it isn't meant to be ... | TITLE:
Is DocumentBuilder.parse() thread safe?
QUESTION:
Is the standard Java 1.6 javax.xml.parsers.DocumentBuilder class thread safe? Is it safe to call the parse() method from several threads in parallel? The JavaDoc doesn't mention the issue, but the JavaDoc for the same class in Java 1.4 specifically says that it ... | [
"java",
"thread-safety"
] | 28 | 28 | 14,233 | 3 | 0 | 2008-09-11T14:45:40.090000 | 2008-09-11T15:07:39.180000 |
56,741 | 56,882 | File system info - how to query it? | Is there a way to access file system info via some type of Windows API? If not what other methods are available to a user mode developer? | Not very clean, but you can use DeviceIoControl() Open volume as a file, pass resulting handle to DeviceIoControl() together with control code. Check MSDN for control codes, there is something like "read journal record". | File system info - how to query it? Is there a way to access file system info via some type of Windows API? If not what other methods are available to a user mode developer? | TITLE:
File system info - how to query it?
QUESTION:
Is there a way to access file system info via some type of Windows API? If not what other methods are available to a user mode developer?
ANSWER:
Not very clean, but you can use DeviceIoControl() Open volume as a file, pass resulting handle to DeviceIoControl() tog... | [
"c++",
"windows",
"winapi",
"filesystems"
] | 4 | 2 | 854 | 2 | 0 | 2008-09-11T14:46:04.833000 | 2008-09-11T15:27:39.537000 |
56,761 | 56,773 | Keyboard Shortcut in Access 2003 | Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode? | It's not built-in. I would try a macro - AutoKeys? You should be able to make almost any keyboard short you want that way. | Keyboard Shortcut in Access 2003 Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode? | TITLE:
Keyboard Shortcut in Access 2003
QUESTION:
Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?
ANSWER:
It's not built-in. I would try a macro - AutoKeys? You should be able to make almost any keyboard short you want that way. | [
"ms-access"
] | 2 | 1 | 4,172 | 9 | 0 | 2008-09-11T14:51:43.553000 | 2008-09-11T14:55:41.937000 |
56,764 | 56,806 | Starting a new job focused on brownfield application refactoring & Agile | I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile coach. They are currently focused on 6-9 mo... | Great question! I would say the first thing to do is get the daily scrums going. Your part in the scrum will be learning the code. It will provide you a way to ask questions and get a feel for who can help you learn the code. Once you have that guy (or guys) picked out start pair programming with them. Let them drive b... | Starting a new job focused on brownfield application refactoring & Agile I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Maste... | TITLE:
Starting a new job focused on brownfield application refactoring & Agile
QUESTION:
I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two ... | [
".net",
"vb.net",
"refactoring",
"brownfield"
] | 3 | 4 | 276 | 2 | 0 | 2008-09-11T14:52:15.190000 | 2008-09-11T15:03:42.590000 |
56,767 | 56,781 | Differences Between DataSet Merges | Is there a difference (performance, overhead) between these two ways of merging data sets? MyTypedDataSet aDataSet = new MyTypedDataSet(); aDataSet.Merge(anotherDataSet); aDataSet.Merge(yetAnotherDataSet); and MyTypedDataSet aDataSet = anotherDataSet; aDataSet.Merge(yetAnotherDataSet); Which do you recommend? | While Keith is right, I suppose the example was simply badly chosen. Generally, it is better to initialize to the “right” object from the beginning and not construct an intermediate, empty object as in your case. Two reasons: Performance. This should be obvious: Object creation costs time so creating less objects is be... | Differences Between DataSet Merges Is there a difference (performance, overhead) between these two ways of merging data sets? MyTypedDataSet aDataSet = new MyTypedDataSet(); aDataSet.Merge(anotherDataSet); aDataSet.Merge(yetAnotherDataSet); and MyTypedDataSet aDataSet = anotherDataSet; aDataSet.Merge(yetAnotherDataSet)... | TITLE:
Differences Between DataSet Merges
QUESTION:
Is there a difference (performance, overhead) between these two ways of merging data sets? MyTypedDataSet aDataSet = new MyTypedDataSet(); aDataSet.Merge(anotherDataSet); aDataSet.Merge(yetAnotherDataSet); and MyTypedDataSet aDataSet = anotherDataSet; aDataSet.Merge(... | [
"c#",
"object",
"initialization",
"dataset"
] | 1 | 1 | 4,702 | 3 | 0 | 2008-09-11T14:54:07.620000 | 2008-09-11T14:58:18.187000 |
56,769 | 58,007 | How do I tell a multi-core / multi-CPU machine to process function calls in a loop in parallel? | I am currently designing an application that has one module which will load large amounts of data from a database and reduce it to a much smaller set by various calculations depending on the circumstances. Many of the more intensive operations behave deterministically and would lend themselves to parallel processing. P... | I might be missing something here, but this this seems fairly straight forward using pthreads. Set up a small threadpool with N threads in it and have one thread to control them all. The master thread simply sits in a loop doing something like: Get data chunk from DB Find next free thread If no thread is free then wait... | How do I tell a multi-core / multi-CPU machine to process function calls in a loop in parallel? I am currently designing an application that has one module which will load large amounts of data from a database and reduce it to a much smaller set by various calculations depending on the circumstances. Many of the more i... | TITLE:
How do I tell a multi-core / multi-CPU machine to process function calls in a loop in parallel?
QUESTION:
I am currently designing an application that has one module which will load large amounts of data from a database and reduce it to a much smaller set by various calculations depending on the circumstances. ... | [
"concurrency",
"mapreduce"
] | 7 | 2 | 861 | 9 | 0 | 2008-09-11T14:54:59.303000 | 2008-09-12T00:29:38.860000 |
56,798 | 56,814 | Converting scripts from ksh to bash | I have some ksh scripts which I'd like to convert to run with bash instead. Are there any useful on-line resources for this? I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome:-) | Have you tried looking at this page? It has a useful matrix of features and links to elsewhere. Also this link, search for: C2) How does bash differ from the Korn shell | Converting scripts from ksh to bash I have some ksh scripts which I'd like to convert to run with bash instead. Are there any useful on-line resources for this? I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome:-) | TITLE:
Converting scripts from ksh to bash
QUESTION:
I have some ksh scripts which I'd like to convert to run with bash instead. Are there any useful on-line resources for this? I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome:-)... | [
"bash",
"unix",
"ksh"
] | 1 | 3 | 13,734 | 2 | 0 | 2008-09-11T15:01:58.850000 | 2008-09-11T15:06:58.260000 |
56,801 | 56,864 | The difference between the connections strings in SQLCLR | I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used Dim cn As New SqlConnection("server=LOCALHOST;integrated security=yes;database=" & sDb) instead of DIM conn As New SqlConn... | The context connection uses the user's already established connection to the server. So you inherit things like their database context, connection options, etc. Using localhost will connect to the server using a normal shared memory connection. This can be useful if you don't want to use the user's connection (i.e. if ... | The difference between the connections strings in SQLCLR I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used Dim cn As New SqlConnection("server=LOCALHOST;integrated security... | TITLE:
The difference between the connections strings in SQLCLR
QUESTION:
I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used Dim cn As New SqlConnection("server=LOCALHOST;i... | [
"sqlclr"
] | 2 | 6 | 1,976 | 2 | 0 | 2008-09-11T15:02:20.893000 | 2008-09-11T15:19:57.637000 |
56,810 | 56,825 | How do I start threads in plain C? | I have used fork() in C to start another process. How do I start a new thread? | Since you mentioned fork() I assume you're on a Unix-like system, in which case POSIX threads (usually referred to as pthreads) are what you want to use. Specifically, pthread_create() is the function you need to create a new thread. Its arguments are: int pthread_create(pthread_t * thread, pthread_attr_t * attr, void ... | How do I start threads in plain C? I have used fork() in C to start another process. How do I start a new thread? | TITLE:
How do I start threads in plain C?
QUESTION:
I have used fork() in C to start another process. How do I start a new thread?
ANSWER:
Since you mentioned fork() I assume you're on a Unix-like system, in which case POSIX threads (usually referred to as pthreads) are what you want to use. Specifically, pthread_cre... | [
"c",
"multithreading"
] | 61 | 66 | 87,996 | 6 | 0 | 2008-09-11T15:04:25.053000 | 2008-09-11T15:09:22.577000 |
56,812 | 56,918 | BOM not expected in CF but sent by IIS/SharePoint | I'm trying to consume a SharePoint webservice from ColdFusion via cfinvoke ('cause I don't want to deal with (read: parse) the SOAP response itself). The SOAP response includes a byte-order-mark character (BOM), which produces the following exception in CF: "Cannot perform web service invocation GetList. The fault retu... | I'm going to say that the answer to your question (is it possible?) is no. I don't know that definitively, but the poster who commented just above halL ( in the comments on this page ) gave a work-around for the problem -- so I assume it is possible to deal with when parsing manually. You say that you're using CFInvoke... | BOM not expected in CF but sent by IIS/SharePoint I'm trying to consume a SharePoint webservice from ColdFusion via cfinvoke ('cause I don't want to deal with (read: parse) the SOAP response itself). The SOAP response includes a byte-order-mark character (BOM), which produces the following exception in CF: "Cannot perf... | TITLE:
BOM not expected in CF but sent by IIS/SharePoint
QUESTION:
I'm trying to consume a SharePoint webservice from ColdFusion via cfinvoke ('cause I don't want to deal with (read: parse) the SOAP response itself). The SOAP response includes a byte-order-mark character (BOM), which produces the following exception i... | [
"web-services",
"sharepoint",
"iis",
"coldfusion",
"byte-order-mark"
] | 2 | 2 | 1,871 | 3 | 0 | 2008-09-11T15:05:57.233000 | 2008-09-11T15:37:35.300000 |
56,820 | 56,833 | round() doesn't seem to be rounding properly | The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, good old floating point weirdness creeps in and you get: 5.5999999999999996 For the purposes of UI, I need to display 5.6. I pok... | I can't help the way it's stored, but at least formatting works correctly: '%.1f' % round(n, 1) # Gives you '5.6' | round() doesn't seem to be rounding properly The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, good old floating point weirdness creeps in and you get: 5.5999999999999996 For the... | TITLE:
round() doesn't seem to be rounding properly
QUESTION:
The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, good old floating point weirdness creeps in and you get: 5.599999... | [
"python",
"floating-point",
"rounding"
] | 143 | 110 | 284,775 | 21 | 0 | 2008-09-11T15:08:09.240000 | 2008-09-11T15:11:41.400000 |
56,837 | 58,471 | How can I make an exact copy of a xml node's children with XSLT? | My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them. I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to < and > as opposed to being echoe... | This is referred to as the "identity transformation" in the XSLT specification. | How can I make an exact copy of a xml node's children with XSLT? My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them. I've tried wrapping the snippet in a CDATA but it doesn't work since less than and... | TITLE:
How can I make an exact copy of a xml node's children with XSLT?
QUESTION:
My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them. I've tried wrapping the snippet in a CDATA but it doesn't work s... | [
"xml",
"xslt",
"xhtml"
] | 3 | 7 | 7,002 | 4 | 0 | 2008-09-11T15:12:03.397000 | 2008-09-12T07:57:31.840000 |
56,843 | 57,100 | Looking for an HQL builder (Hibernate Query Language) | I'm looking for a builder for HQL in Java. I want to get rid of things like: StringBuilder builder = new StringBuilder().append("select stock from ").append( Stock.class.getName() ).append( " as stock where stock.id = ").append( id ); I'd rather have something like: HqlBuilder builder = new HqlBuilder().select( "stock"... | @ Sébastien Rocca-Serra Now we're getting somewhere concrete. The sort of join you're trying to do isn't really possible through the Criteria API, but a sub-query should accomplish the same thing. First you create a DetachedCriteria for the bonus table, then use the IN operator for someValue. DetachedCriteria bonuses =... | Looking for an HQL builder (Hibernate Query Language) I'm looking for a builder for HQL in Java. I want to get rid of things like: StringBuilder builder = new StringBuilder().append("select stock from ").append( Stock.class.getName() ).append( " as stock where stock.id = ").append( id ); I'd rather have something like:... | TITLE:
Looking for an HQL builder (Hibernate Query Language)
QUESTION:
I'm looking for a builder for HQL in Java. I want to get rid of things like: StringBuilder builder = new StringBuilder().append("select stock from ").append( Stock.class.getName() ).append( " as stock where stock.id = ").append( id ); I'd rather ha... | [
"java",
"hibernate",
"hql"
] | 10 | 5 | 26,679 | 11 | 0 | 2008-09-11T15:12:52.193000 | 2008-09-11T17:02:48.123000 |
56,856 | 59,152 | How do I make a UIDatePicker display specific dates? | My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a UIDatePicker to limit date choices to a certain subset or should I just use a UIPickerView? | You cannot limit which dates are selectable in a UIDatePicker. You could change the date when the value changed event is sent, but since the user cannot tell which dates are "good" and which are not, it's a bad UI choice to do so. Use a UIPickerView of your own making instead. | How do I make a UIDatePicker display specific dates? My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a UIDatePicker to limit date choices to a certain subs... | TITLE:
How do I make a UIDatePicker display specific dates?
QUESTION:
My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a UIDatePicker to limit date choices... | [
"iphone",
"cocoa-touch",
"cocoa",
"uidatepicker"
] | 5 | 6 | 1,379 | 2 | 0 | 2008-09-11T15:15:52.140000 | 2008-09-12T14:39:32.623000 |
56,859 | 58,647 | Is it possible to display a modal window in SCSF application at the center of the screen | In SCSF application I would like to display a view as a modal window at the center of the screen. Is it possible to do that? WindowSmartPartInfo doesn't have any option for setting screen postion. Thanks. | Assuming you're talking about Winforms, not WPF since the WPF layer for CAB does expose this option. In winforms there is no option in the WindowSmartPartInfo to do this. However, you could extend it and extend WindowWorkspace to use your new SmartPartInfo (override the OnApplySmartPartInfo method). Before you do this,... | Is it possible to display a modal window in SCSF application at the center of the screen In SCSF application I would like to display a view as a modal window at the center of the screen. Is it possible to do that? WindowSmartPartInfo doesn't have any option for setting screen postion. Thanks. | TITLE:
Is it possible to display a modal window in SCSF application at the center of the screen
QUESTION:
In SCSF application I would like to display a view as a modal window at the center of the screen. Is it possible to do that? WindowSmartPartInfo doesn't have any option for setting screen postion. Thanks.
ANSWER:... | [
"cab",
"scsf"
] | 1 | 1 | 941 | 1 | 0 | 2008-09-11T15:17:02.480000 | 2008-09-12T10:42:46.220000 |
56,860 | 584,732 | What is an example of the Liskov Substitution Principle? | I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use? | A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn't quite work in code. In mathematics, a Square is a Rectangle. Indeed it is a specialization of a rectangle. The "is a" makes you want to model this with inheritanc... | What is an example of the Liskov Substitution Principle? I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use? | TITLE:
What is an example of the Liskov Substitution Principle?
QUESTION:
I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use?
ANSWER:
A great example illustrating LSP (given by Uncle Bob in a podcast I heard ... | [
"oop",
"definition",
"solid-principles",
"design-principles",
"liskov-substitution-principle"
] | 1,234 | 1,233 | 566,644 | 35 | 0 | 2008-09-11T15:17:38.983000 | 2009-02-25T04:44:31.487000 |
56,865 | 58,591 | Calling a Web Service from Seam | A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results? I need to be able to integrate with a search platform being provided by a private vendor who is exposing his functionality as a web service. So, I'm just loo... | There's roughly a gajillion HTTP client libraries (Restlet is quite a bit more than that, but I already had that code snippet for something else), but they should all provide support for sending GET requests. Here's a rather less featureful snippet that uses HttpClient from Apache Commons: HttpClient client = new HttpC... | Calling a Web Service from Seam A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results? I need to be able to integrate with a search platform being provided by a private vendor who is exposing his functionality as... | TITLE:
Calling a Web Service from Seam
QUESTION:
A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results? I need to be able to integrate with a search platform being provided by a private vendor who is exposing hi... | [
"java",
"seam"
] | 3 | 1 | 4,454 | 3 | 0 | 2008-09-11T15:20:05.453000 | 2008-09-12T10:04:05.517000 |
56,867 | 56,912 | Interface vs Base class | When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMak... | Let's take your example of a Dog and a Cat class, and let's illustrate using C#: Both a dog and a cat are animals, specifically, quadruped mammals (animals are waaay too general). Let us assume that you have an abstract class Mammal, for both of them: public abstract class Mammal This base class will probably have defa... | Interface vs Base class When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces fo... | TITLE:
Interface vs Base class
QUESTION:
When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand ha... | [
"oop",
"interface",
"language-agnostic",
"base-class",
"static-typing"
] | 838 | 547 | 198,528 | 38 | 0 | 2008-09-11T15:20:30.803000 | 2008-09-11T15:36:14.540000 |
56,886 | 56,898 | UI Thread Safety | Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me. Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc. | Invoke is the proper way to do it if you're pushing stuff at the form from another thread. But you might consider whether the form might be better pulling data itself, perhaps from a timer, and perhaps less frequently than a background process might push individual updates. | UI Thread Safety Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me. Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc. | TITLE:
UI Thread Safety
QUESTION:
Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me. Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc.
ANSWER:
Invoke is the proper way to do it if you're pushing stuff at... | [
"vb.net",
"multithreading",
"winforms",
".net-3.5",
"form-control"
] | 1 | 3 | 267 | 2 | 0 | 2008-09-11T15:29:00.797000 | 2008-09-11T15:32:59.570000 |
56,895 | 93,489 | Proving SQL query equivalency | How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set. As I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned and comparing the results, ensuring there was no ... | The best you can do is compare the 2 query outputs based on a given set of inputs looking for any differences. To say that they will always return the same results for all inputs really depends on the data. For Oracle one of the better if not best approaches (very efficient) is here ( Ctrl + F Comparing the Contents of... | Proving SQL query equivalency How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set. As I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned and comparing the r... | TITLE:
Proving SQL query equivalency
QUESTION:
How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set. As I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned a... | [
"sql",
"oracle"
] | 23 | 13 | 18,397 | 9 | 0 | 2008-09-11T15:32:14.550000 | 2008-09-18T15:16:50.300000 |
56,905 | 2,561,528 | ASP.Net AJAX JavaScript Serialization Error | Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code: Default.aspx MainScript.js function getObject(){ return new Array(); }
function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); }
function function... | This problem happens because Sys.Serialization.JavaScriptSerializer can't serialize objects from others frames, but only those objects which where instantiated in the current window (which calls serialize() method). The only workaround which is known for me it's making clone of the object from other frame before callin... | ASP.Net AJAX JavaScript Serialization Error Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code: Default.aspx MainScript.js function getObject(){ return new Array(); }
function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.se... | TITLE:
ASP.Net AJAX JavaScript Serialization Error
QUESTION:
Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code: Default.aspx MainScript.js function getObject(){ return new Array(); }
function function1(obj){ var s=Sys.Serialization.JavaS... | [
"asp.net",
"javascript",
"asp.net-ajax"
] | 1 | 2 | 2,833 | 3 | 0 | 2008-09-11T15:35:25.447000 | 2010-04-01T15:26:21.493000 |
56,906 | 56,935 | Opening a file stored in a database in .NET | I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)? | Depends on what's reading it. If it's Word, you'll probably have to serialize to a file, but if it's a function or library that can take an IO.Stream then you could wrap a new MemoryStream around the byte array and pass that. | Opening a file stored in a database in .NET I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)? | TITLE:
Opening a file stored in a database in .NET
QUESTION:
I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the datab... | [
"sql-server",
"vb.net"
] | 3 | 3 | 604 | 2 | 0 | 2008-09-11T15:35:31.127000 | 2008-09-11T15:41:25.510000 |
56,908 | 57,079 | C#: Create a virtual drive in Computer | Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it? It probably does something like: override OnRead(object sender, Event e) { ShowFilesFromAmazon(); } Are there any API:s for this? Maybe to write to an XML-file or a database, instead of a real drive. The D... | You can use the Dokan library to create a virtual drive. There is a.Net wrapper for interfacing with C#. | C#: Create a virtual drive in Computer Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it? It probably does something like: override OnRead(object sender, Event e) { ShowFilesFromAmazon(); } Are there any API:s for this? Maybe to write to an XML-file or a d... | TITLE:
C#: Create a virtual drive in Computer
QUESTION:
Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it? It probably does something like: override OnRead(object sender, Event e) { ShowFilesFromAmazon(); } Are there any API:s for this? Maybe to write to ... | [
"c#",
".net",
"virtualization",
"storage",
"virtual-drive"
] | 36 | 7 | 29,132 | 4 | 0 | 2008-09-11T15:35:34.293000 | 2008-09-11T16:48:47.453000 |
56,913 | 57,359 | Batch renaming of files with international chars on Windows XP | I have a whole bunch of files with filenames using our lovely Swedish letters å å and ö. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causing me trouble is that I'd like to replace å with a, ö with o and so on. This is c... | You can use this code (Python) Rename international files # -*- coding: cp1252 -*-
import os, shutil
base_dir = "g:\\awk\\" # Base Directory (includes subdirectories) char_table_1 = "áéíóúñ" char_table_2 = "aeioun"
adirs = os.walk (base_dir)
for adir in adirs: dir = adir[0] + "\\" # Directory # print "\nDir: " + di... | Batch renaming of files with international chars on Windows XP I have a whole bunch of files with filenames using our lovely Swedish letters å å and ö. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causing me trouble is t... | TITLE:
Batch renaming of files with international chars on Windows XP
QUESTION:
I have a whole bunch of files with filenames using our lovely Swedish letters å å and ö. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causi... | [
"windows",
"file",
"batch-file",
"utf-8",
"rename"
] | 1 | 1 | 3,562 | 4 | 0 | 2008-09-11T15:36:40.450000 | 2008-09-11T19:07:28.650000 |
56,923 | 56,927 | How do I script a password change for a SQL server login? | Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script. | ALTER LOGIN http://msdn.microsoft.com/en-us/library/ms189828.aspx | How do I script a password change for a SQL server login? Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script. | TITLE:
How do I script a password change for a SQL server login?
QUESTION:
Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script.
ANSWER:
ALTER LOGIN http://msdn.microsoft.com/en-us/library/ms189828.aspx | [
"sql",
"sql-server",
"sql-server-2005"
] | 26 | 11 | 51,602 | 3 | 0 | 2008-09-11T15:38:26.330000 | 2008-09-11T15:39:21.897000 |
56,943 | 63,063 | Yes/No dialog in Java ME | I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey. if (YesNoDialog.ask("Are you sure?") == true) { // yes was chosen } else { // no was chosen } | You need an Alert: An alert is a screen that shows data to the user and waits for a certain period of time before proceeding to the next Displayable. An alert can contain a text string and an image. The intended use of Alert is to inform the user about errors and other exceptional conditions. With 2 commands ("Yes"/"No... | Yes/No dialog in Java ME I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey. if (YesNoDialog.ask("Are you sure?") == true) { // yes was chosen } else { // no was chosen } | TITLE:
Yes/No dialog in Java ME
QUESTION:
I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey. if (YesNoDialog.ask("Are you sure?") == true) { // yes was chosen } else { // no was chosen }
ANSWER:
You need an Alert: An alert is a scree... | [
"java",
"user-interface",
"java-me",
"midlet"
] | 5 | 7 | 5,496 | 2 | 0 | 2008-09-11T15:43:04.307000 | 2008-09-15T13:51:59.657000 |
56,944 | 373,685 | secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID | Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the DotNetOpenId library for authentication. Is it safe for me to permit/deny administrative functions on the site by simply comparing the current session's "ClaimedID" (as r... | Jarrett makes some good comments about using database tables. Just to answer another one of your questions, no, it's not a confidentiality thing to put your OpenID in your code generally. If setting up roles seems overkill for your site, a simple equality check against your ClaimedIdentifier is just perfect. | secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the DotNetOpenId library for authentication. Is it safe for me to permit/deny administ... | TITLE:
secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID
QUESTION:
Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the DotNetOpenId library for authentication. Is it safe for me to pe... | [
"asp.net",
"openid",
"dotnetopenauth"
] | 3 | 2 | 638 | 2 | 0 | 2008-09-11T15:43:07.970000 | 2008-12-17T04:43:37.227000 |
56,947 | 57,031 | How is floating point stored? When does it matter? | In follow up to this question, it appears that some numbers cannot be represented by floating point at all, and instead are approximated. How are floating point numbers stored? Is there a common standard for the different sizes? What kind of gotchas do I need to watch out for if I use floating point? Are they cross-lan... | As mentioned, the Wikipedia article on IEEE 754 does a good job of showing how floating point numbers are stored on most systems. Now, here are some common gotchas: The biggest is that you almost never want to compare two floating point numbers for equality (or inequality). You'll want to use greater than/less than com... | How is floating point stored? When does it matter? In follow up to this question, it appears that some numbers cannot be represented by floating point at all, and instead are approximated. How are floating point numbers stored? Is there a common standard for the different sizes? What kind of gotchas do I need to watch ... | TITLE:
How is floating point stored? When does it matter?
QUESTION:
In follow up to this question, it appears that some numbers cannot be represented by floating point at all, and instead are approximated. How are floating point numbers stored? Is there a common standard for the different sizes? What kind of gotchas d... | [
"floating-point",
"rounding-error"
] | 38 | 28 | 23,970 | 9 | 0 | 2008-09-11T15:45:13.583000 | 2008-09-11T16:20:27.553000 |
56,949 | 56,967 | Race Condition Analysers for .NET | I've seen there are some race condition analysis tools for C++, C and Java. Anyone know of any static analysis tools that do the same for.NET? | I haven't ever used this tool, but it looks like TypeMock has a tool called Racer that can handle this. Roy Osherove blogged about it here. Another post with a better preview is here. | Race Condition Analysers for .NET I've seen there are some race condition analysis tools for C++, C and Java. Anyone know of any static analysis tools that do the same for.NET? | TITLE:
Race Condition Analysers for .NET
QUESTION:
I've seen there are some race condition analysis tools for C++, C and Java. Anyone know of any static analysis tools that do the same for.NET?
ANSWER:
I haven't ever used this tool, but it looks like TypeMock has a tool called Racer that can handle this. Roy Osherove... | [
".net",
"static-analysis",
"race-condition"
] | 3 | 4 | 335 | 1 | 0 | 2008-09-11T15:46:53.017000 | 2008-09-11T15:55:09.860000 |
56,950 | 56,972 | Right Align Numeric Data in SQL Server | We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example: Value ---------- 143.55 3532.13 1.75 How would you go about that? A good solution ought to be clear and compact, but remember there... | The STR function has an optional length argument as well as a number-of-decimals one. SELECT STR(123.45, 6, 1)
------ 123.5
(1 row(s) affected) | Right Align Numeric Data in SQL Server We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example: Value ---------- 143.55 3532.13 1.75 How would you go about that? A good solution ought to b... | TITLE:
Right Align Numeric Data in SQL Server
QUESTION:
We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example: Value ---------- 143.55 3532.13 1.75 How would you go about that? A good s... | [
"sql-server",
"t-sql"
] | 17 | 17 | 40,746 | 3 | 0 | 2008-09-11T15:47:03.860000 | 2008-09-11T15:57:41.853000 |
56,951 | 57,555 | Is it possible to programmatically push files to a wireless SD card? | Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way... | The eye-fi card relies on image files being written to a specific directory in the card before they'll transfer them. Beyond that it works exactly like a memory card. Write a file to it as if you're writing a regular memory card, and as long as it's a jpg image file of reasonable size, and in an appropriate directory (... | Is it possible to programmatically push files to a wireless SD card? Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way... | TITLE:
Is it possible to programmatically push files to a wireless SD card?
QUESTION:
Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way...
ANSWER:
The eye-fi card relies on image files... | [
"applescript",
"wifi"
] | 2 | 2 | 421 | 3 | 0 | 2008-09-11T15:47:40.283000 | 2008-09-11T20:35:50.060000 |
56,974 | 56,987 | Keyword for the outer class from an anonymous inner class | In the following snippet: public class a { public void otherMethod(){} public void doStuff(String str, InnerClass b){} public void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ); } } Is there a keyword to refer to the outer class from the inner class? Basically what I want t... | In general you use OuterClassName.this to refer to the enclosing instance of the outer class. In your example that would be a.this.otherMethod() | Keyword for the outer class from an anonymous inner class In the following snippet: public class a { public void otherMethod(){} public void doStuff(String str, InnerClass b){} public void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ); } } Is there a keyword to refer to the... | TITLE:
Keyword for the outer class from an anonymous inner class
QUESTION:
In the following snippet: public class a { public void otherMethod(){} public void doStuff(String str, InnerClass b){} public void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ); } } Is there a keywo... | [
"java",
"anonymous-inner-class"
] | 216 | 368 | 88,877 | 2 | 0 | 2008-09-11T15:58:55.030000 | 2008-09-11T16:03:27.127000 |
56,975 | 56,988 | What is the best way to send large batches of emails in ASP.NET? | I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it default... | You could send the mail asynchronous. That way the timeout should not interrupt your sending. This article should help you get started with that: Sending Emails Asynchronously in C#. There is another approach here: http://www.vikramlakhotia.com/Sending_Email_asynchronously_in_AspNet_20.aspx And off course there are sev... | What is the best way to send large batches of emails in ASP.NET? I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to overri... | TITLE:
What is the best way to send large batches of emails in ASP.NET?
QUESTION:
I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host... | [
"asp.net",
"email",
"batch-file"
] | 5 | 6 | 2,938 | 2 | 0 | 2008-09-11T15:59:06.683000 | 2008-09-11T16:04:23.257000 |
56,999 | 57,032 | How to access a PCMCIA modem's serial number? | A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Does that imply that the serial/phone number of the modem could be... | Sometimes you can get the modem's serial number using the AT command set. To see this in action, go to your control panel and open up Phone and Modem Options. Select the Modems tab, select the modem you're interested in, and choose Properties. In the modem window, select the Diagnostics tab, and press the Query Modem b... | How to access a PCMCIA modem's serial number? A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Does that imply that... | TITLE:
How to access a PCMCIA modem's serial number?
QUESTION:
A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Do... | [
"hardware",
"modem"
] | 1 | 1 | 1,375 | 2 | 0 | 2008-09-11T16:07:32.547000 | 2008-09-11T16:20:27.897000 |
57,002 | 57,006 | CSS to make an empty cell's border appear? | What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically. | If I recall, the cell dosn't exist in some IE's unless it's filled with something... If you can put a (non-breaking space) to fill the void, that will usually work. Or do you require a pure CSS solution? Apparently, IE8 shows the cells by default, and you have to hide it with empty-cells:hide But it doesn't work at all... | CSS to make an empty cell's border appear? What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically. | TITLE:
CSS to make an empty cell's border appear?
QUESTION:
What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically.
ANSWER:
If I recall, the cell dosn't exist in some IE's unless it's filled with something... If you can put a (non-breaking space) to fill the void, that will ... | [
"css"
] | 73 | 59 | 78,287 | 15 | 0 | 2008-09-11T16:08:06.913000 | 2008-09-11T16:09:23.477000 |
57,004 | 57,015 | How can I find what search terms (if any) brought a user to my site? | I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself. | You can use the "referer" part of the request that the user sent to figure out what he searched for. Example from Google: http://www.google.no/search?q=stack%20overflow So you must search the string (in ASP(.NET) this can be found be looking in Request.Referer ) for "q=" and then URLDecode the contents. Also, you shoul... | How can I find what search terms (if any) brought a user to my site? I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself. | TITLE:
How can I find what search terms (if any) brought a user to my site?
QUESTION:
I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.... | [
"search-engine",
"analytics"
] | 3 | 7 | 710 | 2 | 0 | 2008-09-11T16:08:44.710000 | 2008-09-11T16:13:53.653000 |
57,007 | 57,114 | Getting Information From Master File Table on Windows | I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might not be able to use the tools provided by the company for... | There is a documented API for getting info on file positions on disk since Windows 2000. Look for DeviceIoControl function with FSCTL_GET_RETRIEVAL_POINTERS control code on MSDN: http://msdn.microsoft.com/en-us/library/aa364572(VS.85).aspx The API has been provided for writing custom disk defragmenters and consists of ... | Getting Information From Master File Table on Windows I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might no... | TITLE:
Getting Information From Master File Table on Windows
QUESTION:
I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal c... | [
"windows",
"filesystems"
] | 2 | 2 | 1,100 | 1 | 0 | 2008-09-11T16:09:57.907000 | 2008-09-11T17:16:38.933000 |
57,010 | 57,410 | Best way to reduce sequences in an array of strings | This question is about removing sequences from an array, not duplicates in the strict sense. Consider this sequence of elements in an array; [0] a [1] a [2] b [3] c [4] c [5] a [6] c [7] d [8] c [9] d In this example I want to obtain the following... [0] a [1] b [2] c [3] a [4] c [5] d Notice that duplicate elements ar... | Here's C# app i wrote that solves this problem. takes aabccacdcd outputs abcacd Probably looks pretty messy, took me a bit to get my head around the dynamic pattern length bit. class Program { private static List values; private const int MAX_PATTERN_LENGTH = 4;
static void Main(string[] args) { values = new List (); ... | Best way to reduce sequences in an array of strings This question is about removing sequences from an array, not duplicates in the strict sense. Consider this sequence of elements in an array; [0] a [1] a [2] b [3] c [4] c [5] a [6] c [7] d [8] c [9] d In this example I want to obtain the following... [0] a [1] b [2] c... | TITLE:
Best way to reduce sequences in an array of strings
QUESTION:
This question is about removing sequences from an array, not duplicates in the strict sense. Consider this sequence of elements in an array; [0] a [1] a [2] b [3] c [4] c [5] a [6] c [7] d [8] c [9] d In this example I want to obtain the following...... | [
"c#",
".net",
"algorithm"
] | 7 | 2 | 1,067 | 4 | 0 | 2008-09-11T16:10:38.297000 | 2008-09-11T19:30:46.020000 |
57,019 | 57,025 | Where should cross-platform apps keep their data? | I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settings.... | Each platform has its own API for finding the user's home folder, or documents folder, or preferences folder. Windows: SHGetFolderPath() or SHGetKnownFolderPath() Mac OS X and iPhone OS: NSSearchPathForDirectoriesInDomains() Unix: $HOME environment variable Don't hardcode specific paths or just tack a prefix and suffix... | Where should cross-platform apps keep their data? I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security mo... | TITLE:
Where should cross-platform apps keep their data?
QUESTION:
I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new... | [
"cross-platform"
] | 16 | 12 | 2,017 | 9 | 0 | 2008-09-11T16:15:21.093000 | 2008-09-11T16:17:35.797000 |
57,034 | 57,047 | jQuery and Java applets | I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that setup is not under discussion. I started out ... | For the first issue, how about trying alert( $("#applet-id")[0].foo() ); For the second issue here is a thread with a possible workaround. Quoting the workaround // Prevent memory leaks in IE // And prevent errors on refresh with events like mouseover in other browsers // Window isn't included so as not to unbind exist... | jQuery and Java applets I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that setup is not under di... | TITLE:
jQuery and Java applets
QUESTION:
I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that set... | [
"java",
"javascript",
"jquery",
"applet"
] | 10 | 12 | 13,997 | 1 | 0 | 2008-09-11T16:21:03.467000 | 2008-09-11T16:31:39.260000 |
57,053 | 355,649 | What, if any, checksum is used for TNT.com tracking numbers? | I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment nu... | OK, so it's three months since you asked but I stumbled across this as I'm writing a similar piece of software. As far as we know TNT uses the S10 tracking number system. Which means that their numbers will be of the type AA#########AA. With the last two letters corresponding to a ISO/IATA country code. Having said tha... | What, if any, checksum is used for TNT.com tracking numbers? I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a ... | TITLE:
What, if any, checksum is used for TNT.com tracking numbers?
QUESTION:
I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify... | [
"algorithm",
"validation",
"checksum"
] | 2 | 3 | 1,594 | 4 | 0 | 2008-09-11T16:36:12.697000 | 2008-12-10T10:41:10.597000 |
57,054 | 57,166 | How to solve call ambiguity between Generic.IList<T>.this[] and IList.this[]? | I've got a collection that implements an interface that extends both IList and List. public Interface IMySpecialCollection: IList, IList {... } That means I have two versions of the indexer. I wish the generic implementation to be used, so I implement that one normally: public MyObject this[int index] {.... } I only ne... | You can't do this with public interface IMySpecialCollection: IList, IList {... } But you can do what you want with a class, you will need to make the implementations for one of the interfaces explicit. In my example I made IList explicit. public class MySpecialCollection: IList, IList {... } IList myspecialcollection ... | How to solve call ambiguity between Generic.IList<T>.this[] and IList.this[]? I've got a collection that implements an interface that extends both IList and List. public Interface IMySpecialCollection: IList, IList {... } That means I have two versions of the indexer. I wish the generic implementation to be used, so I ... | TITLE:
How to solve call ambiguity between Generic.IList<T>.this[] and IList.this[]?
QUESTION:
I've got a collection that implements an interface that extends both IList and List. public Interface IMySpecialCollection: IList, IList {... } That means I have two versions of the indexer. I wish the generic implementation... | [
".net",
"generics",
"interface",
"explicit"
] | 7 | 3 | 2,987 | 5 | 0 | 2008-09-11T16:36:20.497000 | 2008-09-11T17:41:12.837000 |
57,068 | 57,081 | Where can I find sample databases with common formatted data that I can use in multiple database engines? | Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? I know that the Canadian Department of Environment has historical weather data that you can download. However, it's not in a... | The datawrangling blog posted a nice list a while back: http://www.datawrangling.com/some-datasets-available-on-the-web Includes financial, government data (labor, housing, etc.), and too many more to list here. | Where can I find sample databases with common formatted data that I can use in multiple database engines? Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? I know that the Ca... | TITLE:
Where can I find sample databases with common formatted data that I can use in multiple database engines?
QUESTION:
Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? ... | [
"database",
"sample"
] | 69 | 31 | 101,709 | 12 | 0 | 2008-09-11T16:43:10.790000 | 2008-09-11T16:51:04.017000 |
57,075 | 595,309 | How do I assign a keyboard shortcut to a VBA macro in Outlook 2007? | How can I assign a keyboard shortcut to a VBA macro in Outlook 2007? I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of Alt + {menu key} + {tool key}. What if I want to assign it to Alt + F12 or something like that? The Visual Basic... | The article Do-It-Yourself IntelliSense from MSDN provides excellent information about key bindings in VBA. | How do I assign a keyboard shortcut to a VBA macro in Outlook 2007? How can I assign a keyboard shortcut to a VBA macro in Outlook 2007? I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of Alt + {menu key} + {tool key}. What if I wan... | TITLE:
How do I assign a keyboard shortcut to a VBA macro in Outlook 2007?
QUESTION:
How can I assign a keyboard shortcut to a VBA macro in Outlook 2007? I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of Alt + {menu key} + {tool k... | [
"excel",
"outlook",
"keyboard-shortcuts",
"vba"
] | 5 | 3 | 18,650 | 2 | 0 | 2008-09-11T16:45:38.430000 | 2009-02-27T15:50:55.983000 |
57,094 | 57,105 | How can I programmatically run the ASP.Net Development Server using C#? | I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS. | From what I know, you can fire up the dev server from the command prompt with the following path/syntax: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Webdev.WebServer.exe /port:[PORT NUMBER] /path: [PATH TO ROOT]...so I could imagine you could easily use Process.Start() to launch the particulars you need through some ... | How can I programmatically run the ASP.Net Development Server using C#? I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS. | TITLE:
How can I programmatically run the ASP.Net Development Server using C#?
QUESTION:
I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS.
ANSWER:
From what I know, you can fire up the dev se... | [
"c#",
"asp.net"
] | 13 | 8 | 6,038 | 4 | 0 | 2008-09-11T17:00:47.927000 | 2008-09-11T17:09:06.313000 |
57,104 | 57,608 | Rails Binary Stream support | I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functi... | +1 for attachment_fu I use attachment_fu in one of my apps and MUST store files in the DB (for annoying reasons which are outside the scope of this convo). The (one?) tricky thing dealing w/BLOB's I've found is that you need a separate code path to send the data to the user -- you can't simply in-line a path on the fil... | Rails Binary Stream support I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, di... | TITLE:
Rails Binary Stream support
QUESTION:
I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and ... | [
"ruby-on-rails",
"blob"
] | 16 | 8 | 12,493 | 5 | 0 | 2008-09-11T17:08:27.143000 | 2008-09-11T20:53:59.377000 |
57,124 | 57,130 | How to detect true Windows version? | I know I can call the GetVersionEx Win32 API function to retrieve the Windows version. In most cases, the returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version en... | The best approach I know is to check if specific API is exported from some DLL. Each new Windows version adds new functions and by checking the existance of those functions one can tell which OS the application is running on. For example, Vista exports GetLocaleInfoEx from kernel32.dll while previous Windowses didn't. ... | How to detect true Windows version? I know I can call the GetVersionEx Win32 API function to retrieve the Windows version. In most cases, the returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting... | TITLE:
How to detect true Windows version?
QUESTION:
I know I can call the GetVersionEx Win32 API function to retrieve the Windows version. In most cases, the returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then GetVersionEx ... | [
"windows",
"delphi",
"winapi",
"version"
] | 43 | 28 | 24,416 | 10 | 0 | 2008-09-11T17:21:31.370000 | 2008-09-11T17:25:30.597000 |
57,137 | 57,148 | 403 Forbidden error using Subversion | I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on? | Answering my own question: Apparently my SVN URL had the wrong case! A Google search turned up an article (no longer available online) that explained what was going on. My URL was of the form http://svn.foobar.com/foobar but the actual repository was called http://svn.foobar.com/fooBar. I use TortoiseSVN, so the fix wa... | 403 Forbidden error using Subversion I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on? | TITLE:
403 Forbidden error using Subversion
QUESTION:
I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on?
ANSWER:... | [
"svn"
] | 45 | 54 | 102,214 | 14 | 0 | 2008-09-11T17:31:11.410000 | 2008-09-11T17:34:13.697000 |
57,140 | 57,203 | Is there any disadvantage to returning this instead of void? | Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a fluent-interface-like style and I can't really think of any disadvantages since... | I know in Java they're actually thinking about making this standard behaviour for void methods. If you do that you don't need the extra syntactic sugar. The only downside I can think of is performance. But that's easilly measured. I'll get back to you with the results in a few minutes:-) Edit: Returning a reference is ... | Is there any disadvantage to returning this instead of void? Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a fluent-interface-l... | TITLE:
Is there any disadvantage to returning this instead of void?
QUESTION:
Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a ... | [
".net",
"fluent-interface"
] | 12 | 10 | 1,266 | 7 | 0 | 2008-09-11T17:32:51.390000 | 2008-09-11T17:54:19.107000 |
57,145 | 57,185 | Using Small (1-10 Items) Instance-Level Collections in Java | While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc). class Foo { ArrayList bars ... | The ArrayList class in Java has only two data members, a reference to an Object[] array and a size—which you need anyway if you don't use an ArrayList. So the only advantage to not using an ArrayList is saving one object allocation, which is unlikely ever to be a big deal. If you're creating and disposing of many, many... | Using Small (1-10 Items) Instance-Level Collections in Java While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic coll... | TITLE:
Using Small (1-10 Items) Instance-Level Collections in Java
QUESTION:
While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt ... | [
"java",
"collections"
] | 6 | 10 | 633 | 4 | 0 | 2008-09-11T17:33:41.230000 | 2008-09-11T17:48:59.527000 |
57,154 | 63,602 | Problems with migrating Cardspace cards between computers | Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support. I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and a filename... | It should work; however if you have 3.5SP1 on one machine and 3.5 or less on another there was an (unannounced) breaking change with the code to generate the unique ID from the card; which may explain why it doesn't work. I would try sending a test transaction to the SharpSTS test page with only the PPID as the claim, ... | Problems with migrating Cardspace cards between computers Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support. I later wanted to access Stackoverflow from another machine so I cho... | TITLE:
Problems with migrating Cardspace cards between computers
QUESTION:
Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support. I later wanted to access Stackoverflow from anothe... | [
"openid",
"cardspace"
] | 3 | 3 | 182 | 2 | 0 | 2008-09-11T17:36:33.190000 | 2008-09-15T14:52:19.557000 |
57,168 | 57,188 | How to copy a row from one SQL Server table to another | I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility). | As long as there are no identity columns you can just INSERT INTO TableNew SELECT * FROM TableOld WHERE [Conditions] | How to copy a row from one SQL Server table to another I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility). | TITLE:
How to copy a row from one SQL Server table to another
QUESTION:
I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility).
ANSWER:
As long as there are no identity colum... | [
"sql",
"sql-server"
] | 111 | 144 | 282,936 | 6 | 0 | 2008-09-11T17:42:11.663000 | 2008-09-11T17:49:36.187000 |
57,179 | 400,816 | Oracle from .Net with a 64 bit client | Has anyone had any luck of using Oracle from.Net on a 64 bit machine, and using the UDT capabilities of Oracle? I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs. Thanks Nick [Edit] I've posted an answer below. The latest (as of December 2008) release is 11.1.0.7. This has suppo... | You need to use 11.1.0.7 release. This has UDT support and works with 32 and 64 bit. | Oracle from .Net with a 64 bit client Has anyone had any luck of using Oracle from.Net on a 64 bit machine, and using the UDT capabilities of Oracle? I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs. Thanks Nick [Edit] I've posted an answer below. The latest (as of December 200... | TITLE:
Oracle from .Net with a 64 bit client
QUESTION:
Has anyone had any luck of using Oracle from.Net on a 64 bit machine, and using the UDT capabilities of Oracle? I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs. Thanks Nick [Edit] I've posted an answer below. The latest (... | [
".net",
"oracle",
"64-bit"
] | 5 | 2 | 1,683 | 3 | 0 | 2008-09-11T17:46:58.890000 | 2008-12-30T16:52:24.530000 |
57,183 | 57,218 | Get CVS history for a particular user | How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient. | cvs history -u username gives a history of changes the user has made | Get CVS history for a particular user How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient. | TITLE:
Get CVS history for a particular user
QUESTION:
How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.
ANSWER:
cvs history -u username gives a histo... | [
"cvs",
"tortoisecvs"
] | 9 | 10 | 9,484 | 3 | 0 | 2008-09-11T17:48:18.637000 | 2008-09-11T18:00:06.597000 |
57,194 | 91,422 | FTP Timeout on NLST when directory is empty | EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone can point me ... | I tried this in WebMethods IS Version 6.5 Updates WmPRT_6-5-1_SP1, IS_6-5_SP3. It worked perfectly first time. I turned on debugging on the FTP server (Debian's default ftpd). WebMethods' NLST honours the active/passive parameter passed to it. There's nothing special about the NLST command, nor its correct behaviour wi... | FTP Timeout on NLST when directory is empty EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specifi... | TITLE:
FTP Timeout on NLST when directory is empty
QUESTION:
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem t... | [
"java",
"ftp",
"webmethods"
] | 1 | 2 | 6,728 | 5 | 0 | 2008-09-11T17:51:19.817000 | 2008-09-18T10:15:10.993000 |
57,202 | 57,306 | How do I put a link to a webpage in a JScript Alert dialog box? | I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. How can I make the dialog box show something like this: There was an error. Go to this page to fix it. wwww.TheWebPageToFix.com Thanks. | You could try asking them if they wish to visit via window.prompt: if(window.prompt('Do you wish to visit the following website?','http://www.google.ca')) location.href='http://www.google.ca/'; Also, Internet Explorer supports modal dialogs so you could try showing one of those: if (window.showModalDialog) window.showM... | How do I put a link to a webpage in a JScript Alert dialog box? I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. How can I make the dialog box show something like this: There was an error. Go to t... | TITLE:
How do I put a link to a webpage in a JScript Alert dialog box?
QUESTION:
I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. How can I make the dialog box show something like this: There was... | [
"javascript",
"alert"
] | 4 | 5 | 20,052 | 7 | 0 | 2008-09-11T17:54:09.013000 | 2008-09-11T18:40:03.130000 |
57,208 | 63,942 | ToolStrips in TabPages frequently disappear from Windows Forms designer | I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property back... | I may have found a workaround for this. My ToolStrip was placed directly on the TabPage, docked to Top. However, I found a thread on Microsoft Connect that described the same problem when the ToolStrip was in a ToolStripContainer on the TabPage. That problem was observed in a release candidate of VS2005, but supposedly... | ToolStrips in TabPages frequently disappear from Windows Forms designer I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear i... | TITLE:
ToolStrips in TabPages frequently disappear from Windows Forms designer
QUESTION:
I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the tools... | [
".net",
"vb.net",
"visual-studio",
"winforms"
] | 5 | 5 | 3,662 | 2 | 0 | 2008-09-11T17:57:50.470000 | 2008-09-15T15:28:27.537000 |
57,238 | 57,246 | Find Missing Javascript Includes in Website | Say I have several JavaScript includes in a page: Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas? | If you get the Firebug firefox plugin and enable the consoles it should tell you when there are errors retrieving resources in the console. | Find Missing Javascript Includes in Website Say I have several JavaScript includes in a page: Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas? | TITLE:
Find Missing Javascript Includes in Website
QUESTION:
Say I have several JavaScript includes in a page: Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas?
ANSWER:
If you get the Firebug... | [
"javascript",
"include"
] | 2 | 9 | 2,186 | 6 | 0 | 2008-09-11T18:09:39.320000 | 2008-09-11T18:12:49.233000 |
57,243 | 57,264 | Finding missing emails in SQL Server | I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE ... | We had a very similar problem recently where the subquery was returning null values sometimes. Then, the in statement treats null in a weird way, I think always matching the value, so if you change your query to: select j.email from jobseeker j where j.email not in (select email from aspnet_Membership where email is no... | Finding missing emails in SQL Server I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Members... | TITLE:
Finding missing emails in SQL Server
QUESTION:
I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. ... | [
"sql",
"join",
"anti-join"
] | 0 | 3 | 352 | 4 | 0 | 2008-09-11T18:11:28.770000 | 2008-09-11T18:20:05.927000 |
57,249 | 57,592 | Getting EPG info from DVB-T | I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data? | tv_grab_dvb can do this. See the subversion repository for sources. tv_grab_dvb is made to work with the stream grabbed from the DVB-T card using dvbtools on Linux, but it may be portable to other platforms - I think it just works with the raw data from the stream. | Getting EPG info from DVB-T I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data? | TITLE:
Getting EPG info from DVB-T
QUESTION:
I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data?
ANSWER:
tv_grab_dvb can do this. See the subversion repository for sources. tv_grab_dvb is made to work with the stream grabbed from... | [
"epg"
] | 7 | 3 | 6,214 | 2 | 0 | 2008-09-11T18:13:31.713000 | 2008-09-11T20:48:50.543000 |
57,285 | 57,336 | SMTP Mail Timeout Issue | When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Alright, so I'll display a message indicatin... | Well, depending on your platform, if you can just hand off your mail to a local MTA, it should handle the retries and such. Your program can just queue the mail and move on, not worry about dealing with timeouts and graylists etc. If the message still can't be delivered, you could always try resending it (via a passwor... | SMTP Mail Timeout Issue When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Alright, so I'll dis... | TITLE:
SMTP Mail Timeout Issue
QUESTION:
When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Al... | [
".net",
"asp.net",
"email",
"smtp"
] | 0 | 1 | 5,938 | 4 | 0 | 2008-09-11T18:29:52.797000 | 2008-09-11T18:56:16.477000 |
57,287 | 57,298 | How to create an ASP.NET RSS feed | How do I create an RSS feed in ASP.NET? Is there anything built in to support it? If not, what third-party tools are available? I'm thinking Webforms, not MVC, though I suppose since this isn't a traditional page the difference may be minimal. | For built-in, there's nothing stopping you from using XmlDocument or XDocument (3.5) to build up the required XML for RSS. It's more work than it's worth though. I use the Argotic Syndication Framework and serve the feeds through Generic Handlers (.ashx) with the content type set to text/xml. The RSSToolkit is also nic... | How to create an ASP.NET RSS feed How do I create an RSS feed in ASP.NET? Is there anything built in to support it? If not, what third-party tools are available? I'm thinking Webforms, not MVC, though I suppose since this isn't a traditional page the difference may be minimal. | TITLE:
How to create an ASP.NET RSS feed
QUESTION:
How do I create an RSS feed in ASP.NET? Is there anything built in to support it? If not, what third-party tools are available? I'm thinking Webforms, not MVC, though I suppose since this isn't a traditional page the difference may be minimal.
ANSWER:
For built-in, t... | [
"asp.net",
".net-2.0",
"webforms",
"rss"
] | 16 | 6 | 3,234 | 6 | 0 | 2008-09-11T18:30:47.273000 | 2008-09-11T18:35:19.570000 |
57,291 | 881,612 | Is there a simpler way to deploy to WebSphere? | I have seen this question about deploying to WebSphere using the WAS ant tasks. Is there a simpler way to do this? In the past I have deployed to Tomcat by dropping a war file into a directory. I was hoping there would be a similar mechanism for WebSphere that doesn't involve calling the IBM libraries or rely on RAD to... | There is the concept of WebSphere Rapid Deployment. It's supposed to be the same experience as what you describe for Tomcat. | Is there a simpler way to deploy to WebSphere? I have seen this question about deploying to WebSphere using the WAS ant tasks. Is there a simpler way to do this? In the past I have deployed to Tomcat by dropping a war file into a directory. I was hoping there would be a similar mechanism for WebSphere that doesn't invo... | TITLE:
Is there a simpler way to deploy to WebSphere?
QUESTION:
I have seen this question about deploying to WebSphere using the WAS ant tasks. Is there a simpler way to do this? In the past I have deployed to Tomcat by dropping a war file into a directory. I was hoping there would be a similar mechanism for WebSphere... | [
"ant",
"jakarta-ee",
"websphere",
"jacl"
] | 10 | 3 | 3,415 | 4 | 0 | 2008-09-11T18:32:33.587000 | 2009-05-19T08:39:33.740000 |
57,322 | 57,443 | <asp:RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace | Is there an easy way of using the RegularExpressionValidator control while ignoring white space? I can use a custom validator control with Regex and IgnorePatternWhitespace, but it would be good to just have an option in the RegularExpressionValidator control. | Surround your regex with (?x: ) so "a b c" becomes "(?x:a b c) | <asp:RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace Is there an easy way of using the RegularExpressionValidator control while ignoring white space? I can use a custom validator control with Regex and IgnorePatternWhitespace, but it would be good to just have an option in the RegularExpressionValid... | TITLE:
<asp:RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace
QUESTION:
Is there an easy way of using the RegularExpressionValidator control while ignoring white space? I can use a custom validator control with Regex and IgnorePatternWhitespace, but it would be good to just have an option in the Regu... | [
"asp.net",
"regex"
] | 3 | 2 | 1,045 | 2 | 0 | 2008-09-11T18:47:54.453000 | 2008-09-11T19:44:26.020000 |
57,345 | 57,358 | How can I stop losing all my IDE window position when pressing the start debugging button? | I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options. When I press Start debugging all the possibly windows (watch 1 - 4), data sources, properties, registers (to be honest I have not even ever seen these windows before) appear in front of the code... | Visual Studio remembers 2 sets of window layouts, normal mode and debugging mode. My solution is to arrange my normal windows exactly like I want them, then start debugging an application and once again arrange all of the windows the way I want, usually making it as similar to my normal layout as possible, then stoppin... | How can I stop losing all my IDE window position when pressing the start debugging button? I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options. When I press Start debugging all the possibly windows (watch 1 - 4), data sources, properties, register... | TITLE:
How can I stop losing all my IDE window position when pressing the start debugging button?
QUESTION:
I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options. When I press Start debugging all the possibly windows (watch 1 - 4), data sources, pr... | [
"visual-studio",
"visual-studio-2008"
] | 3 | 5 | 605 | 3 | 0 | 2008-09-11T18:59:16.220000 | 2008-09-11T19:07:26.747000 |
57,350 | 57,363 | How do I get the current user's Local Settings folder path in C#? | I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path? | How about this, for example: String appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); I don't see an enum for just the Local Settings folder. http://web.archive.org/web/20080303235606/http://dotnetjunkies.com/WebLog/nenoloje/archive/2007/07/07/259223.aspx has a list with examples. | How do I get the current user's Local Settings folder path in C#? I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path? | TITLE:
How do I get the current user's Local Settings folder path in C#?
QUESTION:
I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path?
ANSWER:
How about this, for example: String appData = Environment.GetFolderPath(Environ... | [
"c#",
".net",
"windows"
] | 23 | 35 | 34,695 | 3 | 0 | 2008-09-11T19:03:01.797000 | 2008-09-11T19:08:43.373000 |
57,355 | 57,376 | Const Struct& | I'm having a little trouble figuring out exactly how const applies in a specific case. Here's the code I have: struct Widget { Widget():x(0), y(0), z(0){}
int x, y, z; };
struct WidgetHolder //Just a simple struct to hold four Widgets. { WidgetHolder(Widget a, Widget b, Widget c, Widget d): A(a), B(b), C(c), D(d){}
... | This compiles because although the WidgetHolder is a const object, this const-ness does not automatically apply to objects pointed to (referenced by) the WidgetHolder. Think of it at a machine level - if the WidgetHolder object itself were held in read-only memory, you could still write to things that were pointed to b... | Const Struct& I'm having a little trouble figuring out exactly how const applies in a specific case. Here's the code I have: struct Widget { Widget():x(0), y(0), z(0){}
int x, y, z; };
struct WidgetHolder //Just a simple struct to hold four Widgets. { WidgetHolder(Widget a, Widget b, Widget c, Widget d): A(a), B(b), ... | TITLE:
Const Struct&
QUESTION:
I'm having a little trouble figuring out exactly how const applies in a specific case. Here's the code I have: struct Widget { Widget():x(0), y(0), z(0){}
int x, y, z; };
struct WidgetHolder //Just a simple struct to hold four Widgets. { WidgetHolder(Widget a, Widget b, Widget c, Widge... | [
"c++",
"constants"
] | 8 | 2 | 1,241 | 6 | 0 | 2008-09-11T19:05:57.813000 | 2008-09-11T19:14:59.427000 |
57,380 | 57,407 | web page cache setexpires | Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user that previously used that machine. Yet w... | This question covers making sure a webpage is not cached. It seems you have to set several properties to ensure a web page is not cached across all browsers. | web page cache setexpires Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user that previousl... | TITLE:
web page cache setexpires
QUESTION:
Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a u... | [
"caching"
] | 2 | 3 | 3,303 | 3 | 0 | 2008-09-11T19:17:24.913000 | 2008-09-11T19:29:10.080000 |
57,382 | 209,637 | Obout controls in C# .Net | Is anyone using the Obout controls in C#.Net? How would you rate these controls, especially the Grid Control? | I was thoroughly impressed with them. Of all the other control sets out there (infragistics, telerik) this is the only (more than) respectable one I've worked with that was 1) free! and 2) lightweight!. The only caveat to Obout is I had trouble with merging some of these controls and some of the stock AJAX components. ... | Obout controls in C# .Net Is anyone using the Obout controls in C#.Net? How would you rate these controls, especially the Grid Control? | TITLE:
Obout controls in C# .Net
QUESTION:
Is anyone using the Obout controls in C#.Net? How would you rate these controls, especially the Grid Control?
ANSWER:
I was thoroughly impressed with them. Of all the other control sets out there (infragistics, telerik) this is the only (more than) respectable one I've worke... | [
"c#",
".net",
"obout"
] | 6 | 6 | 5,553 | 7 | 0 | 2008-09-11T19:17:49.920000 | 2008-10-16T18:06:44.073000 |
57,384 | 57,408 | Inter-convertability of asymmetric key containers (eg: X.509, PGP, OpenSSH) | Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? And--assuming the answer is yes--is it "security neutral" to keep one key pair in whatever format and convert into whichever container... | Yes and no: yes, the RSA keys embedded into certificates and privkeys are just numbers. You can extract them from the certificate and use them to build keys in other formats. This is commonly done to convert between different certificate formats. PGP has some support for X.509 for S/MIME, but no ability to use X.509 pr... | Inter-convertability of asymmetric key containers (eg: X.509, PGP, OpenSSH) Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? And--assuming the answer is yes--is it "security neutral" ... | TITLE:
Inter-convertability of asymmetric key containers (eg: X.509, PGP, OpenSSH)
QUESTION:
Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? And--assuming the answer is yes--is it "... | [
"security",
"ssh",
"cryptography",
"x509",
"gnupg"
] | 5 | 5 | 2,958 | 3 | 0 | 2008-09-11T19:18:21.010000 | 2008-09-11T19:29:23.747000 |
57,386 | 57,391 | Where should interfaces "physically live"? | I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate.Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Interfaces? | Put your domain objects and interfaces in a seperate "domain" assembly. This assembly should never reference anything but the core.net assemblies. This way you get a clean seperation from your domain/service model and your implementation. Edit: http://jeffreypalermo.com/blog/the-onion-architecture-part-1/ | Where should interfaces "physically live"? I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate.Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Inter... | TITLE:
Where should interfaces "physically live"?
QUESTION:
I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate.Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dep... | [
".net",
"architecture"
] | 5 | 7 | 482 | 4 | 0 | 2008-09-11T19:18:44.817000 | 2008-09-11T19:22:14.997000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.