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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
118,547 | 118,606 | Creating a ZIP file on Windows (XP/2003) in C/C++ | I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine too, project already uses MFC). I'd be really gratef... | EDIT: This answer is old, but I cannot delete it because it was accepted. See the next one https://stackoverflow.com/a/121720/3937 ----- ORIGINAL ANSWER ----- There is sample code to do that here [EDIT: Link is now broken] http://www.eggheadcafe.com/software/aspnet/31056644/using-shfileoperation-to.aspx Make sure you r... | Creating a ZIP file on Windows (XP/2003) in C/C++ I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine to... | TITLE:
Creating a ZIP file on Windows (XP/2003) in C/C++
QUESTION:
I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C A... | [
"c++",
"winapi",
"zip"
] | 13 | 5 | 40,055 | 7 | 0 | 2008-09-23T01:05:12.557000 | 2008-09-23T01:20:38.357000 |
118,565 | 118,574 | How do I call a web service from javascript | Say I have a web service http://www.example.com/webservice.pl?q=google which returns text "google.com". I need to call this web service ( http://www.example.com/webservice.pl ) from a JavaScript module with a parameter (q=google) and then use the return value ("google.com") to do further processing. What's the simplest... | Take a look at one of the many javascript libraries out there. I'd recommend jQuery, personally. Aside from all the fancy UI stuff they can do, it has really good cross-browser AJAX libraries. $.get( "http://xyz.com/webservice.pl", { q: "google" }, function(data) { alert(data); // "google.com" } ); | How do I call a web service from javascript Say I have a web service http://www.example.com/webservice.pl?q=google which returns text "google.com". I need to call this web service ( http://www.example.com/webservice.pl ) from a JavaScript module with a parameter (q=google) and then use the return value ("google.com") t... | TITLE:
How do I call a web service from javascript
QUESTION:
Say I have a web service http://www.example.com/webservice.pl?q=google which returns text "google.com". I need to call this web service ( http://www.example.com/webservice.pl ) from a JavaScript module with a parameter (q=google) and then use the return valu... | [
"javascript",
"web-services"
] | 11 | 12 | 38,145 | 2 | 0 | 2008-09-23T01:08:32.783000 | 2008-09-23T01:10:42.280000 |
118,591 | 118,817 | How to express this Bash command in pure Python | I have this line in a useful Bash script that I haven't managed to translate into Python, where 'a' is a user-input number of days' worth of files to archive: find ~/podcasts/current -mindepth 2 -mtime '+`a`+' -exec mv {} ~/podcasts/old \; I am familiar with the os.name and getpass.getuser for the most general cross-pl... | import os import shutil from os import path from os.path import join, getmtime from time import time
archive = "bak" current = "cur"
def archive_old_versions(days = 3): for root, dirs, files in os.walk(current): for name in files: fullname = join(root, name) if (getmtime(fullname) < time() - days * 60 * 60 * 24): shu... | How to express this Bash command in pure Python I have this line in a useful Bash script that I haven't managed to translate into Python, where 'a' is a user-input number of days' worth of files to archive: find ~/podcasts/current -mindepth 2 -mtime '+`a`+' -exec mv {} ~/podcasts/old \; I am familiar with the os.name a... | TITLE:
How to express this Bash command in pure Python
QUESTION:
I have this line in a useful Bash script that I haven't managed to translate into Python, where 'a' is a user-input number of days' worth of files to archive: find ~/podcasts/current -mindepth 2 -mtime '+`a`+' -exec mv {} ~/podcasts/old \; I am familiar ... | [
"python",
"shell",
"language-comparisons"
] | 1 | 5 | 1,344 | 4 | 0 | 2008-09-23T01:15:54.123000 | 2008-09-23T02:39:18.447000 |
118,595 | 121,067 | AJAX webservices - extensions of web or biz layer? | My question is possibly a subtle one: Web services - are they extensions of the presentation/web layer?..or are they extensions of the biz/data layer? That may seem like a dumb question. Web services are an extension of the web tier. I'm not so sure though. I'm building a pretty standard webform with some AJAX-y featur... | In my mind, a web service has 2 characteristics: it exposes data to external sources, i.e. other sources than the application they reside within. In this sense I agree with @Pete in that you're not really designing a web service; you're designing a helper class that responds to requests in a web-service-like fashion. A... | AJAX webservices - extensions of web or biz layer? My question is possibly a subtle one: Web services - are they extensions of the presentation/web layer?..or are they extensions of the biz/data layer? That may seem like a dumb question. Web services are an extension of the web tier. I'm not so sure though. I'm buildin... | TITLE:
AJAX webservices - extensions of web or biz layer?
QUESTION:
My question is possibly a subtle one: Web services - are they extensions of the presentation/web layer?..or are they extensions of the biz/data layer? That may seem like a dumb question. Web services are an extension of the web tier. I'm not so sure t... | [
"asp.net",
"javascript",
"ajax",
"web-services"
] | 0 | 2 | 265 | 4 | 0 | 2008-09-23T01:18:02.980000 | 2008-09-23T13:41:35.220000 |
118,599 | 118,613 | Encryption output always different even with same key | I'm trying to store a password in a file that I'd like to retrieve for later. Hashing is not an option as I need the password for connecting to a remote server for later. The following code works well, but it creates a different output each time even though the key is the same. This is bad as when the application shuts... | I believe that what's happening is that the crypto provider is randomly generating an IV. Specify this and it should no longer differ. Edit: You can do this in your 'keyProvider' by setting the IV property. | Encryption output always different even with same key I'm trying to store a password in a file that I'd like to retrieve for later. Hashing is not an option as I need the password for connecting to a remote server for later. The following code works well, but it creates a different output each time even though the key ... | TITLE:
Encryption output always different even with same key
QUESTION:
I'm trying to store a password in a file that I'd like to retrieve for later. Hashing is not an option as I need the password for connecting to a remote server for later. The following code works well, but it creates a different output each time ev... | [
"c#",
"encryption",
"cryptography"
] | 4 | 8 | 4,993 | 3 | 0 | 2008-09-23T01:19:00.123000 | 2008-09-23T01:22:56.960000 |
118,615 | 118,881 | How do I get access to Castle Windsor's Fluent Interfaces API? | I've been having tons of problems getting the non-xml configuration for Castle Windsor set up working properly. In the meantime I've seen more and more people giving advice via the Windsor Container fluent interface. I've been Gooogling about for the last day and I cannot find this API anywhere. I am talking about the ... | The Fluent interfaces were introduced a while ago - but are only available on Trunk (after RC3) either grab the castles sources (from the projects subversion repository) and build the IoC projects yourself from here, or easier still grab the latest successful build on the continuous integration server and use that. Cas... | How do I get access to Castle Windsor's Fluent Interfaces API? I've been having tons of problems getting the non-xml configuration for Castle Windsor set up working properly. In the meantime I've seen more and more people giving advice via the Windsor Container fluent interface. I've been Gooogling about for the last d... | TITLE:
How do I get access to Castle Windsor's Fluent Interfaces API?
QUESTION:
I've been having tons of problems getting the non-xml configuration for Castle Windsor set up working properly. In the meantime I've seen more and more people giving advice via the Windsor Container fluent interface. I've been Gooogling ab... | [
"api",
"castle-windsor",
"fluent-interface"
] | 4 | 7 | 1,790 | 2 | 0 | 2008-09-23T01:23:23.653000 | 2008-09-23T03:06:31.767000 |
118,624 | 118,637 | What is semantic markup, and why would I want to use that? | Like it says. | Using semantic markup means that the (X)HTML code you use in a page contains metadata describing its purpose -- for example, an that contains an employee's name might be marked class="employee-name". Originally there were some people that hoped search engines would use this information, but as the web has evolved seman... | What is semantic markup, and why would I want to use that? Like it says. | TITLE:
What is semantic markup, and why would I want to use that?
QUESTION:
Like it says.
ANSWER:
Using semantic markup means that the (X)HTML code you use in a page contains metadata describing its purpose -- for example, an that contains an employee's name might be marked class="employee-name". Originally there wer... | [
"html",
"language-agnostic",
"xhtml",
"web-standards",
"semantic-markup"
] | 10 | 7 | 8,244 | 5 | 0 | 2008-09-23T01:26:28.403000 | 2008-09-23T01:31:48.843000 |
118,630 | 118,664 | What is the best signature for overloaded arithmetic operators in C++? | I had assumed that the canonical form for operator+, assuming the existence of an overloaded operator+= member function, was like this: const T operator+(const T& lhs, const T& rhs) { return T(lhs) +=rhs; } But it was pointed out to me that this would also work: const T operator+ (T lhs, const T& rhs) { return lhs+=rhs... | With the edited question, the first form would be preferred. The compiler will more likely optimize the return value (you could verify this by placing a breakpoint in the constructor for T). The first form also takes both parameters as const, which would be more desirable. Research on the topic of return value optimiza... | What is the best signature for overloaded arithmetic operators in C++? I had assumed that the canonical form for operator+, assuming the existence of an overloaded operator+= member function, was like this: const T operator+(const T& lhs, const T& rhs) { return T(lhs) +=rhs; } But it was pointed out to me that this wou... | TITLE:
What is the best signature for overloaded arithmetic operators in C++?
QUESTION:
I had assumed that the canonical form for operator+, assuming the existence of an overloaded operator+= member function, was like this: const T operator+(const T& lhs, const T& rhs) { return T(lhs) +=rhs; } But it was pointed out t... | [
"c++",
"operator-keyword"
] | 1 | 2 | 1,799 | 7 | 0 | 2008-09-23T01:29:26.383000 | 2008-09-23T01:39:58.807000 |
118,632 | 118,655 | CSS to make a table column take up as much room as possible, and other cols as little | I need to layout a html datatable with CSS. The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of its contents, while the other columns take up as little width as possible. I can't sp... | I'm far from being a CSS expert but this works for me (in IE, FF, Safari and Chrome): td.zero_width { width: 1%; } Then in your HTML:... | CSS to make a table column take up as much room as possible, and other cols as little I need to layout a html datatable with CSS. The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of... | TITLE:
CSS to make a table column take up as much room as possible, and other cols as little
QUESTION:
I need to layout a html datatable with CSS. The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possi... | [
"css",
"css-tables",
"column-width"
] | 11 | 6 | 8,589 | 3 | 0 | 2008-09-23T01:30:11.483000 | 2008-09-23T01:38:07.517000 |
118,633 | 118,776 | What's so wrong about using GC.Collect()? | Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers wouldn't ever use, even those who don't even know what it is for. Let's say I'm developing an application where memory usage... | From Rico's Blog... Rule #1 Don't. This is really the most important rule. It's fair to say that most usages of GC.Collect() are a bad idea and I went into that in some detail in the orginal posting so I won't repeat all that here. So let's move on to... Rule #2 Consider calling GC.Collect() if some non-recurring event... | What's so wrong about using GC.Collect()? Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers wouldn't ever use, even those who don't even know what it is for. Let's say I'm de... | TITLE:
What's so wrong about using GC.Collect()?
QUESTION:
Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers wouldn't ever use, even those who don't even know what it is for... | [
".net",
"performance",
"memory-management",
"garbage-collection"
] | 113 | 91 | 73,350 | 20 | 0 | 2008-09-23T01:30:12.357000 | 2008-09-23T02:15:16.947000 |
118,643 | 118,744 | Is there a way to convert indentation in Python code to braces? | I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter and... | There's a solution to your problem that is distributed with python itself. pindent.py, it's located in the Tools\Scripts directory in a windows install (my path to it is C:\Python25\Tools\Scripts), it looks like you'd have to grab it from svn.python.org if you are running on Linux or OSX. It adds comments when blocks a... | Is there a way to convert indentation in Python code to braces? I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me t... | TITLE:
Is there a way to convert indentation in Python code to braces?
QUESTION:
I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available tha... | [
"python"
] | 85 | 59 | 12,474 | 11 | 0 | 2008-09-23T01:33:13.363000 | 2008-09-23T02:04:01.760000 |
118,648 | 118,666 | Best way to import a website into a Visual Sourcesafe 2005 Database | What is the best way to import a website into a Visual Sourcesafe 2005 database? I tried opening a the VSS database and drag-n-drop the folder but it started prompting me for a comment on each folder. Is there a better way or someway to have it only ask onces for any files or folders that are being processed? | I'm assuming your using ASP.NET for your website, if not Im sorry but you dont specify in your question. There is an MSDN article here describing how to work with ASP.NET websites in VSS, hope this helps. | Best way to import a website into a Visual Sourcesafe 2005 Database What is the best way to import a website into a Visual Sourcesafe 2005 database? I tried opening a the VSS database and drag-n-drop the folder but it started prompting me for a comment on each folder. Is there a better way or someway to have it only as... | TITLE:
Best way to import a website into a Visual Sourcesafe 2005 Database
QUESTION:
What is the best way to import a website into a Visual Sourcesafe 2005 database? I tried opening a the VSS database and drag-n-drop the folder but it started prompting me for a comment on each folder. Is there a better way or someway ... | [
"import",
"visual-sourcesafe"
] | 0 | 1 | 704 | 2 | 0 | 2008-09-23T01:34:49.820000 | 2008-09-23T01:41:00.100000 |
118,654 | 170,856 | Iron python, beautiful soup, win32 app | Does beautiful soup work with iron python? If so with which version of iron python? How easy is it to distribute a windows desktop app on.net 2.0 using iron python (mostly c# calling some python code for parsing html)? | I was asking myself this same question and after struggling to follow advice here and elsewhere to get IronPython and BeautifulSoup to play nicely with my existing code I decided to go looking for an alternative native.NET solution. BeautifulSoup is a wonderful bit of code and at first it didn't look like there was any... | Iron python, beautiful soup, win32 app Does beautiful soup work with iron python? If so with which version of iron python? How easy is it to distribute a windows desktop app on.net 2.0 using iron python (mostly c# calling some python code for parsing html)? | TITLE:
Iron python, beautiful soup, win32 app
QUESTION:
Does beautiful soup work with iron python? If so with which version of iron python? How easy is it to distribute a windows desktop app on.net 2.0 using iron python (mostly c# calling some python code for parsing html)?
ANSWER:
I was asking myself this same quest... | [
".net",
"python",
"ironpython"
] | 21 | 34 | 8,972 | 10 | 0 | 2008-09-23T01:37:48.830000 | 2008-10-04T19:04:21.950000 |
118,659 | 175,086 | How do I use Qt and SDL together? | I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL. My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like... | While you might get it to work like first answer suggest you will likely run into problems due to threading. There is no simple solutions when it comes to threading, and here you would have SDL Qt and OpenGL mainloop interacting. Not fun. The easiest and sanest solution would be to decouple both parts. So that SDL and ... | How do I use Qt and SDL together? I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL. My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, ... | TITLE:
How do I use Qt and SDL together?
QUESTION:
I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL. My first idea was to build the editor using only Qt and share as much code with the engine (the resource manag... | [
"c++",
"winapi",
"qt",
"sdl"
] | 30 | 15 | 37,060 | 3 | 0 | 2008-09-23T01:38:32.900000 | 2008-10-06T16:37:13.837000 |
118,678 | 119,152 | What are some decent ways to prevent users from creating meeting workspaces? | I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form. Shy of customizing the new event form (which breaks attachment support), how can this be done? | By default, in order for users to create a meeting workspace, they will need to be an administrator or Site Owner (specifically they will need the Create Sites permission). If you don't give them this permission, they won't be able to create a meeting workspace. This will disallow the user to create any site under the ... | What are some decent ways to prevent users from creating meeting workspaces? I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form. Shy of customizing the new event form (which breaks attachment support), how can this be done? | TITLE:
What are some decent ways to prevent users from creating meeting workspaces?
QUESTION:
I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form. Shy of customizing the new event form (which breaks attachment support), how can this ... | [
"sharepoint",
"outlook",
"integration"
] | 1 | 2 | 1,161 | 4 | 0 | 2008-09-23T01:43:27.630000 | 2008-09-23T04:34:41.667000 |
118,685 | 382,960 | How can I apply my CSS stylesheet to an RSS feed | On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for class="whatever" and replacing with style="something: something;". But this means whenever I modify my CSS I need to modify my RSS-generating code too, and it doesn't work for a ... | The popular RSS readers WILL NOT bother downloading a style sheet, even if you provide one and link to it using. Many RSS readers simply strip all inline style attributes from your tags. From testing today, I discovered that Outlook 2007 seems to strip out all styles, for example, even if they are inline. Good RSS read... | How can I apply my CSS stylesheet to an RSS feed On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for class="whatever" and replacing with style="something: something;". But this means whenever I modify my CSS I need to modify my RS... | TITLE:
How can I apply my CSS stylesheet to an RSS feed
QUESTION:
On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for class="whatever" and replacing with style="something: something;". But this means whenever I modify my CSS I ne... | [
"css",
"rss",
"blogs"
] | 20 | 24 | 25,467 | 5 | 0 | 2008-09-23T01:44:42.090000 | 2008-12-20T05:11:17.307000 |
118,686 | 118,764 | MeasureString() pads the text on the left and the right | I'm using GDI+ in C++. (This issue might exist in C# too). I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right. For example, if I am using a Courier font, (not italic!) and I measure "P" I get 90, but "PP" gives me 150. I would e... | It's by design, that method doesn't use the actual glyphs to measure the width and so adds a little padding in the case of overhangs. MSDN suggests using a different method if you need more accuracy: To obtain metrics suitable for adjacent strings in layout (for example, when implementing formatted text), use the Measu... | MeasureString() pads the text on the left and the right I'm using GDI+ in C++. (This issue might exist in C# too). I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right. For example, if I am using a Courier font, (not italic!) and ... | TITLE:
MeasureString() pads the text on the left and the right
QUESTION:
I'm using GDI+ in C++. (This issue might exist in C# too). I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right. For example, if I am using a Courier font, ... | [
"gdi+",
"drawstring"
] | 18 | 13 | 15,599 | 5 | 0 | 2008-09-23T01:45:15.893000 | 2008-09-23T02:10:50.747000 |
118,698 | 119,235 | Lazy Function Definition in PHP - is it possible? | In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function. I'd like to do the same sort of thing in PHP 5, but redefining a function is not allowed, nor is overloading a function. Effectively w... | Use a local static var: function foo() { static $called = false; if ($called == false) { $called = true; expensive_stuff(); } } Avoid using a global for this. It clutters the global namespace and makes the function less encapsulated. If other places besides the innards of the function need to know if it's been called, ... | Lazy Function Definition in PHP - is it possible? In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function. I'd like to do the same sort of thing in PHP 5, but redefining a function is not all... | TITLE:
Lazy Function Definition in PHP - is it possible?
QUESTION:
In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function. I'd like to do the same sort of thing in PHP 5, but redefining a f... | [
"php",
"design-patterns",
"optimization"
] | 5 | 13 | 2,462 | 9 | 0 | 2008-09-23T01:49:19.037000 | 2008-09-23T05:06:32.993000 |
118,719 | 118,754 | How do I effectively persist a .Net font object? | Usecase: The user makes font customizations to an object on the design surface, that I need to load/save to my datastore. I.e. settings like Bold, Italics, Size, Font Name need to persisted. Is there some easy (and reliable) mechanism to convert/read back from a string representation of the font object (in which case I... | Use TypeConverter: Font font = new Font("Arial", 12, GraphicsUnit.Pixel);
TypeConverter converter = TypeDescriptor.GetConverter(typeof (Font));
string fontStr = converter.ConvertToInvariantString(font);
Font font2 = (Font) converter.ConvertFromString(fontStr);
Console.WriteLine(font.Name == font2.Name); // prints T... | How do I effectively persist a .Net font object? Usecase: The user makes font customizations to an object on the design surface, that I need to load/save to my datastore. I.e. settings like Bold, Italics, Size, Font Name need to persisted. Is there some easy (and reliable) mechanism to convert/read back from a string r... | TITLE:
How do I effectively persist a .Net font object?
QUESTION:
Usecase: The user makes font customizations to an object on the design surface, that I need to load/save to my datastore. I.e. settings like Bold, Italics, Size, Font Name need to persisted. Is there some easy (and reliable) mechanism to convert/read ba... | [
".net",
"serialization",
"fonts"
] | 6 | 10 | 1,221 | 3 | 0 | 2008-09-23T01:55:38.897000 | 2008-09-23T02:07:42.440000 |
118,724 | 118,790 | Preferred way to do logging in the SpringFrame work | I have done some searches looking for information about how to do logging with the Spring Framework. We currently have an application that has no logging in it except for system.out statements (very bad way). What I would like to do, is add logging, but also want to be able to control the logging at run time, with say ... | I would use Commons Logging and Log4j. This is not really a question for Spring, however the Springframework source does uses Commons Logging as well. If you create a log4j logger and appender in log4j, you can enable logging within the Springframework classes too. There are a few ways to control logging at runtime. Th... | Preferred way to do logging in the SpringFrame work I have done some searches looking for information about how to do logging with the Spring Framework. We currently have an application that has no logging in it except for system.out statements (very bad way). What I would like to do, is add logging, but also want to b... | TITLE:
Preferred way to do logging in the SpringFrame work
QUESTION:
I have done some searches looking for information about how to do logging with the Spring Framework. We currently have an application that has no logging in it except for system.out statements (very bad way). What I would like to do, is add logging, ... | [
"java",
"spring",
"logging"
] | 2 | 5 | 1,893 | 3 | 0 | 2008-09-23T01:57:03.197000 | 2008-09-23T02:26:37.557000 |
118,727 | 118,734 | Compile errors in mshtml.h compiling with VS2008 | I'm in the process of moving one of our projects from VS6 to VS2008 and I've hit the following compile error with mshtml.h: 1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272): error C2143: syntax error: missing '}' before 'constant' 1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(52... | There is probably a #define changing something. Try running just the preprocessor on your.cpp and generating a.i file. The setting is in the project property pages. EDIT: Also, you can get the answer from that other expert site by scrolling to the bottom of the page. They have to do that or Google will take them out of... | Compile errors in mshtml.h compiling with VS2008 I'm in the process of moving one of our projects from VS6 to VS2008 and I've hit the following compile error with mshtml.h: 1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272): error C2143: syntax error: missing '}' before 'constant' 1>c:\program files... | TITLE:
Compile errors in mshtml.h compiling with VS2008
QUESTION:
I'm in the process of moving one of our projects from VS6 to VS2008 and I've hit the following compile error with mshtml.h: 1>c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272): error C2143: syntax error: missing '}' before 'constant' ... | [
"c++",
"visual-studio-2008"
] | 3 | 1 | 1,440 | 4 | 0 | 2008-09-23T01:57:27.423000 | 2008-09-23T02:01:10.880000 |
118,730 | 118,737 | GCC inline assembler, mixing register sizes (x86) | Does anyone know how I can get rid of the following assembler warning? Code is x86, 32 bit: int test (int x) { int y; // do a bit-rotate by 8 on the lower word. leave upper word intact. asm ("rorw $8, %0\n\t": "=q"(y):"0"(x)); return y; } If I compile it I get the following (very valid) warning: Warning: using `%ax' in... | You can use %w0 if I remember right. I just tested it, too.:-) int test(int x) { int y; asm ("rorw $8, %w0": "=q" (y): "0" (x)); return y; } Edit: In response to the OP, yes, you can do the following too: int test(int x) { int y; asm ("xchg %b0, %h0": "=Q" (y): "0" (x)); return y; } For x86 it's documented in the x86 O... | GCC inline assembler, mixing register sizes (x86) Does anyone know how I can get rid of the following assembler warning? Code is x86, 32 bit: int test (int x) { int y; // do a bit-rotate by 8 on the lower word. leave upper word intact. asm ("rorw $8, %0\n\t": "=q"(y):"0"(x)); return y; } If I compile it I get the follo... | TITLE:
GCC inline assembler, mixing register sizes (x86)
QUESTION:
Does anyone know how I can get rid of the following assembler warning? Code is x86, 32 bit: int test (int x) { int y; // do a bit-rotate by 8 on the lower word. leave upper word intact. asm ("rorw $8, %0\n\t": "=q"(y):"0"(x)); return y; } If I compile ... | [
"assembly",
"gcc",
"x86",
"inline-assembly",
"cpu-registers"
] | 13 | 23 | 7,290 | 4 | 0 | 2008-09-23T01:59:00.993000 | 2008-09-23T02:01:58.397000 |
118,748 | 118,796 | Windows console command to open multiple pages in Internet Explorer 7 | How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this? Thanks! | A batch file will work as a quick and dirty solution. @echo off @setlocal:openurl set url=%~1
if "%url:~0,4%" == "http" ( start "%ProgramFiles%\Internet Explorer\iexplore.exe" "%url%" ) if NOT "%url:~0,4%" == "http" ( start "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://%url%" )
shift if "%~1" == "" goto:end... | Windows console command to open multiple pages in Internet Explorer 7 How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this? Thanks! | TITLE:
Windows console command to open multiple pages in Internet Explorer 7
QUESTION:
How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this? Thanks!
ANSWER:
A batch file will work as a quick and dirty solution. @echo off @setlocal:openurl set url=%~1
... | [
"internet-explorer",
"command-line",
"windows-xp",
"batch-file"
] | 3 | 7 | 15,644 | 4 | 0 | 2008-09-23T02:05:52.333000 | 2008-09-23T02:30:19.827000 |
118,750 | 119,310 | How to count rows in Lift (Scala's web framework) | I want to add a property to my User model that returns the number of rows in the Project table that have a user Id of the user. So something like this... def numProjects = {
/* somehow get count from Project table The straight sql would be: SELECT COUNT(*) FROM projects WHERE userId = */
} | According to the documentation here (found here ), assuming you're looking for the project count for a User of id 1234 and assuming that your Project model inherits the MetaMapper trait (probably through KeyedMetaMapper), it seems you can use the count method as such: Project.count(By(User.id, 1234)) or Project.count(B... | How to count rows in Lift (Scala's web framework) I want to add a property to my User model that returns the number of rows in the Project table that have a user Id of the user. So something like this... def numProjects = {
/* somehow get count from Project table The straight sql would be: SELECT COUNT(*) FROM project... | TITLE:
How to count rows in Lift (Scala's web framework)
QUESTION:
I want to add a property to my User model that returns the number of rows in the Project table that have a user Id of the user. So something like this... def numProjects = {
/* somehow get count from Project table The straight sql would be: SELECT COU... | [
"scala",
"lift"
] | 5 | 6 | 1,052 | 1 | 0 | 2008-09-23T02:06:50.820000 | 2008-09-23T05:51:32.963000 |
118,774 | 119,553 | Is there a clean way to prevent windows.h from creating a near & far macro? | Deep down in WinDef.h there's this relic from the segmented memory era: #define far #define near This obviously causes problems if you attempt to use near or far as variable names. Any clean workarounds? Other then renaming my variables? | You can safely undefine them, contrary to claims from others. The reason is that they're just macros's. They only affect the preprocessor between their definition and their undefinition. In your case, that will be from early in windows.h to the last line of windows.h. If you need extra windows headers, you'd include th... | Is there a clean way to prevent windows.h from creating a near & far macro? Deep down in WinDef.h there's this relic from the segmented memory era: #define far #define near This obviously causes problems if you attempt to use near or far as variable names. Any clean workarounds? Other then renaming my variables? | TITLE:
Is there a clean way to prevent windows.h from creating a near & far macro?
QUESTION:
Deep down in WinDef.h there's this relic from the segmented memory era: #define far #define near This obviously causes problems if you attempt to use near or far as variable names. Any clean workarounds? Other then renaming my... | [
"c++",
"c",
"winapi",
"dos"
] | 15 | 35 | 7,051 | 5 | 0 | 2008-09-23T02:14:49.940000 | 2008-09-23T07:23:55.580000 |
118,813 | 118,820 | How do I uninstall python from OSX Leopard so that I can use the MacPorts version? | I want to use the macports version of python instead of the one that comes with Leopard. | I have both installed: $ which python /usr/bin/python $ which python2.5 /opt/local/bin/python2.5 I also added the following line to my.profile: export PATH=/opt/local/bin:/opt/local/sbin:$PATH | How do I uninstall python from OSX Leopard so that I can use the MacPorts version? I want to use the macports version of python instead of the one that comes with Leopard. | TITLE:
How do I uninstall python from OSX Leopard so that I can use the MacPorts version?
QUESTION:
I want to use the macports version of python instead of the one that comes with Leopard.
ANSWER:
I have both installed: $ which python /usr/bin/python $ which python2.5 /opt/local/bin/python2.5 I also added the followi... | [
"python",
"macos",
"osx-leopard",
"macports"
] | 19 | 22 | 22,760 | 7 | 0 | 2008-09-23T02:38:04.317000 | 2008-09-23T02:40:05.513000 |
118,839 | 118,852 | gsub partial replace | I would like to replace only the group in parenthesis in this expression: my_string.gsub(/<--MARKER_START-->(.)*<--MARKER_END-->/, 'replace_text') so that I get: <--MARKER_START-->replace_text<--MARKER_END--> I know I could repeat the whole MARKER_START and MARKER_END blocks in the substitution expression but I thought... | You could do something like this: my_string.gsub(/(<--MARKER_START-->)(.*)(<--MARKER_END-->)/, '\1replace_text\3') | gsub partial replace I would like to replace only the group in parenthesis in this expression: my_string.gsub(/<--MARKER_START-->(.)*<--MARKER_END-->/, 'replace_text') so that I get: <--MARKER_START-->replace_text<--MARKER_END--> I know I could repeat the whole MARKER_START and MARKER_END blocks in the substitution exp... | TITLE:
gsub partial replace
QUESTION:
I would like to replace only the group in parenthesis in this expression: my_string.gsub(/<--MARKER_START-->(.)*<--MARKER_END-->/, 'replace_text') so that I get: <--MARKER_START-->replace_text<--MARKER_END--> I know I could repeat the whole MARKER_START and MARKER_END blocks in th... | [
"ruby",
"regex"
] | 19 | 14 | 6,904 | 2 | 0 | 2008-09-23T02:48:25.650000 | 2008-09-23T02:56:04.383000 |
118,863 | 143,395 | When to use a Class in VBA? | When is it appropriate to use a class in Visual Basic for Applications (VBA)? I'm assuming the accelerated development and reduction of introducing bugs is a common benefit for most languages that support OOP. But with VBA, is there a specific criterion? | It depends on who's going to develop and maintain the code. Typical "Power User" macro writers hacking small ad-hoc apps may well be confused by using classes. But for serious development, the reasons to use classes are the same as in other languages. You have the same restrictions as VB6 - no inheritance - but you can... | When to use a Class in VBA? When is it appropriate to use a class in Visual Basic for Applications (VBA)? I'm assuming the accelerated development and reduction of introducing bugs is a common benefit for most languages that support OOP. But with VBA, is there a specific criterion? | TITLE:
When to use a Class in VBA?
QUESTION:
When is it appropriate to use a class in Visual Basic for Applications (VBA)? I'm assuming the accelerated development and reduction of introducing bugs is a common benefit for most languages that support OOP. But with VBA, is there a specific criterion?
ANSWER:
It depends... | [
"oop",
"vba",
"class"
] | 42 | 56 | 46,635 | 13 | 0 | 2008-09-23T02:59:55.793000 | 2008-09-27T10:51:06.943000 |
118,872 | 198,615 | How to set sql profiler to profile SQL 2005 reporting services | I'm trying to profile SQL reporting services, used from ASP.NET application. In SQL profiler all the SQL run by ASP.NET shows up. It looks like the reporting SQL (from the RDL) doesn't show. Is there some setting or filter I'm missing? | Application name column = Reporting Services (or similar) usually. You may need to trace SQL batch complete and RPC call complete I've been bitten with this before... | How to set sql profiler to profile SQL 2005 reporting services I'm trying to profile SQL reporting services, used from ASP.NET application. In SQL profiler all the SQL run by ASP.NET shows up. It looks like the reporting SQL (from the RDL) doesn't show. Is there some setting or filter I'm missing? | TITLE:
How to set sql profiler to profile SQL 2005 reporting services
QUESTION:
I'm trying to profile SQL reporting services, used from ASP.NET application. In SQL profiler all the SQL run by ASP.NET shows up. It looks like the reporting SQL (from the RDL) doesn't show. Is there some setting or filter I'm missing?
AN... | [
"asp.net",
"sql-server",
"reporting-services",
"reportingservices-2005",
"sql-server-profiler"
] | 2 | 3 | 3,833 | 3 | 0 | 2008-09-23T03:02:27.393000 | 2008-10-13T18:48:46.783000 |
118,929 | 127,251 | ETW - Best Fix/Class-Library for Messy Interface? | By ETW I mean "Event Tracing for Windows". According to my experimenting one virtue is that while by-design it occasionally fails to record events in Very-Busy conditions it otherwise Just Works, as you might expect from a Kernel feature. ETW is the only game in town if you want per-processor-buffering to avoid cache-v... | If you are looking for an ease-of-use C/C++ wrapper on top of ETW, the only thing that comes close is WPP. You might hit limitations in WPP if you get too advanced. Watch out for Microsoft PDC in October for something helpful;) | ETW - Best Fix/Class-Library for Messy Interface? By ETW I mean "Event Tracing for Windows". According to my experimenting one virtue is that while by-design it occasionally fails to record events in Very-Busy conditions it otherwise Just Works, as you might expect from a Kernel feature. ETW is the only game in town if... | TITLE:
ETW - Best Fix/Class-Library for Messy Interface?
QUESTION:
By ETW I mean "Event Tracing for Windows". According to my experimenting one virtue is that while by-design it occasionally fails to record events in Very-Busy conditions it otherwise Just Works, as you might expect from a Kernel feature. ETW is the on... | [
"logging",
"etw"
] | 2 | 1 | 649 | 1 | 0 | 2008-09-23T03:23:30.417000 | 2008-09-24T13:50:16.983000 |
118,931 | 121,307 | ASP.NET MVC & Web Services | Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC? That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution). Should I add this to the Controller or Model layer? | It sounds like you should split out your model into its own assembly and reference it from your MVC-application and WCF-application. YourApp.Data -- Shared model and data access maybe YourApp.Web -- If you want to share more across your web-apps YourApp.Web.Mvc YourApp.Web.WebService If you want to do WebServices MVC-s... | ASP.NET MVC & Web Services Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC? That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution). Should I add this to the Controller or M... | TITLE:
ASP.NET MVC & Web Services
QUESTION:
Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC? That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution). Should I add this to t... | [
"asp.net",
"asp.net-mvc",
"wcf",
"web-services",
"architecture"
] | 48 | 27 | 55,061 | 7 | 0 | 2008-09-23T03:24:20.413000 | 2008-09-23T14:23:09.083000 |
118,935 | 118,964 | Know of an OCaml IDE? | Know of an OCAML/CAML IDE? Especially one that runs on Linux? | Emacs in Caml mode, or Tuareg mode, or TypeRex mode. TypeRex adds auto-completion to Taureg in emacs - a really nice feature for people who prefer the more graphical IDE's. | Know of an OCaml IDE? Know of an OCAML/CAML IDE? Especially one that runs on Linux? | TITLE:
Know of an OCaml IDE?
QUESTION:
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
ANSWER:
Emacs in Caml mode, or Tuareg mode, or TypeRex mode. TypeRex adds auto-completion to Taureg in emacs - a really nice feature for people who prefer the more graphical IDE's. | [
"linux",
"ide",
"ocaml",
"typerex"
] | 25 | 25 | 15,029 | 11 | 0 | 2008-09-23T03:24:59.837000 | 2008-09-23T03:33:49.020000 |
118,945 | 118,968 | Best C/C++ Network Library | I haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use. I'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different libraries and that's okay. | Aggregated List of Libraries Boost.Asio is really good. Asio is also available as a stand-alone library. ACE is also good, a bit more mature and has a couple of books to support it. C++ Network Library POCO Qt Raknet ZeroMQ (C++) nanomsg (C Library) nng (C Library) Berkeley Sockets libevent Apache APR yield Winsock2(Wi... | Best C/C++ Network Library I haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use. I'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different libraries and that... | TITLE:
Best C/C++ Network Library
QUESTION:
I haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use. I'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different ... | [
"c++",
"c",
"networking"
] | 78 | 340 | 402,670 | 1 | 0 | 2008-09-23T03:27:26.413000 | 2008-09-23T03:35:59.373000 |
118,955 | 118,972 | Architecture for a business objects / database access layer | For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. It is possible to have multiple data storage layers that implement access to the same object - for example, a main "da... | might i suggest another alternative, with possibly better decoupling: business objects use data objects, and data objects implement storage objects. This should keep the business rules in the business objects but without any dependence on the storage source or format, while allowing the data objects to support whatever... | Architecture for a business objects / database access layer For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. It is possible to have multiple data storage layers that i... | TITLE:
Architecture for a business objects / database access layer
QUESTION:
For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. It is possible to have multiple data sto... | [
"orm",
"architecture"
] | 7 | 12 | 6,028 | 7 | 0 | 2008-09-23T03:30:57.480000 | 2008-09-23T03:36:56.500000 |
119,000 | 120,921 | Connection to report server could not be made from BI VS 2005 but the report server is browseable | I have IIS6 configured such that browsing to http://localhost:8082/Reports gets me the reporting services default home page, which is all as expected. However, when I try to publish a report via Microsoft Business Intelligence Visual Studio 2005 I get the following error: A connection could not be made to the report se... | I cannot upvote, but guy is correct. Go into Project->Properties and change TargetServerURL to " http://localhost:8082/ReportsServer ". This should alleviate your problems. If you need to deploy to a named instance remember that your URL will be " http://servername/ReportServer $instancename". | Connection to report server could not be made from BI VS 2005 but the report server is browseable I have IIS6 configured such that browsing to http://localhost:8082/Reports gets me the reporting services default home page, which is all as expected. However, when I try to publish a report via Microsoft Business Intellig... | TITLE:
Connection to report server could not be made from BI VS 2005 but the report server is browseable
QUESTION:
I have IIS6 configured such that browsing to http://localhost:8082/Reports gets me the reporting services default home page, which is all as expected. However, when I try to publish a report via Microsoft... | [
"sql-server",
"reporting-services",
"business-intelligence"
] | 0 | 0 | 3,708 | 3 | 0 | 2008-09-23T03:49:10.120000 | 2008-09-23T13:20:01.417000 |
119,006 | 122,928 | What should I do with the vendor directory with respect to subversion? | So I have a problem. I checked in my frozen gems and rails even though you aren't supposed to do that. I figured it was easy and wouldn't be that big of a deal anyway. Well, later I updated rails and in doing so deleted all the.svn files in the vendor/rails directories. I have heard that what I really should do is just... | To recover your deleted.svn directories, just run an svn update. They'll come back. I just check in exported gems. I use gem unpack in the vendor/gems directory and svn add and commit from there. Anything in vendor/plugins or vendor/rails I track using piston. For example, this is how I get rails in there: % piston imp... | What should I do with the vendor directory with respect to subversion? So I have a problem. I checked in my frozen gems and rails even though you aren't supposed to do that. I figured it was easy and wouldn't be that big of a deal anyway. Well, later I updated rails and in doing so deleted all the.svn files in the vend... | TITLE:
What should I do with the vendor directory with respect to subversion?
QUESTION:
So I have a problem. I checked in my frozen gems and rails even though you aren't supposed to do that. I figured it was easy and wouldn't be that big of a deal anyway. Well, later I updated rails and in doing so deleted all the.svn... | [
"ruby-on-rails",
"svn",
"capistrano"
] | 5 | 3 | 1,214 | 4 | 0 | 2008-09-23T03:51:00.350000 | 2008-09-23T18:42:09.413000 |
119,008 | 119,033 | Can't connect to MySQL server on 'localhost' (10061) | I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error ( Can't connect to MySQL server on 'localhost' (10061) ). I do have a port 3306 exception in my firewall for 'MySQL Server'. | You'll probably have to grant 'localhost' privileges to on the table to the user. See the 'GRANT' syntax documentation. Here's an example (from some C source). "GRANT ALL PRIVILEGES ON %s.* TO '%s'@'localhost' IDENTIFIED BY '%s'"; That's the most common access problem with MySQL. Other than that, you might check that t... | Can't connect to MySQL server on 'localhost' (10061) I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error ( Can't connect to MySQL server on 'localhost' (10061) ). I do have a port 33... | TITLE:
Can't connect to MySQL server on 'localhost' (10061)
QUESTION:
I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error ( Can't connect to MySQL server on 'localhost' (10061) ). I... | [
"mysql",
"localhost",
"mysql5",
"windows-firewall"
] | 71 | 33 | 594,664 | 19 | 0 | 2008-09-23T03:52:34.090000 | 2008-09-23T03:58:44.747000 |
119,009 | 119,443 | Directory Layout for Erlang Services? | In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC. I'm about to embark on creating a service written in Erlang, what's a good source layout for Erlang applications? | The Erlang recommended standard directory structure can be found here. In addition you may need a few more directories depending on your project, common ones are (credit to Vance Shipley): lib: OS driver libraries bin: OS executables c_src: C language source files (e.g. for drivers) java_src: Java language source files... | Directory Layout for Erlang Services? In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC. I'm about to embark on creating a service written in Erlang, what's a good source l... | TITLE:
Directory Layout for Erlang Services?
QUESTION:
In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC. I'm about to embark on creating a service written in Erlang, what... | [
"erlang"
] | 13 | 15 | 2,743 | 3 | 0 | 2008-09-23T03:52:37.927000 | 2008-09-23T06:46:34.500000 |
119,018 | 119,212 | How do I prevent SoapExtensions being added to my web service app? | It seems that anyone can snoop on incoming/outgoing.NET web service SOAP messages just by dropping in a simple SoapExtension into the bin folder and then plumbing it in using: Is there a way to prevent SOAP extensions from loading or to be asked in my app (through an event or some such mechanism) whether it's ok to loa... | I am not sure what you mean by extensions and bin folders (I would guess you are using.NET), so I can't answer about them being loaded etc. However, note that SOAP is designed to allow intermediaries to read the headers and even to modify them. (Do a search for "SOAP Active Intermediaries"). Judging by that, I expect t... | How do I prevent SoapExtensions being added to my web service app? It seems that anyone can snoop on incoming/outgoing.NET web service SOAP messages just by dropping in a simple SoapExtension into the bin folder and then plumbing it in using: Is there a way to prevent SOAP extensions from loading or to be asked in my a... | TITLE:
How do I prevent SoapExtensions being added to my web service app?
QUESTION:
It seems that anyone can snoop on incoming/outgoing.NET web service SOAP messages just by dropping in a simple SoapExtension into the bin folder and then plumbing it in using: Is there a way to prevent SOAP extensions from loading or t... | [
"web-services",
"soap"
] | 1 | 2 | 233 | 2 | 0 | 2008-09-23T03:55:58.387000 | 2008-09-23T04:57:43.543000 |
119,031 | 119,062 | How to set my application's desktop icon for Linux: KDE, Gnome etc? | I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build. Is there a standard format for KDE, Gnome etc. or will I have to do something special for each one? My app is in c++ and distributed as source so the end us... | For Gnome and Kde, you would probably want to include a desktop file with your app that defines how it will be launched. The specification can be found here. If you have an installer included with your app, you would probably want to have it generate this desktop file and put it in the right places to make menu entries... | How to set my application's desktop icon for Linux: KDE, Gnome etc? I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build. Is there a standard format for KDE, Gnome etc. or will I have to do something special fo... | TITLE:
How to set my application's desktop icon for Linux: KDE, Gnome etc?
QUESTION:
I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build. Is there a standard format for KDE, Gnome etc. or will I have to do so... | [
"linux",
"icons",
"gnome",
"kde-plasma"
] | 13 | 10 | 16,823 | 3 | 0 | 2008-09-23T03:58:22.547000 | 2008-09-23T04:06:59.267000 |
119,098 | 119,194 | Which C I/O library should be used in C++ code? | In new C++ code, I tend to use the C++ iostream library instead of the C stdio library. I've noticed some programmers seem to stick to stdio, insisting that it's more portable. Is this really the case? What is better to use? | To answer the original question: Anything that can be done using stdio can be done using the iostream library. Disadvantages of iostreams: verbose Advantages of iostreams: easy to extend for new non POD types. The step forward the C++ made over C was type safety. iostreams was designed to be explicitly type safe. Thus ... | Which C I/O library should be used in C++ code? In new C++ code, I tend to use the C++ iostream library instead of the C stdio library. I've noticed some programmers seem to stick to stdio, insisting that it's more portable. Is this really the case? What is better to use? | TITLE:
Which C I/O library should be used in C++ code?
QUESTION:
In new C++ code, I tend to use the C++ iostream library instead of the C stdio library. I've noticed some programmers seem to stick to stdio, insisting that it's more portable. Is this really the case? What is better to use?
ANSWER:
To answer the origin... | [
"c++",
"iostream",
"stdio"
] | 35 | 40 | 14,115 | 13 | 0 | 2008-09-23T04:14:47.157000 | 2008-09-23T04:52:19.813000 |
119,099 | 119,108 | Can you suggest something a little more advanced than java.util.Properties? | Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc? I am not looking for some heavy super-advanced solution, just something light and useful for any project. Thanks. | Commons Configuration from the apache group sounds a lot like what you're looking for. | Can you suggest something a little more advanced than java.util.Properties? Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc? I am not looking for some heavy super-advanced solution, just something light and useful for any projec... | TITLE:
Can you suggest something a little more advanced than java.util.Properties?
QUESTION:
Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc? I am not looking for some heavy super-advanced solution, just something light and use... | [
"java",
"configuration",
"properties"
] | 4 | 8 | 1,202 | 6 | 0 | 2008-09-23T04:16:42.037000 | 2008-09-23T04:19:31.467000 |
119,102 | 119,119 | Is there a way to verify that code will work on the 360 while doing XNA dev? | I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few custom libraries -- will work properly on the 360. If they don't, I need to work around them s... | Well, you could try writing a quick app for a Windows Smartphone, and run it in an emulator. Obviously, this won't work for XNA specific code; but for any runtime libraries that Boo or whatever you're using work on the emulator, they should work on the Xbox. For the XNA code you write yourself, just compile it against ... | Is there a way to verify that code will work on the 360 while doing XNA dev? I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few custom libraries ... | TITLE:
Is there a way to verify that code will work on the 360 while doing XNA dev?
QUESTION:
I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few... | [
"testing",
"xna",
"boo",
"xbox360"
] | 5 | 4 | 471 | 4 | 0 | 2008-09-23T04:17:30.520000 | 2008-09-23T04:24:10.287000 |
119,107 | 119,159 | How do I generate a list of n unique random numbers in Ruby? | This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers? Edit: I'd really like to see this done w/o loop - ... | This uses Set: require 'set'
def rand_n(n, max) randoms = Set.new loop do randoms << rand(max) return randoms.to_a if randoms.size >= n end end | How do I generate a list of n unique random numbers in Ruby? This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n uniqu... | TITLE:
How do I generate a list of n unique random numbers in Ruby?
QUESTION:
This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then jus... | [
"ruby",
"random"
] | 36 | 25 | 38,040 | 15 | 0 | 2008-09-23T04:19:16.367000 | 2008-09-23T04:36:53.173000 |
119,114 | 119,148 | Conditional compilation for working at home | I code C++ using MS Dev Studio and I work from home two days per week. I use CVS to keep my sources synchronized between the two computers but there are difference between the environments the machines are in. Can anyone suggest a way I can conditionally modify constants in my code depending on whether I am compiling o... | On your home and work machines, set an environment variable LOCATION that is either "1" for home or "2" for work. Then in the preprocessor options, add a preprocessor define /DLOCATION=$(LOCATION). This will evaluate to either the "home" or "work" string that you set in the environment variable. Then in your code: #if ... | Conditional compilation for working at home I code C++ using MS Dev Studio and I work from home two days per week. I use CVS to keep my sources synchronized between the two computers but there are difference between the environments the machines are in. Can anyone suggest a way I can conditionally modify constants in m... | TITLE:
Conditional compilation for working at home
QUESTION:
I code C++ using MS Dev Studio and I work from home two days per week. I use CVS to keep my sources synchronized between the two computers but there are difference between the environments the machines are in. Can anyone suggest a way I can conditionally mod... | [
"c++"
] | 2 | 6 | 590 | 4 | 0 | 2008-09-23T04:21:39.870000 | 2008-09-23T04:32:42.217000 |
119,123 | 119,128 | Why isn't sizeof for a struct equal to the sum of sizeof of each member? | Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members? | This is because of padding added to satisfy alignment constraints. Data structure alignment impacts both performance and correctness of programs: Mis-aligned access might be a hard error (often SIGBUS ). Mis-aligned access might be a soft error. Either corrected in hardware, for a modest performance-degradation. Or cor... | Why isn't sizeof for a struct equal to the sum of sizeof of each member? Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members? | TITLE:
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
QUESTION:
Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?
ANSWER:
This is because of padding added to satisfy alignment constraints. Data structure alignment impacts both ... | [
"c++",
"c",
"struct",
"sizeof",
"c++-faq"
] | 863 | 796 | 295,291 | 13 | 0 | 2008-09-23T04:24:47.820000 | 2008-09-23T04:25:34.527000 |
119,157 | 120,897 | Will it be faster to use several threads to update the same database? | I wrote a Java program to add and retrieve data from an MS Access. At present it goes sequentially through ~200K insert queries in ~3 minutes, which I think is slow. I plan to rewrite it using threads with 3-4 threads handling different parts of the hundred thousands records. I have a compound question: Will this help ... | First, don't use Access. Move your data anywhere else -- SQL/Server -- MySQL -- anything. The DB engine inside access (called Jet) is pitifully slow. It's not a real database; it's for personal projects that involve small amounts of data. It doesn't scale at all. Second, threads rarely help. The JDBC-to-Database connec... | Will it be faster to use several threads to update the same database? I wrote a Java program to add and retrieve data from an MS Access. At present it goes sequentially through ~200K insert queries in ~3 minutes, which I think is slow. I plan to rewrite it using threads with 3-4 threads handling different parts of the ... | TITLE:
Will it be faster to use several threads to update the same database?
QUESTION:
I wrote a Java program to add and retrieve data from an MS Access. At present it goes sequentially through ~200K insert queries in ~3 minutes, which I think is slow. I plan to rewrite it using threads with 3-4 threads handling diffe... | [
"sql",
"database",
"multithreading"
] | 2 | 2 | 648 | 8 | 0 | 2008-09-23T04:36:43.237000 | 2008-09-23T13:13:23.120000 |
119,160 | 119,169 | What is the difference between Events with Delegate Handlers and those without? | What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click += this.btnOK_Click; They both work. The former is what Visual Studio defaults to when you use the snippets. But it seems like it only ads extra verbiage, or am I missing something? | No difference. Omitting the delegate instantiation is just syntax candy; the C# compiler will generate the delegate instantiation for you under the hood. | What is the difference between Events with Delegate Handlers and those without? What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click += this.btnOK_Click; They both work. The former is what Visual Studio defaults to when you use the snippets. But ... | TITLE:
What is the difference between Events with Delegate Handlers and those without?
QUESTION:
What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click += this.btnOK_Click; They both work. The former is what Visual Studio defaults to when you use ... | [
"c#",
"events"
] | 6 | 10 | 1,855 | 4 | 0 | 2008-09-23T04:37:18.087000 | 2008-09-23T04:41:36.967000 |
119,167 | 119,178 | Adding code to __init__.py | I'm taking a look at how the model system in django works and I noticed something that I don't understand. I know that you create an empty __init__.py file to specify that the current directory is a package. And that you can set some variable in __init__.py so that import * works properly. But django adds a bunch of fr... | All imports in __init__.py are made available when you import the package (directory) that contains it. Example:./dir/__init__.py: import something./test.py: import dir # can now use dir.something EDIT: forgot to mention, the code in __init__.py runs the first time you import any module from that directory. So it's nor... | Adding code to __init__.py I'm taking a look at how the model system in django works and I noticed something that I don't understand. I know that you create an empty __init__.py file to specify that the current directory is a package. And that you can set some variable in __init__.py so that import * works properly. Bu... | TITLE:
Adding code to __init__.py
QUESTION:
I'm taking a look at how the model system in django works and I noticed something that I don't understand. I know that you create an empty __init__.py file to specify that the current directory is a package. And that you can set some variable in __init__.py so that import * ... | [
"python",
"initialization",
"package"
] | 104 | 82 | 82,906 | 4 | 0 | 2008-09-23T04:41:18.217000 | 2008-09-23T04:47:51.010000 |
119,180 | 119,189 | What tools allows me to keep track of html tags when doing web development? | What tools allows me keep track of tags when doing web development? For example, I would like to be able to quickly find whether I missed closing a div tag. At the moment I am using notepad++ to write html. It highlights starting and ending tags, but it can take me time to review almost all tags to find where I went wr... | HTMLTidy is pretty much the de-facto standard for this kind of thing nowadays Tidy Windows Installer Tidy FAQ | What tools allows me to keep track of html tags when doing web development? What tools allows me keep track of tags when doing web development? For example, I would like to be able to quickly find whether I missed closing a div tag. At the moment I am using notepad++ to write html. It highlights starting and ending tag... | TITLE:
What tools allows me to keep track of html tags when doing web development?
QUESTION:
What tools allows me keep track of tags when doing web development? For example, I would like to be able to quickly find whether I missed closing a div tag. At the moment I am using notepad++ to write html. It highlights start... | [
"html",
"tags",
"tracking"
] | 1 | 3 | 592 | 6 | 0 | 2008-09-23T04:48:16.703000 | 2008-09-23T04:50:20.833000 |
119,197 | 120,168 | The Rails Way - Namespaces | I have a question about how to do something "The Rails Way". With an application that has a public facing side and an admin interface what is the general consensus in the Rails community on how to do it? Namespaces, subdomains or forego them altogether? | There's no real "Rails way" for admin interfaces, actually - you can find every possible solution in a number of applications. DHH has implied that he prefers namespaces (with HTTP Basic authentication), but that has remained a simple implication and not one of the official Rails Opinions. That said, I've found good su... | The Rails Way - Namespaces I have a question about how to do something "The Rails Way". With an application that has a public facing side and an admin interface what is the general consensus in the Rails community on how to do it? Namespaces, subdomains or forego them altogether? | TITLE:
The Rails Way - Namespaces
QUESTION:
I have a question about how to do something "The Rails Way". With an application that has a public facing side and an admin interface what is the general consensus in the Rails community on how to do it? Namespaces, subdomains or forego them altogether?
ANSWER:
There's no r... | [
"ruby-on-rails",
"namespaces"
] | 30 | 41 | 24,753 | 4 | 0 | 2008-09-23T04:53:05.707000 | 2008-09-23T10:05:39.077000 |
119,204 | 119,276 | Migrate clearcase to perforce | I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in clearcase but not in perforce. What advice or tools... | The first step is to decide if you need to migrate everything, or just certain key versions. If you only migrate the important versions (releases and major milestones) you'll end up with a much simpler history in Perforce, without losing anything important. Then ClearCase can be keep as a historical archive in case it ... | Migrate clearcase to perforce I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in clearcase but not in ... | TITLE:
Migrate clearcase to perforce
QUESTION:
I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in cle... | [
"migration",
"perforce",
"clearcase"
] | 3 | 3 | 1,635 | 5 | 0 | 2008-09-23T04:55:11.100000 | 2008-09-23T05:25:00.017000 |
119,207 | 119,236 | What does 'yield called out of block' mean in Ruby? | I'm new to Ruby, and I'm trying the following: mySet = numOfCuts.times.map{ rand(seqLength) } but I get the 'yield called out of block' error. I'm not sure what his means. BTW, this question is part of a more general question I asked here. | The problem is that the times method expects to get a block that it will yield control to. However you haven't passed a block to it. There are two ways to solve this. The first is to not use times: mySet = (1..numOfCuts).map{ rand(seqLength) } or else pass a block to it: mySet = [] numOfCuts.times {mySet.push( rand(seq... | What does 'yield called out of block' mean in Ruby? I'm new to Ruby, and I'm trying the following: mySet = numOfCuts.times.map{ rand(seqLength) } but I get the 'yield called out of block' error. I'm not sure what his means. BTW, this question is part of a more general question I asked here. | TITLE:
What does 'yield called out of block' mean in Ruby?
QUESTION:
I'm new to Ruby, and I'm trying the following: mySet = numOfCuts.times.map{ rand(seqLength) } but I get the 'yield called out of block' error. I'm not sure what his means. BTW, this question is part of a more general question I asked here.
ANSWER:
T... | [
"ruby",
"functional-programming"
] | 3 | 9 | 4,310 | 5 | 0 | 2008-09-23T04:56:06.903000 | 2008-09-23T05:06:35.053000 |
119,234 | 119,261 | PHP unserialize keeps throwing same error over 100 times | I have a large 2d array that I serialize and base64_encode and throw into a database. On a different page I pull the array out and when I base64_decode the serialized array I can echo it out and it definitely looks valid. However, if I try to unserialize(base64_decode($serializedArray)) it just throws the same error to... | Are you sure you're just serializing an array, and not an object (e.g. DOMNode?) Like resources, not all classes are going to be happy with being unserialized. As an example with the DOM (which your error suggests to me you're working with), every node has a reference to the parentNode, and if the parentNode doesn't ex... | PHP unserialize keeps throwing same error over 100 times I have a large 2d array that I serialize and base64_encode and throw into a database. On a different page I pull the array out and when I base64_decode the serialized array I can echo it out and it definitely looks valid. However, if I try to unserialize(base64_d... | TITLE:
PHP unserialize keeps throwing same error over 100 times
QUESTION:
I have a large 2d array that I serialize and base64_encode and throw into a database. On a different page I pull the array out and when I base64_decode the serialized array I can echo it out and it definitely looks valid. However, if I try to un... | [
"php",
"mysql",
"serialization"
] | 0 | 5 | 2,539 | 4 | 0 | 2008-09-23T05:06:21.387000 | 2008-09-23T05:13:25.817000 |
119,242 | 119,251 | In .Net, what is the fastest way to recursively find all files from a root directory? | I want to search a directory for all files that match a certain pattern. Surprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then! -Thanks | use SearchOption.AllDirectories parameter: using System.IO;
Directory.GetFiles(@"C:\", "*.mp3", SearchOption.AllDirectories); | In .Net, what is the fastest way to recursively find all files from a root directory? I want to search a directory for all files that match a certain pattern. Surprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then! -Thanks | TITLE:
In .Net, what is the fastest way to recursively find all files from a root directory?
QUESTION:
I want to search a directory for all files that match a certain pattern. Surprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then! -Thanks
ANSWER:
use SearchOption.AllDirect... | [
".net",
"search",
"filesystems"
] | 5 | 11 | 465 | 1 | 0 | 2008-09-23T05:07:44.550000 | 2008-09-23T05:10:34.590000 |
119,281 | 119,344 | How do you copy a PHP object into a different object type | New class is a subclass of the original object It needs to be php4 compatible | You could have your classes instantiated empty and then loaded by any number of methods. One of these methods could accept an instance of the parent class as an argument, and then copy its data from there class childClass extends parentClass { function childClass() { //do nothing }
function loadFromParentObj( $parentO... | How do you copy a PHP object into a different object type New class is a subclass of the original object It needs to be php4 compatible | TITLE:
How do you copy a PHP object into a different object type
QUESTION:
New class is a subclass of the original object It needs to be php4 compatible
ANSWER:
You could have your classes instantiated empty and then loaded by any number of methods. One of these methods could accept an instance of the parent class as... | [
"php",
"oop"
] | 8 | 6 | 9,254 | 5 | 0 | 2008-09-23T05:30:17.430000 | 2008-09-23T06:11:57.860000 |
119,284 | 119,368 | Position the caret in a MaskedTextbox | I would like to be able to override the default behaviour for positioning the caret in a masked textbox. The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask. I know that you can hide the caret as mentioned in this post, is there something similar... | This should do the trick: private void maskedTextBox1_Enter(object sender, EventArgs e) { this.BeginInvoke((MethodInvoker)delegate() { maskedTextBox1.Select(0, 0); }); } | Position the caret in a MaskedTextbox I would like to be able to override the default behaviour for positioning the caret in a masked textbox. The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask. I know that you can hide the caret as mentioned in... | TITLE:
Position the caret in a MaskedTextbox
QUESTION:
I would like to be able to override the default behaviour for positioning the caret in a masked textbox. The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask. I know that you can hide the car... | [
".net",
"winforms",
"user-interface",
"textbox"
] | 22 | 34 | 24,178 | 9 | 0 | 2008-09-23T05:30:32.107000 | 2008-09-23T06:21:23.717000 |
119,286 | 119,304 | Catching line numbers in ruby exceptions | Consider the following ruby code test.rb: begin
puts thisFunctionDoesNotExist x = 1+1 rescue Exception => e p e end For debugging purposes, I would like the rescue block to know that the error occurred in line 4 of this file. Is there a clean way of doing that? | p e.backtrace I ran it on an IRB session which has no source and it still gave relevant info. => ["(irb):11:in `foo'", "(irb):17:in `irb_binding'", "/usr/lib64/ruby/1.8/irb/workspace.rb:52:in `irb_binding'", "/usr/lib64/ruby/1.8/irb/workspace.rb:52"] If you want a nicely parsed backtrace, the following regex might be h... | Catching line numbers in ruby exceptions Consider the following ruby code test.rb: begin
puts thisFunctionDoesNotExist x = 1+1 rescue Exception => e p e end For debugging purposes, I would like the rescue block to know that the error occurred in line 4 of this file. Is there a clean way of doing that? | TITLE:
Catching line numbers in ruby exceptions
QUESTION:
Consider the following ruby code test.rb: begin
puts thisFunctionDoesNotExist x = 1+1 rescue Exception => e p e end For debugging purposes, I would like the rescue block to know that the error occurred in line 4 of this file. Is there a clean way of doing that... | [
"ruby",
"exception"
] | 58 | 87 | 26,877 | 5 | 0 | 2008-09-23T05:32:28.733000 | 2008-09-23T05:48:03.877000 |
119,295 | 119,348 | Pass-through authentication for MS SQL 2005 DB from SharePoint? | Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server. Both authenticate against our LDAP server. Would like to allow these authenticated SharePoint visitors to see some of the data from the MS SQL database. Primary challenge is authentication. Any tips on gettin... | If you are using C# the code and connection string is: using System.Data.SqlClient;... SqlConnection oSQLConn = new SqlConnection(); oSQLConn.ConnectionString = "Data Source=(local);" + "Initial Catalog=myDatabaseName;" + "Integrated Security=SSPI"; //Or // "Server=(local);" + // "Database=myDatabaseName;" + // "Truste... | Pass-through authentication for MS SQL 2005 DB from SharePoint? Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server. Both authenticate against our LDAP server. Would like to allow these authenticated SharePoint visitors to see some of the data from the MS SQL d... | TITLE:
Pass-through authentication for MS SQL 2005 DB from SharePoint?
QUESTION:
Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server. Both authenticate against our LDAP server. Would like to allow these authenticated SharePoint visitors to see some of the data... | [
"sql-server",
"sharepoint"
] | 0 | 1 | 1,834 | 3 | 0 | 2008-09-23T05:45:22.290000 | 2008-09-23T06:13:20.087000 |
119,308 | 119,403 | How do I get a list of tables affected by a set of stored procedures? | I have a huge database with some 100 tables and some 250 stored procedures. I want to know the list of tables affected by a subset of stored procedures. For example, I have a list of 50 stored procedures, out of 250, and I want to know the list of tables that will be affected by these 50 stored procedures. Is there any... | This would be your SQL Server query: SELECT [NAME] FROM sysobjects WHERE xType = 'U' AND --specifies a user table object id in ( SELECT sd.depid FROM sysobjects so, sysdepends sd WHERE so.name = 'NameOfStoredProcedure' AND sd.id = so.id ) Hope this helps someone. | How do I get a list of tables affected by a set of stored procedures? I have a huge database with some 100 tables and some 250 stored procedures. I want to know the list of tables affected by a subset of stored procedures. For example, I have a list of 50 stored procedures, out of 250, and I want to know the list of ta... | TITLE:
How do I get a list of tables affected by a set of stored procedures?
QUESTION:
I have a huge database with some 100 tables and some 250 stored procedures. I want to know the list of tables affected by a subset of stored procedures. For example, I have a list of 50 stored procedures, out of 250, and I want to k... | [
"database",
"stored-procedures"
] | 2 | 5 | 2,002 | 4 | 0 | 2008-09-23T05:50:45.103000 | 2008-09-23T06:33:02.147000 |
119,312 | 119,318 | URLs: Dash vs. Underscore | Is it better convention to use hyphens or underscores in your URLs? Should it be /about_us or /about-us? From usability point of view, I personally think /about-us is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming pattern. Is it just matter of style? Are th... | This is just a guess, but it seems they picked the one that people most probably wouldn't use in a name. This way you can have a name that includes a hyphenated word, and still use the underbar as a word delimiter, e.g. UseTwo-wayLinks could be converted to use_two-way_links. In your example, /about-us would be a direc... | URLs: Dash vs. Underscore Is it better convention to use hyphens or underscores in your URLs? Should it be /about_us or /about-us? From usability point of view, I personally think /about-us is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming pattern. Is it ju... | TITLE:
URLs: Dash vs. Underscore
QUESTION:
Is it better convention to use hyphens or underscores in your URLs? Should it be /about_us or /about-us? From usability point of view, I personally think /about-us is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming... | [
"url",
"seo",
"naming-conventions"
] | 235 | 31 | 125,369 | 18 | 0 | 2008-09-23T05:51:50.857000 | 2008-09-23T05:54:36.620000 |
119,328 | 119,586 | How do I truncate a java string to fit in a given number of bytes, once UTF-8 encoded? | How do I truncate a java String so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded? | Here is a simple loop that counts how big the UTF-8 representation is going to be, and truncates when it is exceeded: public static String truncateWhenUTF8(String s, int maxBytes) { int b = 0; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i);
// ranges from http://en.wikipedia.org/wiki/UTF-8 int skip = 0; i... | How do I truncate a java string to fit in a given number of bytes, once UTF-8 encoded? How do I truncate a java String so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded? | TITLE:
How do I truncate a java string to fit in a given number of bytes, once UTF-8 encoded?
QUESTION:
How do I truncate a java String so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded?
ANSWER:
Here is a simple loop that counts how big the UTF-8 representation is going to be, and... | [
"java",
"string",
"unicode",
"utf-8",
"truncate"
] | 49 | 35 | 39,299 | 8 | 0 | 2008-09-23T06:03:21.187000 | 2008-09-23T07:30:27.123000 |
119,336 | 4,762,977 | ssl_error_rx_record_too_long and Apache SSL | I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long They're getting this error on all browsers, all platforms. I can't reproduce the problem at all. My server and myself are located in the USA, the customer is located in India. I googled on the problem, ... | The link mentioned by Subimage was right on the money for me. It suggested changing the virtual host tag, ie, from to Error code: ssl_error_rx_record_too_long This usually means the implementation of SSL on your server is not correct. The error is usually caused by a server side problem which the server administrator w... | ssl_error_rx_record_too_long and Apache SSL I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long They're getting this error on all browsers, all platforms. I can't reproduce the problem at all. My server and myself are located in the USA, the customer is ... | TITLE:
ssl_error_rx_record_too_long and Apache SSL
QUESTION:
I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long They're getting this error on all browsers, all platforms. I can't reproduce the problem at all. My server and myself are located in the USA... | [
"apache",
"configuration",
"ssl",
"webserver",
"mod-ssl"
] | 291 | 190 | 825,519 | 15 | 0 | 2008-09-23T06:07:09.947000 | 2011-01-21T19:31:32.447000 |
119,388 | 119,468 | How to customize directory structure in ASP.NET MVC? | The project I'm starting to work at will have several dozens of controllers, so it would be nice to structure them into logical directories and respective namespaces, like "Controllers/Admin/", "Controllers/Warehouse/Supplies/", etc. Does ASP.NET MVC support nested controller directories and namespacing? How do I manag... | You can put the controllers anywhere; routes do not depend on where a controller is stored. It will be able to find any class that implements IController within your application. I usually keep my controllers in a separate project, f.ex a MyProject.Frontend project, alongisde a MyProject.Frontend.Application project wh... | How to customize directory structure in ASP.NET MVC? The project I'm starting to work at will have several dozens of controllers, so it would be nice to structure them into logical directories and respective namespaces, like "Controllers/Admin/", "Controllers/Warehouse/Supplies/", etc. Does ASP.NET MVC support nested c... | TITLE:
How to customize directory structure in ASP.NET MVC?
QUESTION:
The project I'm starting to work at will have several dozens of controllers, so it would be nice to structure them into logical directories and respective namespaces, like "Controllers/Admin/", "Controllers/Warehouse/Supplies/", etc. Does ASP.NET MV... | [
"asp.net-mvc",
"project-structure"
] | 1 | 2 | 1,810 | 1 | 0 | 2008-09-23T06:28:43.920000 | 2008-09-23T06:58:02.710000 |
119,390 | 119,438 | Specify the from user when sending email using the mail command | Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. We are running Redhat Linux 5. | http://www.mindspill.org/962 seems to have a solution. Essentially: echo "This is the main body of the mail" | mail -s "Subject of the Email" recipent_address@example.com -- -f from_user@example.com | Specify the from user when sending email using the mail command Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. We are running Redhat Linux 5. | TITLE:
Specify the from user when sending email using the mail command
QUESTION:
Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. We are running Redhat Linux 5.
ANSWER:
http://www.mindspill.org/962 seems to have ... | [
"linux",
"email",
"redhat"
] | 72 | 30 | 222,789 | 15 | 0 | 2008-09-23T06:29:09.393000 | 2008-09-23T06:44:28.653000 |
119,391 | 119,401 | What is the best search approach? | I'm using lucene in my project. Here is my question: should I use lucene to replace the whole search module which has been implemented with sql using a large number of like statement and accurate search by id or sth, or should I just use lucene in fuzzy search(i mean full text search)? | Probably you should use lucene, unless the SQL search is very performant. We are right now moving to Solr (based on Lucene) because our search queries are inherently slow, and cannot be sped up with our database.... If you have reasonably large tables, your search queries will start to get really slow unless the DB has... | What is the best search approach? I'm using lucene in my project. Here is my question: should I use lucene to replace the whole search module which has been implemented with sql using a large number of like statement and accurate search by id or sth, or should I just use lucene in fuzzy search(i mean full text search)? | TITLE:
What is the best search approach?
QUESTION:
I'm using lucene in my project. Here is my question: should I use lucene to replace the whole search module which has been implemented with sql using a large number of like statement and accurate search by id or sth, or should I just use lucene in fuzzy search(i mean ... | [
"search",
"lucene"
] | 1 | 3 | 1,003 | 3 | 0 | 2008-09-23T06:29:34.963000 | 2008-09-23T06:32:36.733000 |
119,396 | 119,539 | Source code control policy | I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team. Can someone provide a link to an overview or even give me some names of policies so I can launch google on it? | The paper "streamed lines: branching patterns for parallel software development" is an excellent discussion on branching patterns such as the "main line" pattern you mention - it lists the options in the form of patterns together with discussion of anti-patterns. One of the authors is Robert Orenstein of Perforce. | Source code control policy I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team. Can someone provide a link to an overview or even give me some names of policies so I can launch google... | TITLE:
Source code control policy
QUESTION:
I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team. Can someone provide a link to an overview or even give me some names of policies so I... | [
"svn",
"version-control"
] | 8 | 6 | 4,673 | 8 | 0 | 2008-09-23T06:31:59.200000 | 2008-09-23T07:20:11.267000 |
119,399 | 119,513 | How well does Python's whitespace dependency interact with source control with regards to merging? | I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN. | It works fine so long as everyone on the project has agreed to use the same whitespace style (spaces or tabs). But I've seen cases where a developer has converted an entire file from spaces to tabs (I think Eclipse had that as a feature, bound to Ctrl+Tab!), which makes spotting diffs near impossible. | How well does Python's whitespace dependency interact with source control with regards to merging? I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN. | TITLE:
How well does Python's whitespace dependency interact with source control with regards to merging?
QUESTION:
I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN.
ANSWER:
It works fine so long as everyone on the project... | [
"version-control",
"merge",
"whitespace"
] | 1 | 1 | 352 | 3 | 0 | 2008-09-23T06:32:23.473000 | 2008-09-23T07:13:14.733000 |
119,404 | 119,418 | time length of an mp3 file | What is the simplest way to determine the length (in seconds) of a given mp3 file, without using outside libraries? (python source highly appreciated) | You can use pymad. It's an external library, but don't fall for the Not Invented Here trap. Any particular reason you don't want any external libraries? import mad
mf = mad.MadFile("foo.mp3") track_length_in_milliseconds = mf.total_time() Spotted here. -- If you really don't want to use an external library, have a loo... | time length of an mp3 file What is the simplest way to determine the length (in seconds) of a given mp3 file, without using outside libraries? (python source highly appreciated) | TITLE:
time length of an mp3 file
QUESTION:
What is the simplest way to determine the length (in seconds) of a given mp3 file, without using outside libraries? (python source highly appreciated)
ANSWER:
You can use pymad. It's an external library, but don't fall for the Not Invented Here trap. Any particular reason y... | [
"python",
"mp3",
"media",
"duration"
] | 19 | 26 | 31,874 | 6 | 0 | 2008-09-23T06:33:14.767000 | 2008-09-23T06:37:50.947000 |
119,414 | 119,522 | How would you unittest a memory allocator? | There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to produce a working (but absolutely useless) mem... | Highly testable code tends to be structured differently than other code. You describe several tasks that you want an allocator to do: coalescing free blocks reusing free blocks on next allocations returning excess free memory to the system asserting that the allocation policy (e.g. first-fit) really is respected While ... | How would you unittest a memory allocator? There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to pro... | TITLE:
How would you unittest a memory allocator?
QUESTION:
There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It... | [
"c++",
"c",
"unit-testing",
"testing",
"memory-management"
] | 8 | 11 | 3,898 | 8 | 0 | 2008-09-23T06:36:32.293000 | 2008-09-23T07:16:06.660000 |
119,426 | 119,430 | Jar file naming conventions | Are there any industry standard conventions for naming jar files? | I have been using *Informative*-*name*-*M*.*m*.*b*.jar Where: M = major version number (changed when backward compatibility is not necessarily maintained) m = minor version number (feature additions etc) b = build number (for releases containing bug fixes) | Jar file naming conventions Are there any industry standard conventions for naming jar files? | TITLE:
Jar file naming conventions
QUESTION:
Are there any industry standard conventions for naming jar files?
ANSWER:
I have been using *Informative*-*name*-*M*.*m*.*b*.jar Where: M = major version number (changed when backward compatibility is not necessarily maintained) m = minor version number (feature additions ... | [
"java",
"jar",
"naming-conventions"
] | 23 | 26 | 15,005 | 2 | 0 | 2008-09-23T06:41:24.543000 | 2008-09-23T06:42:25.570000 |
119,432 | 119,510 | Logging Clientside JavaScript Errors on Server | Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing. Is there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something like that)? | You could try setting up your own handler for the onerror event and use XMLHttpRequest to tell the server what went wrong, however since it's not part of any specification, support is somewhat flaky. Here's an example from Using XMLHttpRequest to log JavaScript errors: window.onerror = function(msg, url, line) { var re... | Logging Clientside JavaScript Errors on Server Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing. Is there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something like that)? | TITLE:
Logging Clientside JavaScript Errors on Server
QUESTION:
Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing. Is there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something l... | [
"javascript",
"logging",
"error-handling"
] | 108 | 74 | 59,268 | 8 | 0 | 2008-09-23T06:43:11.747000 | 2008-09-23T07:12:28.917000 |
119,441 | 119,473 | Highlight a word with jQuery | I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris... | Try highlight: JavaScript text highlighting jQuery plugin. Warning: The source code available on this page contains a cryptocurrency mining script, either use the code below or remove the mining script from the script downloaded from the website. /*
highlight v4
Highlights arbitrary terms. MIT license.
Johann Burkar... | Highlight a word with jQuery I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam rhoncus eros at au... | TITLE:
Highlight a word with jQuery
QUESTION:
I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam ... | [
"javascript",
"jquery",
"html"
] | 105 | 87 | 198,186 | 13 | 0 | 2008-09-23T06:45:58.277000 | 2008-09-23T06:58:58.743000 |
119,467 | 123,922 | How do you structure your URL routes? | Is there a specific pattern that developers generally follow? I never really gave it much thought before in my web applications, but the ASP.NET MVC routing engine pretty much forces you to at least take it into consideration. So far I've liked the controller/action/index structure (e.g. Products/Edit/1), but I'm strug... | I like RESTful, user friendly and hackable URLs. What does this mean? Lets start with user friendly URLs. To me a user friendly URL is something easy to type and easy to remember /Default.aspx?action=show&userID=140 doesn't meet any of these requirements. A URL like `/users/troethom´ seems logical though. This leads to... | How do you structure your URL routes? Is there a specific pattern that developers generally follow? I never really gave it much thought before in my web applications, but the ASP.NET MVC routing engine pretty much forces you to at least take it into consideration. So far I've liked the controller/action/index structure... | TITLE:
How do you structure your URL routes?
QUESTION:
Is there a specific pattern that developers generally follow? I never really gave it much thought before in my web applications, but the ASP.NET MVC routing engine pretty much forces you to at least take it into consideration. So far I've liked the controller/acti... | [
"asp.net-mvc",
"url",
"routes"
] | 8 | 8 | 2,163 | 6 | 0 | 2008-09-23T06:57:04.757000 | 2008-09-23T21:14:19.313000 |
119,471 | 119,849 | Is it possible to create full screen color overlay effects in windows? | I remember my old Radeon graphics drivers which had a number of overlay effects or color filters (whatever they are called) that would render the screen in e.g. sepia tones or negative colors. My current NVIDIA card does not seem to have such a function so I wondered if it is possible to make my own for Vista. I don't ... | You could have a full-screen layered window on top of everything and passing through click events.. However that's hacky and slow compared to what could be done by getting a hook in the WDM renderer's DirectX context. However, so far it's not possible, as Microsoft does not provide any public interface into this. The F... | Is it possible to create full screen color overlay effects in windows? I remember my old Radeon graphics drivers which had a number of overlay effects or color filters (whatever they are called) that would render the screen in e.g. sepia tones or negative colors. My current NVIDIA card does not seem to have such a func... | TITLE:
Is it possible to create full screen color overlay effects in windows?
QUESTION:
I remember my old Radeon graphics drivers which had a number of overlay effects or color filters (whatever they are called) that would render the screen in e.g. sepia tones or negative colors. My current NVIDIA card does not seem t... | [
"windows",
"colors",
"overlay"
] | 6 | 1 | 2,615 | 1 | 0 | 2008-09-23T06:58:23.207000 | 2008-09-23T08:31:07.417000 |
119,477 | 141,394 | SQL Server 2005 / XML Stored Proc - Unicode to ascii? (Exception 0xc00ce508) | I have an MSSQL2005 stored procedure here, which is supposed to take an XML message as input, and store it's content into a table. The table fields are varchars, because our delphi backend application could not handle unicode. Now, the messages that come in, are encoded ISO-8859-1. All is fine until characters over the... | I don't know if anybody with enough rights to edit the answer will see this but while the answer is correct I would like to add that without specifying the collation explicitly the default collation of the database would be used in this case since it is implicitly assigned to every varchar-variable without a collation ... | SQL Server 2005 / XML Stored Proc - Unicode to ascii? (Exception 0xc00ce508) I have an MSSQL2005 stored procedure here, which is supposed to take an XML message as input, and store it's content into a table. The table fields are varchars, because our delphi backend application could not handle unicode. Now, the message... | TITLE:
SQL Server 2005 / XML Stored Proc - Unicode to ascii? (Exception 0xc00ce508)
QUESTION:
I have an MSSQL2005 stored procedure here, which is supposed to take an XML message as input, and store it's content into a table. The table fields are varchars, because our delphi backend application could not handle unicode... | [
"sql-server-2005",
"t-sql",
"stored-procedures",
"unicode"
] | 0 | 1 | 3,450 | 3 | 0 | 2008-09-23T07:00:52.377000 | 2008-09-26T19:21:24.073000 |
119,492 | 119,498 | Difference between Visual C++ 2008 and 2005 | I couldn't find any useful information on Microsoft's site, so here is the question: has the compiler in Visual C++ 2008 been improved significantly since the 2005 version? I'm especially looking for better optimization. | Straight from the horses mouth.... http://msdn.microsoft.com/en-us/library/bb384632.aspx | Difference between Visual C++ 2008 and 2005 I couldn't find any useful information on Microsoft's site, so here is the question: has the compiler in Visual C++ 2008 been improved significantly since the 2005 version? I'm especially looking for better optimization. | TITLE:
Difference between Visual C++ 2008 and 2005
QUESTION:
I couldn't find any useful information on Microsoft's site, so here is the question: has the compiler in Visual C++ 2008 been improved significantly since the 2005 version? I'm especially looking for better optimization.
ANSWER:
Straight from the horses mou... | [
"c++",
"visual-studio",
"visual-studio-2008",
"visual-studio-2005",
"compiler-construction"
] | 2 | 6 | 4,943 | 5 | 0 | 2008-09-23T07:06:37.260000 | 2008-09-23T07:08:43.260000 |
119,506 | 119,543 | Virtual member call in a constructor | I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. Why would this be something not to do? | When an object written in C# is constructed, what happens is that the initializers run in order from the most derived class to the base class, and then constructors run in order from the base class to the most derived class ( see Eric Lippert's blog for details as to why this is ). Also in.NET objects do not change typ... | Virtual member call in a constructor I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. Why would this be something not to do? | TITLE:
Virtual member call in a constructor
QUESTION:
I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. Why would this be something not to do?
ANSWER:
When an object written in C# is constructed, what happens is that the initializers run in order from the most derived ... | [
"c#",
"constructor",
"warnings",
"resharper",
"virtual-functions"
] | 1,490 | 1,288 | 223,545 | 18 | 0 | 2008-09-23T07:11:30.337000 | 2008-09-23T07:21:13.747000 |
119,508 | 119,881 | Is it possible to determine the current user from within a global keyboard hook in .NET | I want to create a keyboard and mouse hook which will be started as a windows service. I want to monitor the activity of the various users who use the system throughout the day. i.e. which users are active at what times. Is is possible to determine which user will be receiving the events? (The service will be running a... | No, Environment.UserName does not work - the hook procedure is not called under the context of the input receiver. Indeed, I think this is not possible - the _LL hooks, which you are no doubt using if using.NET, are low-level hooks. It seems to me that they are executed well before Windows even determines which desktop... | Is it possible to determine the current user from within a global keyboard hook in .NET I want to create a keyboard and mouse hook which will be started as a windows service. I want to monitor the activity of the various users who use the system throughout the day. i.e. which users are active at what times. Is is possi... | TITLE:
Is it possible to determine the current user from within a global keyboard hook in .NET
QUESTION:
I want to create a keyboard and mouse hook which will be started as a windows service. I want to monitor the activity of the various users who use the system throughout the day. i.e. which users are active at what ... | [
".net",
"windows"
] | 3 | 1 | 345 | 4 | 0 | 2008-09-23T07:12:19.710000 | 2008-09-23T08:39:54.243000 |
119,540 | 119,652 | Business Logic: Database or Application Layer | The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly, Why? Assume database independence is not a goal. | Put enough of the business logic in the database to ensure that the data is consistent and correct. But don't fear having to duplicate some of this logic at another level to enhance the user experience. | Business Logic: Database or Application Layer The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly, Why? Assume database independence is not a goal. | TITLE:
Business Logic: Database or Application Layer
QUESTION:
The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly, Why? Assume database independence is not a goal.
ANSWER:
Put enough of the busin... | [
"database",
"oracle",
"business-logic"
] | 42 | 32 | 19,968 | 24 | 0 | 2008-09-23T07:20:27.663000 | 2008-09-23T07:46:03.623000 |
119,548 | 119,599 | Issue writing to single file in Web service in .NET | I have created a webservice in.net 2.0, C#. I need to log some information to a file whenever different methods are called by the web service clients. The problem comes when one user process is writing to a file and another process tries to write to it. I get the following error: The process cannot access the file beca... | The locking is probably failing because your webservice is being run by more than one worker process. You could protect the access with a named mutex, which is shared across processes, unlike the locks you get by using lock(someobject) {...}: Mutex lock = new Mutex("mymutex", false);
lock.WaitOne();
// access file
l... | Issue writing to single file in Web service in .NET I have created a webservice in.net 2.0, C#. I need to log some information to a file whenever different methods are called by the web service clients. The problem comes when one user process is writing to a file and another process tries to write to it. I get the foll... | TITLE:
Issue writing to single file in Web service in .NET
QUESTION:
I have created a webservice in.net 2.0, C#. I need to log some information to a file whenever different methods are called by the web service clients. The problem comes when one user process is writing to a file and another process tries to write to ... | [
"c#",
"web-services"
] | 6 | 11 | 7,252 | 11 | 0 | 2008-09-23T07:22:30.077000 | 2008-09-23T07:32:55.043000 |
119,555 | 119,585 | How do you start building an ASP.NET web app? | Say for example you're getting a web app project that interacts with a database. How do you start your development? Do you start by designing your database, drawing simple ERD and writting a create scripts? Do you start by designing the look of your of web app, maybe using photoshop, then create a master page for it? o... | You start by deciding which way you start. No but really, it depends on too much factors to have a general answer. Do you develop using concepts of agile development, are there specified functional designs, did the client give you strict requirements, what is your own experience etc.. Generally we start by developing o... | How do you start building an ASP.NET web app? Say for example you're getting a web app project that interacts with a database. How do you start your development? Do you start by designing your database, drawing simple ERD and writting a create scripts? Do you start by designing the look of your of web app, maybe using ... | TITLE:
How do you start building an ASP.NET web app?
QUESTION:
Say for example you're getting a web app project that interacts with a database. How do you start your development? Do you start by designing your database, drawing simple ERD and writting a create scripts? Do you start by designing the look of your of web... | [
"asp.net"
] | 2 | 1 | 248 | 7 | 0 | 2008-09-23T07:24:06.640000 | 2008-09-23T07:29:58.420000 |
119,559 | 119,572 | Determine the number of lines within a text file | Is there an easy way to programmatically determine the number of lines within a text file? | Seriously belated edit: If you're using.NET 4.0 or later The File class has a new ReadLines method which lazily enumerates lines rather than greedily reading them all into an array like ReadAllLines. So now you can have both efficiency and conciseness with: var lineCount = File.ReadLines(@"C:\file.txt").Count(); Origin... | Determine the number of lines within a text file Is there an easy way to programmatically determine the number of lines within a text file? | TITLE:
Determine the number of lines within a text file
QUESTION:
Is there an easy way to programmatically determine the number of lines within a text file?
ANSWER:
Seriously belated edit: If you're using.NET 4.0 or later The File class has a new ReadLines method which lazily enumerates lines rather than greedily rea... | [
"c#",
"input",
"text-files"
] | 238 | 445 | 320,758 | 12 | 0 | 2008-09-23T07:25:31.473000 | 2008-09-23T07:27:24.870000 |
119,578 | 119,752 | Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE | What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Studio versions? | If you don't want to pollute your source code (after all this warning presents only with Microsoft compiler), add _CRT_SECURE_NO_WARNINGS symbol to your project settings via "Project"->"Properties"->"Configuration properties"->"C/C++"->"Preprocessor"->"Preprocessor definitions". Also you can define it just before you i... | Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Studio versions? | TITLE:
Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE
QUESTION:
What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Studio versions?
ANSWER:
If you don't want to pollute your source code (after all this ... | [
"c++",
"visual-studio",
"visual-c++"
] | 76 | 106 | 166,457 | 10 | 0 | 2008-09-23T07:28:06.537000 | 2008-09-23T08:06:15.760000 |
119,588 | 132,209 | ASP MVC Preview 5 and IIS 6 Windows Authentication | I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access. I've just deployed this to IIS6 running on Server 2003 R2 SP2. The web app is configured with it's own pool with i... | After extensive Googling I managed to find a solution on the following MSDN article: How To: Create a Service Account for an ASP.NET 2.0 Application Specifically the Additional Considerations section which describes "Creating Service Principal Names (SPNs) for Domain Accounts" using the setspn tool from the Windows Sup... | ASP MVC Preview 5 and IIS 6 Windows Authentication I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access. I've just deployed this to IIS6 running on Server 2003 R2 SP2. ... | TITLE:
ASP MVC Preview 5 and IIS 6 Windows Authentication
QUESTION:
I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access. I've just deployed this to IIS6 running on Se... | [
"asp.net-mvc",
"authentication",
"iis-6"
] | 4 | 7 | 4,254 | 5 | 0 | 2008-09-23T07:31:01.727000 | 2008-09-25T08:53:08.907000 |
119,622 | 119,659 | Where is a good place to brush up on some math? | Math skills are becoming more and more essential, and I wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A site with lots of video's as well as practice exercises would be a double win but I can't seem to find one. | It depends on your math level. You should start by revising what you should know till that moment and then go further to algorithm mathmatics, geometry (transforms and etc), statistics and more. There are tons of places on the internet were you can learn: http://www.math.cornell.edu/Courses/courses.html http://ocw.mit.... | Where is a good place to brush up on some math? Math skills are becoming more and more essential, and I wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A site with lots of video's as well as practice exercises would be a double win but I can't seem to find o... | TITLE:
Where is a good place to brush up on some math?
QUESTION:
Math skills are becoming more and more essential, and I wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A site with lots of video's as well as practice exercises would be a double win but I ca... | [
"math",
"computer-science",
"algebra",
"discrete-mathematics"
] | 5 | 5 | 2,183 | 11 | 0 | 2008-09-23T07:39:26.883000 | 2008-09-23T07:47:37.863000 |
119,627 | 119,665 | Storing xml data in a cookie | I'm trying to store an xml serialized object in a cookie, but i get an error like this: A potentially dangerous Request.Cookies value was detected from the client (KundeContextCookie=" I know the problem from similiar cases when you try to store something that looks like javascript code in a form input field. What is t... | I wouldn't store data in XML in the cookie - there is a limit on cookie size for starters (used to be 4K for all headers including the cookie). Pick a less verbose encoding strategy such as delimiters instead e.g. a|b|c or separate cookie values. Delimited encoding makes it especially easy and fast to decode the values... | Storing xml data in a cookie I'm trying to store an xml serialized object in a cookie, but i get an error like this: A potentially dangerous Request.Cookies value was detected from the client (KundeContextCookie=" I know the problem from similiar cases when you try to store something that looks like javascript code in ... | TITLE:
Storing xml data in a cookie
QUESTION:
I'm trying to store an xml serialized object in a cookie, but i get an error like this: A potentially dangerous Request.Cookies value was detected from the client (KundeContextCookie=" I know the problem from similiar cases when you try to store something that looks like j... | [
"c#",
"asp.net",
"serialization",
"cookies"
] | 1 | 1 | 7,213 | 4 | 0 | 2008-09-23T07:40:45.367000 | 2008-09-23T07:48:55.583000 |
119,632 | 119,744 | Running scripts inside C# | I want to run javascript/Python/Ruby inside my application. I have an application that creates process automatically based on user's definition. The process is generated in C#. I want to enable advanced users to inject script in predefined locations. Those scripts should be run from the C# process. For example, the cre... | Basically, you have two problems: how to define point of injections in your generated code, and how to run python / ruby / whatev scripts from there. Depending on how you generate the process, one possible solution would be to add a function to each possible point of injection. The function would check, whether the use... | Running scripts inside C# I want to run javascript/Python/Ruby inside my application. I have an application that creates process automatically based on user's definition. The process is generated in C#. I want to enable advanced users to inject script in predefined locations. Those scripts should be run from the C# pro... | TITLE:
Running scripts inside C#
QUESTION:
I want to run javascript/Python/Ruby inside my application. I have an application that creates process automatically based on user's definition. The process is generated in C#. I want to enable advanced users to inject script in predefined locations. Those scripts should be r... | [
"c#",
"scripting"
] | 6 | 5 | 13,027 | 9 | 0 | 2008-09-23T07:42:22.947000 | 2008-09-23T08:04:51.550000 |
119,647 | 1,396,689 | British English to American English (and vice versa) Converter | Does anyone know of a library or bit of code that converts British English to American English and vice versa? I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, localised/localized) but it would be nice to be able to provide localised site content... | I've been working on one to convert US English to UK English. As I've discovered it's actually a lot harder to write something to convert the other way but I hope to get around to providing a reverse conversion one day. This isn't perfect, but it's not a bad effort (even if I do say so myself). It'll convert most US sp... | British English to American English (and vice versa) Converter Does anyone know of a library or bit of code that converts British English to American English and vice versa? I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, localised/localized) bu... | TITLE:
British English to American English (and vice versa) Converter
QUESTION:
Does anyone know of a library or bit of code that converts British English to American English and vice versa? I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, local... | [
"language-agnostic",
"converters"
] | 12 | 7 | 15,440 | 5 | 0 | 2008-09-23T07:45:18.057000 | 2009-09-08T22:34:46.917000 |
119,651 | 119,718 | Find matching sequences in two binary files | Let me start off with a bit of background. This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of another program (SpyBot) have reported the same problem. A now... | See the longest common substring problem. I guess difflib uses the DP solution, which is certainly too slow to compare executables. You can do much better with suffix trees/arrays. Using perl Tree::Suffix might be easiest solution. Apparently it gives all common substrings in a specified length range: @lcs = $tree->lcs... | Find matching sequences in two binary files Let me start off with a bit of background. This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of another program (S... | TITLE:
Find matching sequences in two binary files
QUESTION:
Let me start off with a bit of background. This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of ... | [
"python",
"binary",
"diff",
"antivirus"
] | 2 | 5 | 2,285 | 5 | 0 | 2008-09-23T07:46:02.563000 | 2008-09-23T08:00:13.137000 |
119,669 | 120,092 | Connectivity of Winform Applications/ASP.NET application with SAP databases | How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The.NET framework used is 2.0., language is C# and SAP version is 7.10. | Not sure if this will work for you, but there's a C library, which can probably be used from your C# application and which provides a quite easy API for calling BAPIs in SAP. (Accessing the underlying database directly via SQL is not to be recommended... Better use BAPIs or a custom-tailored RFC-enabled function module... | Connectivity of Winform Applications/ASP.NET application with SAP databases How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The.NET framework used is 2.0., language is C# and SAP version is 7.10. | TITLE:
Connectivity of Winform Applications/ASP.NET application with SAP databases
QUESTION:
How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The.NET framework used is 2.0., language is C# and SAP version is 7.10.
ANSWER:
Not sure if this will work for you, but there's a C library, ... | [
"asp.net",
"connectivity",
"sap-basis"
] | 1 | 1 | 1,525 | 2 | 0 | 2008-09-23T07:49:48.577000 | 2008-09-23T09:44:11.873000 |
119,679 | 119,734 | List of Stored Procedure from Table | I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table. | select so.name, sc.text from sysobjects so inner join syscomments sc on so.id = sc.id where sc.text like '%INSERT INTO xyz%' or sc.text like '%UPDATE xyz%' This will give you a list of all stored procedure contents with INSERT or UPDATE in them for a particular table (you can obviously tweak the query to suit). Also lo... | List of Stored Procedure from Table I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table. | TITLE:
List of Stored Procedure from Table
QUESTION:
I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table.
ANSWER:
select so.name, sc.text from sysobjects so inner join syscomme... | [
"sql",
"sql-server",
"stored-procedures"
] | 8 | 10 | 18,747 | 7 | 0 | 2008-09-23T07:52:43.920000 | 2008-09-23T08:02:49.903000 |
119,694 | 163,833 | Replacing strings inside SWF | We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess and refactoring it is currently not an option). I... | You could try Burak's URL Action Editor -- it says URL, but I'm pretty sure it lets you edit any text in a SWF. I haven't used it, but I have used his ActionScript Viewer, which works wonderfully. | Replacing strings inside SWF We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess and refactoring it i... | TITLE:
Replacing strings inside SWF
QUESTION:
We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess an... | [
"flash"
] | 7 | 3 | 10,722 | 11 | 0 | 2008-09-23T07:55:16.520000 | 2008-10-02T18:28:06.177000 |
119,706 | 119,743 | How to get my own code's module handle? | Possible Duplicate: How do I get the HMODULE for the currently executing code? I'm trying to find a resource in my own module. If this module is an executable, that's trivial - GetModuleHandle(NULL) returns the handle of the "main" module. My module, however, is a DLL that is loaded by another executable. So GetModuleH... | Store the module handle away when it is given to you in DllMain and then use it later when you actually need it. A lot of frameworks (e.g., MFC) do this automatically. | How to get my own code's module handle? Possible Duplicate: How do I get the HMODULE for the currently executing code? I'm trying to find a resource in my own module. If this module is an executable, that's trivial - GetModuleHandle(NULL) returns the handle of the "main" module. My module, however, is a DLL that is loa... | TITLE:
How to get my own code's module handle?
QUESTION:
Possible Duplicate: How do I get the HMODULE for the currently executing code? I'm trying to find a resource in my own module. If this module is an executable, that's trivial - GetModuleHandle(NULL) returns the handle of the "main" module. My module, however, is... | [
"winapi",
"dll"
] | 14 | 13 | 16,827 | 3 | 0 | 2008-09-23T07:57:00.103000 | 2008-09-23T08:04:42.987000 |
119,723 | 119,782 | Is it worth the development time to output valid HTML? | Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usually end up using the prototype in product... | It is only worth the effort if it gives you a practical benefit. Sticking to standards might make it easier to build a website that works across most browsers. Then again, if you're happy with how a website displays on the browsers you care about (maybe one, maybe all), then going through hoops to make it pass validati... | Is it worth the development time to output valid HTML? Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable de... | TITLE:
Is it worth the development time to output valid HTML?
QUESTION:
Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give ... | [
"xhtml",
"strict"
] | 13 | 20 | 864 | 13 | 0 | 2008-09-23T08:01:01.233000 | 2008-09-23T08:13:53.167000 |
119,724 | 119,758 | In continuous integration what is the best way to deal with external application dependencies | In using our TeamCity Continuous Integration server we have uncovered some issues that we are unsure as to the best way to handle. Namely how to reference external applications that our application requires on the CI server. This was initially uncovered with a dependency on Crystal Reports, so we went and installed Cry... | Where possible make the external dependencies part of your build system. For instance check the installer in to your version control system and have a step that checks it out and runs it in silent mode (many installers support a mode with no user action sometimes using the commandline /s). This way if you need to set u... | In continuous integration what is the best way to deal with external application dependencies In using our TeamCity Continuous Integration server we have uncovered some issues that we are unsure as to the best way to handle. Namely how to reference external applications that our application requires on the CI server. T... | TITLE:
In continuous integration what is the best way to deal with external application dependencies
QUESTION:
In using our TeamCity Continuous Integration server we have uncovered some issues that we are unsure as to the best way to handle. Namely how to reference external applications that our application requires o... | [
"continuous-integration",
"dependencies",
"teamcity"
] | 1 | 4 | 751 | 4 | 0 | 2008-09-23T08:01:03.480000 | 2008-09-23T08:07:44.943000 |
119,730 | 119,842 | How do I sort a VARCHAR column in SQL server that contains numbers? | I have a VARCHAR column in a SQL Server 2000 database that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer. When it does contain numbers, I want it to be sorted numerically, e.g. as "1", "2", "10" instead of "1", "10", "2". Fields containing just ... | One possible solution is to pad the numeric values with a character in front so that all are of the same string length. Here is an example using that approach: select MyColumn from MyTable order by case IsNumeric(MyColumn) when 1 then Replicate('0', 100 - Len(MyColumn)) + MyColumn else MyColumn end The 100 should be re... | How do I sort a VARCHAR column in SQL server that contains numbers? I have a VARCHAR column in a SQL Server 2000 database that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer. When it does contain numbers, I want it to be sorted numerically, e.g. ... | TITLE:
How do I sort a VARCHAR column in SQL server that contains numbers?
QUESTION:
I have a VARCHAR column in a SQL Server 2000 database that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer. When it does contain numbers, I want it to be sorted ... | [
"sql",
"t-sql"
] | 61 | 85 | 142,703 | 14 | 0 | 2008-09-23T08:01:51.590000 | 2008-09-23T08:29:07.530000 |
119,751 | 120,609 | Is Approximate Nearest Neighbour the fastest feature matching in Computer Vision? | When using feature descriptors [like SIFT, SURF] - is Approximate Nearest Neighbour the fastest method to do matching between images? | I'd say that Euclidean distnace based nearest neighbor would be the easiest to implement, but not necessarily the fastest. I'd agree that approximate nearest neighbor or 'best bin first' would be the quickest at identifying which image in your background set most closely resembles the probe image. If your trying to ide... | Is Approximate Nearest Neighbour the fastest feature matching in Computer Vision? When using feature descriptors [like SIFT, SURF] - is Approximate Nearest Neighbour the fastest method to do matching between images? | TITLE:
Is Approximate Nearest Neighbour the fastest feature matching in Computer Vision?
QUESTION:
When using feature descriptors [like SIFT, SURF] - is Approximate Nearest Neighbour the fastest method to do matching between images?
ANSWER:
I'd say that Euclidean distnace based nearest neighbor would be the easiest t... | [
"computer-vision",
"sift",
"nearest-neighbor",
"approximate-nn-searching"
] | 2 | 3 | 2,626 | 3 | 0 | 2008-09-23T08:06:05.807000 | 2008-09-23T12:19:13.170000 |
119,762 | 120,264 | NHibernate transaction and race condition | I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified. My problem is how to prevent a race condition whereby two user actions occur almost simultan... | make the isolation level of your transaction SERIALIZABLE ( session.BeginTransaction(IsolationLevel.Serializable ) and check and insert in the same transaction. You should not in general set the isolationlevel to serializable, just in situations like this. or lock the table before you check and eventually insert. You c... | NHibernate transaction and race condition I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified. My problem is how to prevent a race condition wher... | TITLE:
NHibernate transaction and race condition
QUESTION:
I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified. My problem is how to prevent a r... | [
"sql",
"sql-server",
"nhibernate"
] | 1 | 5 | 2,641 | 3 | 0 | 2008-09-23T08:08:22.713000 | 2008-09-23T10:38:15.863000 |
119,774 | 131,677 | Schema reference for IIS programmatic administration | Where can I find the IIS object schema? All I found from MSDN was a picture of the class hierarchy. To be clear, I want to configure IIS through either WMI or ADSI and I'm looking for something like the Active Directory schema, only for IIS. I want a list of all the objects I can configure, which objects they can be co... | While I can't point you to a definitive document, you might find this even better: WMI code creator: http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&DisplayLang=en I've used this tool to query IIS WMI objects and it will even script the queries or WMI method calls for you i... | Schema reference for IIS programmatic administration Where can I find the IIS object schema? All I found from MSDN was a picture of the class hierarchy. To be clear, I want to configure IIS through either WMI or ADSI and I'm looking for something like the Active Directory schema, only for IIS. I want a list of all the ... | TITLE:
Schema reference for IIS programmatic administration
QUESTION:
Where can I find the IIS object schema? All I found from MSDN was a picture of the class hierarchy. To be clear, I want to configure IIS through either WMI or ADSI and I'm looking for something like the Active Directory schema, only for IIS. I want ... | [
"windows",
"iis",
"schema"
] | 1 | 1 | 194 | 2 | 0 | 2008-09-23T08:12:41.203000 | 2008-09-25T06:04:58.140000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.