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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50,571 | 727,993 | Windows XP support for Remote NDIS | I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it ove... | After doing my own research and testing, a single NDIS device works reasonably well. However, if you are at all needing to support multiple NDIS devices, you are out of luck. My system became extremely unstable and was essentially unusable. This was very reproducible. I would not recommend NDIS in any type of multiple-... | Windows XP support for Remote NDIS I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking o... | TITLE:
Windows XP support for Remote NDIS
QUESTION:
I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, ... | [
"windows",
"embedded",
"usb",
"drivers",
"ndis"
] | 1 | 0 | 3,019 | 4 | 0 | 2008-09-08T20:18:40.207000 | 2009-04-07T23:32:23.843000 |
50,579 | 50,593 | __doPostBack not rendering on postback | I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the.NET function is not rendered... any ideas? This is what I'm missing after the postback: | The first thing I would look at is whether you have any asp controls (such as linkbutton, comboboxes,that don't normally generate a submit but requre a postback) being displayed on the page. The __doPostback function will only be put into the page if ASP thinks that one of your controls requires it. If you aren't using... | __doPostBack not rendering on postback I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the.NET function is not rendered... any ideas? This is what I'm missing after the postback: | TITLE:
__doPostBack not rendering on postback
QUESTION:
I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the.NET function is not rendered... any ideas? This is what I'm missing after the postback:
ANSWER:
The first thing I ... | [
"asp.net",
"javascript",
"postback"
] | 3 | 3 | 3,950 | 2 | 0 | 2008-09-08T20:22:48.433000 | 2008-09-08T20:28:16.750000 |
50,585 | 1,839,458 | How do you capture mouse events in FF, over Shockwave Object | How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed. Update: fun... | You could also catch the mouse event within Director (That never fails) and then call your JS functions from there, using gotoNetPage "javascript:function('" & argument & "')" ej: on mouseDown me gotoNetPage "javascript:function('" & argument & "')" end The mouse move detection is a little bit trickier, as there is no ... | How do you capture mouse events in FF, over Shockwave Object How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. The script works on the document body of both IE and Moz, but mouse events do not fire when... | TITLE:
How do you capture mouse events in FF, over Shockwave Object
QUESTION:
How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. The script works on the document body of both IE and Moz, but mouse event... | [
"javascript",
"firefox",
"shockwave"
] | 1 | 2 | 1,813 | 2 | 0 | 2008-09-08T20:25:30.517000 | 2009-12-03T11:51:22.140000 |
50,605 | 50,632 | Signed to unsigned conversion in C - is it always safe? | Suppose I have the following C code. unsigned int u = 1234; int i = -5678;
unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (Safe, in the sense that even though result in this example will overflow to some huge positive number, I could cast it b... | Short Answer Your i will be converted to an unsigned integer by adding UINT_MAX + 1, then the addition will be carried out with the unsigned values, resulting in a large result (depending on the values of u and i ). Long Answer According to the C99 Standard: 6.3.1.8 Usual arithmetic conversions If both operands have th... | Signed to unsigned conversion in C - is it always safe? Suppose I have the following C code. unsigned int u = 1234; int i = -5678;
unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (Safe, in the sense that even though result in this example will ... | TITLE:
Signed to unsigned conversion in C - is it always safe?
QUESTION:
Suppose I have the following C code. unsigned int u = 1234; int i = -5678;
unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (Safe, in the sense that even though result in ... | [
"c",
"type-conversion"
] | 166 | 265 | 221,413 | 8 | 0 | 2008-09-08T20:36:45.107000 | 2008-09-08T20:44:26.790000 |
50,606 | 50,642 | Wordpress Category Template Question | I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well? So based on the answer so far, is there a way to accomplish this? I want to add text and images to all categories within ... | From the documentation it does not appear to be possible without actually adding several category template files (unless you custom program it). I run Wordpress, and I have only seen it accomplished category by category. http://codex.wordpress.org/Category_Templates | Wordpress Category Template Question I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well? So based on the answer so far, is there a way to accomplish this? I want to add text... | TITLE:
Wordpress Category Template Question
QUESTION:
I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well? So based on the answer so far, is there a way to accomplish this? ... | [
"wordpress",
"templates"
] | 0 | 2 | 330 | 1 | 0 | 2008-09-08T20:36:45.590000 | 2008-09-08T20:48:06.110000 |
50,618 | 50,627 | What is the point of the finally block? | Syntax aside, what is the difference between try { } catch() { } finally { x = 3; } and try { } catch() { }
x = 3; edit: in.NET 2.0? so try { throw something maybe x = 3 } catch (...) { x = 3 } is behaviourally equivalent? | Depends on the language as there might be some slight semantic differences, but the idea is that it will execute (almost) always, even if the code in the try block threw an exception. In the second example, if the code in the catch block returns or quits, the x = 3 will not be executed. In the first it will. In the.NET... | What is the point of the finally block? Syntax aside, what is the difference between try { } catch() { } finally { x = 3; } and try { } catch() { }
x = 3; edit: in.NET 2.0? so try { throw something maybe x = 3 } catch (...) { x = 3 } is behaviourally equivalent? | TITLE:
What is the point of the finally block?
QUESTION:
Syntax aside, what is the difference between try { } catch() { } finally { x = 3; } and try { } catch() { }
x = 3; edit: in.NET 2.0? so try { throw something maybe x = 3 } catch (...) { x = 3 } is behaviourally equivalent?
ANSWER:
Depends on the language as th... | [
".net",
"design-patterns",
"exception",
"try-catch-finally"
] | 35 | 36 | 5,967 | 16 | 0 | 2008-09-08T20:41:49.307000 | 2008-09-08T20:43:21.817000 |
50,702 | 823,467 | linq - how do you do a query for items in one query source that are not in another one? | If I have 2 query sources how do I find ones that are in one that are not in the other? example of join to find items in both: var results = from item1 in qs1.Items join item2 in qs2 on item1.field1 equals item2.field2 select item1; So what would the linq code be to return the items in qs1 that are not in qs2? | Darren Kopp's answer: var excluded = items1.Except(items2); is the best solution from a performance perspective. (NB: This true for at least regular LINQ, perhaps LINQ to SQL changes things as per Marco Russo's blog post. However, I'd imagine that in the "worst case" Darren Kopp's method will return at least the speed ... | linq - how do you do a query for items in one query source that are not in another one? If I have 2 query sources how do I find ones that are in one that are not in the other? example of join to find items in both: var results = from item1 in qs1.Items join item2 in qs2 on item1.field1 equals item2.field2 select item1;... | TITLE:
linq - how do you do a query for items in one query source that are not in another one?
QUESTION:
If I have 2 query sources how do I find ones that are in one that are not in the other? example of join to find items in both: var results = from item1 in qs1.Items join item2 in qs2 on item1.field1 equals item2.fi... | [
"c#",
".net",
"linq",
".net-3.5"
] | 4 | 3 | 1,265 | 5 | 0 | 2008-09-08T21:10:49.923000 | 2009-05-05T05:25:46.113000 |
50,723 | 50,752 | Rss feed for game programmer? | I was browsing this thread, which has good recommendation but a bit too general for me. So, if anyone has a collection of nice game programming feeds,please share them.:) (both general and specific topics are welcome) | Here are two I've used DirectX forum feed and Summary of interesting resources | Rss feed for game programmer? I was browsing this thread, which has good recommendation but a bit too general for me. So, if anyone has a collection of nice game programming feeds,please share them.:) (both general and specific topics are welcome) | TITLE:
Rss feed for game programmer?
QUESTION:
I was browsing this thread, which has good recommendation but a bit too general for me. So, if anyone has a collection of nice game programming feeds,please share them.:) (both general and specific topics are welcome)
ANSWER:
Here are two I've used DirectX forum feed and... | [
"graphics",
"rss",
"artificial-intelligence",
"feed"
] | 1 | 1 | 602 | 4 | 0 | 2008-09-08T21:22:57.273000 | 2008-09-08T21:37:45.850000 |
50,737 | 50,826 | Can I have TortoiseSVN auto-add files? | Is there a way to have TortoiseSVN (or any other tool) auto-add any new.cs files I create within a directory to my working copy so I don't have to remember which files I created at the end of the day? | I would probably make a batch file, something like this (untested): dir /b /S *.cs > allcsfiles.txt svn add --targets allcsfiles.txt I believe svn won't mind you trying to add files which are already versioned.. Anyway, that's probably about as automatic as you will easily get. | Can I have TortoiseSVN auto-add files? Is there a way to have TortoiseSVN (or any other tool) auto-add any new.cs files I create within a directory to my working copy so I don't have to remember which files I created at the end of the day? | TITLE:
Can I have TortoiseSVN auto-add files?
QUESTION:
Is there a way to have TortoiseSVN (or any other tool) auto-add any new.cs files I create within a directory to my working copy so I don't have to remember which files I created at the end of the day?
ANSWER:
I would probably make a batch file, something like th... | [
"svn",
"tortoisesvn"
] | 12 | 3 | 6,579 | 4 | 0 | 2008-09-08T21:29:38.850000 | 2008-09-08T22:16:26.867000 |
50,744 | 50,800 | Wait until file is unlocked in .NET | What's the simplest way of blocking a thread until a file has been unlocked and is accessible for reading and renaming? For example, is there a WaitOnFile() somewhere in the.NET Framework? I have a service that uses a FileSystemWatcher to look for files that are to be transmitted to an FTP site, but the file created ev... | This was the answer I gave on a related question: /// /// Blocks until the file is not locked any more. /// /// bool WaitForFile(string fullPath) { int numTries = 0; while (true) { ++numTries; try { // Attempt to open the file exclusively. using (FileStream fs = new FileStream(fullPath, FileMode.Open, FileAccess.ReadWr... | Wait until file is unlocked in .NET What's the simplest way of blocking a thread until a file has been unlocked and is accessible for reading and renaming? For example, is there a WaitOnFile() somewhere in the.NET Framework? I have a service that uses a FileSystemWatcher to look for files that are to be transmitted to ... | TITLE:
Wait until file is unlocked in .NET
QUESTION:
What's the simplest way of blocking a thread until a file has been unlocked and is accessible for reading and renaming? For example, is there a WaitOnFile() somewhere in the.NET Framework? I have a service that uses a FileSystemWatcher to look for files that are to ... | [
".net",
".net-3.5",
"file"
] | 119 | 47 | 95,257 | 16 | 0 | 2008-09-08T21:33:09.620000 | 2008-09-08T21:59:11.790000 |
50,747 | 50,812 | Response.StatusCode and Internet Explorer - Display custom message? | I am implementing a HttpRequestValidationException in my Application_Error Handler, and if possible, I want to display a custom message. Now, I'm thinking about the StatusCode. In my current example, it sends a 200, which I think should not be done. I would like to send the (IMHO) more appropriate 400 Bad Request inste... | An HTTP 200 Response Code does not indicate an error. It indicates that everything was OK. You should not use a 200 response code for an error. Internet Explorer shows its "Friendly Errors" page if the response is less than 512 bytes. Here's more on this issue: http://weblogs.asp.net/scottgu/archive/2006/04/09/442332.a... | Response.StatusCode and Internet Explorer - Display custom message? I am implementing a HttpRequestValidationException in my Application_Error Handler, and if possible, I want to display a custom message. Now, I'm thinking about the StatusCode. In my current example, it sends a 200, which I think should not be done. I ... | TITLE:
Response.StatusCode and Internet Explorer - Display custom message?
QUESTION:
I am implementing a HttpRequestValidationException in my Application_Error Handler, and if possible, I want to display a custom message. Now, I'm thinking about the StatusCode. In my current example, it sends a 200, which I think shou... | [
"asp.net",
"http",
"internet-explorer-7"
] | 1 | 4 | 1,414 | 3 | 0 | 2008-09-08T21:34:16.310000 | 2008-09-08T22:05:02.570000 |
50,762 | 50,821 | Determine Disk Geometry on Windows | I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information? | Use DeviceIoControl with control code IOCTL_DISK_GET_DRIVE_GEOMETRY or IOCTL_DISK_GET_DRIVE_GEOMETRY_EX. There's sample code in MSDN to do this here. | Determine Disk Geometry on Windows I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information? | TITLE:
Determine Disk Geometry on Windows
QUESTION:
I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information?
ANSWER:
Use DeviceIoControl with control code IOCTL_DI... | [
"windows",
"winapi",
"hard-drive"
] | 5 | 6 | 3,057 | 3 | 0 | 2008-09-08T21:41:57.820000 | 2008-09-08T22:12:22.787000 |
50,771 | 51,268 | ASP.NET AJAX Load Balancing Issues | This would be a question for anyone who has code in the App_Code folder and uses a hardware load balancer. Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off. When a file in the App_Code folder, and the site is not pre-comp... | You could move whatever is in your app_code to an external class library if your QA dept can promote that entire library. I think you are stuck with sticky sessions if you can't find a convenient or tolerable way to switch to a pre-compiled site. | ASP.NET AJAX Load Balancing Issues This would be a question for anyone who has code in the App_Code folder and uses a hardware load balancer. Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off. When a file in the App_Code f... | TITLE:
ASP.NET AJAX Load Balancing Issues
QUESTION:
This would be a question for anyone who has code in the App_Code folder and uses a hardware load balancer. Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off. When a file... | [
"asp.net",
"load-balancing"
] | 1 | 0 | 4,720 | 8 | 0 | 2008-09-08T21:46:25.393000 | 2008-09-09T05:53:57.203000 |
50,786 | 153,206 | How do I get ms-access to connect to ms-sql as a different user? | How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it in the ODBC connection would put me right back in to the original... | I think you can get this to work the way you want it to if you use an "ODBC DSN-LESS connection" If you need to, keep your ODBC DSN's on your users' machines using windows authentication. Give your users read-only access to your database. (If they create a new mdb file and link the tables they'll only be able to read t... | How do I get ms-access to connect to ms-sql as a different user? How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it ... | TITLE:
How do I get ms-access to connect to ms-sql as a different user?
QUESTION:
How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from m... | [
"sql-server",
"ms-access",
"odbc"
] | 3 | 5 | 12,874 | 6 | 0 | 2008-09-08T21:51:02.403000 | 2008-09-30T14:14:16.913000 |
50,799 | 156,000 | What version of TinyMCE will work in Drupal 5 with google chrome? | My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5? | Just Refresh the edit page and the editor will render in Chrome. | What version of TinyMCE will work in Drupal 5 with google chrome? My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5? | TITLE:
What version of TinyMCE will work in Drupal 5 with google chrome?
QUESTION:
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5?
ANSWER:
Just Refresh the edit page and the editor will render in Chrome. | [
"drupal",
"tinymce",
"drupal-5"
] | 2 | 0 | 812 | 3 | 0 | 2008-09-08T21:59:07.733000 | 2008-10-01T02:30:46.223000 |
50,819 | 90,165 | #line and jump to line | Do any editors honer C #line directives with regards to goto line features? Context: I'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding. I can drop them but then finding the input line is even a worse pain | If the editor is scriptable it should be possible to write a script to do the navigation. There might even be a Vim or Emacs script that already does something similar. FWIW when I writing a lot of Bison/Flexx I wrote a Zeus Lua macro script that attempted to do something similar (i.e. move from input file to the corre... | #line and jump to line Do any editors honer C #line directives with regards to goto line features? Context: I'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding. I can drop them but then finding the input line is even a worse ... | TITLE:
#line and jump to line
QUESTION:
Do any editors honer C #line directives with regards to goto line features? Context: I'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding. I can drop them but then finding the input lin... | [
"preprocessor",
"text-editor"
] | 2 | 2 | 331 | 4 | 0 | 2008-09-08T22:10:00.343000 | 2008-09-18T05:02:10.060000 |
50,822 | 51,104 | Message passing in a plug-in framework | First off, there's a bit of background to this issue available on my blog: http://www.codebork.com/coding/2008/06/25/message-passing-a-plug-framework.html http://www.codebork.com/coding/2008/07/31/message-passing-2.html I'm aware that the descriptions aren't hugely clear, so I'll try to summarise what I'm attempting as... | This is my understanding of your question: You have a plugin object that may have to listen for events on x data objects - you don't want to subscribe to the event on each data object though. I'm assuming that several plugins may want to listen to events on the same data object. You could create a session type object. ... | Message passing in a plug-in framework First off, there's a bit of background to this issue available on my blog: http://www.codebork.com/coding/2008/06/25/message-passing-a-plug-framework.html http://www.codebork.com/coding/2008/07/31/message-passing-2.html I'm aware that the descriptions aren't hugely clear, so I'll ... | TITLE:
Message passing in a plug-in framework
QUESTION:
First off, there's a bit of background to this issue available on my blog: http://www.codebork.com/coding/2008/06/25/message-passing-a-plug-framework.html http://www.codebork.com/coding/2008/07/31/message-passing-2.html I'm aware that the descriptions aren't huge... | [
"c#",
"plugins",
"message-passing"
] | 2 | 3 | 1,180 | 3 | 0 | 2008-09-08T22:13:27.807000 | 2008-09-09T01:59:07.703000 |
50,824 | 50,832 | Can XML comments go anywhere? | I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so I am resorting to putting the... | According to the XML specification, a well-formed XML document is: document::= prolog element Misc* where prolog is prolog::= XMLDecl? Misc* (doctypedecl Misc*)? and Misc is Misc::= Comment | PI | S and XMLDecl::= ' ' which means that, if you want to have comments at the top, you cannot have an XML type declaration. Yo... | Can XML comments go anywhere? I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so... | TITLE:
Can XML comments go anywhere?
QUESTION:
I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data... | [
"xml",
"comments"
] | 20 | 17 | 7,930 | 4 | 0 | 2008-09-08T22:14:32.407000 | 2008-09-08T22:19:32.740000 |
50,829 | 50,861 | How to log mallocs | This is a bit hypothetical and grossly simplified but... Assume a program that will be calling functions written by third parties. These parties can be assumed to be non-hostile but can't be assumed to be "competent". Each function will take some arguments, have side effects and return a value. They have no state while... | You don't specify the operating system or environment, this answer assumes Linux, glibc, and C. You can set __malloc_hook, __free_hook, and __realloc_hook to point to functions which will be called from malloc(), realloc(), and free() respectively. There is a __malloc_hook manpage showing the prototypes. You can add tr... | How to log mallocs This is a bit hypothetical and grossly simplified but... Assume a program that will be calling functions written by third parties. These parties can be assumed to be non-hostile but can't be assumed to be "competent". Each function will take some arguments, have side effects and return a value. They ... | TITLE:
How to log mallocs
QUESTION:
This is a bit hypothetical and grossly simplified but... Assume a program that will be calling functions written by third parties. These parties can be assumed to be non-hostile but can't be assumed to be "competent". Each function will take some arguments, have side effects and ret... | [
"memory",
"memory-management",
"malloc"
] | 6 | 6 | 2,298 | 11 | 0 | 2008-09-08T22:18:27.717000 | 2008-09-08T22:33:16.187000 |
50,845 | 285,923 | How to click on an AutoCompleteExtender with Watin | For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list. In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is populated. Now my problem is when I try to click on the populated list. ... | The shorter version of that is: string lookupString = "string in list"; Element list = Browser.Element("li", Find.ByText(new Regex(lookupString))); list.MouseDown(); Regexs will do a partial match so you don't need to specify.* either side and use string.Format. This assumes however that the lookupString doesn't contai... | How to click on an AutoCompleteExtender with Watin For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list. In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is populated. Now my pro... | TITLE:
How to click on an AutoCompleteExtender with Watin
QUESTION:
For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list. In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is pop... | [
"watin",
"autocompleteextender"
] | 0 | 1 | 1,258 | 2 | 0 | 2008-09-08T22:25:48.153000 | 2008-11-13T00:29:52.953000 |
50,863 | 50,874 | What role to give a sql login in order to create a database and additional logins | What role should I give a sql login if I need the login to be able to create a database, and create additional logins and add users based on those logins to the database i created? This is sql 2005. | There is no fixed database role that includes these permissions. You'll have to create a role and assign the permissions individually. CREATE ROLE db_creator GRANT CREATE DATABASE TO db_creator GRANT ALTER ANY LOGIN TO db_creator GRANT ALTER ANY USER TO db_creator | What role to give a sql login in order to create a database and additional logins What role should I give a sql login if I need the login to be able to create a database, and create additional logins and add users based on those logins to the database i created? This is sql 2005. | TITLE:
What role to give a sql login in order to create a database and additional logins
QUESTION:
What role should I give a sql login if I need the login to be able to create a database, and create additional logins and add users based on those logins to the database i created? This is sql 2005.
ANSWER:
There is no ... | [
"sql-server-2005"
] | 2 | 1 | 367 | 1 | 0 | 2008-09-08T22:34:41.657000 | 2008-09-08T22:42:51.387000 |
50,890 | 50,896 | Average User Download Speeds | Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality. I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to start. | Speedtest.net has a lot of stats broken down by country, region, city and ISP. Not sure about accuracy, since it's only based on the people using their "bandwidth measurement" service. | Average User Download Speeds Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality. I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to st... | TITLE:
Average User Download Speeds
QUESTION:
Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality. I know i might be comparing apples with oranges but I'm just looking for something to get a bas... | [
"performance",
"download",
"average"
] | 3 | 6 | 1,024 | 9 | 0 | 2008-09-08T22:48:43.497000 | 2008-09-08T22:53:47.773000 |
50,898 | 52,099 | Nesting a GridView within Repeater | I have a scenario wherein, for example, I need to repeat a list of US states and display a table of cities and city populations after the name of each state. The design requirement dictates that every outer repetition must be the name of a state followed by a table of cities, and that requirement cannot be changed at t... | The best solution I was able to come up with was to nest the GridView in the Repeater. Then I bound each repeated GridView during the Repeater's ItemDataBound event. I turned off their ViewStates, of course, as they weren't required. | Nesting a GridView within Repeater I have a scenario wherein, for example, I need to repeat a list of US states and display a table of cities and city populations after the name of each state. The design requirement dictates that every outer repetition must be the name of a state followed by a table of cities, and that... | TITLE:
Nesting a GridView within Repeater
QUESTION:
I have a scenario wherein, for example, I need to repeat a list of US states and display a table of cities and city populations after the name of each state. The design requirement dictates that every outer repetition must be the name of a state followed by a table o... | [
"asp.net",
"data-binding",
"gridview",
"repeater"
] | 3 | 1 | 7,306 | 4 | 0 | 2008-09-08T22:56:22.230000 | 2008-09-09T15:03:04.073000 |
50,900 | 50,966 | Best way to detect a release build from a debug build? .net | So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do somethin... | Specifically, like this in C#: #if (DEBUG) Debug Stuff #endif C# has the following preprocessor directives: #if #else #elif // Else If #endif #define #undef // Undefine #warning // Causes the preprocessor to fire warning #error // Causes the preprocessor to fire a fatal error #line // Lets the preprocessor know where t... | Best way to detect a release build from a debug build? .net So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not... | TITLE:
Best way to detect a release build from a debug build? .net
QUESTION:
So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if e... | [
".net",
"debugging",
"release"
] | 9 | 28 | 13,025 | 5 | 0 | 2008-09-08T22:57:20.463000 | 2008-09-08T23:40:44.790000 |
50,914 | 50,975 | Search by hash? | I had the idea of a search engine that would index web items like other search engines do now but would only store the file's title, url and a hash of the contents. This way it would be easy to find items on the web if you already had them and didn't know where they came from or wanted to know all the places that somet... | Check out the wikipedia page on locality sensitive hashing. There's also a good page hosted by a research on MIT. In general, there are several flavors available: hashes for strings (such as simhash ), sets or 0/1 features (such as min-wise hashes ), and for real vectors. The main trick for numerical hashes is basicall... | Search by hash? I had the idea of a search engine that would index web items like other search engines do now but would only store the file's title, url and a hash of the contents. This way it would be easy to find items on the web if you already had them and didn't know where they came from or wanted to know all the p... | TITLE:
Search by hash?
QUESTION:
I had the idea of a search engine that would index web items like other search engines do now but would only store the file's title, url and a hash of the contents. This way it would be easy to find items on the web if you already had them and didn't know where they came from or wanted... | [
"search",
"hash",
"utilities"
] | 5 | 5 | 6,886 | 5 | 0 | 2008-09-08T23:06:34.013000 | 2008-09-08T23:50:30.447000 |
50,923 | 50,929 | How do you create a weak reference to an object in Python? | How do you create a weak reference to an object in Python? | >>> import weakref >>> class Object:... pass... >>> o = Object() >>> r = weakref.ref(o) >>> # if the reference is still active, r() will be o, otherwise None >>> do_something_with_o(r()) See the wearkref module docs for more details. You can also use weakref.proxy to create an object that proxies o. Will throw Referenc... | How do you create a weak reference to an object in Python? How do you create a weak reference to an object in Python? | TITLE:
How do you create a weak reference to an object in Python?
QUESTION:
How do you create a weak reference to an object in Python?
ANSWER:
>>> import weakref >>> class Object:... pass... >>> o = Object() >>> r = weakref.ref(o) >>> # if the reference is still active, r() will be o, otherwise None >>> do_something_... | [
"python",
"weak-references"
] | 11 | 14 | 921 | 1 | 0 | 2008-09-08T23:10:53.037000 | 2008-09-08T23:13:16.527000 |
50,931 | 50,948 | Redirecting non-www URL to www using .htaccess | I'm using Helicon's ISAPI Rewrite 3, which basically enables.htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)(.+... | Append the following RewriteCond: RewriteCond %{HTTP:Host} ^[^.]+\.[a-z]{2,5}$ [NC] That way it'll only apply the rule to nondottedsomething.uptofiveletters as you can see, subdomain.domain.com will not match the condition and thus will not be rewritten. You can change [a-z]{2,5} for a stricter tld matching regex, as w... | Redirecting non-www URL to www using .htaccess I'm using Helicon's ISAPI Rewrite 3, which basically enables.htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTP... | TITLE:
Redirecting non-www URL to www using .htaccess
QUESTION:
I'm using Helicon's ISAPI Rewrite 3, which basically enables.htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: ... | [
".htaccess",
"isapi-rewrite"
] | 6 | 3 | 2,954 | 7 | 0 | 2008-09-08T23:14:45.117000 | 2008-09-08T23:28:15.617000 |
50,945 | 51,031 | Can you do a partial checkout with Subversion? | If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk? | Subversion 1.5 introduces sparse checkouts which may be something you might find useful. From the documentation:... sparse directories (or shallow checkouts )... allows you to easily check out a working copy—or a portion of a working copy—more shallowly than full recursion, with the freedom to bring in previously ignor... | Can you do a partial checkout with Subversion? If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk? | TITLE:
Can you do a partial checkout with Subversion?
QUESTION:
If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk?
ANSWER:
Subversion 1.5 introduces sparse checkouts which m... | [
"svn",
"sparse-checkout"
] | 177 | 82 | 127,156 | 8 | 0 | 2008-09-08T23:26:12.953000 | 2008-09-09T00:48:08.403000 |
50,965 | 50,968 | Will random data appended to a JPG make it unusable? | So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 bytes for block encryption. Having tried this out with a few programs, it a... | No, you can add bits to the end of a jpg file, without making it unusable. The heading of the jpg file tells how to read it, so the program reading it will stop at the end of the jpg data. In fact, people have hidden zip files inside jpg files by appending the zip data to the end of the jpg data. Because of the way the... | Will random data appended to a JPG make it unusable? So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 bytes for block encryp... | TITLE:
Will random data appended to a JPG make it unusable?
QUESTION:
So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 byte... | [
"jpeg",
"file-format",
"steganography"
] | 25 | 25 | 4,350 | 4 | 0 | 2008-09-08T23:39:52.063000 | 2008-09-08T23:43:45.627000 |
50,983 | 50,991 | Are there any languages that implement generics _well_? | I liked the discussion at Differences in Generics, and was wondering whether there were any languages that used this feature particularly well. I really dislike Java's List for a List of things that are Liskov-substitutable for Foo. Why can't List cover that? And honestly, Comparable? I also can't remember for the life... | Haskell implements type-constructor parameterisation (generics, or parametric polymorphism) quite well. So does Scala (although it needs a bit of hand-holding sometimes). Both of these languages have higher-kinded types (a.k.a. abstract type constructors, or type-constructor polymorphism, or higher-order polymorphism).... | Are there any languages that implement generics _well_? I liked the discussion at Differences in Generics, and was wondering whether there were any languages that used this feature particularly well. I really dislike Java's List for a List of things that are Liskov-substitutable for Foo. Why can't List cover that? And ... | TITLE:
Are there any languages that implement generics _well_?
QUESTION:
I liked the discussion at Differences in Generics, and was wondering whether there were any languages that used this feature particularly well. I really dislike Java's List for a List of things that are Liskov-substitutable for Foo. Why can't Lis... | [
"language-agnostic",
"generics"
] | 7 | 14 | 587 | 6 | 0 | 2008-09-08T23:58:17.307000 | 2008-09-09T00:02:12.603000 |
50,995 | 51,025 | Using strings in XML Literals | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me. I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument I have 2 questions, the second regarding a workaround due to my inabilit... | If I understand correctly what you are trying to do, you can use the StringBuilder. Use the StringBuilder.Append method and append the XmlElement 'OuterXml' property. For example: sb.Append(xmlElement.OuterXml) | Using strings in XML Literals I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me. I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument I have 2 questions, the second regarding a... | TITLE:
Using strings in XML Literals
QUESTION:
I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me. I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument I have 2 questions, the ... | [
"xml",
"vb.net",
"xml-literals"
] | 3 | 0 | 2,096 | 4 | 0 | 2008-09-09T00:05:57.587000 | 2008-09-09T00:44:06.277000 |
51,002 | 51,024 | Java Desktop application framework | I am working on designing and building a desktop application. I am thinking about using eclipse or netbeans for the base of this application. However, I have never built on either of these platforms. I am personally leaning to using netbeans because it seams like that platform is an easer learning curve. But, I wanted ... | I can't say enough about the Eclipse RCP platform. I would recommend it for any Java desktop app development. It's free, has great tutorials, and allows cross-platform development of rich desktop applications that use native OS windowing toolkit, meaning that your application will look native in any platform. It also h... | Java Desktop application framework I am working on designing and building a desktop application. I am thinking about using eclipse or netbeans for the base of this application. However, I have never built on either of these platforms. I am personally leaning to using netbeans because it seams like that platform is an e... | TITLE:
Java Desktop application framework
QUESTION:
I am working on designing and building a desktop application. I am thinking about using eclipse or netbeans for the base of this application. However, I have never built on either of these platforms. I am personally leaning to using netbeans because it seams like tha... | [
"java",
"eclipse",
"netbeans",
"desktop",
"platform"
] | 18 | 6 | 19,894 | 12 | 0 | 2008-09-09T00:11:34.030000 | 2008-09-09T00:42:40.477000 |
51,007 | 51,310 | Lack of operator overloading in ActionScript 3.0 | One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a "Compare" method to my classes, but that doesn't help in many cases, like when you want to use things like the built in Dictionary. Is there a good way to work around thi... | Nope. But it doesn't hurt to add equals methods to your own classes. I try to never use == when comparing objects (the same goes for ===, which is the same thing for objects) since it only checks identity. Sadly all the collections in Flash and Flex assume that identity is the only measure of equality that is needed. T... | Lack of operator overloading in ActionScript 3.0 One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a "Compare" method to my classes, but that doesn't help in many cases, like when you want to use things like the built in D... | TITLE:
Lack of operator overloading in ActionScript 3.0
QUESTION:
One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a "Compare" method to my classes, but that doesn't help in many cases, like when you want to use things l... | [
"flash",
"actionscript-3"
] | 15 | 12 | 7,398 | 2 | 0 | 2008-09-09T00:23:28.447000 | 2008-09-09T06:52:00.353000 |
51,011 | 51,057 | best tool to reverse-engineer a WinXP PS/2 touchpad driver? | I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what message it is sending but I'm not sure how to start. Would ... | IDA Pro won't be much use to you if you want to find out what 'messages' are being sent. You should realise that this is a very big step up for most web developers, but you already knew that? I would start by deciding if you really need to work at the driver-level, often this is the Kernel level. The user mode level ma... | best tool to reverse-engineer a WinXP PS/2 touchpad driver? I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what... | TITLE:
best tool to reverse-engineer a WinXP PS/2 touchpad driver?
QUESTION:
I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm tryin... | [
"windows-xp",
"reverse-engineering",
"drivers",
"black-box"
] | 2 | 4 | 1,938 | 3 | 0 | 2008-09-09T00:31:42.250000 | 2008-09-09T01:07:09.730000 |
51,019 | 51,058 | What does it mean when a PostgreSQL process is "idle in transaction"? | What does it mean when a PostgreSQL process is "idle in transaction"? On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following: postgres: user db 127.0.0.1(55658) idle in transaction Does this mean that some of the processes are hung, waiting for a... | The PostgreSQL manual indicates that this means the transaction is open (inside BEGIN) and idle. It's most likely a user connected using the monitor who is thinking or typing. I have plenty of those on my system, too. If you're using Slony for replication, however, the Slony-I FAQ suggests idle in transaction may mean ... | What does it mean when a PostgreSQL process is "idle in transaction"? What does it mean when a PostgreSQL process is "idle in transaction"? On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following: postgres: user db 127.0.0.1(55658) idle in transac... | TITLE:
What does it mean when a PostgreSQL process is "idle in transaction"?
QUESTION:
What does it mean when a PostgreSQL process is "idle in transaction"? On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following: postgres: user db 127.0.0.1(5565... | [
"postgresql"
] | 114 | 77 | 194,986 | 2 | 0 | 2008-09-09T00:40:53.413000 | 2008-09-09T01:07:21.900000 |
51,021 | 51,037 | What is the difference between Raising Exceptions vs Throwing Exceptions in Ruby? | Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two? When should you use one and not the other? | I think http://hasno.info/ruby-gotchas-and-caveats has a decent explanation of the difference: catch/throw are not the same as raise/rescue. catch/throw allows you to quickly exit blocks back to a point where a catch is defined for a specific symbol, raise rescue is the real exception handling stuff involving the Excep... | What is the difference between Raising Exceptions vs Throwing Exceptions in Ruby? Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two? When should you use one and not the other? | TITLE:
What is the difference between Raising Exceptions vs Throwing Exceptions in Ruby?
QUESTION:
Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two? When should you use one and not the other?
ANSWER:
I think http://hasno.info/ruby-gotchas-and-caveats has a decent explanat... | [
"ruby",
"exception"
] | 203 | 116 | 62,028 | 3 | 0 | 2008-09-09T00:41:03.070000 | 2008-09-09T00:50:02.753000 |
51,032 | 51,080 | Is there a difference between foo(void) and foo() in C++ or C? | Consider these two function definitions: void foo() { }
void foo(void) { } Is there any difference between these two? If not, why is the void argument there? Aesthetic reasons? | Historical note: this answer applies to C17 and older editions. C23 and later editions treat void foo() differently. In C: void foo() means "a function foo taking an unspecified number of arguments of unspecified type" void foo(void) means "a function foo taking no arguments" In C++: void foo() means "a function foo ta... | Is there a difference between foo(void) and foo() in C++ or C? Consider these two function definitions: void foo() { }
void foo(void) { } Is there any difference between these two? If not, why is the void argument there? Aesthetic reasons? | TITLE:
Is there a difference between foo(void) and foo() in C++ or C?
QUESTION:
Consider these two function definitions: void foo() { }
void foo(void) { } Is there any difference between these two? If not, why is the void argument there? Aesthetic reasons?
ANSWER:
Historical note: this answer applies to C17 and olde... | [
"c++",
"c",
"arguments",
"function-declaration"
] | 286 | 360 | 79,890 | 5 | 0 | 2008-09-09T00:48:23.630000 | 2008-09-09T01:34:28.060000 |
51,054 | 51,069 | Batch file to delete files older than N days | I am looking for a way to delete all files older than 7 days in a batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task. Similar things can be done in BASH in just a couple lines of code. ... | Enjoy: forfiles -p "C:\what\ever" -s -m *.* -d -c "cmd /c del @path" See forfiles documentation for more details. For more goodies, refer to An A-Z Index of the Windows XP command line. If you don't have forfiles installed on your machine, copy it from any Windows Server 2003 to your Windows XP machine at %WinDir%\syst... | Batch file to delete files older than N days I am looking for a way to delete all files older than 7 days in a batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task. Similar things can be ... | TITLE:
Batch file to delete files older than N days
QUESTION:
I am looking for a way to delete all files older than 7 days in a batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task. Simi... | [
"windows",
"date",
"batch-file",
"file-io",
"cmd"
] | 755 | 1,185 | 1,366,622 | 25 | 0 | 2008-09-09T01:05:28.707000 | 2008-09-09T01:18:27.380000 |
51,088 | 789,776 | Plugin for R# similar to CodeRush "statement highlight" | See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block highlighting - eg in the pics on the link the "statement blocks" are grouped with a vertical line. I understand this is a feature of CodeRush - does R# have eithe... | I use the latest version of ReSharper that is currently available — ReSharper 4.5 — but unfortunately I don't believe there is any feature for drawing a vertical line between matching braces, as in the screen-shots you referenced. The feature I find useful, which Ben mentioned, is the matching brace highlighting, howev... | Plugin for R# similar to CodeRush "statement highlight" See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block highlighting - eg in the pics on the link the "statement blocks" are grouped with a vertical line. I under... | TITLE:
Plugin for R# similar to CodeRush "statement highlight"
QUESTION:
See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block highlighting - eg in the pics on the link the "statement blocks" are grouped with a vert... | [
"resharper",
"codehighlighter"
] | 2 | 1 | 1,438 | 3 | 0 | 2008-09-09T01:45:24.383000 | 2009-04-25T21:37:52.337000 |
51,092 | 51,103 | SQL: aggregate function and group by | Consider the Oracle emp table. I'd like to get the employees with the top salary with department = 20 and job = clerk. Also assume that there is no "empno" column, and that the primary key involves a number of columns. You can do this with: select * from scott.emp where deptno = 20 and job = 'CLERK' and sal = (select m... | The following is slightly over-engineered, but is a good SQL pattern for "top x" queries. SELECT * FROM scott.emp WHERE (deptno,job,sal) IN (SELECT deptno, job, max(sal) FROM scott.emp WHERE deptno = 20 and job = 'CLERK' GROUP BY deptno, job ) Also note that this will work in Oracle and Postgress (i think) but not MS S... | SQL: aggregate function and group by Consider the Oracle emp table. I'd like to get the employees with the top salary with department = 20 and job = clerk. Also assume that there is no "empno" column, and that the primary key involves a number of columns. You can do this with: select * from scott.emp where deptno = 20 ... | TITLE:
SQL: aggregate function and group by
QUESTION:
Consider the Oracle emp table. I'd like to get the employees with the top salary with department = 20 and job = clerk. Also assume that there is no "empno" column, and that the primary key involves a number of columns. You can do this with: select * from scott.emp ... | [
"sql",
"oracle",
"aggregate"
] | 3 | 3 | 2,401 | 6 | 0 | 2008-09-09T01:49:32.093000 | 2008-09-09T01:58:32.883000 |
51,094 | 52,640 | Payment Processors - What do I need to know if I want to accept credit cards on my website? | This question talks about different payment processors and what they cost, but I'm looking for the answer to what do I need to do if I want to accept credit card payments? Assume I need to store credit card numbers for customers, so that the obvious solution of relying on the credit card processor to do the heavy lifti... | I went through this process not to long ago with a company I worked for and I plan on going through it again soon with my own business. If you have some network technical knowledge, it really isn't that bad. Otherwise you will be better off using Paypal or another type of service. The process starts by getting a mercha... | Payment Processors - What do I need to know if I want to accept credit cards on my website? This question talks about different payment processors and what they cost, but I'm looking for the answer to what do I need to do if I want to accept credit card payments? Assume I need to store credit card numbers for customers... | TITLE:
Payment Processors - What do I need to know if I want to accept credit cards on my website?
QUESTION:
This question talks about different payment processors and what they cost, but I'm looking for the answer to what do I need to do if I want to accept credit card payments? Assume I need to store credit card num... | [
"security",
"e-commerce",
"pci-dss"
] | 261 | 238 | 26,186 | 9 | 0 | 2008-09-09T01:50:45.913000 | 2008-09-09T19:06:50.930000 |
51,098 | 51,111 | Modifying a spreadsheet using a VB macro | I have two spreadsheets... when one gets modified in a certain way I want to have a macro run that modifies the second in an appropriate manner. I've already isolated the event I need to act on (the modification of any cell in a particular column), I just can't seem to find any concrete information on accessing and mod... | In Excel, you would likely just write code to open the other worksheet, modify it and then save the data. See this tutorial for more info. I'll have to edit my VBA later, so pretend this is pseudocode, but it should look something like: Dim xl: Set xl = CreateObject("Excel.Application") xl.Open "\\the\share\file.xls"
... | Modifying a spreadsheet using a VB macro I have two spreadsheets... when one gets modified in a certain way I want to have a macro run that modifies the second in an appropriate manner. I've already isolated the event I need to act on (the modification of any cell in a particular column), I just can't seem to find any ... | TITLE:
Modifying a spreadsheet using a VB macro
QUESTION:
I have two spreadsheets... when one gets modified in a certain way I want to have a macro run that modifies the second in an appropriate manner. I've already isolated the event I need to act on (the modification of any cell in a particular column), I just can't... | [
"excel",
"vba"
] | 2 | 5 | 1,180 | 4 | 0 | 2008-09-09T01:56:09.503000 | 2008-09-09T02:07:50.927000 |
51,108 | 51,166 | Spartan Programming | I really enjoyed Jeff's post on Spartan Programming. I agree that code like that is a joy to read. Unfortunately, I'm not so sure it would necessarily be a joy to work with. For years I have read about and adhered to the "one-expression-per-line" practice. I have fought the good fight and held my ground when many progr... | In The Pragmatic Programmer Hunt and Thomas talk about a study they term the Law of Demeter and it focuses on the coupling of functions to modules other than there own. By allowing a function to never reach a 3rd level in it's coupling you significantly reduce the number of errors and increase the maintainability of th... | Spartan Programming I really enjoyed Jeff's post on Spartan Programming. I agree that code like that is a joy to read. Unfortunately, I'm not so sure it would necessarily be a joy to work with. For years I have read about and adhered to the "one-expression-per-line" practice. I have fought the good fight and held my gr... | TITLE:
Spartan Programming
QUESTION:
I really enjoyed Jeff's post on Spartan Programming. I agree that code like that is a joy to read. Unfortunately, I'm not so sure it would necessarily be a joy to work with. For years I have read about and adhered to the "one-expression-per-line" practice. I have fought the good fi... | [
"language-agnostic",
"styles",
"spartan"
] | 10 | 7 | 2,497 | 8 | 0 | 2008-09-09T02:05:36.627000 | 2008-09-09T03:26:01.690000 |
51,110 | 51,116 | Get MIME type of a local file in PHP5 without a PECL extension? | mime_content_type() is deprecated. How can I find the MIME type of a local file using PHP5 but without using this deprecated method or the PECL fileinfo extension? Edit: That's what I was afraid of. It's unfortunate that they deprecated a built-in function in favour of one that requires an extension that isn't always a... | If you can't use the fileinfo extension, and you don't want to use mime_content_type, your options are limited. Most likely you'll need to do a lookup based on the file extension. mime_content_type did something a bit more intelligent and actually looked for special data in the file to determine the mime type. | Get MIME type of a local file in PHP5 without a PECL extension? mime_content_type() is deprecated. How can I find the MIME type of a local file using PHP5 but without using this deprecated method or the PECL fileinfo extension? Edit: That's what I was afraid of. It's unfortunate that they deprecated a built-in function... | TITLE:
Get MIME type of a local file in PHP5 without a PECL extension?
QUESTION:
mime_content_type() is deprecated. How can I find the MIME type of a local file using PHP5 but without using this deprecated method or the PECL fileinfo extension? Edit: That's what I was afraid of. It's unfortunate that they deprecated a... | [
"php",
"mime"
] | 0 | 1 | 2,002 | 2 | 0 | 2008-09-09T02:07:26.437000 | 2008-09-09T02:12:32.617000 |
51,114 | 52,109 | ASP.NET 3.5 Without Microsoft SQL Server - What do I lose? | I was just assigned to do a CMS using ASP.net 3.5 and MySQL. I am kind of new to ASP.NET development (quite sufficient with C#) and I am wondering what major ASP.NET and general.NET features I am losing when I don't have the option to use Microsoft SQL Server. I know already from quick Googling that I lose LINQ (and I ... | You do not lose LINQ, you lose LINQtoSQL. LINQ itself is more generic as it can be used on anything that implements iQueryable. You lose the SqlDataSource, not a big deal. You lose some of the integration the server explorer does for you with sql server, again not a big deal. As far as im concerned you dont lose anythi... | ASP.NET 3.5 Without Microsoft SQL Server - What do I lose? I was just assigned to do a CMS using ASP.net 3.5 and MySQL. I am kind of new to ASP.NET development (quite sufficient with C#) and I am wondering what major ASP.NET and general.NET features I am losing when I don't have the option to use Microsoft SQL Server. ... | TITLE:
ASP.NET 3.5 Without Microsoft SQL Server - What do I lose?
QUESTION:
I was just assigned to do a CMS using ASP.net 3.5 and MySQL. I am kind of new to ASP.NET development (quite sufficient with C#) and I am wondering what major ASP.NET and general.NET features I am losing when I don't have the option to use Micr... | [
"asp.net",
"mysql",
".net-3.5"
] | 2 | 2 | 960 | 4 | 0 | 2008-09-09T02:09:25.760000 | 2008-09-09T15:08:28.477000 |
51,124 | 51,131 | Usefulness of SQL Server "with encryption" statement | Recently a friend and I were talking about securing stored procedure code in a SQL server database. From distant memory, I'm pretty certain that "with encryption" is incredibly easily broken in all versions of SQL Server, however he said it has been greatly improved in SQL 2005. As a result I have not seriously conside... | It can be used to hide your code from casual observers, but as you say: it's easily circumvented. It really can't be any other way, since the server needs to decrypt the code to execute it. It's DRM, basically, and fails for the same reason as all the other DRM does - you can't simultaneously hide the data, and allow i... | Usefulness of SQL Server "with encryption" statement Recently a friend and I were talking about securing stored procedure code in a SQL server database. From distant memory, I'm pretty certain that "with encryption" is incredibly easily broken in all versions of SQL Server, however he said it has been greatly improved ... | TITLE:
Usefulness of SQL Server "with encryption" statement
QUESTION:
Recently a friend and I were talking about securing stored procedure code in a SQL server database. From distant memory, I'm pretty certain that "with encryption" is incredibly easily broken in all versions of SQL Server, however he said it has been... | [
"sql-server",
"encryption"
] | 5 | 6 | 984 | 3 | 0 | 2008-09-09T02:16:44.510000 | 2008-09-09T02:24:29.607000 |
51,126 | 51,128 | How do you Modify TextBox Control Tab Stops | When you use a Windows Forms TextBox, the default number of tab stops (spaces) is 8. How do you modify this? | First add the following namespace using System.Runtime.InteropServices; Then add the following after the class declaration: private const int EM_SETTABSTOPS = 0x00CB; [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SendMessage(IntPtr h, int msg, int wParam, int [] lParam); Then add the fol... | How do you Modify TextBox Control Tab Stops When you use a Windows Forms TextBox, the default number of tab stops (spaces) is 8. How do you modify this? | TITLE:
How do you Modify TextBox Control Tab Stops
QUESTION:
When you use a Windows Forms TextBox, the default number of tab stops (spaces) is 8. How do you modify this?
ANSWER:
First add the following namespace using System.Runtime.InteropServices; Then add the following after the class declaration: private const in... | [
"c#",
".net",
"winforms"
] | 1 | 4 | 1,681 | 1 | 0 | 2008-09-09T02:21:26.823000 | 2008-09-09T02:23:01.937000 |
51,129 | 51,225 | How do I get a value from an XML web service in C#? | In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that? For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back somevalue I'd like it to spit out "somevalue". | I use this code and it works great: System.Xml.XmlDocument xd = new System.Xml.XmlDocument; xd.Load("http://www.webservice.com/webservice?fXML=1"); string xPath = "/xml/somekey"; // this node's inner text contains "somevalue" return xd.SelectSingleNode(xPath).InnerText; EDIT: I just realized you're talking about a webs... | How do I get a value from an XML web service in C#? In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that? For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back somevalue I'd like it ... | TITLE:
How do I get a value from an XML web service in C#?
QUESTION:
In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that? For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back some... | [
"c#",
"xml",
"web-services"
] | 5 | 3 | 4,368 | 4 | 0 | 2008-09-09T02:24:08.283000 | 2008-09-09T04:31:03.610000 |
51,148 | 51,149 | How do I find out if a process is already running using c#? | I have C# winforms application that needs to start an external exe from time to time, but I do not wish to start another process if one is already running, but rather switch to it. So how in C# would I so this in the example below? using System.Diagnostics;...
Process foo = new Process();
foo.StartInfo.FileName = @"C... | This should do it for ya. Check Processes //Namespaces we need to use using System.Diagnostics;
public bool IsProcessOpen(string name) { //here we're going to get a list of all running processes on //the computer foreach (Process clsProcess in Process.GetProcesses()) { //now we're going to see if any of the running pr... | How do I find out if a process is already running using c#? I have C# winforms application that needs to start an external exe from time to time, but I do not wish to start another process if one is already running, but rather switch to it. So how in C# would I so this in the example below? using System.Diagnostics;...... | TITLE:
How do I find out if a process is already running using c#?
QUESTION:
I have C# winforms application that needs to start an external exe from time to time, but I do not wish to start another process if one is already running, but rather switch to it. So how in C# would I so this in the example below? using Syst... | [
"c#",
"winforms",
"external-process"
] | 29 | 39 | 56,615 | 10 | 0 | 2008-09-09T02:54:06.637000 | 2008-09-09T02:58:09.653000 |
51,156 | 51,159 | Is there a way of selecting the last item of a list with CSS? | Say I have a list as follows: item1 item2 item3 Is there a CSS selector that will allow me to directly select the last item of a list? In this case item 3. Cheers! | Not that i'm aware of. The traditional solution is to tag the first & last items with class="first" & class="last" so you can identify them. The CSS psudo-class first-child will get you the first item but not all browsers support it. CSS3 will have last-child too (this is currently supported by Firefox, Safari but not ... | Is there a way of selecting the last item of a list with CSS? Say I have a list as follows: item1 item2 item3 Is there a CSS selector that will allow me to directly select the last item of a list? In this case item 3. Cheers! | TITLE:
Is there a way of selecting the last item of a list with CSS?
QUESTION:
Say I have a list as follows: item1 item2 item3 Is there a CSS selector that will allow me to directly select the last item of a list? In this case item 3. Cheers!
ANSWER:
Not that i'm aware of. The traditional solution is to tag the first... | [
"css",
"css-selectors"
] | 11 | 15 | 12,412 | 3 | 0 | 2008-09-09T03:11:59.463000 | 2008-09-09T03:14:58.100000 |
51,165 | 51,169 | How to sort strings in JavaScript | I have a list of objects I wish to sort based on a field attr of type string. I tried using - list.sort(function (a, b) { return a.attr - b.attr }) but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type string? | Use String.prototype.localeCompare as per your example: list.sort(function (a, b) { return ('' + a.attr).localeCompare(b.attr); }) We force a.attr to be a string to avoid exceptions. localeCompare has been supported since Internet Explorer 6 and Firefox 1. You may also see the following code used that doesn't respect a... | How to sort strings in JavaScript I have a list of objects I wish to sort based on a field attr of type string. I tried using - list.sort(function (a, b) { return a.attr - b.attr }) but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type strin... | TITLE:
How to sort strings in JavaScript
QUESTION:
I have a list of objects I wish to sort based on a field attr of type string. I tried using - list.sort(function (a, b) { return a.attr - b.attr }) but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribu... | [
"javascript",
"string"
] | 538 | 924 | 649,063 | 16 | 0 | 2008-09-09T03:25:15.343000 | 2008-09-09T03:29:17.300000 |
51,176 | 51,196 | Separating concerns with Linq To SQL and DTO's | I recently started a new webforms project and decided to separate the business classes from any DBML references. My business layer classes instead access discrete Data layer methods and are returned collections of DTO's. So the data layer might project DTO's like the following: (from c in dataContext.Customers where c.... | I don't know if it's best practice but I have written similar code in the not so recent past because I too felt that I could improve the separation of concerns by using my own classes instead of the LINQ-designer-generated ones within my application. You may want to consider just returning an IQueryable instead of an I... | Separating concerns with Linq To SQL and DTO's I recently started a new webforms project and decided to separate the business classes from any DBML references. My business layer classes instead access discrete Data layer methods and are returned collections of DTO's. So the data layer might project DTO's like the follo... | TITLE:
Separating concerns with Linq To SQL and DTO's
QUESTION:
I recently started a new webforms project and decided to separate the business classes from any DBML references. My business layer classes instead access discrete Data layer methods and are returned collections of DTO's. So the data layer might project DT... | [
"c#",
"linq",
"dto-mapping"
] | 11 | 5 | 2,967 | 2 | 0 | 2008-09-09T03:40:22.373000 | 2008-09-09T03:54:51.950000 |
51,180 | 51,194 | How do I stop Visual Studio from automatically inserting asterisk during a block comment? | I'm tearing my hair out with this one. If I start a block comment /* in VS.NET 2005+ then carriage return, Visual Studio insists that I have another asterisk *. I know there's an option to turn this off but I just can't find it. Anyone know how to turn this feature off? | Update: this setting was changed in VS 2015 update 2. See this answer. This post addresses your question. The gist of it is: Text Editor > C# > Advanced > Generate XML documentation comments for /// | How do I stop Visual Studio from automatically inserting asterisk during a block comment? I'm tearing my hair out with this one. If I start a block comment /* in VS.NET 2005+ then carriage return, Visual Studio insists that I have another asterisk *. I know there's an option to turn this off but I just can't find it. A... | TITLE:
How do I stop Visual Studio from automatically inserting asterisk during a block comment?
QUESTION:
I'm tearing my hair out with this one. If I start a block comment /* in VS.NET 2005+ then carriage return, Visual Studio insists that I have another asterisk *. I know there's an option to turn this off but I jus... | [
"visual-studio"
] | 40 | 25 | 4,485 | 3 | 0 | 2008-09-09T03:41:23.480000 | 2008-09-09T03:51:15.343000 |
51,185 | 4,717,855 | Are JavaScript strings immutable? Do I need a "string builder" in JavaScript? | Does javascript use immutable or mutable strings? Do I need a "string builder"? | They are immutable. You cannot change a character within a string with something like var myString = "abbdef"; myString[2] = 'c'. The string manipulation methods such as trim, slice return new strings. In the same way, if you have two references to the same string, modifying one doesn't affect the other let a = b = "he... | Are JavaScript strings immutable? Do I need a "string builder" in JavaScript? Does javascript use immutable or mutable strings? Do I need a "string builder"? | TITLE:
Are JavaScript strings immutable? Do I need a "string builder" in JavaScript?
QUESTION:
Does javascript use immutable or mutable strings? Do I need a "string builder"?
ANSWER:
They are immutable. You cannot change a character within a string with something like var myString = "abbdef"; myString[2] = 'c'. The s... | [
"javascript",
"string"
] | 302 | 355 | 103,984 | 10 | 0 | 2008-09-09T03:44:54.110000 | 2011-01-17T21:03:35.843000 |
51,195 | 51,205 | How to get hashes out of arrays in Perl? | I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issue) which is preventing me from packing out the information ... | The nested data structure contains a hash reference, not a hash. # Will work (the -> dereferences the reference) $row = $records[$index]; print "This will work: ", $row->{firstName}, "\n";
# This will also work, by promoting the hash reference into a hash %row = %{ $records[$index] }; print "This will work: ", $row{fi... | How to get hashes out of arrays in Perl? I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issue) which is preven... | TITLE:
How to get hashes out of arrays in Perl?
QUESTION:
I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issu... | [
"arrays",
"perl",
"hash",
"perl-data-structures"
] | 14 | 23 | 12,143 | 6 | 0 | 2008-09-09T03:51:31.927000 | 2008-09-09T04:03:09.247000 |
51,202 | 51,350 | Can a STP template be hidden from subsite creation page? | When a template is added using the add-template stsadm command, it becomes available to everyone when creating a subsite. Is there any way to make it only available when a site collection is being created? | go to site actions -> Site Settings -> view all site settings -> site templates and page layouts and remove the site template from the list of allowed items. Gary Lapointe may also have made an stsadm extenstion for it; check stsadm.blogspot.com Mauro Masucci http://www.brantas.co.uk | Can a STP template be hidden from subsite creation page? When a template is added using the add-template stsadm command, it becomes available to everyone when creating a subsite. Is there any way to make it only available when a site collection is being created? | TITLE:
Can a STP template be hidden from subsite creation page?
QUESTION:
When a template is added using the add-template stsadm command, it becomes available to everyone when creating a subsite. Is there any way to make it only available when a site collection is being created?
ANSWER:
go to site actions -> Site Set... | [
"sharepoint",
"templates",
"moss"
] | 0 | 2 | 1,024 | 4 | 0 | 2008-09-09T03:58:06.920000 | 2008-09-09T07:27:49.410000 |
51,212 | 51,239 | How to write a download progress indicator in Python? | I am writing a little application to download files over http (as, for example, described here ). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: sys.stdout.write(rem_file + "...") urllib.urlretrieve(rem_file, loc_file, reporthook... | There's a text progress bar library for python at http://pypi.python.org/pypi/progressbar/2.2 that you might find useful: This library provides a text mode progressbar. This is tipically used to display the progress of a long running operation, providing a visual clue that processing is underway. The ProgressBar class ... | How to write a download progress indicator in Python? I am writing a little application to download files over http (as, for example, described here ). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: sys.stdout.write(rem_file + ".... | TITLE:
How to write a download progress indicator in Python?
QUESTION:
I am writing a little application to download files over http (as, for example, described here ). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: sys.stdout.w... | [
"python",
"http"
] | 59 | 18 | 32,713 | 10 | 0 | 2008-09-09T04:09:15.503000 | 2008-09-09T04:48:28.203000 |
51,224 | 51,231 | Regular Expression to match valid dates | I'm trying to write a regular expression that validates a date. The regex needs to match the following M/D/YYYY MM/DD/YYYY Single digit months can start with a leading zero (eg: 03/12/2008) Single digit days can start with a leading zero (eg: 3/02/2008) CANNOT include February 30 or February 31 (eg: 2/31/2008) So far I... | This is not an appropriate use of regular expressions. You'd be better off using [0-9]{2}/[0-9]{2}/[0-9]{4} and then checking ranges in a higher-level language. | Regular Expression to match valid dates I'm trying to write a regular expression that validates a date. The regex needs to match the following M/D/YYYY MM/DD/YYYY Single digit months can start with a leading zero (eg: 03/12/2008) Single digit days can start with a leading zero (eg: 3/02/2008) CANNOT include February 30... | TITLE:
Regular Expression to match valid dates
QUESTION:
I'm trying to write a regular expression that validates a date. The regex needs to match the following M/D/YYYY MM/DD/YYYY Single digit months can start with a leading zero (eg: 03/12/2008) Single digit days can start with a leading zero (eg: 3/02/2008) CANNOT i... | [
"regex",
"date"
] | 80 | 159 | 320,296 | 17 | 0 | 2008-09-09T04:30:42.957000 | 2008-09-09T04:37:15.310000 |
51,233 | 51,240 | How can I retrieve the page title of a webpage using Python? | How can I retrieve the page title of a webpage (title html tag) using Python? | I'll always use lxml for such tasks. You could use beautifulsoup as well. import lxml.html t = lxml.html.parse(url) print(t.find(".//title").text) EDIT based on comment: from urllib2 import urlopen from lxml.html import parse
url = "https://www.google.com" page = urlopen(url) p = parse(page) print(p.find(".//title").t... | How can I retrieve the page title of a webpage using Python? How can I retrieve the page title of a webpage (title html tag) using Python? | TITLE:
How can I retrieve the page title of a webpage using Python?
QUESTION:
How can I retrieve the page title of a webpage (title html tag) using Python?
ANSWER:
I'll always use lxml for such tasks. You could use beautifulsoup as well. import lxml.html t = lxml.html.parse(url) print(t.find(".//title").text) EDIT ba... | [
"python",
"html"
] | 89 | 70 | 114,029 | 12 | 0 | 2008-09-09T04:38:55.527000 | 2008-09-09T04:49:38.463000 |
51,238 | 58,277 | How do I conditionally set a column to its default value with MySqlParameter? | I have a table in a MySql database that stores user accounts. One of the columns, expires, stores an expiration date but defaults to NULL. I need to be able to remove an expiration date and set it back to the default value. Currently, all of my CRUD routines are written using MySqlCommand with parameters. Can this be d... | The problem was DBNull, doing: command.Parameters.AddWithValue("@parameter", null); compiles OK. | How do I conditionally set a column to its default value with MySqlParameter? I have a table in a MySql database that stores user accounts. One of the columns, expires, stores an expiration date but defaults to NULL. I need to be able to remove an expiration date and set it back to the default value. Currently, all of ... | TITLE:
How do I conditionally set a column to its default value with MySqlParameter?
QUESTION:
I have a table in a MySql database that stores user accounts. One of the columns, expires, stores an expiration date but defaults to NULL. I need to be able to remove an expiration date and set it back to the default value. ... | [
"c#",
".net",
"mysql",
"sql",
"mysql-parameter"
] | 2 | 3 | 1,426 | 3 | 0 | 2008-09-09T04:47:33.070000 | 2008-09-12T04:02:21.970000 |
51,256 | 51,260 | How to upload a file to a WCF Service? | I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data. I would think this ok but on the Service side I get an error. The error is "P... | @jdiaz, @JasonS is right, to upload file you need to transfer it as a byte stream. You need to use WCF streaming. For example on how to upload file via WCF see an article from http://kjellsj.blogspot.com | How to upload a file to a WCF Service? I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data. I would think this ok but on the Servi... | TITLE:
How to upload a file to a WCF Service?
QUESTION:
I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data. I would think this o... | [
"wcf",
"web-services"
] | 20 | 9 | 50,806 | 4 | 0 | 2008-09-09T05:27:00.137000 | 2008-09-09T05:40:05.457000 |
51,264 | 51,285 | What table/view do you query against to select all the table names in a schema in Oracle? | What object do you query against to select all the table names in a schema in Oracle? | To see all the tables you have access to select table_name from all_tables where owner=' '; To select all tables for the current logged in schema (eg, your tables) select table_name from user_tables; | What table/view do you query against to select all the table names in a schema in Oracle? What object do you query against to select all the table names in a schema in Oracle? | TITLE:
What table/view do you query against to select all the table names in a schema in Oracle?
QUESTION:
What object do you query against to select all the table names in a schema in Oracle?
ANSWER:
To see all the tables you have access to select table_name from all_tables where owner=' '; To select all tables for ... | [
"sql",
"oracle"
] | 3 | 5 | 1,767 | 3 | 0 | 2008-09-09T05:46:34.037000 | 2008-09-09T06:16:42.140000 |
51,266 | 51,427 | High availability and scalable platform for Java/C++ on Solaris | I have an application that's a mix of Java and C++ on Solaris. The Java aspects of the code run the web UI and establish state on the devices that we're talking to, and the C++ code does the real-time crunching of data coming back from the devices. Shared memory is used to pass device state and context information from... | The first thing I would do is construct a model of the system to map the data flow and try to understand precisely where the bottleneck lies. If you can model your system as a pipeline, then you should be able to use the theory of constraints (most of the literature is about optimising business processes but it applies... | High availability and scalable platform for Java/C++ on Solaris I have an application that's a mix of Java and C++ on Solaris. The Java aspects of the code run the web UI and establish state on the devices that we're talking to, and the C++ code does the real-time crunching of data coming back from the devices. Shared ... | TITLE:
High availability and scalable platform for Java/C++ on Solaris
QUESTION:
I have an application that's a mix of Java and C++ on Solaris. The Java aspects of the code run the web UI and establish state on the devices that we're talking to, and the C++ code does the real-time crunching of data coming back from th... | [
"java",
"c++",
"scalability",
"solaris",
"high-availability"
] | 9 | 5 | 1,530 | 3 | 0 | 2008-09-09T05:52:23.680000 | 2008-09-09T09:00:54.337000 |
51,276 | 51,373 | Performance gain in compiling java to native code? | Is there any performance to be gained these days from compiling java to native code, or do modern hotspot compilers end up doing this over time anyway? | There was a similar discussion here recently, for the question What are advantages of bytecode over native code?. You can find interesting answers in that thread. | Performance gain in compiling java to native code? Is there any performance to be gained these days from compiling java to native code, or do modern hotspot compilers end up doing this over time anyway? | TITLE:
Performance gain in compiling java to native code?
QUESTION:
Is there any performance to be gained these days from compiling java to native code, or do modern hotspot compilers end up doing this over time anyway?
ANSWER:
There was a similar discussion here recently, for the question What are advantages of byte... | [
"java",
"performance"
] | 12 | 4 | 9,409 | 5 | 0 | 2008-09-09T06:05:02.870000 | 2008-09-09T08:08:20 |
51,279 | 51,284 | Strategy for single sign on with legacy applications | I'm wondering what strategies people use for reduced sign on with legacy applications and how effective they have found them? We have an ASP.Net based intranet and own a lot of the legacy applications, but not all. We also have BizTalk and are considering the use of it's SSO engine too. | A good compromise between effort/rework and the convenience of single sign on is to continue to maintain a list of users, privileges, roles etc in the legacy app. Make the changes necessary to automatically log the user into your application based on their user account (usually their Windows or network account). I'm cu... | Strategy for single sign on with legacy applications I'm wondering what strategies people use for reduced sign on with legacy applications and how effective they have found them? We have an ASP.Net based intranet and own a lot of the legacy applications, but not all. We also have BizTalk and are considering the use of ... | TITLE:
Strategy for single sign on with legacy applications
QUESTION:
I'm wondering what strategies people use for reduced sign on with legacy applications and how effective they have found them? We have an ASP.Net based intranet and own a lot of the legacy applications, but not all. We also have BizTalk and are consi... | [
"integration",
"single-sign-on",
"legacy"
] | 3 | 2 | 3,116 | 4 | 0 | 2008-09-09T06:05:57.377000 | 2008-09-09T06:12:55.037000 |
51,283 | 51,287 | Access to restricted URI denied code: 1012 | How do you get around this Ajax cross site scripting problem on FireFox 3? | If you're using jQuery it has a callback function to overcome this: http://docs.jquery.com/Ajax/jQuery.ajax#options As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the? with the correct metho... | Access to restricted URI denied code: 1012 How do you get around this Ajax cross site scripting problem on FireFox 3? | TITLE:
Access to restricted URI denied code: 1012
QUESTION:
How do you get around this Ajax cross site scripting problem on FireFox 3?
ANSWER:
If you're using jQuery it has a callback function to overcome this: http://docs.jquery.com/Ajax/jQuery.ajax#options As of jQuery 1.2, you can load JSON data located on another... | [
"javascript",
"jquery",
"ajax",
"xss"
] | 28 | 20 | 47,810 | 5 | 0 | 2008-09-09T06:12:10.450000 | 2008-09-09T06:19:47.997000 |
51,288 | 51,295 | How to keep Stored Procedures and other scripts in SVN/Other repository? | Can anyone provide some real examples as to how best to keep script files for views, stored procedures and functions in a SVN (or other) repository. Obviously one solution is to have the script files for all the different components in a directory or more somewhere and simply using TortoiseSVN or the like to keep them ... | Sounds like you're not wanting to use Revision Control properly, to me. Obviously one solution is to have the script files for all the different components in a directory or more somewhere and simply using TortoiseSVN or the like to keep them in SVN This is what should be done. You would have your local copy you are wo... | How to keep Stored Procedures and other scripts in SVN/Other repository? Can anyone provide some real examples as to how best to keep script files for views, stored procedures and functions in a SVN (or other) repository. Obviously one solution is to have the script files for all the different components in a directory... | TITLE:
How to keep Stored Procedures and other scripts in SVN/Other repository?
QUESTION:
Can anyone provide some real examples as to how best to keep script files for views, stored procedures and functions in a SVN (or other) repository. Obviously one solution is to have the script files for all the different compone... | [
"sql-server",
"svn",
"tortoisesvn",
"repository"
] | 13 | 10 | 5,343 | 10 | 0 | 2008-09-09T06:19:51.337000 | 2008-09-09T06:31:14.600000 |
51,289 | 69,165 | Pass Silverlight type to Microsoft AJAX and pass parameter validation | I'm working on a Silverlight application where I want to take advantage of the Microsoft ASP.NET AJAX Client library. I'm calling the library using the HTML Bridge that is part of Silverlight 2. Silverlight got great support for passing types between JavaScript and Managed Code, but now I've bumped against a problem. M... | I found a pretty good overview of this here, but even that overview seemed to cover every scenario except the one you mention. I'm wondering if this can't be done because javascript objects really are functions (more or less). What if you wrote a wrapper function that could create the state object using a string? | Pass Silverlight type to Microsoft AJAX and pass parameter validation I'm working on a Silverlight application where I want to take advantage of the Microsoft ASP.NET AJAX Client library. I'm calling the library using the HTML Bridge that is part of Silverlight 2. Silverlight got great support for passing types between... | TITLE:
Pass Silverlight type to Microsoft AJAX and pass parameter validation
QUESTION:
I'm working on a Silverlight application where I want to take advantage of the Microsoft ASP.NET AJAX Client library. I'm calling the library using the HTML Bridge that is part of Silverlight 2. Silverlight got great support for pas... | [
"javascript",
"ajax",
"silverlight",
"asp.net-ajax",
"htmlbridge"
] | 1 | 1 | 875 | 1 | 0 | 2008-09-09T06:20:44.610000 | 2008-09-16T03:27:09.337000 |
51,296 | 160,334 | Checking network status and controlling PPP in a program | So I'm running PPP under linux with a cellular modem. The program I'm writing needs to know if the link is active before sending any data. What are my options to check if the link is available if it routes to a server I control (it doesn't go to the internet as I said earlier) Also, what is the best way to restart it -... | You can use the ip-up script functionality of pppd to have it execute a program when the IP interface is up and ready. Details are in the pppd(8) man page - search for "ip-up". To restart pppd, use the linkname parameter to set a known pidfile name ( /var/run/ppp-name.pid ). Also use the persist option. When you want t... | Checking network status and controlling PPP in a program So I'm running PPP under linux with a cellular modem. The program I'm writing needs to know if the link is active before sending any data. What are my options to check if the link is available if it routes to a server I control (it doesn't go to the internet as I... | TITLE:
Checking network status and controlling PPP in a program
QUESTION:
So I'm running PPP under linux with a cellular modem. The program I'm writing needs to know if the link is active before sending any data. What are my options to check if the link is available if it routes to a server I control (it doesn't go to... | [
"c",
"linux",
"networking",
"embedded",
"ppp"
] | 3 | 6 | 8,192 | 2 | 0 | 2008-09-09T06:32:42.430000 | 2008-10-02T00:11:32.820000 |
51,311 | 51,504 | What is the quickest way to a very simple blog? | I am about to start a new project and would like to document its development in a very simple blog. My requirements are: self-hosted on my Gentoo-based LAMP stack (that seems to rule out blogger) Integration in a django based website (as in www.myproject.com/about, www.myproject.com/blog etc rather than www.myproject.c... | If you're the perfectionist kind, roll your own. It isn't that hard You learn something useful You'll get exactly what you want and need Be warned that you may run into a quagmire fighting comment spam, fixing security holes, etc. But it'll probably be a fun project. If you are the practical type and ready to face some... | What is the quickest way to a very simple blog? I am about to start a new project and would like to document its development in a very simple blog. My requirements are: self-hosted on my Gentoo-based LAMP stack (that seems to rule out blogger) Integration in a django based website (as in www.myproject.com/about, www.my... | TITLE:
What is the quickest way to a very simple blog?
QUESTION:
I am about to start a new project and would like to document its development in a very simple blog. My requirements are: self-hosted on my Gentoo-based LAMP stack (that seems to rule out blogger) Integration in a django based website (as in www.myproject... | [
"django",
"blogs"
] | 7 | 13 | 1,546 | 9 | 0 | 2008-09-09T06:54:32.937000 | 2008-09-09T10:07:18.387000 |
51,320 | 51,331 | Find all drive letters in Java | For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows. I can safely assume the file is at most 2 levels deep into the filesystem, but I don't know on what drive it will be... | http://docs.oracle.com/javase/7/docs/api/java/io/File.html#listRoots() File[] roots = File.listRoots(); for(int i = 0; i < roots.length; i++) System.out.println("Root["+i+"]:" + roots[i]); google: list drives java, first hit:-) | Find all drive letters in Java For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows. I can safely assume the file is at most 2 levels deep into the filesystem, but I don'... | TITLE:
Find all drive letters in Java
QUESTION:
For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows. I can safely assume the file is at most 2 levels deep into the file... | [
"java",
"windows"
] | 20 | 39 | 24,004 | 5 | 0 | 2008-09-09T07:01:14.577000 | 2008-09-09T07:08:30.783000 |
51,338 | 237,100 | How do I implement license management for on-site installation of webapps (preferably cross-platform)? | I have a web application running on a Gentoo-based LAMP stack. My customers buy the software as a service and I host everything. However, there is some demand for on-site deployment inside the clients' own networks. Currently, because I host the system, there is no built-in license management in the app. I bill based o... | Don't. Every hour that you spend writing a license key system is an hour that you are not spending fixing bugs or adding features. By writing a license management system, you are spending resources in order to reduce the value of your product! Copyright your code, have a lawyer and be ready to prosecute anyone who viol... | How do I implement license management for on-site installation of webapps (preferably cross-platform)? I have a web application running on a Gentoo-based LAMP stack. My customers buy the software as a service and I host everything. However, there is some demand for on-site deployment inside the clients' own networks. C... | TITLE:
How do I implement license management for on-site installation of webapps (preferably cross-platform)?
QUESTION:
I have a web application running on a Gentoo-based LAMP stack. My customers buy the software as a service and I host everything. However, there is some demand for on-site deployment inside the client... | [
"web-applications",
"licensing"
] | 6 | 3 | 4,082 | 3 | 0 | 2008-09-09T07:20:11.363000 | 2008-10-25T22:11:13.993000 |
51,339 | 51,400 | How can you handle an IN sub-query with LINQ to SQL? | I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL: SELECT f.* FROM Foo f WHERE f.FooId IN ( SELECT fb.FooId FROM FooBar fb WHERE fb.BarId = 1000 ) Any help would be gratefully received. | Have a look at this article. Basically, if you want to get the equivalent of IN, you need to construct an inner query first, and then use the Contains() method. Here's my attempt at translating: var innerQuery = from fb in FoorBar where fb.BarId = 1000 select fb.FooId; var result = from f in Foo where innerQuery.Contai... | How can you handle an IN sub-query with LINQ to SQL? I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL: SELECT f.* FROM Foo f WHERE f.FooId IN ( SELECT fb.FooId FROM FooBar fb WHERE fb.BarId = 1000 ) Any help would be gratefully received. | TITLE:
How can you handle an IN sub-query with LINQ to SQL?
QUESTION:
I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL: SELECT f.* FROM Foo f WHERE f.FooId IN ( SELECT fb.FooId FROM FooBar fb WHERE fb.BarId = 1000 ) Any help would be gratefully received.
ANSWER:
Ha... | [
"sql",
"linq",
"linq-to-sql"
] | 56 | 65 | 78,147 | 9 | 0 | 2008-09-09T07:20:51.330000 | 2008-09-09T08:39:47.273000 |
51,342 | 51,358 | Implementing user defined display order UI | i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table has a [displayOrder(int)] filed which determines the display o... | using AJAX you could implement a Reoder list control you can find more information here http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ReorderList/ReorderList.aspx Mauro http://www.brantas.co.uk | Implementing user defined display order UI i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table has a [displayOrder... | TITLE:
Implementing user defined display order UI
QUESTION:
i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table h... | [
"c#",
"asp.net",
"visual-studio-2005"
] | 2 | 2 | 709 | 4 | 0 | 2008-09-09T07:24:12.167000 | 2008-09-09T07:40:54.793000 |
51,349 | 51,386 | How do you start Knowledge Transfer? | Do you use a formal event to get people talking in your IT department? Like a monthly meetup in a social place, a internal wiki/chat space or just a regular "information market" with some presentations about technology or projects made by your staff for your staff? Do you invite Sales people to participate or is it a c... | Knowledge Transfer and Knowledge Management have one drawback. They seem to cost an aweful lot: if everybody knows what I know, am I still needed? All the time I use to bring others up to speed, what do I gain from it? The best way to go about this is to be an example. Share your knowledge; in a wiki, blog about it, ta... | How do you start Knowledge Transfer? Do you use a formal event to get people talking in your IT department? Like a monthly meetup in a social place, a internal wiki/chat space or just a regular "information market" with some presentations about technology or projects made by your staff for your staff? Do you invite Sal... | TITLE:
How do you start Knowledge Transfer?
QUESTION:
Do you use a formal event to get people talking in your IT department? Like a monthly meetup in a social place, a internal wiki/chat space or just a regular "information market" with some presentations about technology or projects made by your staff for your staff?... | [
"knowledge-management"
] | 14 | 4 | 5,015 | 8 | 0 | 2008-09-09T07:27:39.957000 | 2008-09-09T08:27:00.580000 |
51,352 | 52,597 | How to show a spinner while loading an image via JavaScript | I'm currently working on a web application which has a page which displays a single chart (a.png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the chart in the middle of the page. What I want to do is when a lin... | I've used something like this to preload an image and then automatically call back to my javascript when the image is finished loading. You want to check complete before you setup the callback because the image may already be cached and it may not call your callback. function PreloadImage(imgSrc, callback){ var objImag... | How to show a spinner while loading an image via JavaScript I'm currently working on a web application which has a page which displays a single chart (a.png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the char... | TITLE:
How to show a spinner while loading an image via JavaScript
QUESTION:
I'm currently working on a web application which has a page which displays a single chart (a.png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before e... | [
"javascript",
"jquery",
"dom"
] | 57 | 41 | 105,175 | 13 | 0 | 2008-09-09T07:33:36.790000 | 2008-09-09T18:51:31.887000 |
51,363 | 51,391 | How does the Licenses.licx based .Net component licensing model work? | I've encountered multiple third party.Net component-vendors that use a licensing scheme. On an evaluation copy, the components show up with a nag-screen or watermark or some such indicator. On a licensed machine, a Licenses.licx is created - with what appears to be just the assembly full name/identifiers. This file has... | Almost everything about.Net licensing is explained here. No need to rewrite, I think. It is better to exclude license files from project in source control, if you can. Otherwise, editing visual components may be pain in the ass. Also, storing license files in source control repository is not a need. Hope this helps. | How does the Licenses.licx based .Net component licensing model work? I've encountered multiple third party.Net component-vendors that use a licensing scheme. On an evaluation copy, the components show up with a nag-screen or watermark or some such indicator. On a licensed machine, a Licenses.licx is created - with wha... | TITLE:
How does the Licenses.licx based .Net component licensing model work?
QUESTION:
I've encountered multiple third party.Net component-vendors that use a licensing scheme. On an evaluation copy, the components show up with a nag-screen or watermark or some such indicator. On a licensed machine, a Licenses.licx is ... | [
".net"
] | 53 | 14 | 33,326 | 3 | 0 | 2008-09-09T07:49:56.720000 | 2008-09-09T08:32:22.063000 |
51,380 | 51,393 | When can DataInputStream.skipBytes(n) not skip n bytes? | The Sun Documentation for DataInput.skipBytes states that it "makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number of bytes, possibly zero. This may result from any of a number of conditions; reaching end of file before n bytes ... | 1) There might not be that much data available to read (the other end of the pipe might not have sent that much data yet), and the implementing class might be non-blocking (i.e. it will just return what it can, rather than waiting for enough data to fulfil the request). I don't know if any implementations actually beha... | When can DataInputStream.skipBytes(n) not skip n bytes? The Sun Documentation for DataInput.skipBytes states that it "makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number of bytes, possibly zero. This may result from any of a nu... | TITLE:
When can DataInputStream.skipBytes(n) not skip n bytes?
QUESTION:
The Sun Documentation for DataInput.skipBytes states that it "makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number of bytes, possibly zero. This may resul... | [
"io",
"java"
] | 11 | 5 | 3,220 | 5 | 0 | 2008-09-09T08:19:01.533000 | 2008-09-09T08:33:02.903000 |
51,390 | 51,399 | Where did all the java applets go? | When java was young, people were excited about writing applets. They were cool and popular, for a little while. Now, I never see them anymore. Instead we have flash, javascript, and a plethora of other web app-building technologies. Why don't sites use java applets anymore? I'm also curious: historically, why do you th... | I think Java applets were overshadowed by Flash and ActionScript (pun unintended), being much easier to use for what Java Applets were being used at the time (animations + stateful applications). Flash's success in this respect in turn owes to its much smaller file sizes, as well as benefiting from the Sun vs. Microsof... | Where did all the java applets go? When java was young, people were excited about writing applets. They were cool and popular, for a little while. Now, I never see them anymore. Instead we have flash, javascript, and a plethora of other web app-building technologies. Why don't sites use java applets anymore? I'm also c... | TITLE:
Where did all the java applets go?
QUESTION:
When java was young, people were excited about writing applets. They were cool and popular, for a little while. Now, I never see them anymore. Instead we have flash, javascript, and a plethora of other web app-building technologies. Why don't sites use java applets a... | [
"java",
"applet"
] | 56 | 36 | 13,567 | 15 | 0 | 2008-09-09T08:30:38.120000 | 2008-09-09T08:39:12.530000 |
51,407 | 51,433 | Can you load a .Net form as a control? | I want to load a desktop application, via reflection, as a Control inside another application. The application I'm reflecting is a legacy one - I can't make changes to it. I can dynamically access the Form, but can't load it as a Control. In.Net Form expands on Control, and I can assign the reflected Form as a Control,... | Yes, this works just fine. I'm working on a.NET app right now that loads forms into a panel on a host form. The relevant snippet: // setup the new form form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; form.Show ( );
// add to the panel's list of child controls panelFormHo... | Can you load a .Net form as a control? I want to load a desktop application, via reflection, as a Control inside another application. The application I'm reflecting is a legacy one - I can't make changes to it. I can dynamically access the Form, but can't load it as a Control. In.Net Form expands on Control, and I can ... | TITLE:
Can you load a .Net form as a control?
QUESTION:
I want to load a desktop application, via reflection, as a Control inside another application. The application I'm reflecting is a legacy one - I can't make changes to it. I can dynamically access the Form, but can't load it as a Control. In.Net Form expands on C... | [
".net",
"winforms"
] | 7 | 10 | 1,146 | 3 | 0 | 2008-09-09T08:45:43.607000 | 2008-09-09T09:06:08.193000 |
51,412 | 51,415 | Passing on named variable arguments in python | Say I have the following methods: def methodA(arg, **kwargs): pass
def methodB(arg, *args, **kwargs): pass In methodA I wish to call methodB, passing on the kwargs. However, it seems that if I define methodA as follows, the second argument will be passed on as positional rather than named variable arguments. def metho... | Put the asterisks before the kwargs variable. This makes Python pass the variable (which is assumed to be a dictionary) as keyword arguments. methodB("argvalue", **kwargs) | Passing on named variable arguments in python Say I have the following methods: def methodA(arg, **kwargs): pass
def methodB(arg, *args, **kwargs): pass In methodA I wish to call methodB, passing on the kwargs. However, it seems that if I define methodA as follows, the second argument will be passed on as positional r... | TITLE:
Passing on named variable arguments in python
QUESTION:
Say I have the following methods: def methodA(arg, **kwargs): pass
def methodB(arg, *args, **kwargs): pass In methodA I wish to call methodB, passing on the kwargs. However, it seems that if I define methodA as follows, the second argument will be passed ... | [
"python",
"variadic-functions"
] | 13 | 34 | 10,663 | 3 | 0 | 2008-09-09T08:46:51.920000 | 2008-09-09T08:50:34.143000 |
51,420 | 51,426 | How to get the base 10 logarithm of a Fixnum in Ruby? | I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10. What is the easiest way to get the base 10 logarithm of a Fixnum? | There is Math::log10 (n) And there is also a property of logarithms that logx(y) = log(y)/log(x) | How to get the base 10 logarithm of a Fixnum in Ruby? I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10. What is the easiest way to get the base 10 logarithm of a Fixnum? | TITLE:
How to get the base 10 logarithm of a Fixnum in Ruby?
QUESTION:
I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10. What is the easiest way to get the base 10 logarithm of a Fixnum?
ANSWER:
There is... | [
"ruby",
"math",
"logarithm"
] | 3 | 10 | 2,913 | 3 | 0 | 2008-09-09T08:56:23.287000 | 2008-09-09T09:00:35.553000 |
51,436 | 51,460 | How to host licensed .Net controls in unmanaged C++ app? | I need to host and run managed controls inside of a purely unmanaged C++ app. How to do this? To run unlicensed controls is typically simple: if (SUCCEEDED(ClrCreateManagedInstance(type, iid, &obj))) { // do something with obj } When using a licensed control however, we need to somehow embed a.licx file into the projec... | The answer depends on the particular component you're using. Contact your component help desk OR read up the documentation on what it takes to deploy their component. Basically component developers are free to implement licensing as they deem fit. With the.licx file the component needs to be able to do whatever the dev... | How to host licensed .Net controls in unmanaged C++ app? I need to host and run managed controls inside of a purely unmanaged C++ app. How to do this? To run unlicensed controls is typically simple: if (SUCCEEDED(ClrCreateManagedInstance(type, iid, &obj))) { // do something with obj } When using a licensed control howe... | TITLE:
How to host licensed .Net controls in unmanaged C++ app?
QUESTION:
I need to host and run managed controls inside of a purely unmanaged C++ app. How to do this? To run unlicensed controls is typically simple: if (SUCCEEDED(ClrCreateManagedInstance(type, iid, &obj))) { // do something with obj } When using a lic... | [
"c++",
".net",
"unmanaged"
] | 3 | 1 | 542 | 1 | 0 | 2008-09-09T09:08:55.847000 | 2008-09-09T09:30:04.687000 |
51,452 | 51,543 | Best practice for Java IPC | what is the best method for inter process communication in a multithreaded java app. It should be performant (so no JMS please) easy to implement and reliable,so that objects & data can be bound to one thread only? Any ideas welcome! | Assuming the scenario 1 JVM, multiple threads then indeed java.util.concurrent is the place to look, specifically the various Queue implementations. However an abstraction on top of that may be nice and there Jetlang looks very interesting, lightweight Java message passing. | Best practice for Java IPC what is the best method for inter process communication in a multithreaded java app. It should be performant (so no JMS please) easy to implement and reliable,so that objects & data can be bound to one thread only? Any ideas welcome! | TITLE:
Best practice for Java IPC
QUESTION:
what is the best method for inter process communication in a multithreaded java app. It should be performant (so no JMS please) easy to implement and reliable,so that objects & data can be bound to one thread only? Any ideas welcome!
ANSWER:
Assuming the scenario 1 JVM, mul... | [
"java",
"multithreading"
] | 14 | 9 | 17,633 | 5 | 0 | 2008-09-09T09:20:37.393000 | 2008-09-09T10:29:51.393000 |
51,470 | 93,633 | How do I reset a sequence in Oracle? | In PostgreSQL, I can do something like this: ALTER SEQUENCE serial RESTART WITH 0; Is there an Oracle equivalent? | Here is a good procedure for resetting any sequence to 0 from Oracle guru Tom Kyte. Great discussion on the pros and cons in the links below too. tkyte@TKYTE901.US.ORACLE.COM> create or replace procedure reset_seq( p_seq_name in varchar2 ) is l_val number; begin execute immediate 'select ' || p_seq_name || '.nextval fr... | How do I reset a sequence in Oracle? In PostgreSQL, I can do something like this: ALTER SEQUENCE serial RESTART WITH 0; Is there an Oracle equivalent? | TITLE:
How do I reset a sequence in Oracle?
QUESTION:
In PostgreSQL, I can do something like this: ALTER SEQUENCE serial RESTART WITH 0; Is there an Oracle equivalent?
ANSWER:
Here is a good procedure for resetting any sequence to 0 from Oracle guru Tom Kyte. Great discussion on the pros and cons in the links below t... | [
"sql",
"database",
"oracle",
"sequence"
] | 205 | 164 | 735,375 | 18 | 0 | 2008-09-09T09:36:39.320000 | 2008-09-18T15:34:52.270000 |
51,492 | 2,567,924 | What usable alternatives to XML syntax do you know? | For me usable means that: it's being used in real-wold it has tools support. (at least some simple editor) it has human readable syntax (no angle brackets please) Also I want it to be as close to XML as possible, i.e. there must be support for attributes as well as for properties. So, no YAML please. Currently, only on... | YAML is a 100% superset of JSON, so it doesn't make sense to reject YAML and then consider JSON instead. YAML does everything JSON does, but YAML gives so much more too (like references). I can't think of anything XML can do that YAML can't, except to validate a document with a DTD, which in my experience has never bee... | What usable alternatives to XML syntax do you know? For me usable means that: it's being used in real-wold it has tools support. (at least some simple editor) it has human readable syntax (no angle brackets please) Also I want it to be as close to XML as possible, i.e. there must be support for attributes as well as fo... | TITLE:
What usable alternatives to XML syntax do you know?
QUESTION:
For me usable means that: it's being used in real-wold it has tools support. (at least some simple editor) it has human readable syntax (no angle brackets please) Also I want it to be as close to XML as possible, i.e. there must be support for attrib... | [
"xml",
"syntax",
"yaml"
] | 29 | 57 | 31,103 | 14 | 0 | 2008-09-09T09:54:41.383000 | 2010-04-02T16:53:50.263000 |
51,499 | 62,714 | Are there any good automated frameworks for applying coding standards in Perl? | One I am aware of is Perl::Critic And my googling has resulted in no results on multiple attempts so far.:-( Does anyone have any recommendations here? Any resources to configure Perl::Critic as per our coding standards and run it on code base would be appreciated. | In terms of setting up a profile, have you tried perlcritic --profile-proto? This will emit to stdout all of your installed policies with all their options with descriptions of both, including their default values, in perlcriticrc format. Save and edit to match what you want. Whenever you upgrade Perl::Critic, you may ... | Are there any good automated frameworks for applying coding standards in Perl? One I am aware of is Perl::Critic And my googling has resulted in no results on multiple attempts so far.:-( Does anyone have any recommendations here? Any resources to configure Perl::Critic as per our coding standards and run it on code ba... | TITLE:
Are there any good automated frameworks for applying coding standards in Perl?
QUESTION:
One I am aware of is Perl::Critic And my googling has resulted in no results on multiple attempts so far.:-( Does anyone have any recommendations here? Any resources to configure Perl::Critic as per our coding standards and... | [
"perl",
"frameworks",
"coding-style",
"perl-critic"
] | 8 | 12 | 1,038 | 7 | 0 | 2008-09-09T10:01:06.640000 | 2008-09-15T13:12:17.130000 |
51,501 | 202,989 | Where to find gdb for an arm target running on linux 2.6.21.5-cfs-v19 | I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that was with some earlier version of the board linux version. With this v... | Sometime ago I published an article about cross-target debugging with GDB and GDBServer. The target processor there is PPC7450, but it's rather detailed, so maybe you'll find it useful. | Where to find gdb for an arm target running on linux 2.6.21.5-cfs-v19 I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that... | TITLE:
Where to find gdb for an arm target running on linux 2.6.21.5-cfs-v19
QUESTION:
I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the... | [
"linux",
"gdb",
"arm"
] | 0 | 2 | 3,430 | 2 | 0 | 2008-09-09T10:04:03.467000 | 2008-10-14T21:50:41.860000 |
51,502 | 52,090 | Improving Python readability? | I've been really enjoying Python programming lately. I come from a background of a strong love for C-based coding, where everything is perhaps more complicated than it should be (but puts hair on your chest, at least). So switching from C to Python for more complex things that don't require tons of speed has been more ... | Part of learning a new programming language is learning to read code in that language. A crutch like this may make it easier to read your own code, but it's going to impede the process of learning how to read anyone else's Python code. I really think you'd be better off getting rid of the end of block comments and gett... | Improving Python readability? I've been really enjoying Python programming lately. I come from a background of a strong love for C-based coding, where everything is perhaps more complicated than it should be (but puts hair on your chest, at least). So switching from C to Python for more complex things that don't requir... | TITLE:
Improving Python readability?
QUESTION:
I've been really enjoying Python programming lately. I come from a background of a strong love for C-based coding, where everything is perhaps more complicated than it should be (but puts hair on your chest, at least). So switching from C to Python for more complex things... | [
"python",
"readability"
] | 4 | 24 | 3,066 | 7 | 0 | 2008-09-09T10:05:36.770000 | 2008-09-09T14:58:52.277000 |
51,520 | 51,523 | How to get an absolute file path in Python | Given a path such as "mydir/myfile.txt", how do I find the file's absolute path in Python? E.g. on Windows, I might end up with: "C:/example/cwd/mydir/myfile.txt" | >>> import os >>> os.path.abspath("mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt' Also works if it is already an absolute path: >>> import os >>> os.path.abspath("C:/example/cwd/mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt' | How to get an absolute file path in Python Given a path such as "mydir/myfile.txt", how do I find the file's absolute path in Python? E.g. on Windows, I might end up with: "C:/example/cwd/mydir/myfile.txt" | TITLE:
How to get an absolute file path in Python
QUESTION:
Given a path such as "mydir/myfile.txt", how do I find the file's absolute path in Python? E.g. on Windows, I might end up with: "C:/example/cwd/mydir/myfile.txt"
ANSWER:
>>> import os >>> os.path.abspath("mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt'... | [
"python",
"path",
"relative-path",
"absolute-path"
] | 1,043 | 1,503 | 1,471,137 | 11 | 0 | 2008-09-09T10:19:32.727000 | 2008-09-09T10:21:03.987000 |
51,526 | 51,537 | Changing the value of an element in a list of structs | I have a list of structs and I want to change one element. For example: MyList.Add(new MyStruct("john"); MyList.Add(new MyStruct("peter"); Now I want to change one element: MyList[1].Name = "bob" However, whenever I try and do this I get the following error: Cannot modify the return value of System.Collections.Generic.... | MyList[1] = new MyStruct("bob"); structs in C# should almost always be designed to be immutable (that is, have no way to change their internal state once they have been created). In your case, what you want to do is to replace the entire struct in specified array index, not to try to change just a single property or fi... | Changing the value of an element in a list of structs I have a list of structs and I want to change one element. For example: MyList.Add(new MyStruct("john"); MyList.Add(new MyStruct("peter"); Now I want to change one element: MyList[1].Name = "bob" However, whenever I try and do this I get the following error: Cannot ... | TITLE:
Changing the value of an element in a list of structs
QUESTION:
I have a list of structs and I want to change one element. For example: MyList.Add(new MyStruct("john"); MyList.Add(new MyStruct("peter"); Now I want to change one element: MyList[1].Name = "bob" However, whenever I try and do this I get the follow... | [
"c#",
"struct",
"value-type"
] | 84 | 44 | 116,932 | 8 | 0 | 2008-09-09T10:23:29.503000 | 2008-09-09T10:27:56.700000 |
51,530 | 51,547 | How do you treat legacy code (and data)? | I am currently in the process of restructuring my local Subversion repository by adding some new projects and merging legacy code and data from a couple of older repositories into it. When I have done this in the past I have usually put the legacy code in a dedicated "legacy" folder, as not to "disturb" the new and "we... | All code becomes 'legacy' one day, why seperate it at all? Source control is by project/branch or project/platform/branch and that type of hierarchy. Who cares how long in the tooth it is? | How do you treat legacy code (and data)? I am currently in the process of restructuring my local Subversion repository by adding some new projects and merging legacy code and data from a couple of older repositories into it. When I have done this in the past I have usually put the legacy code in a dedicated "legacy" fo... | TITLE:
How do you treat legacy code (and data)?
QUESTION:
I am currently in the process of restructuring my local Subversion repository by adding some new projects and merging legacy code and data from a couple of older repositories into it. When I have done this in the past I have usually put the legacy code in a ded... | [
"svn",
"version-control",
"project-management",
"legacy"
] | 0 | 4 | 559 | 5 | 0 | 2008-09-09T10:24:44.710000 | 2008-09-09T10:31:39.327000 |
51,540 | 51,554 | Determine how much memory a class uses? | I am trying to find a way to determine at run-time how much memory a given class is using in.NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses? | I've only recently started looking into this type of thing, but i have found that memory profilers can give quite detailed information regarding instances of objects within your application. Here are a couple that are worth trying: ANTS Profiler.NET Memory Profiler | Determine how much memory a class uses? I am trying to find a way to determine at run-time how much memory a given class is using in.NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses? | TITLE:
Determine how much memory a class uses?
QUESTION:
I am trying to find a way to determine at run-time how much memory a given class is using in.NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses?
ANSWER:
I've only recently started lo... | [
".net",
"memory"
] | 8 | 5 | 658 | 3 | 0 | 2008-09-09T10:28:47.667000 | 2008-09-09T10:34:01.040000 |
51,553 | 52,006 | Why are SQL aggregate functions so much slower than Python and Java (or Poor Man's OLAP) | I need a real DBA's opinion. Postgres 8.3 takes 200 ms to execute this query on my Macbook Pro while Java and Python perform the same calculation in under 20 ms (350,000 rows): SELECT count(id), avg(a), avg(b), avg(c), avg(d) FROM tuples; Is this normal behaviour when using a SQL database? The schema (the table holds r... | Postgres is doing a lot more than it looks like (maintaining data consistency for a start!) If the values don't have to be 100% spot on, or if the table is updated rarely, but you are running this calculation often, you might want to look into Materialized Views to speed it up. (Note, I have not used materialized views... | Why are SQL aggregate functions so much slower than Python and Java (or Poor Man's OLAP) I need a real DBA's opinion. Postgres 8.3 takes 200 ms to execute this query on my Macbook Pro while Java and Python perform the same calculation in under 20 ms (350,000 rows): SELECT count(id), avg(a), avg(b), avg(c), avg(d) FROM ... | TITLE:
Why are SQL aggregate functions so much slower than Python and Java (or Poor Man's OLAP)
QUESTION:
I need a real DBA's opinion. Postgres 8.3 takes 200 ms to execute this query on my Macbook Pro while Java and Python perform the same calculation in under 20 ms (350,000 rows): SELECT count(id), avg(a), avg(b), av... | [
"python",
"sql",
"optimization",
"aggregate",
"olap"
] | 16 | 12 | 7,656 | 10 | 0 | 2008-09-09T10:33:39.620000 | 2008-09-09T14:26:28.297000 |
51,561 | 51,566 | How do I automate finding unused #include directives? | Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed? Of course ... | You can use PC-Lint/FlexeLint to do that. Unusually there isn't a free OS version of the tool available. You can remove #includes by passing by reference instead of passing by value and forward declaring. This is because the compiler doesn't need to know the size of the object at compile time. This will require a large... | How do I automate finding unused #include directives? Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do ... | TITLE:
How do I automate finding unused #include directives?
QUESTION:
Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no long... | [
"c"
] | 28 | 5 | 4,002 | 5 | 0 | 2008-09-09T10:38:25.507000 | 2008-09-09T10:41:43.563000 |
51,574 | 52,691 | Good Java graph algorithm library? | Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend? To clarify, I'm not looking for a library that produces graph... | If you were using JGraph, you should give a try to JGraphT which is designed for algorithms. One of its features is visualization using the JGraph library. It's still developed, but pretty stable. I analyzed the complexity of JGraphT algorithms some time ago. Some of them aren't the quickest, but if you're going to imp... | Good Java graph algorithm library? Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend? To clarify, I'm not lookin... | TITLE:
Good Java graph algorithm library?
QUESTION:
Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend? To clari... | [
"java",
"algorithm",
"graph"
] | 237 | 114 | 219,683 | 18 | 0 | 2008-09-09T10:47:34.047000 | 2008-09-09T19:28:21.427000 |
51,582 | 51,623 | Java Generics: Comparing the class of Object o to <E> | Let's say I have the following class: public class Test { public boolean sameClassAs(Object o) { // TODO help! } } How would I check that o is the same class as E? Test test = new Test (); test.sameClassAs("a string"); // returns true; test.sameClassAs(4); // returns false; I can't change the method signature from (Obj... | An instance of Test has no information as to what E is at runtime. So, you need to pass a Class to the constructor of Test. public class Test { private final Class clazz; public Test(Class clazz) { if (clazz == null) { throw new NullPointerException(); } this.clazz = clazz; } // To make things easier on clients: public... | Java Generics: Comparing the class of Object o to <E> Let's say I have the following class: public class Test { public boolean sameClassAs(Object o) { // TODO help! } } How would I check that o is the same class as E? Test test = new Test (); test.sameClassAs("a string"); // returns true; test.sameClassAs(4); // return... | TITLE:
Java Generics: Comparing the class of Object o to <E>
QUESTION:
Let's say I have the following class: public class Test { public boolean sameClassAs(Object o) { // TODO help! } } How would I check that o is the same class as E? Test test = new Test (); test.sameClassAs("a string"); // returns true; test.sameCla... | [
"java",
"generics"
] | 27 | 27 | 41,495 | 4 | 0 | 2008-09-09T10:54:10.537000 | 2008-09-09T11:16:30.907000 |
51,584 | 51,596 | Twitter for work updates | If you are sending work/progress reports to the project lead on a daily or weekly basis, I wondered if you would consider using Twitter or similar services for these updates. Say if you're working remotely or with a distributed team and the project lead has a hard time getting an overview about the topics people are wo... | Try Laconica: An open source Twitter-like system you could run on your own servers. | Twitter for work updates If you are sending work/progress reports to the project lead on a daily or weekly basis, I wondered if you would consider using Twitter or similar services for these updates. Say if you're working remotely or with a distributed team and the project lead has a hard time getting an overview about... | TITLE:
Twitter for work updates
QUESTION:
If you are sending work/progress reports to the project lead on a daily or weekly basis, I wondered if you would consider using Twitter or similar services for these updates. Say if you're working remotely or with a distributed team and the project lead has a hard time getting... | [
"project-management",
"project-planning",
"knowledge-management"
] | 7 | 15 | 610 | 11 | 0 | 2008-09-09T10:55:04.437000 | 2008-09-09T11:01:32.330000 |
51,586 | 51,621 | Accessing non-generic members of a generic object | Is there a way to collect (e.g. in a List) multiple 'generic' objects that don't share a common super class? If so, how can I access their common properties? For example: class MyObject { public T Value { get; set; } public string Name { get; set; }
public MyObject(string name, T value) { Name = name; Value = value; }... | I don't think it is possible in C#, because MyObject is not a baseclass of MyObject. What I usually do is to define an interface (a 'normal' one, not generic) and make MyObject implement that interface, e.g. interface INamedObject { string Name {get;} } and then you can use the interface: List list = new List (){fst, s... | Accessing non-generic members of a generic object Is there a way to collect (e.g. in a List) multiple 'generic' objects that don't share a common super class? If so, how can I access their common properties? For example: class MyObject { public T Value { get; set; } public string Name { get; set; }
public MyObject(str... | TITLE:
Accessing non-generic members of a generic object
QUESTION:
Is there a way to collect (e.g. in a List) multiple 'generic' objects that don't share a common super class? If so, how can I access their common properties? For example: class MyObject { public T Value { get; set; } public string Name { get; set; }
p... | [
"c#",
".net",
"generics"
] | 3 | 7 | 1,249 | 3 | 0 | 2008-09-09T10:56:45.103000 | 2008-09-09T11:13:54.483000 |
51,592 | 51,602 | Is there a need to destroy char * = "string" or char * = new char[6]? | I assume that char* = "string" is the same to char* = new char[6]. I believe these strings are created on the heap instead of the stack. So do I need to destroy them or free their memory when I'm done using them or do they get destroyed by themselves? | No. You only need to manually free strings when you manually allocate the memory yourself using the malloc function (in C) or the new operator (in C++). If you do not use malloc or new, then the char* or string will be created on the stack or as a compile-time constant. | Is there a need to destroy char * = "string" or char * = new char[6]? I assume that char* = "string" is the same to char* = new char[6]. I believe these strings are created on the heap instead of the stack. So do I need to destroy them or free their memory when I'm done using them or do they get destroyed by themselves... | TITLE:
Is there a need to destroy char * = "string" or char * = new char[6]?
QUESTION:
I assume that char* = "string" is the same to char* = new char[6]. I believe these strings are created on the heap instead of the stack. So do I need to destroy them or free their memory when I'm done using them or do they get destr... | [
"c++",
"memory"
] | 20 | 36 | 13,667 | 8 | 0 | 2008-09-09T10:59:38.620000 | 2008-09-09T11:02:44.480000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.