instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I've been trying to figure out a regex to allow me to search for a particular string while automatically skipping comments. Anyone have an RE like this or know of one? It doesn't even need to be sophisticated enough to skip #if 0 blocks; I just want it to skip over // and /* blocks. The converse, that is only search...
To create a regex that can help you search for a particular string while skipping comments in code (specifically C/C++ style comments with `//` and `/* ... */`), you can follow these approaches. ### Regex to Skip Comments Here is a regex pattern you can use to skip both single-line (`//`) and multi-line (`/* ... */`...
7,205
[ { "from": "human", "value": "I've been trying to figure out a regex to allow me to search for a particular string while automatically skipping comments. Anyone have an RE like this or know of one? It doesn't even need to be sophisticated enough to skip #if 0 blocks; I just want it to skip over // and /* b...
I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC How do I retrieve the "name" param in my Java code?
In a Java web application running on a GlassFish server (or any Java EE server), you can retrieve query parameters sent via the GET method using the `@PathParam` or `@QueryParam` annotations in a JAX-RS resource class. Since your URL contains a query parameter (`name=ABC`), you would use `@QueryParam`. Here is how you...
7,824
[ { "from": "human", "value": "I just installed Glassfish V2 on my local machine just to play around with it.\nI was wondering if there is a way to retrieve a param passed in by the GET HTTP method.\nFor instance,\nhttp://localhost:8080/HelloWorld/resources/helloWorld?name=ABC\n\nHow do I retrieve the \"name\...
I'm still trying to decide whether my (home) project should use UTF-8 strings (implemented in terms of std::string with additional UTF-8-specific functions when necessary) or some 16-bit string (implemented as std::wstring). The project is a programming language and environment (like VB, it's a combination of both). Th...
Given your project requirements and constraints, it seems that sticking with UTF-8 (`std::string`) is a solid choice for the following reasons: 1. **Memory Efficiency**: UTF-8 is more memory-efficient for texts that are primarily ASCII, which is common in programming languages and environments. Since you're concerned ...
8,027
[ { "from": "human", "value": "I'm still trying to decide whether my (home) project should use UTF-8 strings (implemented in terms of std::string with additional UTF-8-specific functions when necessary) or some 16-bit string (implemented as std::wstring). The project is a programming language and environment ...
I'm trying to bind controls in a WPF form to an interface and I get a runtime error that it can't find the interface's properties. Here's the class I'm using as a datasource: public interface IPerson { string UserId { get; set; } string UserName { get; set; } string Email { get; set; } } public class Perso...
The error you're encountering indicates that the WPF binding system cannot access the properties of your `Person` class, specifically for `UserId`, `UserName`, and `Email`. This is primarily due to the way the properties are defined in the `Person` class and how you are trying to bind to an interface type. To fix the ...
7,282
[ { "from": "human", "value": "I'm trying to bind controls in a WPF form to an interface and I get a runtime error that it can't find the interface's properties.\nHere's the class I'm using as a datasource:\npublic interface IPerson\n{\n string UserId { get; set; }\n string UserName { get; set; }\n s...
Given a declaration like this: class A { public: void Foo() const; }; What does it mean? Google turns up this: Member functions should be declared with the const keyword after them if they can operate on a const (this) object. If the function is not declared const, in can not be applied to a const object, and the...
Certainly! The `const` keyword in the context of a member function declaration, like in your example `void Foo() const;`, indicates that this function does not modify the state of the object on which it is called. Here’s a breakdown of what this means: 1. **Const Member Function**: By declaring `Foo` as a `const` me...
6,646
[ { "from": "human", "value": "Given a declaration like this:\nclass A {\npublic:\n void Foo() const;\n};\n\nWhat does it mean?\nGoogle turns up this:\n\nMember functions should be declared with the const keyword after them if they can operate on a const (this) object. If the function is not declared const...
Anyone knows of a good tool for developing add-ins for Word in .net? Hopefully something that supports both office 2003 and 2007. Thanks.
For developing add-ins for Microsoft Word in .NET that support both Office 2003 and 2007, you have a few options: 1. **VSTO (Visual Studio Tools for Office)**: This is the primary toolset provided by Microsoft for creating Office add-ins using .NET. However, VSTO primarily supports Office 2007 and later. For Office 20...
9,542
[ { "from": "human", "value": "Anyone knows of a good tool for developing add-ins for Word in .net?\nHopefully something that supports both office 2003 and 2007.\nThanks.\n" }, { "from": "gpt", "value": "For developing add-ins for Microsoft Word in .NET that support both Office 2003 and 2007, you ...
I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter). I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm...
If you're looking to access a Java-based web service without using Java yourself, you're in luck. Most web services, regardless of their underlying technology, can typically be accessed using standard protocols like HTTP, SOAP, or REST. Here are some options and steps to guide you through the process: ### 1. Understan...
6,478
[ { "from": "human", "value": "I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter). I'm not going to lie, I am a Java software engineer,...
I have some website which requires a logon and shows sensitive information. The person goes to the page, is prompted to log in, then gets to see the information. The person logs out of the site, and is redirected back to the login page. The person then can hit "back" and go right back to the page where the sensitive in...
This is a common challenge in web applications where sensitive information might be cached in the browser. When a user logs out and then hits the back button, the browser often retrieves the cached content, which can lead to unauthorized access to sensitive data. In ASP.NET, you can implement several strategies to mit...
5,891
[ { "from": "human", "value": "I have some website which requires a logon and shows sensitive information.\nThe person goes to the page, is prompted to log in, then gets to see the information.\nThe person logs out of the site, and is redirected back to the login page.\nThe person then can hit \"back\" and go...
I receive HTML pages from our creative team, and then use those to build aspx pages. One challenge I frequently face is getting the HTML I spit out to match theirs exactly. I almost always end up screwing up the nesting of <div>s between my page and the master pages. Does anyone know of a tool that will help in this s...
To tackle the issue of comparing HTML structures and identifying nesting differences, you might want to consider using specialized HTML comparison tools or libraries. Here are some suggestions that can help you achieve your goal: 1. **HTML Tidy**: While not specifically a comparison tool, HTML Tidy can help clean up a...
7,012
[ { "from": "human", "value": "I receive HTML pages from our creative team, and then use those to build aspx pages. One challenge I frequently face is getting the HTML I spit out to match theirs exactly. I almost always end up screwing up the nesting of <div>s between my page and the master pages.\nDoes anyo...
Anyone has ever programmed a PHP (or Perl) function to get the ceiling value Excel style?
Yes, you can create a PHP or Perl function to mimic Excel's CEILING function, which rounds a number up to the nearest multiple of a specified significance. Here's how you can do it in both languages: ### PHP Function In PHP, you can create a function like this: ```php function excelCeiling($number, $significance) { ...
7,841
[ { "from": "human", "value": "Anyone has ever programmed a PHP (or Perl) function to get the ceiling value Excel style?\n" }, { "from": "gpt", "value": "Yes, you can create a PHP or Perl function to mimic Excel's CEILING function, which rounds a number up to the nearest multiple of a specified si...
I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. I know this is a classic limitation (feature?) of HTTP's request/response protocol, but...
Yes, it is possible to create a Firefox extension (previously known as a plugin) that can establish a socket connection to a server and manipulate the DOM of the webpage. Firefox extensions use the WebExtensions API, which allows developers to create extensions with access to the browser's capabilities. While traditio...
6,514
[ { "from": "human", "value": "I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. \nI know this is a classic limitation (feature?...
I have recently run across these terms few times but I am quite confused how they work and when they are usualy implemented?
It looks like you might be referring to specific terms or concepts, but you didn't specify which ones you are confused about. Could you please clarify the terms you're interested in? This way, I can provide a more detailed and accurate explanation for you.
11,693
[ { "from": "human", "value": "I have recently run across these terms few times but I am quite confused how they work and when they are usualy implemented?\n" }, { "from": "gpt", "value": "It looks like you might be referring to specific terms or concepts, but you didn't specify which ones you are...
In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to "fade in". And then, once all the processes finish, I would like it to appear as though the s...
To implement a "fade in" and "fade out" effect on a splash screen in a C# Windows Forms application targeting .NET 2.0, you can use a timer to gradually adjust the opacity of the splash screen. Unfortunately, .NET 2.0 does not support opacity directly, so we need a workaround to achieve the fade effect using a techniqu...
3,982
[ { "from": "human", "value": "In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to \"fade in\". And then, once all the processes finish...
Recently, I read an article entitled "SATA vs. SCSI reliability". It mostly discusses the very high rate bit flipping in consumer SATA drives and concludes "A 56% chance that you can't read all the data from a particular disk now". Even Raid-5 can't save us as it must be constantly scanned for problems and if a disk do...
You've raised several important points regarding data integrity, reliability, and recovery mechanisms for storage systems, especially concerning the vulnerabilities of consumer-grade SATA drives. Let's break down the different aspects you've mentioned: ### 1. **Bit Flipping and Data Integrity** The article you mention...
4,626
[ { "from": "human", "value": "Recently, I read an article entitled \"SATA vs. SCSI reliability\". It mostly discusses the very high rate bit flipping in consumer SATA drives and concludes \"A 56% chance that you can't read all the data from a particular disk now\". Even Raid-5 can't save us as it must be con...
public static IList<T> LoadObjectListAll<T>() { ISession session = CheckForExistingSession(); var cfg = new NHibernate.Cfg.Configuration().Configure(); var returnList = session.CreateCriteria(typeof(T)); var list = returnList.List(); var castList = list.Cast<typeof(T)>(); return castList; } So,...
Yes, there are a couple of issues in your code that can lead to compile-time errors: 1. **Incorrect Usage of `typeof(T)`**: In the line `var castList = list.Cast<typeof(T)>();`, `typeof(T)` returns a `Type` object, but the `Cast` method expects a type argument. You should simply use `T` (the generic type) instead of `...
8,769
[ { "from": "human", "value": "public static IList<T> LoadObjectListAll<T>()\n{\n ISession session = CheckForExistingSession();\n var cfg = new NHibernate.Cfg.Configuration().Configure();\n var returnList = session.CreateCriteria(typeof(T));\n var list = returnList.List();\n var castList = list...
After hitting a few StackOverflowExceptions in .NET I noticed they completely bypass the unhandled exception handlers that .NET offers (Application.ThreadException / AppDomain.UnhandledException). This is very disturbing since we have critical cleanup code in those exception handlers. Is there any way to overcome this?...
You're correct that `StackOverflowException` in .NET is a special case. It represents a severe error that occurs when the execution stack of a thread grows beyond its allowed size. When a `StackOverflowException` occurs, the .NET runtime does not allow the normal exception handling mechanisms to function, which means y...
8,098
[ { "from": "human", "value": "After hitting a few StackOverflowExceptions in .NET I noticed they completely bypass the unhandled exception handlers that .NET offers (Application.ThreadException / AppDomain.UnhandledException).\nThis is very disturbing since we have critical cleanup code in those exception ha...
I'm running in a windows environment with Trac / SVN and I want commits to the repository to integrate to Trac and close the bugs that were noted in the SVN Comment. I know there's some post commit hooks to do that, but there's not much information about how to do it on windows. Anyone done it successfully? And what w...
Setting up a post-commit hook in SVN to integrate with Trac and automatically close bugs mentioned in SVN commit messages on a Windows environment can be done with a series of steps. Below are the detailed instructions: ### Prerequisites 1. **SVN Repository**: Ensure you have a working SVN repository. 2. **Trac**: Ma...
3,969
[ { "from": "human", "value": "I'm running in a windows environment with Trac / SVN and I want commits to the repository to integrate to Trac and close the bugs that were noted in the SVN Comment.\nI know there's some post commit hooks to do that, but there's not much information about how to do it on windows...
I need to build a simple, single user database application for Windows. Main requirements are independence from windows version and installed software. What technologies (language/framework) would you recommend? My preference for language is the Visual Basic. EDIT: What about VB.Net and SQL Server Compact Edition?
Given your requirements for a simple, single-user database application for Windows, and your preference for Visual Basic, using VB.NET along with SQL Server Compact Edition (SQL CE) is indeed a suitable choice. Here's why this combination could work well for you: ### Why VB.NET? 1. **Familiarity**: Since you have a p...
7,834
[ { "from": "human", "value": "I need to build a simple, single user database application for Windows. Main requirements are independence from windows version and installed software. What technologies (language/framework) would you recommend? My preference for language is the Visual Basic.\nEDIT: What about V...
I have a 'foreach' macro I use frequently in C++ that works for most STL containers: #define foreach(var, container) \ for(typeof((container).begin()) var = (container).begin(); \ var != (container).end(); \ ++var) (Note that 'typeof' is a gcc extension.) It is used like this: std::vector< Blorgus > blor...
Creating a macro to iterate over the values of a map while avoiding variable naming conflicts is indeed a challenge due to the limitations of macros in C++. However, you can achieve this with a little trickery involving additional helper macros. One approach is to define a unique identifier for the iterator using the ...
4,690
[ { "from": "human", "value": "I have a 'foreach' macro I use frequently in C++ that works for most STL containers:\n#define foreach(var, container) \\\n for(typeof((container).begin()) var = (container).begin(); \\\n var != (container).end(); \\\n ++var)\n\n(Note that 'typeof' is a gcc extension.)...
I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SVN. EDIT: You guys are fast.
To have TortoiseSVN ignore the `_Resharper.ProjectName` directories (or any other specific files/folders) when committing changes, you can follow these steps: 1. **Open your working copy in Windows Explorer.** 2. **Right-click on the folder or file** you want to ignore (in this case, the `_Resharper.ProjectName` dire...
6,983
[ { "from": "human", "value": "I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SV...
I am trying out FirePHP. I installed it and restarted Firefox, enabled Firebug for my localhost, moved the demo oo.php file that comes with the download into an IIS virtual directory, changed the include path, removed the apache_request_headers() call since I am running IIS, and the only output I see is Notice: Undefi...
It seems like you're encountering a few issues while trying to set up FirePHP with IIS. Let's go through a checklist and some troubleshooting steps to ensure everything is set up correctly. 1. **Output Buffering**: You've mentioned you added `ob_start()` at the top of your PHP file. Make sure you do this before any ot...
5,411
[ { "from": "human", "value": "I am trying out FirePHP.\nI installed it and restarted Firefox, enabled Firebug for my localhost, moved the demo oo.php file that comes with the download into an IIS virtual directory, changed the include path, removed the apache_request_headers() call since I am running IIS, an...
In evaluating different systems integration strategies, I've come across some words of encouragement, but also some words of frustration over BizTalk Server. What are some pros and cons to using BizTalk Server (both from a developer standpoint and a business user), and should companies also consider open source altern...
BizTalk Server has been a prominent solution for enterprise application integration, but it comes with both advantages and disadvantages. Here’s a breakdown of the pros and cons from both developer and business user perspectives. ### Pros of BizTalk Server #### For Developers: 1. **Integration Capabilities**: BizTalk...
3,076
[ { "from": "human", "value": "In evaluating different systems integration strategies, I've come across some words of encouragement, but also some words of frustration over BizTalk Server. \nWhat are some pros and cons to using BizTalk Server (both from a developer standpoint and a business user), and should ...
I've had a tough time setting up my replication server. Is there any program (OS X, Windows, Linux, or PHP no problem) that lets me monitor and resolve replication issues? (btw, for those following, I've been on this issue here, here, here and here) My production database is several megs in size and growing. Every time...
It sounds like you're dealing with a challenging database replication setup. Monitoring and managing replication issues can be critical, especially as your database grows. Here are some options to consider for monitoring and resolving replication issues in various environments: ### Monitoring Tools 1. **Percona Toolk...
4,772
[ { "from": "human", "value": "I've had a tough time setting up my replication server. Is there any program (OS X, Windows, Linux, or PHP no problem) that lets me monitor and resolve replication issues? (btw, for those following, I've been on this issue here, here, here and here)\nMy production database is se...
I have a form element that contains multiple lines of inputs. Think of each line as attributes of a new object that I want to create in my web application. And, I want to be able to create multiple new objects in one HTTP POST. I'm using Javascript's built-in cloneNode(true) method to clone each line. The problem is ...
When you clone a DOM element using `cloneNode(true)`, the events and event listeners attached to the original element are not copied over. This means that in your case, when you clone the input line, the `onclick` handler on the "Remove" link does not work as expected because it references the context of the original e...
7,122
[ { "from": "human", "value": "I have a form element that contains multiple lines of inputs. Think of each line as attributes of a new object that I want to create in my web application. And, I want to be able to create multiple new objects in one HTTP POST. I'm using Javascript's built-in cloneNode(true) me...
I'm interested in finding out how the recently-released Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented.
Comparing Hive and HBase involves understanding their architectures, use cases, and performance characteristics, as they serve different purposes within the Hadoop ecosystem. Here’s an overview of how they compare, particularly focusing on performance and usability: ### 1. **Architecture and Design** - **HBase**: -...
5,235
[ { "from": "human", "value": "I'm interested in finding out how the recently-released Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented.\n" }, { "from": "gpt", "value": "Comparing Hive and HBase involve...
What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? does a higher level of optimization necessarily (i.e. provably) generate a faster program?
GCC (GNU Compiler Collection) offers several optimization levels, each designed to enhance performance in different ways. Here's a breakdown of the common optimization levels: - **`-O0`**: No optimization. The compiler performs no optimizations, focusing instead on producing code that closely corresponds to the source...
6,182
[ { "from": "human", "value": "What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? does a higher level of optimization necessarily (i.e. provably) generate a faster prog...
I want a list of hyperlinks on a basic html page, which point to files on our corporate intranet. When a user clicks the link, I want the file to open. They are excel spreadsheets, and this is an intranet environment, so I can count on everyone having Excel installed. I've tried two things: The obvious and simple thin...
When working with hyperlinks to open files on an intranet, especially Excel files, the approach can vary based on the browser and operating system. Below are a few solutions to try that should work in both Internet Explorer and Firefox: ### 1. Simple Hyperlink Approach If the Excel files are accessible over a network...
6,911
[ { "from": "human", "value": "I want a list of hyperlinks on a basic html page, which point to files on our corporate intranet.\nWhen a user clicks the link, I want the file to open.\nThey are excel spreadsheets, and this is an intranet environment, so I can count on everyone having Excel installed.\nI've tr...
I need to update a combobox with a new value so it changes the reflected text in it. The cleanest way to do this is after the comboboxhas been initialised and with a message. So I am trying to craft a postmessage to the hwnd that contains the combobox. So if I want to send a message to it, changing the currently select...
To update the selected item in a ComboBox in a Windows application, you typically need to send a message to the ComboBox window handle (HWND) to change its selection. The `ON_CBN_SELCHANGE` message you mentioned is an event notification that is sent to the parent window when the selection changes, but it is not used fo...
7,641
[ { "from": "human", "value": "I need to update a combobox with a new value so it changes the reflected text in it. The cleanest way to do this is after the comboboxhas been initialised and with a message.\nSo I am trying to craft a postmessage to the hwnd that contains the combobox.\nSo if I want to send a m...
Visual Studio solutions contain two types of hidden user files. One is the solution .suo file which is a binary file. The other is the project .user file which is a text file. Exactly what data do these files contain? I've also been wondering whether I should add these files to source control (Subversion in my case). I...
In Visual Studio, the hidden user files you're referring to serve different purposes and contain different types of data: ### 1. **Solution User Options File (.suo)** - **Type**: Binary file - **Contents**: The .suo file contains user-specific settings and preferences for the solution, such as the state of the Soluti...
6,481
[ { "from": "human", "value": "Visual Studio solutions contain two types of hidden user files. One is the solution .suo file which is a binary file. The other is the project .user file which is a text file. Exactly what data do these files contain?\nI've also been wondering whether I should add these files to...
What do you find is the optimal setting for mysql slow query log parameter, and why?
The optimal setting for the MySQL slow query log parameter largely depends on the specific workload, performance goals, and infrastructure of your database environment. Here are some key considerations when configuring the slow query log: ### 1. **Enable the Slow Query Log** - **Setting**: `slow_query_log=ON` - ...
7,798
[ { "from": "human", "value": "What do you find is the optimal setting for mysql slow query log parameter, and why?\n" }, { "from": "gpt", "value": "The optimal setting for the MySQL slow query log parameter largely depends on the specific workload, performance goals, and infrastructure of your da...
What is the best way to copy a directory (with sub-dirs and files) from one remote Linux server to another remote Linux server? I have connected to both using SSH client (like Putty). I have root access to both.
To copy a directory (along with its subdirectories and files) from one remote Linux server to another, you can use the `rsync` command or `scp` command over SSH. However, `rsync` is often preferred due to its efficiency, especially for larger datasets or when the directory may already exist on the destination server. ...
6,927
[ { "from": "human", "value": "What is the best way to copy a directory (with sub-dirs and files) from one remote Linux server to another remote Linux server? I have connected to both using SSH client (like Putty). I have root access to both. \n" }, { "from": "gpt", "value": "To copy a directory (...
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an XPathContext but is this enough? Example: Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <xsl:value-of select="ourFunction()" /> </xsl:templat...
To access the entire XML tree from within a custom XPath function in Saxon, you'll need to utilize the `XPathContext` parameter available in your custom function implementation. The `XPathContext` provides methods to access the current node and navigate through the XML tree. Here's a basic approach to achieving this: ...
7,074
[ { "from": "human", "value": "Is there a way to get the current xml data when we make our own custom XPath function (see here).\nI know you have access to an XPathContext but is this enough?\nExample:\nOur XML:\n<foo>\n <bar>smang</bar>\n <fizz>buzz</fizz>\n</foo>\n\nOur XSL:\n<xsl:template match=\"/\">\n ...
I am using a perl script to POST to Google Appengine application. I post a text file containing some XML using the -F option. http://www.cpan.org/authors/id/E/EL/ELIJAH/bget-1.1 There is a version 1.2, already tested and get the same issue. The post looks something like this. Host: foo.appspot.com User-Agent: lwp-reque...
It sounds like you're experiencing an issue with the way your Perl script is handling the POST request to your Google App Engine application, specifically with the `Content-Length` header and the truncation of the XML content being sent. Here's a checklist of things you can consider and try to resolve the issue: 1. ...
3,992
[ { "from": "human", "value": "I am using a perl script to POST to Google Appengine application. I post a text file containing some XML using the -F option.\nhttp://www.cpan.org/authors/id/E/EL/ELIJAH/bget-1.1\nThere is a version 1.2, already tested and get the same issue. The post looks something like this.\...
I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed VS 2008 Express with .NET 3.5. So obviously IIS is configured for ASP.NET automatically for .NET 3.5 The problem is whenever I access http://localhost IE & Firefox both presents authentication box. Even if I enter Administrator user and its passwo...
It sounds like you're encountering an issue with authentication in IIS 5.1 on Windows XP. Here are several troubleshooting steps you can take to resolve the problem: 1. **Check Authentication Settings**: - Open the IIS Manager. - Right-click on the website (Default Web Site) and select **Properties**. - Go to...
6,782
[ { "from": "human", "value": "I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed VS 2008 Express with .NET 3.5. So obviously IIS is configured for ASP.NET automatically for .NET 3.5\nThe problem is whenever I access http://localhost IE & Firefox both presents authentication box. Even if...
I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settings....
When building cross-platform applications, it's important to follow best practices for storing user-specific data, such as settings and preferences, to ensure a smooth experience for users across different operating systems. Here's a breakdown of the recommended paths for Windows, macOS, and Linux: ### Windows On Wind...
6,201
[ { "from": "human", "value": "I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc.\nApplication's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Bes...
I'm building a quick csv from a mysql table with a query like: select DATE(date),count(date) from table group by DATE(date) order by date asc; and just dumping them to a file in perl over a: while(my($date,$sum) = $sth->fetchrow) { print CSV "$date,$sum\n" } There are date gaps in the data, though: | 2008-08-05 |...
It sounds like you're trying to fill in the gaps in your date data by generating zero-count entries for missing dates, which is a common requirement in reporting and data analysis. Since you've already implemented a stored procedure that generates a temporary table for the date range you're interested in, I'll provide...
7,331
[ { "from": "human", "value": "I'm building a quick csv from a mysql table with a query like:\nselect DATE(date),count(date) from table group by DATE(date) order by date asc;\n\nand just dumping them to a file in perl over a:\nwhile(my($date,$sum) = $sth->fetchrow) {\n print CSV \"$date,$sum\\n\"\n}\n\nThe...
Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it doesn't load absolutely everything...
RSpec performance issues can indeed slow down your test suite, especially in larger Rails applications. Here are some reasons why RSpec might be slow and potential strategies to speed it up: ### Reasons for Slow Performance 1. **Rails Boot Time**: Rails has to load a lot of components when initializing, which can cau...
7,302
[ { "from": "human", "value": "Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only)...
I am writing a Java utility that helps me to generate loads of data for performance testing. It would be really cool to be able to specify a regex for Strings so that my generator spits out things that match this. Is something out there already baked that I can use to do this? Or is there a library that gets me most o...
Yes, there are libraries in Java that can help you generate data that matches specified regular expressions, and some can even generate large volumes of test data for performance testing. Here are a few options you can consider: 1. **Java Faker**: - While Java Faker primarily generates fake data for testing (like ...
4,644
[ { "from": "human", "value": "I am writing a Java utility that helps me to generate loads of data for performance testing. It would be really cool to be able to specify a regex for Strings so that my generator spits out things that match this.\nIs something out there already baked that I can use to do this? ...
I'd like to experiment with burn-down and planning game with the team I'm on. People on my team are interested in making it happen, however I'm sure someone has done this before and has learned some lessons we hopefully don't have to repeat. Does anyone know of an example Excel (or other tool) template available for ...
It's great to hear that you and your team are interested in experimenting with burn-down charts and planning games! Both of these practices can help improve project visibility and team collaboration. Here are some resources and templates you can use, along with lessons learned from others who have implemented these act...
6,369
[ { "from": "human", "value": "I'd like to experiment with burn-down and planning game with the team I'm on. People on my team are interested in making it happen, however I'm sure someone has done this before and has learned some lessons we hopefully don't have to repeat. Does anyone know of an example Exce...
As a part of database maintenance we are thinking of taking daily backups onto an external/firewire drives. Are there any specific recommended drives for the frequent read/write operations from sql server 2000 to take backups?
When selecting external drives for frequent read/write operations, especially for backups from SQL Server 2000, you should consider a few factors to ensure optimal performance, reliability, and longevity. Here are some recommended features and types of drives: ### Recommended Features: 1. **Speed**: Look for drives wi...
7,779
[ { "from": "human", "value": "As a part of database maintenance we are thinking of taking daily backups onto an external/firewire drives. Are there any specific recommended drives for the frequent read/write operations from sql server 2000 to take backups?\n" }, { "from": "gpt", "value": "When se...
I'm not a usability specialist, and I really don't care to be one. I just want a small set of rules of thumb that I can follow while coding my user interfaces so that my product has decent usability. At first I thought that this question would be easy to answer "Use your common sense", but if it's so common among us de...
Absolutely! Here’s a concise list of usability principles that you can follow to improve the user experience of your interfaces without diving deep into usability research: ### 1. **Consistency** - Use the same terminology, colors, and styles throughout the interface. This helps users know what to expect and reduce...
7,415
[ { "from": "human", "value": "I'm not a usability specialist, and I really don't care to be one.\nI just want a small set of rules of thumb that I can follow while coding my user interfaces so that my product has decent usability.\nAt first I thought that this question would be easy to answer \"Use your comm...
How do you randomly select a table row in T-SQL based on an applied weight for all candidate rows? For example, I have a set of rows in a table weighted at 50, 25, and 25 (which adds up to 100 but does not need to), and I want to select one of them randomly with a statistical outcome equivalent to the respective weight...
To randomly select a row from a table based on weights using T-SQL, you can follow these steps: 1. Create a cumulative distribution based on the weights. 2. Generate a random number. 3. Select the row whose cumulative weight interval contains the random number. Here's how you can implement this: ### Step 1: Setup Yo...
5,518
[ { "from": "human", "value": "How do you randomly select a table row in T-SQL based on an applied weight for all candidate rows?\nFor example, I have a set of rows in a table weighted at 50, 25, and 25 (which adds up to 100 but does not need to), and I want to select one of them randomly with a statistical o...
All the docs for SQLAlchemy give INSERT and UPDATE examples using the local table instance (e.g. tablename.update()... ) Doing this seems difficult with the declarative syntax, I need to reference Base.metadata.tables["tablename"] to get the table reference. Am I supposed to do this another way? Is there a different ...
When using SQLAlchemy's declarative syntax, you typically interact with your model classes rather than directly with table objects. This is one of the key benefits of the declarative syntax—it allows you to work with objects representing your data rather than dealing directly with the underlying table structure. Here'...
7,398
[ { "from": "human", "value": "All the docs for SQLAlchemy give INSERT and UPDATE examples using the local table instance (e.g. tablename.update()... )\nDoing this seems difficult with the declarative syntax, I need to reference Base.metadata.tables[\"tablename\"] to get the table reference.\nAm I supposed to...
I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that). How do I eliminate flicker when I have to fully redraw?
To eliminate flicker when redrawing your custom control in C#, there are several techniques you can use in addition to double buffering. Flickering often occurs when the control is drawn in several steps, resulting in the display of incomplete frames. Below are methods you can implement to reduce or eliminate flicker: ...
6,359
[ { "from": "human", "value": "I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that).\nHow do I eliminate flicker when I have to fully redraw?\n" }, { "from": "gpt", "val...
Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that exactly rather than a "5" after the end of input.
Yes, Java provides a way to escape arbitrary text so that it can be safely included in a regular expression. You can use the `Pattern.quote(String s)` method from the `java.util.regex.Pattern` class. This method takes a string and returns a literal pattern for that string, meaning any special characters within it are e...
9,560
[ { "from": "human", "value": "Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter \"$5\", I'd like to match that exactly rather than a \"5\" after the end of input.\n" }, { "from": "gpt", "value": "Yes, Java pro...
Can anyone recommend a good library for generating an audio file, such as mp3, wav, or even midi, from python? I've seen recommendations for working with the id tags (song name, artist, etc) in mp3 files, but this is not my goal.
Certainly! There are several libraries in Python that you can use to generate audio files like MP3, WAV, or MIDI. Here are some recommendations: ### For WAV or MP3: 1. **pydub** - **Installation**: `pip install pydub` - **Description**: Pydub is great for simple audio manipulation and can generate and export au...
1,873
[ { "from": "human", "value": "Can anyone recommend a good library for generating an audio file, such as mp3, wav, or even midi, from python?\nI've seen recommendations for working with the id tags (song name, artist, etc) in mp3 files, but this is not my goal.\n" }, { "from": "gpt", "value": "Cer...
I am setting up a rails app and I just finished making some unit tests and my friend said that apparently fixtures are no longer cool and people are now using RSpec or shoulda. I was wondering what the actual benefits are to use these other toolkits. Any information at all is appreciated. -fREW
Hi Frew! It's great that you’re diving into testing in your Rails app! Let’s break down the options you mentioned: fixtures, RSpec, and Shoulda, and explore their benefits. ### Fixtures Fixtures are a way to set up a predefined state for your database. They are a set of sample data stored in YAML files that can be loa...
8,159
[ { "from": "human", "value": "I am setting up a rails app and I just finished making some unit tests and my friend said that apparently fixtures are no longer cool and people are now using RSpec or shoulda. I was wondering what the actual benefits are to use these other toolkits. Any information at all is ...
http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx This post shows how to test setting a cookie and then seeing it in ViewData. What I what to do is see if the correct cookies were written (values and name). Any reply, blog post or article will be greatly appreciated...
To test whether the correct cookies were written in an ASP.NET MVC application, you can use a unit testing framework alongside a mocking library. This allows you to simulate the behavior of the `HttpContext` and check for cookie values without needing to actually run a web server. Here's a basic example of how you cou...
6,444
[ { "from": "human", "value": "http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx\nThis post shows how to test setting a cookie and then seeing it in ViewData. What I what to do is see if the correct cookies were written (values and name). Any reply, blog p...
I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn't have /* .. */ comments, and also has its own self-documentation facility which seems to be the pythonic way to document. Since I'm familiar with Doxygen, how can I use it to produce my P...
Doxygen can indeed be used to generate documentation for Python projects, even though Python has its own conventions for documentation. Here are some guidelines and tips to help you effectively use Doxygen for documenting your Python code: ### 1. Enable Doxygen for Python To start using Doxygen for your Python project...
6,088
[ { "from": "human", "value": "I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn't have /* .. */ comments, and also has its own self-documentation facility which seems to be the pythonic way to document.\nSince I'm familiar with...
I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this done in C#?
In C#, you can compare two `DateTime` objects using the comparison operators. To ensure that `StartDate` is before `EndDate`, you can use the `<` operator. Here is a simple example demonstrating how to perform this check: ```csharp using System; class Program { static void Main() { DateTime StartDate ...
9,139
[ { "from": "human", "value": "I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this done in C#?\n" }, { "from": "gpt", "value": "In C#, you can compare two `DateTime` objects using the comparison operators. To ensure that `StartDate` is b...
I get an XML file From a web service. Now I want to get one of those elements out of the file. I think I should go use XPath - any good starter reference?
XPath (XML Path Language) is a powerful tool for querying and navigating XML documents. Here are some good starter references and resources to help you get started with XPath: ### Online Tutorials and References: 1. **W3Schools XPath Tutorial**: - [W3Schools XPath](https://www.w3schools.com/xml/xpath_intro.asp) ...
7,290
[ { "from": "human", "value": "I get an XML file From a web service. Now I want to get one of those elements out of the file.\nI think I should go use XPath - any good starter reference?\n" }, { "from": "gpt", "value": "XPath (XML Path Language) is a powerful tool for querying and navigating XML d...
How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.
To get the history of commits made by a particular user in a CVS (Concurrent Versions System) repository, you can utilize the command line or TortoiseCVS. Below are methods for both approaches: ### Using Command Line 1. **Change to the Directory**: Navigate to the directory of your CVS repository. ```bash c...
6,724
[ { "from": "human", "value": "How do I get the history of commits that have been made to the repository for a particular user? \nI am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.\n" }, { "from": "gpt", "value": "To get the hi...
When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent(): Use escape: escape("% +&="); OR use encodeURI() / encodeURIComponent() encodeURI("http://www.google.com?var1=value1&var2=value2"); encodeURIComponent("var1=value1&var2=value2"); ...
When encoding a query string for use in a web server request, you should primarily use `encodeURI()` and `encodeURIComponent()` rather than `escape()`. The `escape()` function is outdated and not recommended for encoding URI components, as it does not handle all characters correctly according to the URI specification. ...
7,960
[ { "from": "human", "value": "When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent():\nUse escape:\nescape(\"% +&=\");\n\nOR\nuse encodeURI() / encodeURIComponent()\nencodeURI(\"http://www.google.com?var1=value1&var2=value2\"...
No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can't tell if my install is messed up or what is going on. IDLE 1.2.2 ==== No Subprocess ==== >>> import unittest >>> >>> class Test(unittest.TestCase): def testA(self): a = 1 self.assertEqual(...
The issue you're encountering is due to how `unittest.main()` behaves when it runs in an interactive environment like IDLE. By default, `unittest.main()` expects to parse command-line arguments, but when you run it inside an interactive interpreter, such as IDLE, it tries to read the arguments that are not available in...
9,207
[ { "from": "human", "value": "No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can't tell if my install is messed up or what is going on.\nIDLE 1.2.2 ==== No Subprocess ====\n>>> import unittest\n>>> \n>>> class Test(unittest.TestCase):\n def testA(self):\n...
How do I setup an Ant task to generate Emma code coverage reports?
To set up an Ant task for generating Emma code coverage reports, you will need to follow a few steps, including integrating the Emma tool with your Ant build script. Below is a step-by-step guide to help you set this up. ### Prerequisites: 1. **Apache Ant**: Make sure you have Apache Ant installed. 2. **Emma JAR**: Do...
5,443
[ { "from": "human", "value": "How do I setup an Ant task to generate Emma code coverage reports?\n" }, { "from": "gpt", "value": "To set up an Ant task for generating Emma code coverage reports, you will need to follow a few steps, including integrating the Emma tool with your Ant build script. B...
I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such. Is there some tool/technique I can use to help me out in this?
Identifying performance bottlenecks in a large Java application can be challenging, but there are several tools and techniques you can use to help pinpoint the issues more effectively. Here's a structured approach to tackle the performance problems: ### 1. Profiling Tools Use profiling tools to analyze the applicatio...
4,424
[ { "from": "human", "value": "I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such.\nIs there some tool/technique I can use to help me out in this?\n...
Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month? If the standard library doesn't support that, does the dateutil package support this?
Python's standard library does not provide a single function call to get the last day of a given month directly, but you can achieve this with the `calendar` module by using `monthrange`. Here’s how you can do it: ```python import calendar def last_day_of_month(year, month): return calendar.monthrange(year, month...
7,184
[ { "from": "human", "value": "Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month?\nIf the standard library doesn't support that, does the dateutil package support this?\n" }, { "from": "gpt", "value": "Python's standard librar...
What are the implications of running a Microsoft Access Database in both 2003 and 2007? Is there some class I forgot to take? The program was originally built in office 2003, and then run in 2007. Issues seem to happen when the machine it is being run on has both 2003 and 2007 on it. The issue would also appear to ste...
Running a Microsoft Access database that was originally built in Access 2003 in Access 2007 (or vice versa) on a machine that has both versions installed can lead to a variety of compatibility issues. Here are several implications and potential solutions to consider: ### 1. **References to Object Libraries:** - Whe...
6,561
[ { "from": "human", "value": "What are the implications of running a Microsoft Access Database in both 2003 and 2007? \nIs there some class I forgot to take?\nThe program was originally built in office 2003, and then run in 2007. Issues seem to happen when the machine it is being run on has both 2003 and 200...
Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able to ...
Guaranteeing that a file will be stored in contiguous sectors on an NTFS file system in Windows is quite challenging. NTFS does not provide direct control over the physical layout of files on disk, as it is designed to optimize storage use and performance. However, there are several approaches you could consider to enc...
7,382
[ { "from": "human", "value": "Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on...
How often should I commit changes to source control ? After every small feature, or only for large features ? I'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature implemented and bug fixed. I even commit after I've added a new ch...
Committing changes to source control is an essential part of software development, and it's great that you're being proactive about it. Here are some best practices to consider when determining how often to commit your changes: 1. **Granularity**: Committing after each small, logical change (like implementing a sub-fe...
7,458
[ { "from": "human", "value": "How often should I commit changes to source control ? After every small feature, or only for large features ?\nI'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature implemented and bug fixe...
I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. Example: Project = Tully.Saps.Data Folder = DataAccess/Interfaces Namespace = Tully.Saps.Data.DataAccess.Interfaces Folder = DataAccess/MbNetRepositories Namespace = Tully.Saps.Data.DataAccess.MbNetRepos...
When dealing with namespaces in an ASP.NET MVC project (or any C# project), it's important to find a balance between readability and maintainability. Here are a few considerations regarding your situation: ### Current Namespace Structure 1. **Long Namespaces**: As you've observed, the current folder structure is resu...
6,964
[ { "from": "human", "value": "I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. \nExample: \nProject = Tully.Saps.Data \nFolder = DataAccess/Interfaces \nNamespace = Tully.Saps.Data.DataAccess.Interfaces\n\nFolder = DataAccess/MbNetRepositories \nN...
A friend and I were discussing C++ templates. He asked me what this should do: #include <iostream> template <bool> struct A { A(bool) { std::cout << "bool\n"; } A(void*) { std::cout << "void*\n"; } }; int main() { A<true> *d = 0; const int b = 2; const int c = 1; new A< b > (c) > (d); } The l...
In the provided C++ code, the line: ```cpp new A< b > (c) > (d); ``` has two potential interpretations, but C++ has rules to resolve such ambiguities based on the language syntax and the context of the operations involved. Let's break down the two possible interpretations you mentioned: 1. **Interpretation 1 (treat...
3,602
[ { "from": "human", "value": "A friend and I were discussing C++ templates. He asked me what this should do:\n#include <iostream>\n\ntemplate <bool>\nstruct A {\n A(bool) { std::cout << \"bool\\n\"; }\n A(void*) { std::cout << \"void*\\n\"; }\n};\n\nint main() {\n A<true> *d = 0;\n const int b = ...
Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach. For example, I have a page that displays a user. This page is very ...
Yes, using an object-oriented approach to structure your Django views can be a great way to manage complexity and reuse functionality across similar views. This is particularly useful when you have multiple views that share similar behavior but have different requirements or data models. Let's explore how you can imple...
2,978
[ { "from": "human", "value": "Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.\nFor example, I have a pag...
Help! I am using jQuery to make an AJAX call to fill in a drop-down dynamically given the user's previous input (from another drop-down, that is filled server-side). In all other browsers aside from Firefox (IE6/7, Opera, Safari), my append call actually appends the information below my existing option - "Select An ". ...
It sounds like you're encountering a common issue with how Firefox handles the selection of options in a `<select>` element when the options are dynamically updated. When you update the `<select>` options, Firefox often automatically selects the last item in the list, which is not the behavior you want. To ensure that...
7,575
[ { "from": "human", "value": "Help! I am using jQuery to make an AJAX call to fill in a drop-down dynamically given the user's previous input (from another drop-down, that is filled server-side). In all other browsers aside from Firefox (IE6/7, Opera, Safari), my append call actually appends the information ...
I have a class: class MyClass: def __init__(self, foo): if foo != 1: raise Error("foo is not equal to 1!") and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error: def testInsufficientArgs(self): foo = 0 self.assertRaises((Error), myClass =...
The `NameError: global name 'Error' is not defined` message you're encountering is because Python does not have a built-in exception class named `Error`. You likely intended to raise a more specific error type, such as `ValueError`, `TypeError`, or perhaps define a custom exception. Here’s how you can fix your code: ...
7,227
[ { "from": "human", "value": "I have a class:\nclass MyClass:\ndef __init__(self, foo):\n if foo != 1:\n raise Error(\"foo is not equal to 1!\")\n\nand a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error:\ndef testInsufficientArgs(self):\n ...
Is it possible to query the Crystal CMS database and get meaningful data back? The data appears to be encrypted. I am running Business Objects Crystal Report Server version 11.5
When dealing with Crystal Reports and the associated database, the approach to querying data largely depends on how the data is stored and the permissions you have. Here are some points to consider regarding querying the Crystal CMS (Central Management Server) database: 1. **Encryption**: If the data within the CMS da...
6,721
[ { "from": "human", "value": "Is it possible to query the Crystal CMS database and get meaningful data back? The data appears to be encrypted.\nI am running Business Objects Crystal Report Server version 11.5\n" }, { "from": "gpt", "value": "When dealing with Crystal Reports and the associated d...
I'm looking for the total commit charge.
The term "commit charge" typically refers to the amount of memory that a system has committed to using for processes and applications. In Windows operating systems, the commit charge indicates how much virtual memory has been allocated and is currently in use. This is important for understanding memory usage and perfor...
9,123
[ { "from": "human", "value": "I'm looking for the total commit charge.\n" }, { "from": "gpt", "value": "The term \"commit charge\" typically refers to the amount of memory that a system has committed to using for processes and applications. In Windows operating systems, the commit charge indicate...
I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice, and works great, but let's face it SDL_Mixer is a b...
It sounds like you're at a crucial juncture in your project where choosing the right audio API is essential for your game's development. Here are some options, considerations, and resources that might help you make a decision: ### 1. **OpenAL** OpenAL is a solid choice for 3D audio, especially for cross-platform devel...
6,529
[ { "from": "human", "value": "I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice, and works ...
Does anyone know a method to programmatically close the CD tray on Windows 2000 or higher? Open CD tray exists, but I can't seem to make it close especially under W2k. I am especially looking for a method to do this from a batch file, if possible, but API calls would be OK.
To programmatically close the CD tray in Windows, you can use a few different approaches. Unfortunately, there isn’t a direct command in batch files to close the CD tray, but you can achieve this using a combination of scripting and API calls. Below are two methods: one using a VBScript and another using a C++ applicat...
6,421
[ { "from": "human", "value": "Does anyone know a method to programmatically close the CD tray on Windows 2000 or higher?\nOpen CD tray exists, but I can't seem to make it close especially under W2k. \nI am especially looking for a method to do this from a batch file, if possible, but API calls would be OK.\n...
I bought an ASP.NET script about a year ago to retrieve FedEx shipping values. It builds an XML string that passes to the FedEx server using an HttpWebRequest, then parses the raw XML. The average response time for the script is about 900 milliseconds. So the other day I was poking around in the FedEx developer c...
Certainly! Let's break down the situation you're experiencing with the FedEx API and the differences in response times between the two methods you're using. ### 1. **Difference in Speed:** - **Direct XML Construction vs. WSDL (SOAP):** - Your original ASP.NET script is constructing an XML request manually and using...
7,309
[ { "from": "human", "value": "I bought an ASP.NET script about a year ago to retrieve FedEx shipping values. It builds an XML string that passes to the FedEx server using an HttpWebRequest, then parses the raw XML. The average response time for the script is about 900 milliseconds. \nSo the other day I ...
What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts? (Please, just one feature per answer.) Similar threads: Hidden Features of JavaScript Hidden Features of Java Hidden Features of C++ Hidden Features of C#
One lesser-known but useful feature in Greasemonkey scripts is **Mutation Observers**. ### Mutation Observers Mutation Observers provide a way to react to changes in the DOM. Unlike older methods, such as using `setInterval` to check for changes, Mutation Observers allow you to set up a callback function that runs au...
9,583
[ { "from": "human", "value": "What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts?\n(Please, just one feature per answer.)\nSimilar threads:\n\nHidden Features of JavaScript\nHidden Features of Java\nHidden Features of C++\nHidden Features ...
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated.
It sounds like you're looking for an Objective-J syntax highlighting file or plugin for jEdit. While I don’t have one readily available, I can guide you on how to create one or where you might find existing ones. 1. **Creating a Syntax Highlighting File**: - jEdit uses XML files for syntax highlighting. You can cr...
9,085
[ { "from": "human", "value": "I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated.\n" }, { "from": "gpt", ...
I am using .NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a Windows service Here is the code from the Windows Service: using System; using System.Collections....
The issue you're encountering with your .NET Remoting Windows Service could be related to several factors, including how the service handles requests, potential resource limitations, or issues in the way the remoting objects are configured. Here are some potential areas to investigate and recommendations to help troub...
4,651
[ { "from": "human", "value": "I am using .NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a Windows service Here is the code from the Windows Service...
What free and commercial garbage collection libraries are available for C++, and what are the pros and cons of each? I am interested in hard-won lessons from actual use in the field, not marketing or promotional blurb. There is no need to elaborate on the usual trade offs associated with automatic garbage collection, b...
Garbage collection (GC) in C++ is less common than in languages like Java or C#, primarily due to C++'s manual memory management model. However, there are several libraries available for both free and commercial use that provide garbage collection features. Here’s a summary of some notable options, their underlying alg...
5,420
[ { "from": "human", "value": "What free and commercial garbage collection libraries are available for C++, and what are the pros and cons of each?\nI am interested in hard-won lessons from actual use in the field, not marketing or promotional blurb.\nThere is no need to elaborate on the usual trade offs asso...
I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property back...
The issue you're encountering with the ToolStrip's `Visible` property being set to `False` in the Windows Forms designer can be quite frustrating. Here are several potential causes and solutions to help you resolve the problem: ### 1. **Designer Logic:** Sometimes, the designer makes changes based on certain condition...
6,841
[ { "from": "human", "value": "I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually f...
I'm creating PDFs on-demand with ColdFusion's CFDocument tag, like so: <cfdocument format="PDF" filename="#attributes.fileName#" overwrite="true"> <cfdocumentitem type="footer"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left"><font face="Taho...
The issue you're encountering with the invisible footer text in your generated PDFs can be attributed to several factors related to the rendering of the PDF with ColdFusion's `CFDocument` tag. Here are some potential solutions and recommendations to troubleshoot and resolve the problem: ### 1. Use Correct Font Specifi...
5,482
[ { "from": "human", "value": "I'm creating PDFs on-demand with ColdFusion's CFDocument tag, like so:\n<cfdocument format=\"PDF\" filename=\"#attributes.fileName#\" overwrite=\"true\">\n <cfdocumentitem type=\"footer\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n ...
I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an agenda template, update the agenda with th...
Using a **Suspend activity** in a workflow to allow for a manual review step is a common approach and can be quite reasonable in many scenarios, especially if the review process does not require complex branching or a lot of context switching. However, there are advantages to considering a **state machine** workflow, e...
7,234
[ { "from": "human", "value": "I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an a...
If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B and C), but not if I search only on (B), or (C), or (B and C). Is this correct?
Yes, your understanding is correct. When you create an index on multiple columns, such as (A, B, C), it follows a specific order, and the database can effectively use that index under certain conditions based on how the columns are queried. 1. **When you search only on (A)**: The database can use the index because A i...
9,450
[ { "from": "human", "value": "If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B and C), but not if I search only on (B), or (C), or (B and C). Is this correct?\n" }, { "from": ...
I keep getting compiler errors when I try to access flashVars in an AS3 class. Here's a stripped version of the code: package myPackage { import flash.display.Loader; import flash.display.LoaderInfo; import flash.display.Sprite; public class myClass { public function CTrafficHandler() { var myVar:Strin...
The issue you're encountering relates to how you're trying to access the `loaderInfo` properties in ActionScript 3. Let's address both points you've raised. 1. **Compiler Error**: When you declare your class as `public class myClass`, it does not have access to `this.root` because the class does not extend a display o...
7,754
[ { "from": "human", "value": "I keep getting compiler errors when I try to access flashVars in an AS3 class.\nHere's a stripped version of the code:\npackage myPackage {\n import flash.display.Loader;\n import flash.display.LoaderInfo;\n import flash.display.Sprite;\n public class myClass {\n public func...
Is it possible in c# to initialize an array in, for example, subindex 1? I'm working with Office interop, and every property is an object array that starts in 1 (I assume it was originally programed in VB.NET), and you cannot modify it, you have to set the entire array for it to accept the changes. As a workaround I am...
In C#, arrays are zero-based by default, meaning that the first element is at index 0. However, you can create an array that uses a different lower bound (such as starting at 1) by utilizing the `Array.CreateInstance` method. This method allows you to specify the lower bounds and sizes for the dimensions of the array. ...
3,109
[ { "from": "human", "value": "Is it possible in c# to initialize an array in, for example, subindex 1?\nI'm working with Office interop, and every property is an object array that starts in 1 (I assume it was originally programed in VB.NET), and you cannot modify it, you have to set the entire array for it t...
If I add 3-400 databases to a single SQL Server instance will I encounter scaling issues introduced by the large number of databases?
Adding 3-400 databases to a single SQL Server instance can introduce several considerations and potential challenges, but whether you'll encounter scaling issues largely depends on various factors, including: ### 1. **Server Resources** - **Hardware Specifications**: The available CPU, RAM, and disk I/O capacity of...
6,380
[ { "from": "human", "value": "If I add 3-400 databases to a single SQL Server instance will I encounter scaling issues introduced by the large number of databases?\n" }, { "from": "gpt", "value": "Adding 3-400 databases to a single SQL Server instance can introduce several considerations and pote...
I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?
The preference for Quicksort over Mergesort, despite both having an average time complexity of \(O(n \log n)\), can be attributed to several factors: 1. **In-Place Sorting**: Quicksort is typically implemented as an in-place sorting algorithm, meaning it requires only a small, constant amount of additional memory spac...
8,388
[ { "from": "human", "value": "I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?\n" }, { "from": "gpt", "value": "The preference for Quicksort over Mergesort, despite both having an average time complexity of \...
Has anyone gotten VisualWorks running under OpenBSD? It's not an officially supported platform, but one of the Cincom guys was telling me that it should be able to run under a linux compatibility mode. How did you set it up? I already have Squeak running without a problem, so I'm not looking for an alternative. I speci...
Running VisualWorks under OpenBSD can be a bit tricky since it's not officially supported. However, as you mentioned, you can use the Linux compatibility mode in OpenBSD to potentially run VisualWorks. Here’s a general guide on how you might set this up: ### Step 1: Install Linux Compatibility Layer First, you need t...
6,785
[ { "from": "human", "value": "Has anyone gotten VisualWorks running under OpenBSD? It's not an officially supported platform, but one of the Cincom guys was telling me that it should be able to run under a linux compatibility mode. How did you set it up?\nI already have Squeak running without a problem, so I...
I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keyword. Token: 1, Line Number: 1 Delphi V7 - object pascal, standard Tquery obj...
When working with Paradox databases, it's essential to properly format your queries, especially when field names contain spaces or special characters. In SQL, when a field name includes spaces, you need to enclose the field name in quotes (single or double, depending on the SQL dialect). For Paradox, you typically use ...
9,956
[ { "from": "human", "value": "I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. \"Street 1\". When I try and formulate a query in delphi for only the \"Street 1\" field, I get an error - Invalid use of keyword. Token: 1, Line Number: 1\n...
What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?
Detecting and removing rootkits can be a complex process, as rootkits are designed to hide their presence and the activities of the malware they host. Here are steps you can take to detect and potentially remove a rootkit from your machine, focusing on free or affordable methods: ### Detection 1. **Use Rootkit Detect...
7,252
[ { "from": "human", "value": "What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?\n" }, { "from": "gpt", "value": "Detecting and removing rootkits can be a complex process, as rootkits are designed to hide their presence and the...
What are the best continuous integration frameworks/projects for Perl and why?
When it comes to continuous integration (CI) frameworks and projects that are compatible with Perl, several options are widely used in the community. Here are some of the best CI tools that Perl developers can use, along with reasons why they might be considered effective: 1. **Jenkins**: - **Why**: Jenkins is a hi...
7,810
[ { "from": "human", "value": "What are the best continuous integration frameworks/projects for Perl and why?\n" }, { "from": "gpt", "value": "When it comes to continuous integration (CI) frameworks and projects that are compatible with Perl, several options are widely used in the community. Here ...
I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording. Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing sound returns. Also, I have other projects I am working on where the ty...
Disabling the typing sound in Adobe Captivate 3 can sometimes be tricky, as it may not always respect the settings you've chosen during recording. Here are steps you can take to ensure that the typing sound is disabled, both for new projects and existing ones: ### Disabling Typing Sound in New Projects 1. **Start a Ne...
7,135
[ { "from": "human", "value": "I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording. Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing sound returns. Also, I have ot...
I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the following, but XMLSpy complains that "The content model contains the elements <element name="DateConstant"> ...
In XML Schema (XSD), achieving a structure where you want at least one child element but none should repeat (i.e., only one of each element) can be a bit tricky because you need to balance the requirements of both the minimum occurrence of elements and the uniqueness of their names. To define a sequence where you can ...
7,838
[ { "from": "human", "value": "I'm trying to set up part of a schema that's like a \"Sequence\" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them.\nI tried doing the following, but XMLSpy complains that \"The content model contain...
I'm trying to convert an application using the 1.1 version of the Enterprise Library Caching block over to the 2.0 version. I think where I'm really having a problem is that the configuration for the different EntLib pieces was split out over several files. Apparently, this used to be handled by the ConfigurationMana...
When migrating from Enterprise Library 1.1 to 2.0, the configuration approach indeed changed, and splitting the configuration across multiple files is a common requirement. In Enterprise Library 2.0, Microsoft introduced a new way of managing configuration that leverages the .NET configuration system more effectively. ...
5,709
[ { "from": "human", "value": "I'm trying to convert an application using the 1.1 version of the Enterprise Library Caching block over to the 2.0 version. I think where I'm really having a problem is that the configuration for the different EntLib pieces was split out over several files. Apparently, this us...
I've seen this done in Borland's Turbo C++ environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?
When transitioning from Borland's Turbo C++ to C#, there are several best practices and important considerations to keep in mind. Here are some key points to help you along the way: ### 1. **Understanding the Environment**: - **IDE**: Familiarize yourself with Visual Studio or any other IDE you are using for C#. Tu...
4,809
[ { "from": "human", "value": "I've seen this done in Borland's Turbo C++ environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?\n" }, { "from": "gpt", "value": "When transitioning from Borland's Turbo C++ to C#, t...
My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a custom exception class - the SuperException - which was der...
It sounds like you've encountered a situation where the old reference to `SuperException` is lingering in your project or in its dependencies, causing the compiler to still expect it even after you've removed it from your own code. Here are several steps you can take to troubleshoot and resolve this issue: 1. **Check ...
5,716
[ { "from": "human", "value": "My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate.\nThis project used to throw and catch a custom exception ...
I have a datagridview with a DataGridViewComboboxColumn column with 3 values: "Small", "Medium", "Large" I get back the users default which in this case is "Medium" I want to show a dropdown cell in the datagridview but default the value to "Medium". i would do this in a regular combobox by doing selected index or ju...
To set the default value of a `DataGridViewComboBoxColumn` to "Medium" in a `DataGridView`, you can do this by initializing the `DataGridView` and then setting the default value for the specific cell after you've populated your `DataGridView`. Below is an example of how you can achieve this in C#. Assuming you already...
7,648
[ { "from": "human", "value": "I have a datagridview with a DataGridViewComboboxColumn column with 3 values:\n\"Small\", \"Medium\", \"Large\"\nI get back the users default which in this case is \"Medium\"\nI want to show a dropdown cell in the datagridview but default the value to \"Medium\". i would do th...
Will IE6 negotiate a 256 bit AES SSL connection if the server is capable?
Internet Explorer 6 (IE6) does not support 256-bit AES encryption for SSL/TLS connections. While IE6 can use SSL and does support some encryption algorithms, it is limited to 128-bit encryption for SSL connections. Even if a server is configured to support 256-bit AES, IE6 would not be able to negotiate such a connec...
9,633
[ { "from": "human", "value": "Will IE6 negotiate a 256 bit AES SSL connection if the server is capable?\n" }, { "from": "gpt", "value": "Internet Explorer 6 (IE6) does not support 256-bit AES encryption for SSL/TLS connections. While IE6 can use SSL and does support some encryption algorithms, it...
I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea? I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?
Using Google Web Toolkit (GWT) can be a good choice for implementing AJAX in your Google App Engine (GAE) application. GWT is designed to simplify the development of web applications by allowing you to write client-side code in Java, which is then compiled into JavaScript. This can help you manage AJAX interactions mor...
6,497
[ { "from": "human", "value": "I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea?\nI am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?\n" }, { "from...
Jeff mentioned the concept of 'Progressive Enhancement' when talking about using JQuery to write stackoverflow. After a quick Google, I found a couple of high-level discussions about it. Can anyone recommend a good place to start as a programmer. Specifically, I have been writing web apps in PHP and would like to use Y...
Progressive enhancement is a web development approach that emphasizes building a basic, functional experience for all users and then enhancing that experience for users with more advanced browsers or features, like JavaScript. This ensures that your web application remains accessible and usable even if some users have ...
2,261
[ { "from": "human", "value": "Jeff mentioned the concept of 'Progressive Enhancement' when talking about using JQuery to write stackoverflow.\nAfter a quick Google, I found a couple of high-level discussions about it.\nCan anyone recommend a good place to start as a programmer.\nSpecifically, I have been wri...
I need to convert an x12 850 v4010 to a x12 940 v4010. Most of the tools convert from x12 to xml then I would need to map the xml to a 940. I am hoping there is a tool that could convert from one edi document to another. EDIT FOR INFORMATION: Quick Background Electronic Data Interchange (EDI) is classically defined ...
Converting an X12 850 (Purchase Order) to an X12 940 (Warehouse Shipping Order) directly can be challenging, as they serve different purposes and have different data requirements. However, you may want to explore specialized EDI translation software that allows for such conversions. Here are some tools and options that...
7,130
[ { "from": "human", "value": "I need to convert an x12 850 v4010 to a x12 940 v4010. Most of the tools convert from x12 to xml then I would need to map the xml to a 940. I am hoping there is a tool that could convert from one edi document to another.\nEDIT FOR INFORMATION:\n\nQuick Background\nElectronic Dat...
Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market?
ASP.NET MVC has already established itself as a significant framework in the Microsoft web development ecosystem, particularly since its initial release. However, the market share of any technology can be influenced by various factors, including the emergence of new frameworks, changes in developer preferences, and the...
7,758
[ { "from": "human", "value": "Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market?\n" }, { "from": "gpt", "value": "ASP.NET MVC has already established itself as a significant framework in the Microsoft ...
I have a method in my Python code that returns a tuple - a row from a SQL query. Let's say it has three fields: (jobId, label, username) For ease of passing it around between functions, I've been passing the entire tuple as a variable called 'job'. Eventually, however, I want to get at the bits, so I've been using code...
You're right that unpacking a tuple into individual variables can lead to maintenance issues, especially when the number of fields grows or if the schema changes. Here are some better approaches to handle this situation: ### 1. Use a Named Tuple Python's `collections` module provides a `namedtuple` class that allows y...
7,424
[ { "from": "human", "value": "I have a method in my Python code that returns a tuple - a row from a SQL query. Let's say it has three fields: (jobId, label, username)\nFor ease of passing it around between functions, I've been passing the entire tuple as a variable called 'job'. Eventually, however, I want t...
I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment.
You can take a screenshot in a Linux environment using Python by utilizing libraries like `Pillow` for image manipulation and `pyautogui` for capturing the screen. If you want to unobtrusively save the screenshot without any graphical user interface pop-ups, you can do this quite simply. Here’s a straightforward way t...
7,628
[ { "from": "human", "value": "I want to take a screenshot via a python script and unobtrusively save it.\nI'm only interested in the Linux solution, and should support any X based environment.\n" }, { "from": "gpt", "value": "You can take a screenshot in a Linux environment using Python by utiliz...
The following SQL: SELECT notes + 'SomeText' FROM NotesTable a Give the error: The data types nvarchar and text are incompatible in the add operator.
The error you are encountering indicates that the `notes` column is of type `text`, which is not directly compatible with `nvarchar` when performing string concatenation in SQL Server. To resolve this issue, you need to convert the `text` data type to a compatible string data type, such as `nvarchar`. You can use the ...
9,730
[ { "from": "human", "value": "The following SQL:\nSELECT notes + 'SomeText'\nFROM NotesTable a \n\nGive the error:\n\nThe data types nvarchar and text are incompatible in the add operator.\n\n" }, { "from": "gpt", "value": "The error you are encountering indicates that the `notes` column is of ty...