instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
So I was writing some code today that basically looks like this: string returnString = s.Replace("!", " ") .Replace("@", " ") .Replace("#", " ") .Replace("$", " ") .Replace("%", " ") .Replace("^", " ") .Replace("*", " ") .Replace("_", "...
Yes, you can simplify your code using a regular expression to replace multiple characters in one go. The `Regex.Replace` method allows you to specify a pattern that matches multiple characters. Here’s how you can do it: 1. Create a character class that includes all the characters you want to replace. 2. Use the `Regex...
11,041
[ { "from": "human", "value": "So I was writing some code today that basically looks like this:\nstring returnString = s.Replace(\"!\", \" \")\n .Replace(\"@\", \" \")\n .Replace(\"#\", \" \")\n .Replace(\"$\", \" \")\n .Replace(\"%\", \" \")\n .Replace(\...
A Little Background Information: I've been looking at a few PHP framework recently, and it came down to two. The Zend Framework or CodeIgniter. I prefer CodeIgniter, because of its simple design. It's very bare bone, and it is just kept simple. The thing I don't like though is the weak template system. The template sy...
Integrating Smarty into CodeIgniter is indeed a viable option, especially if you require a more robust templating system than what CodeIgniter provides by default. However, there are a few considerations and potential challenges you may want to keep in mind. ### Integrating Smarty with CodeIgniter 1. **Installation**...
5,288
[ { "from": "human", "value": "A Little Background Information:\nI've been looking at a few PHP framework recently, and it came down to two. The Zend Framework or CodeIgniter. \nI prefer CodeIgniter, because of its simple design. It's very bare bone, and it is just kept simple. The thing I don't like though i...
String s = ""; for(i=0;i<....){ s = some Assignment; } or for(i=0;i<..){ String s = some Assignment; } I don't need to use 's' outside the loop ever again. The first option is perhaps better since a new String is not initialized each time. The second however would result in the scope of the variable being li...
The choice between the two options you provided can depend on various factors, including readability, scope, and potential performance implications. Here's a breakdown of both options: ### Option 1: `String s` outside the loop ```java String s = ""; for (i = 0; i < ...; i++) { s = someAssignment; // someAssignme...
8,228
[ { "from": "human", "value": "String s = \"\";\nfor(i=0;i<....){\n s = some Assignment;\n}\n\nor\nfor(i=0;i<..){\n String s = some Assignment;\n}\n\nI don't need to use 's' outside the loop ever again. \nThe first option is perhaps better since a new String is not initialized each time. The second howe...
Aside from trying perldoc <module name> individually for any CPAN module that takes my fancy or going through the file system and looking at the directories, I have no idea what modules we have installed. What's the easiest way to just get a big list of every CPAN module installed? From the command line or otherwise.
To get a list of all CPAN modules installed on your system, you have a few options. Here are some common methods you can use: 1. **Using `cpan` command:** You can use the CPAN shell to list all installed modules. Open your terminal and run: ```bash cpan -l ``` This will give you a list of all installe...
8,859
[ { "from": "human", "value": "Aside from trying\nperldoc <module name>\n\nindividually for any CPAN module that takes my fancy or going through the file system and looking at the directories, I have no idea what modules we have installed.\nWhat's the easiest way to just get a big list of every CPAN module in...
Can I determine from an ASP.NET application the transfer rate, i.e. how many KB per second are transferd?
Yes, you can determine the transfer rate of an ASP.NET application by calculating the number of bytes transferred over a specific period and then converting that to kilobytes per second (KB/s). Here’s a general approach to do that: ### 1. Set Up Event Handlers You can use the `Application_BeginRequest` and `Applicat...
9,932
[ { "from": "human", "value": "Can I determine from an ASP.NET application the transfer rate, i.e. how many KB per second are transferd?\n" }, { "from": "gpt", "value": "Yes, you can determine the transfer rate of an ASP.NET application by calculating the number of bytes transferred over a specifi...
Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values. Is this even possible?
In SQL Server, it is not possible to directly modify a computed column to stop being computed while retaining its values. To achieve this, you typically need to drop the computed column and then add a regular column with the same name. However, this can be done in a way that preserves the current values of the computed...
11,119
[ { "from": "human", "value": "Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values.\nIs this even possible?\n" }, { ...
I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated: <results> <test-case name="MyNamespace.Tests.MyTest" executed="True" success="True" time="0.203" asserts="4" /> </results> I would l...
In NUnit, while you cannot directly add custom attributes or modify the generated XML output for each test case from within the test methods themselves, you can use the `TestContext` class to log information that will appear in the test results. The `TestContext` class provides a way to record output during the execu...
12,042
[ { "from": "human", "value": "I would like to be able to add a \"message\" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated:\n<results>\n <test-case name=\"MyNamespace.Tests.MyTest\" executed=\"True\" success=\"True\...
I need to parse RFC 3339 strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type. I have found strptime in the Python standard library, but it is not very convenient. What is the best way to do this?
To parse RFC 3339 strings like "2008-09-03T20:56:35.450686Z" into Python's `datetime` type, you can use the `dateutil` library, which is part of the `dateutil` module. This library provides a powerful and convenient way to handle dates and times, including parsing ISO 8601 and RFC 3339 formatted strings. To get starte...
10,901
[ { "from": "human", "value": "I need to parse RFC 3339 strings like \"2008-09-03T20:56:35.450686Z\" into Python's datetime type.\nI have found strptime in the Python standard library, but it is not very convenient.\nWhat is the best way to do this?\n" }, { "from": "gpt", "value": "To parse RFC 33...
I thought I was a decent programmer until I tried writing gamepad code for OS X. Now I feel deeply useless. Does anyone know of any code that I can legally use in my (non-free) game? Is it really this hard to talk to a gamepad on OS X? What am I missing?
It sounds like you’re facing some challenges with gamepad input on macOS. Handling gamepad input can be a bit tricky, especially if you're unfamiliar with the API and libraries available. Here are some suggestions to help you out: ### 1. Use Game Controller Framework macOS provides the **Game Controller framework**, w...
8,635
[ { "from": "human", "value": "I thought I was a decent programmer until I tried writing gamepad code for OS X. Now I feel deeply useless.\nDoes anyone know of any code that I can legally use in my (non-free) game?\nIs it really this hard to talk to a gamepad on OS X? What am I missing?\n" }, { "from"...
Can share with me any of this script?
Sure! Please provide more details about the script you're referring to. Are you looking for a specific type of script (e.g., a movie script, a play, a programming script, etc.)? Let me know how I can assist you!
15,170
[ { "from": "human", "value": "Can share with me any of this script?\n" }, { "from": "gpt", "value": "Sure! Please provide more details about the script you're referring to. Are you looking for a specific type of script (e.g., a movie script, a play, a programming script, etc.)? Let me know how I ...
I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?
Introspecting a C++ class in native C++ can be challenging due to the lack of built-in reflection capabilities in the language. However, there are several techniques and libraries you can use to achieve some level of introspection, as well as some design patterns that can help make this task easier. ### Techniques 1....
6,853
[ { "from": "human", "value": "I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other technique...
For example, how do I show or hide the Outlook envelope icon from an Outlook Rule? The envelope icon option is set by going to: Tools -> Options... E-mail Options Advanced E-mail Options Show an envelope icon in the notification area The reason why I say programmatically is because none of the standard Rule actions ...
Unfortunately, controlling the display of the envelope icon in Outlook's notification area through a Rule or directly through standard Outlook settings isn't supported programmatically via VBA or the Outlook object model. The envelope icon's visibility is more of a global setting in Outlook rather than something you ca...
10,643
[ { "from": "human", "value": "For example, how do I show or hide the Outlook envelope icon from an Outlook Rule? \nThe envelope icon option is set by going to:\n\nTools -> Options...\nE-mail Options\nAdvanced E-mail Options\nShow an envelope icon in the notification area\n\nThe reason why I say programmatica...
Is there a way to increase the stack size of a Windows application at compile/link time with GCC?
Yes, you can increase the stack size of a Windows application when using GCC (specifically MinGW) by specifying the stack size at link time using the `-Wl,--stack` option. This option allows you to set the stack size of your application in bytes. Here's how to do it: 1. Open your terminal or command prompt. 2. When yo...
12,819
[ { "from": "human", "value": "Is there a way to increase the stack size of a Windows application at compile/link time with GCC?\n" }, { "from": "gpt", "value": "Yes, you can increase the stack size of a Windows application when using GCC (specifically MinGW) by specifying the stack size at link t...
I have just installed a build server with a 64 bit windows server 2008 for continuous integration. The reason I choose a 64 bit server was to have more than ~3Gb of RAM. I had hopes that this machine would provide blazing fast builds. Unfortunately, the result are lacking greatly to say the least. My desktop provides ...
It's frustrating when the performance of a dedicated build server doesn't meet expectations, especially when you've invested in better hardware. There could be multiple reasons for the slower build times on your Windows Server 2008 setup, so let's explore some of the potential bottlenecks and improvements you might con...
10,048
[ { "from": "human", "value": "I have just installed a build server with a 64 bit windows server 2008 for continuous integration. \nThe reason I choose a 64 bit server was to have more than ~3Gb of RAM. I had hopes that this machine would provide blazing fast builds.\nUnfortunately, the result are lacking gre...
When do we use client side reporting and when do we use server side reporting? Which reporting is best practice (client/server)? This pertains to SSRS reporting.
SQL Server Reporting Services (SSRS) can deliver reports through both client-side and server-side processing. The choice between client-side and server-side reporting depends on various factors, including performance, functionality, and user experience. ### Client-Side Reporting **Definition**: In client-side reporti...
10,504
[ { "from": "human", "value": "When do we use client side reporting and when do we use server side reporting?\nWhich reporting is best practice (client/server)?\nThis pertains to SSRS reporting.\n" }, { "from": "gpt", "value": "SQL Server Reporting Services (SSRS) can deliver reports through both ...
I have CSV data loaded into a multidimensional array. In this way each "row" is a record and each "column" contains the same type of data. I am using the function below to load my CSV file. function f_parse_csv($file, $longest, $delimiter) { $mdarray = array(); $file = fopen($file, "r"); while ($line = fgetcs...
To sort the multidimensional array based on a specific column, including handling date strings in the `Y-m-d H:i:s` format, you can use the `usort` function in PHP. Here's how you can implement a function to sort your array based on a specified column index, where the most recent date comes first: ```php function f_so...
9,858
[ { "from": "human", "value": "I have CSV data loaded into a multidimensional array. In this way each \"row\" is a record and each \"column\" contains the same type of data. I am using the function below to load my CSV file.\nfunction f_parse_csv($file, $longest, $delimiter)\n{\n $mdarray = array();\n $fil...
I've got two tables in my database: Articles and Tags The Tags tables consist of ArticleID (foreign key) and a Tag (varchar). Now I need to map an articles tags into a readonly collection on Article entity, either using IList Tags or ReadOnlyCollection Tags. I've consulted the NHibernate reference material, but I can't...
In NHibernate, when mapping a collection of related entities or values, the choice between using a `<set>`, `<bag>`, or other collection types depends on the specific requirements of your application, such as whether you need ordering, uniqueness, or indexed access. Here’s a brief overview of the different collection t...
9,549
[ { "from": "human", "value": "I've got two tables in my database: Articles and Tags\nThe Tags tables consist of ArticleID (foreign key) and a Tag (varchar).\nNow I need to map an articles tags into a readonly collection on Article entity, either using IList Tags or ReadOnlyCollection Tags.\nI've consulted th...
Is there a way to read a module's configuration ini file? For example I installed php-eaccelerator (http://eaccelerator.net) and it put a eaccelerator.ini file in /etc/php.d. My PHP installation wont read this .ini file because the --with-config-file-scan-dir option wasn't used when compiling PHP. Is there a way to ma...
If your PHP installation does not read configuration files from the `php.d` directory because the `--with-config-file-scan-dir` option was not set during compilation, you still have a few options to load the `eaccelerator.ini` configuration file: ### 1. Manually Load the INI File in `php.ini` You can manually include...
8,561
[ { "from": "human", "value": "Is there a way to read a module's configuration ini file? \nFor example I installed php-eaccelerator (http://eaccelerator.net) and it put a eaccelerator.ini file in /etc/php.d. My PHP installation wont read this .ini file because the --with-config-file-scan-dir option wasn't use...
We are using SQL 2005 and the try-catch functionality to handle all of our error handling within the DB. We are currently working on deploying a .NET CLR function to make some WCF calls in the DB. This WCF procedure is written in the CLR and then deployed to SQL. If I put a try-catch block in the CLR code, it catches t...
When working with SQL Server CLR Integration, handling errors between the managed code (CLR) and the SQL Server T-SQL can be tricky. SQL Server's error handling with TRY-CATCH blocks operates differently compared to .NET's exception handling. Here’s how you can effectively propagate exceptions from your CLR code to the...
11,803
[ { "from": "human", "value": "We are using SQL 2005 and the try-catch functionality to handle all of our error handling within the DB. We are currently working on deploying a .NET CLR function to make some WCF calls in the DB. This WCF procedure is written in the CLR and then deployed to SQL. If I put a try-...
Can the Visual Studio IDE profile be changed without clearing all VS settings?
Yes, you can change the Visual Studio IDE profile without clearing all Visual Studio settings. Visual Studio provides a way to switch between different environment settings profiles, which allows you to customize the IDE without affecting other configurations. Here’s how you can change the profile: 1. **Open Visual S...
13,227
[ { "from": "human", "value": "Can the Visual Studio IDE profile be changed without clearing all VS settings?\n" }, { "from": "gpt", "value": "Yes, you can change the Visual Studio IDE profile without clearing all Visual Studio settings. Visual Studio provides a way to switch between different env...
Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string Surname { get; s...
To ensure that you can use the same types for both the client and server in a web service environment while minimizing code duplication, you have several approaches to consider. Here are a few of the most common methods: ### 1. **Using a Shared Library:** The most straightforward approach is to create a separate class...
10,397
[ { "from": "human", "value": "Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code.\nOver simplified example:\n public class Name\n {\n public string FirstName {get;...
How do you shade alternating rows in a SQL Server Reporting Services report? Edit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one...
Shading alternating rows in an SQL Server Reporting Services (SSRS) report can enhance readability. You can achieve this through the use of an expression for the background color of the table rows. Here’s a straightforward method to do it: ### Steps to Shade Alternating Rows: 1. **Open Your Report**: Launch the Repor...
11,939
[ { "from": "human", "value": "How do you shade alternating rows in a SQL Server Reporting Services report?\n\nEdit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one...\n" }, { "from": "gpt", "value": "Shading alternati...
What could be the possible causes for the following exception? System.PlatformNotSupportedException: 'ResourcePool' is not supported on the current platform. at System.EnterpriseServices.Platform.Assert(Boolean fSuccess, String function) at System.EnterpriseServices.Platform.Assert(Version platform, String functi...
The `System.PlatformNotSupportedException` indicates that a certain feature or API is not available on the platform you are running on. In the context of your issue, the exception arises when attempting to instantiate a `ResourcePool` in the `System.EnterpriseServices` namespace, particularly related to database connec...
7,163
[ { "from": "human", "value": "What could be the possible causes for the following exception?\nSystem.PlatformNotSupportedException: 'ResourcePool' is not supported on the current platform.\n at System.EnterpriseServices.Platform.Assert(Boolean fSuccess, String function)\n at System.EnterpriseServices.Pla...
Anyone have any success or failure running Jira on a VM? I am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also free me from hardware problems and give me...
Running Jira on a VM is a common practice and can provide several advantages, such as flexibility, easier backup and recovery options, and the ability to scale resources as needed. However, there are some considerations to keep in mind to ensure a successful implementation: ### Advantages of Running Jira on a VM: 1. *...
8,485
[ { "from": "human", "value": "Anyone have any success or failure running Jira on a VM?\nI am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also ...
I need to rename the database but when I do in PGAdmin : ALTER DATABASE "databaseName" RENAME TO "databaseNameOld" it told me that it cannot. How can I do it? (Version 8.3 on WindowsXP) Update The first error message : Cannot because I was connect to it. So I selected an other database and did the queries. I get a se...
Renaming a database in PostgreSQL requires that you are not connected to the database you wish to rename, and that no other active connections are using that database. Here’s how you can successfully rename your database: ### Steps to Rename the Database 1. **Connect to a Different Database:** Make sure you are co...
11,758
[ { "from": "human", "value": "I need to rename the database but when I do in \nPGAdmin : ALTER DATABASE \"databaseName\" RENAME TO \"databaseNameOld\" it told me that it cannot.\nHow can I do it?\n(Version 8.3 on WindowsXP)\nUpdate\n\nThe first error message : Cannot because I was connect to it. So I selecte...
When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista? For example a simple image manipulation application that allows you to paste photos on top of ...
Yes, it is indeed possible to create a setup (MSI) for a simple application that does not require administrator permissions to install. You can achieve this by installing the application in a user-specific directory such as the `AppData` folder. Below are the answers to your queries regarding installation without admin...
8,337
[ { "from": "human", "value": "When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista?\nFor example a simple image manipulation application ...
I have apache 2.2 and tomcat 5.5 running on a Windows XP machine. Which tomcat/apache connector is the easiest to set up and is well documented?
For integrating Apache HTTP Server (Apache 2.2) with Apache Tomcat (Tomcat 5.5) on a Windows XP machine, the easiest and most commonly used connector is **mod_jk**. This connector is well-documented and widely used for routing requests from Apache to Tomcat. ### Steps to Set Up mod_jk: 1. **Download mod_jk**: - Yo...
8,383
[ { "from": "human", "value": "I have apache 2.2 and tomcat 5.5 running on a Windows XP machine.\nWhich tomcat/apache connector is the easiest to set up and is well documented? \n" }, { "from": "gpt", "value": "For integrating Apache HTTP Server (Apache 2.2) with Apache Tomcat (Tomcat 5.5) on a Wi...
I am serving all content through apache with Content-Encoding: zip but that compresses on the fly. A good amount of my content is static files on the disk. I want to gzip the files beforehand rather than compressing them every time they are requested. This is something that, I believe, mod_gzip did in Apache 1.x auto...
You're correct that `mod_deflate` in Apache doesn't automatically serve pre-compressed `.gz` files like `mod_gzip` did in the older versions of Apache. However, you can configure Apache to serve pre-compressed files easily. Here’s how you can do it: ### Step 1: Pre-compress your files You should pre-compress your sta...
7,000
[ { "from": "human", "value": "I am serving all content through apache with Content-Encoding: zip but that compresses on the fly. A good amount of my content is static files on the disk. I want to gzip the files beforehand rather than compressing them every time they are requested.\nThis is something that, ...
I've got a problem similar to,but subtly different from, that described here (Loading assemblies and their dependencies). I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will have a CLR wrapper around it. The C++ DLL can be built in both 32 and 64bit versions, but I think this mea...
Yes, your scenario regarding the use of a C++ DLL for rendering with a CLR wrapper in both 32-bit and 64-bit versions is indeed quite common when dealing with mixed managed and unmanaged code. You need to ensure that the correct version of your CLR wrapper is loaded based on the architecture of the .NET application tha...
5,284
[ { "from": "human", "value": "I've got a problem similar to,but subtly different from, that described here (Loading assemblies and their dependencies).\nI have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will have a CLR wrapper around it. The C++ DLL can be built in both 3...
I am using DirectoryInfo.GetDirectories() recursively to find the all the sub-directories under a given path. However, I want to exclude the System folders and there is no clear way for that. In FindFirstFile/FindNextFile things were clearer with the attributes.
When using the `DirectoryInfo.GetDirectories()` method in C#, you can exclude system folders by filtering the directories based on their attributes. The `DirectoryInfo` class provides a way to retrieve the attributes of a directory using the `Attributes` property. Here’s how you can achieve this: 1. Use `DirectoryInfo...
9,831
[ { "from": "human", "value": "I am using DirectoryInfo.GetDirectories() recursively to find the all the sub-directories under a given path.\nHowever, I want to exclude the System folders and there is no clear way for that.\nIn FindFirstFile/FindNextFile things were clearer with the attributes.\n" }, { ...
I am using CodeDom to generate dynamic code based on user values. One of those values controls what the name of the class I'm generating is. I know I could sterilize the name based on language rules about valid class names using regular expressions, but I'd like to know if there is a specific method built into the fram...
In .NET, there isn't a dedicated method in the framework specifically designed to validate or sterilize class names. However, you can use a combination of the `CSharpSyntaxTree` and `CSharpSyntax` classes from the Roslyn compiler platform to validate the syntax of class names according to the C# language rules. Here’s...
9,410
[ { "from": "human", "value": "I am using CodeDom to generate dynamic code based on user values. One of those values controls what the name of the class I'm generating is. I know I could sterilize the name based on language rules about valid class names using regular expressions, but I'd like to know if there...
I'm currently working on a ray-tracer in C# as a hobby project. I'm trying to achieve a decent rendering speed by implementing some tricks from a c++ implementation and have run into a spot of trouble. The objects in the scenes which the ray-tracer renders are stored in a KdTree structure and the tree's nodes are, in t...
You're encountering an issue commonly faced when working with C# and trying to manage memory manually, particularly when you use structs as the basis for your KdTree. In C#, when you create a struct, it is a value type and can be moved around in memory by the garbage collector, especially if it is contained within a he...
5,868
[ { "from": "human", "value": "I'm currently working on a ray-tracer in C# as a hobby project. I'm trying to achieve a decent rendering speed by implementing some tricks from a c++ implementation and have run into a spot of trouble.\nThe objects in the scenes which the ray-tracer renders are stored in a KdTre...
I have upgraded a MS Visual Studio Application from VS 2003 to VS 2008 (Targeting .NET 2.0). As part of the conversion process the wizard said I needed to take the additional step of Converting my Project to a Website by Right-Clicking and blah blah blah... I didn't follow directions and the web application seems to be...
Upgrading from Visual Studio 2003 to Visual Studio 2008 and converting a project from a Windows Application to a Web Application can be a significant change, especially since you're working with a web application. Here's a breakdown of what you should consider and whether you need to be concerned about pushing this to ...
7,916
[ { "from": "human", "value": "I have upgraded a MS Visual Studio Application from VS 2003 to VS 2008 (Targeting .NET 2.0). As part of the conversion process the wizard said I needed to take the additional step of Converting my Project to a Website by Right-Clicking and blah blah blah...\nI didn't follow dire...
It's very painful to add multiple tickets to Trac or to have it as your own todo list. That causes people to use their own task management tools so tasks are then spread all around. Is there any plugin or macro that would quicken the process of adding a ticket?
Yes, there are several ways to enhance the process of adding tickets in Trac and manage your tasks more efficiently. While Trac itself may have limitations, you can look into a few options: 1. **Trac plugins**: There are various plugins available that can help streamline ticket management in Trac. For example: - **...
10,208
[ { "from": "human", "value": "It's very painful to add multiple tickets to Trac or to have it as your own todo list. That causes people to use their own task management tools so tasks are then spread all around.\nIs there any plugin or macro that would quicken the process of adding a ticket?\n" }, { ...
I'm looking for embedded database engine supporting isolating storage. Currently I'm aware of VistaDB. What else you can recommend? Requirements are pretty simple: xcopy deployment support for isolated storage preferably free Note that you don't know exact path to the file when using IS.
If you're looking for embedded database engines that support isolated storage and have simple deployment mechanisms like XCOPY, here are several options you might consider: 1. **SQLite**: - **Description**: SQLite is a widely used embedded database engine that is serverless and requires minimal setup. It's cross-pl...
8,941
[ { "from": "human", "value": "I'm looking for embedded database engine supporting isolating storage. Currently I'm aware of VistaDB. What else you can recommend?\nRequirements are pretty simple:\n\nxcopy deployment \nsupport for isolated storage\npreferably free\n\nNote that you don't know exact path to the...
I'm getting an error whenever I load Management Studio or open a folder in the server explorer, etc. Additionally, If I try to create a new database it constantly is updating and does not finish. I have attached a screenshot of the error. Please let me know what I can do to fix this because it's really aggravating. Err...
It sounds like you're experiencing persistent issues with SQL Server Management Studio (SSMS) related to opening folders in Server Explorer and creating new databases. Here are several troubleshooting steps that you can take to resolve the issue: ### 1. Restart SQL Server Services Sometimes simply restarting the SQL S...
8,495
[ { "from": "human", "value": "I'm getting an error whenever I load Management Studio or open a folder in the server explorer, etc. Additionally, If I try to create a new database it constantly is updating and does not finish. I have attached a screenshot of the error. Please let me know what I can do to fix ...
In a VB.NET WinForms project, I get an exception Cannot access a disposed of object when closing a form. It occurs very rarely and I cannot recreate it on demand. The stack trace looks like this: Cannot access a disposed object. Object name: 'dbiSchedule'. at System.Windows.Forms.Control.CreateHandle() at System....
The exception you are encountering, "Cannot access a disposed object," typically occurs when trying to interact with a control that has already been disposed. In your case, the issue arises when the `Timer`'s `Tick` event tries to access the `dbiSchedule` control after the form has been disposed. Here are some steps ...
7,123
[ { "from": "human", "value": "In a VB.NET WinForms project, I get an exception\n\nCannot access a disposed of object\n\nwhen closing a form. It occurs very rarely and I cannot recreate it on demand. The stack trace looks like this:\nCannot access a disposed object. Object name: 'dbiSchedule'.\n at System.Wi...
At what level of complexity is it mandatory to switch to an existing framework for web development? What measurement of complexity is practical for web development? Code length? Feature list? Database Size?
The decision to switch to an existing framework for web development often depends on various factors related to the complexity and requirements of the project. Here are some considerations and metrics that can help gauge when it might be appropriate to adopt a framework: ### 1. Complexity Factors: - **Project Size**: ...
8,466
[ { "from": "human", "value": "At what level of complexity is it mandatory to switch to an existing framework for web development?\nWhat measurement of complexity is practical for web development? Code length? Feature list? Database Size?\n" }, { "from": "gpt", "value": "The decision to switch ...
What do wikis/stackoverflow/etc. do when it comes to storing text? Is the text broken at newlines? Is it broken into fixed-length chunks? How do you best store arbitrarily long chunks of text?
When it comes to storing text in platforms like wikis, Stack Overflow, and similar web applications, there are several strategies and best practices that can be employed to efficiently handle arbitrarily long chunks of text. Here are some key considerations and methods: ### 1. **Text Storage Format** - **Database Sto...
9,051
[ { "from": "human", "value": "What do wikis/stackoverflow/etc. do when it comes to storing text? Is the text broken at newlines? Is it broken into fixed-length chunks? How do you best store arbitrarily long chunks of text?\n" }, { "from": "gpt", "value": "When it comes to storing text in platf...
Let's say you have a solution with two website projects, Website A and Website B. Now inside Website A's App_Code folder, there is a Class X defined in a ClassX.cs file. What do you do if Website B also needs access to ClassX.cs? Is there any way to share this file across App_Code folders? Assume that moving the f...
If moving the `ClassX.cs` file to a common library is not an option, you still have a few potential approaches to share the `ClassX` definition between Website A and Website B: ### 1. **Create a Symbolic Link (Symlink)** If you're working in a development environment where symbolic links are supported (like on Windows...
7,124
[ { "from": "human", "value": "Let's say you have a solution with two website projects, Website A and Website B. Now inside Website A's App_Code folder, there is a Class X defined in a ClassX.cs file. What do you do if Website B also needs access to ClassX.cs? \nIs there any way to share this file across A...
I want to clear the Firebug console of the JavaScript already sent. Does something like console.clear() exist and work?
Yes, `console.clear()` is a valid method in JavaScript that is used to clear the console. When you call `console.clear()`, it will clear the messages that have been printed to the console in most browsers, including when using the Firebug console. Here's a simple example of how you can use it: ```javascript console.l...
13,877
[ { "from": "human", "value": "I want to clear the Firebug console of the JavaScript already sent.\nDoes something like console.clear() exist and work?\n" }, { "from": "gpt", "value": "Yes, `console.clear()` is a valid method in JavaScript that is used to clear the console. When you call `console....
I can use properties of an Excel Worksheet to tell if the worksheet is protected (Worksheet.Protection, Worksheet.ProtectContents etc). How can I tell using VBA if the entire workbook has been protected?
In Excel VBA, you can check if an entire workbook is protected by examining its `ProtectStructure` property. This property indicates whether the structure of the workbook (i.e., the ability to add, delete, or rename sheets) is protected. You can use the following VBA code to determine if the entire workbook is protect...
12,752
[ { "from": "human", "value": "I can use properties of an Excel Worksheet to tell if the worksheet is protected (Worksheet.Protection, Worksheet.ProtectContents etc).\nHow can I tell using VBA if the entire workbook has been protected?\n" }, { "from": "gpt", "value": "In Excel VBA, you can check i...
I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the default settings? For example: I have a user setting named ...
In the .NET Framework, when you use application settings to store user preferences, the default values you set at design time are typically stored separately from the user-specified values. When a user modifies a setting and saves it, the new value overrides the default value, and calling `Properties.Settings.Default.[...
10,073
[ { "from": "human", "value": "I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the default settings?\n...
In Vim editor I opted ]I on a function (in C++ code). This presented a list, which says 'Press ENTER or type command to continue'. Now to jump to an occurrence say 6, I type 6 - but this is not working. What commands can I type in such a case, and how do I jump to Nth occurrence from this list? Update: Actually I trie...
When you press `]I` in Vim while the cursor is on a function or a symbol in C++ code, Vim shows you a list of occurrences of that function or symbol. When you see the message "Press ENTER or type command to continue", Vim is in a preview mode. To navigate this list effectively, you can use the following commands: 1. ...
11,278
[ { "from": "human", "value": "In Vim editor I opted ]I on a function (in C++ code). \nThis presented a list, which says 'Press ENTER or type command to continue'.\nNow to jump to an occurrence say 6, I type 6 - but this is not working.\nWhat commands can I type in such a case, and how do I jump to Nth occurr...
I've seen some people use EXISTS (SELECT 1 FROM ...) rather than EXISTS (SELECT id FROM ...) as an optimization--rather than looking up and returning a value, SQL Server can simply return the literal it was given. Is SELECT(1) always faster? Would Selecting a value from the table require work that Selecting a literal ...
In SQL, using `EXISTS (SELECT 1 FROM ...)` versus `EXISTS (SELECT id FROM ...)` can often lead to the same performance characteristics, but there are some nuances to consider. ### Performance Considerations 1. **Query Optimization**: The SQL Server query optimizer is quite sophisticated and typically optimizes querie...
11,444
[ { "from": "human", "value": "I've seen some people use EXISTS (SELECT 1 FROM ...) rather than EXISTS (SELECT id FROM ...) as an optimization--rather than looking up and returning a value, SQL Server can simply return the literal it was given.\nIs SELECT(1) always faster? Would Selecting a value from the ta...
I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right. How should I go about this, and why? Please base your answers on personal experience, and provide references where necessary.
Creating executable files from Python scripts can be done using several tools, and each has its strengths and weaknesses. Below, I’ll summarize some of the most popular options, along with my personal experiences and best practices. ### Popular Tools for Creating Executables 1. **PyInstaller** - **Overview**: PyIn...
7,913
[ { "from": "human", "value": "I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right.\nHow should I go about this, and why? Please base your answers on personal experience, and provide references where necessary.\n" }, { "from": "gpt", "value": "Creating execut...
Every time I try to run a small application that uses a Derby DB I get this error message: Message: Database at /path/to/db/TheDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.4. I've added the library from Netbeans, and still have the same...
The error message you are encountering indicates that the Derby database you are trying to access was created with or upgraded to an older version (10.4) of Apache Derby, but your application is using a newer version of Derby. This often happens due to changes in the database format across versions. Here are several s...
11,190
[ { "from": "human", "value": "Every time I try to run a small application that uses a Derby DB I get this error message:\n\nMessage: Database at /path/to/db/TheDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.4.\n\nI've added the l...
Is there an app that can change the order of images inside an icon? Thanks!
Yes, there are several apps and tools that can help you change the order of images within an icon or create custom icons with specific image arrangements. Here are a few options you might consider: 1. **Icon Editing Software**: - **IcoFX**: A popular icon editor that allows you to create and edit icons, including c...
11,475
[ { "from": "human", "value": "Is there an app that can change the order of images inside an icon?\nThanks!\n" }, { "from": "gpt", "value": "Yes, there are several apps and tools that can help you change the order of images within an icon or create custom icons with specific image arrangements. He...
I need to combine a VB web project and a C# web project and have them run alongside each other in the same web root. For instance, I need to be able to navigate to localhost:1234/vbProjPage.aspx and then redirect to localhost:1234/cSharpProjPage.aspx. Is this possible from within Visual Studio 2008? I know you have t...
To host both a VB.NET web project and a C# web project in the same web root while keeping them physically separate in Visual Studio 2008, you can utilize a couple of approaches. Here’s how you can achieve this: ### 1. Use a Single Web Application Project You can create a single web application project that serves as ...
8,907
[ { "from": "human", "value": "I need to combine a VB web project and a C# web project and have them run alongside each other in the same web root. For instance, I need to be able to navigate to localhost:1234/vbProjPage.aspx and then redirect to localhost:1234/cSharpProjPage.aspx. Is this possible from wit...
Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0. Anyone know how?
In WCF 3.5, obtaining the client IP address is more straightforward because it includes additional features and enhancements compared to WCF 3.0. However, you can still retrieve the client IP address in WCF 3.0, but it requires a bit more work. Here’s how you can do it in both WCF 3.5 and WCF 3.0: ### WCF 3.5 In WCF...
9,908
[ { "from": "human", "value": "Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0. Anyone know how?\n" }, { "from": "gpt", "value": "In WCF 3.5, obtaining the client IP address is more straightforward because it includes additional features and enhancements compare...
In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand that there are hardware based solutions ...
To achieve high-quality screen captures of your fullscreen Flash application without the choppy video you're experiencing, you can consider hardware-based solutions that offer smooth recording capabilities. Here are some options: 1. **Capture Cards**: Hardware capture cards are designed to record video output from a c...
8,165
[ { "from": "human", "value": "In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand...
I wrote a utility for photographers that I plan to sell online pretty cheap ($10). I'd like to allow the user to try the software out for a week or so before asking for a license. Since this is a personal project and the software is not very expensive, I don't think that purchasing the services of professional licensin...
Creating a trial licensing system can be tricky, especially when you want to strike a balance between protecting your software and providing a good user experience. Here are some suggestions to improve your licensing system while keeping it straightforward: ### 1. Use Machine-Specific Identifiers Instead of just relyi...
9,059
[ { "from": "human", "value": "I wrote a utility for photographers that I plan to sell online pretty cheap ($10). I'd like to allow the user to try the software out for a week or so before asking for a license. Since this is a personal project and the software is not very expensive, I don't think that purchas...
Anyone have any idea? And any open source sofware which also seens to perform this kind of functionality?
Could you please provide a bit more context or specify what kind of functionality you're looking for? This will help me better understand your needs and suggest relevant open-source software options. For example, are you looking for software related to data analysis, web development, automation, machine learning, etc.?
15,169
[ { "from": "human", "value": "Anyone have any idea? And any open source sofware which also seens to perform this kind of functionality?\n" }, { "from": "gpt", "value": "Could you please provide a bit more context or specify what kind of functionality you're looking for? This will help me better u...
How do you extract the Macro code from an OpenOffice.org Writer document using the .NET API? I got an answer to the "Office 2007" version of this question, but we are evaluating OpenOffice as an alternative -- if anyone has any experience with this, any tips or resources would be appreciated.
Extracting macro code from an OpenOffice.org Writer document can be a bit different from extracting it from Microsoft Office documents, especially since OpenOffice uses a different file format (ODF - Open Document Format). Additionally, OpenOffice macros are usually written in StarBasic, which is similar to Visual Basi...
7,966
[ { "from": "human", "value": "How do you extract the Macro code from an OpenOffice.org Writer document using the .NET API?\nI got an answer to the \"Office 2007\" version of this question, but we are evaluating OpenOffice as an alternative -- if anyone has any experience with this, any tips or resources woul...
I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\"" sqlcmdCall.Start(); sqlcmdCall.WaitForExit(); From th...
The exit codes returned by `sqlcmd` are predefined and cannot be customized directly from the command line. The exit codes are as follows: - `0` indicates success. - Non-zero values (like `1`, `2`, and other values) indicate various error conditions. However, you can manage return codes and control flow in your C# ap...
8,363
[ { "from": "human", "value": "I need to run a stored procedure from a C# application.\nI use the following code to do so:\nProcess sqlcmdCall = new Process();\nsqlcmdCall.StartInfo.FileName = \"sqlcmd.exe\";\nsqlcmdCall.StartInfo.Arguments = \"-S localhost\\\\SQLEXPRESS -d some_db -Q \\\":EXIT(sp_test)\\\"\"...
I would like to find a way to take JPEG (or GIF/PNG) images and reduce the amount of colors to e.g. 20. Could someone recommend some library or other reference? Also source codes in other languages are welcome.
To reduce the number of colors in images (JPEG, GIF, PNG) to a specific palette size (like 20 colors), you can use various libraries in different programming languages. Here are some libraries and examples in a few popular programming languages: ### Python 1. **Pillow**: A powerful image processing library in Python t...
6,315
[ { "from": "human", "value": "I would like to find a way to take JPEG (or GIF/PNG) images and reduce the amount of colors to e.g. 20. Could someone recommend some library or other reference? Also source codes in other languages are welcome.\n" }, { "from": "gpt", "value": "To reduce the number of...
I would like to build and deploy a database application for Windows based systems, but need to live within the following constraints: Cannot run as a server (i.e., have open ports); Must be able to share database files with other instances of the program (running on other machines); Must not require a DBA for maintenan...
Based on your requirements, several embedded database options stand out that could fit your constraints. Here are a few suggestions that meet your criteria: ### 1. **SQLite** - **Overview**: SQLite is a lightweight, self-contained, serverless SQL database engine. It is widely used and has a strong community behind it....
7,187
[ { "from": "human", "value": "I would like to build and deploy a database application for Windows based systems, but need to live within the following constraints:\nCannot run as a server (i.e., have open ports);\nMust be able to share database files with other instances of the program (running on other mach...
What libraries are there to write C# internationalized applications? Typical functionalities that should be contained in the library: Validation of country specific data (e.g. VAT numbers, phone numbers, addresses,...) Validation of bank and financial coordinates (e.g. Credit Card numbers, IBAN,...) Language-specific ...
When it comes to developing internationalized applications in C#, there are a few libraries and frameworks that can help you implement the functionalities you described. Here are some options: 1. **NValidator**: - NValidator is a library that allows you to validate various formats, including phone numbers, email ad...
8,117
[ { "from": "human", "value": "What libraries are there to write C# internationalized applications?\nTypical functionalities that should be contained in the library:\n\nValidation of country specific data (e.g. VAT numbers, phone numbers, addresses,...)\nValidation of bank and financial coordinates (e.g. Cred...
I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this: INSERT INTO Table2(LongIntColumn2, CurrencyColumn2) VALUES (SELECT LongIntColumn1, Av...
In MS Access SQL, you can't directly use a subquery in the `VALUES` clause of an `INSERT INTO` statement. Instead, you should use the `INSERT INTO ... SELECT` statement to achieve your goal. Here's how you can rewrite your query: ```sql INSERT INTO Table2 (LongIntColumn2, CurrencyColumn2) SELECT LongIntColumn1, Avg(C...
13,174
[ { "from": "human", "value": "I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this:\nINSERT INTO Table2(LongIntColumn2, CurrencyCo...
I have a SVN structure like this: /Projects /Project1 /Project2 /someFolder /Project3 /Project4 I would like to move all the projects into the /Projects folder, which means I want to move Projects 3 and 4 from /someFolder into the /projects folder. The caveat: I'd like to keep the full history. I assum...
To move directories in SVN while preserving their history, you can use the `svn move` command. This command is designed to facilitate moving files or directories within a repository while keeping their entire history intact. Below are the steps to accomplish your goal of moving `Project3` and `Project4` into the `/Proj...
9,555
[ { "from": "human", "value": "I have a SVN structure like this:\n/Projects\n /Project1\n /Project2\n/someFolder\n /Project3\n /Project4\n\nI would like to move all the projects into the /Projects folder, which means I want to move Projects 3 and 4 from /someFolder into the /projects folder.\nThe ...
Sorry, I'm new to SVN and I looked around a little for this. How do you mark a major version in SVN, kind of like set up a restore point. Right now I just setup my server and added all my files- I've been intermittently committing different changes. When I have something in a stable state is there a way to mark this so...
Welcome to using SVN (Subversion)! To mark a major version in SVN, you can create a "tag." Tags in SVN are essentially copies of a particular state of your project, which allows you to easily reference and revert back to that state if needed. Here's how you can create a tag in SVN: 1. **Create a Tags Directory**: Fir...
9,578
[ { "from": "human", "value": "Sorry, I'm new to SVN and I looked around a little for this. How do you mark a major version in SVN, kind of like set up a restore point. Right now I just setup my server and added all my files- I've been intermittently committing different changes. When I have something in a st...
I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip methods have changed...
Transitioning from ActionScript 1 and 2 to ActionScript 3 (AS3) involves a significant shift in the way you think about programming in Flash. While you may already be familiar with many concepts, AS3 introduces a more structured and object-oriented approach to coding. Here are some of the key differences and aspects yo...
8,101
[ { "from": "human", "value": "I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip methods have ch...
My project has both client and server components in the same solution file. I usually have the debugger set to start them together when debugging, but it's often the case where I start the server up outside of the debugger so I can start and stop the client as needed when working on client-side only stuff. (this is mu...
To create a macro that starts a specific project in Visual Studio without needing to navigate through the UI hierarchy, you can use the DTE (Development Tools Environment) object model directly to launch the project you want. Here's a simple macro that demonstrates how you can start debugging a specific project from ...
9,321
[ { "from": "human", "value": "My project has both client and server components in the same solution file. I usually have the debugger set to start them together when debugging, but it's often the case where I start the server up outside of the debugger so I can start and stop the client as needed when worki...
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly. Any suggestions optimization for image serving? Here is my server.xml: <Service name="Catalina"> <Connector port="8009" protocol="AJP/1.3" /> <Conn...
Optimizing image serving in Tomcat 6, especially when using a framework like OpenBlueDragon (which runs ColdFusion), can significantly improve the user experience. Here are several strategies you can consider: ### 1. **Enable Compression** Ensure that GZIP compression is enabled for your image responses. Although imag...
7,793
[ { "from": "human", "value": "In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly. Any suggestions optimization for image serving?\nHere is my server.xml:\n <Service name=\"Catalina\">\n\n <Connecto...
How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set. As I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned and comparing the results, ensuring there was no...
Proving that two SQL queries are functionally equivalent — meaning they return the same result set under all possible scenarios — can be quite complex. Here are a series of steps and approaches you can take to establish this equivalence: ### 1. **Understand the Queries** - **Analyze the Logic**: Break down the quer...
5,510
[ { "from": "human", "value": "How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set.\n\nAs I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned and c...
Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas? See Ocaml example below in one of the replies, a Haxe code follows: enum Tre...
In C# 3.0, you don't have native support for parameterized enums like you do in languages such as OCaml or Haxe. However, you can achieve similar functionality using a combination of class inheritance and generics. Here's a basic example of how you can represent a parameterized enum-like structure using classes: ### E...
7,393
[ { "from": "human", "value": "Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas?\nSee Ocaml example below in one of ...
I'm looking for the single biggest reason you are glad that you've already made the jump from SQL2000 to SQL2005.
One of the single biggest reasons to be glad about moving from SQL Server 2000 to SQL Server 2005 is the introduction of the **SQL Server Integration Services (SSIS)**, which significantly enhanced data integration and transformation capabilities. SSIS provides a more powerful and flexible platform for data extractio...
14,168
[ { "from": "human", "value": "I'm looking for the single biggest reason you are glad that you've already made the jump from SQL2000 to SQL2005.\n" }, { "from": "gpt", "value": "One of the single biggest reasons to be glad about moving from SQL Server 2000 to SQL Server 2005 is the introduction of...
We are looking for a reliable "current weather" web service for Europe, with city resolution. We only need the current weather. Since it is for a commercial web site, we don't mind paying a reasonable fee for the service. What are our options? What service would you recommend or avoid based on previous experience? Not...
When looking for a reliable current weather web service for Europe with city-level resolution, there are several options available. Here are some popular weather APIs that offer commercial services: ### Recommended Weather APIs 1. **OpenWeatherMap** - **Type**: REST - **Features**: Provides current weather data...
8,482
[ { "from": "human", "value": "We are looking for a reliable \"current weather\" web service for Europe, with city resolution. We only need the current weather. \nSince it is for a commercial web site, we don't mind paying a reasonable fee for the service.\nWhat are our options? What service would you recomme...
How can styles be applied to CheckBoxList ListItems. Unlike other controls, such as the Repeater where you can specify <ItemStyle>, you can't seem to specify a style for each individual control. Is there some sort of work around?
In ASP.NET, the `CheckBoxList` control doesn't provide built-in support for applying styles to individual list items like you can with `ItemStyle` in a `Repeater`. However, there are several workarounds you can employ to style the `ListItem` elements in a `CheckBoxList`. Here are a few methods you can consider: ### 1....
9,486
[ { "from": "human", "value": "How can styles be applied to CheckBoxList ListItems. Unlike other controls, such as the Repeater where you can specify <ItemStyle>, you can't seem to specify a style for each individual control.\nIs there some sort of work around?\n" }, { "from": "gpt", "value": "In...
There are a lot of new features that came with the .Net Framework 3.5. Most of the posts and info on the subject list stuff about new 3.5 features and C# 3 changes at the same time. But C# 3 can be used without .Net 3.5. Does anyone know of a good post describing the changes to the language? (Besides the boring, explic...
Certainly! While .NET Framework 3.5 introduced a range of new features, C# 3.0 brought significant enhancements to the language itself. Here are some key features introduced in C# 3.0: 1. **Automatic Properties**: You can define properties without having to write explicit backing fields. ```csharp public class P...
10,844
[ { "from": "human", "value": "There are a lot of new features that came with the .Net Framework 3.5. Most of the posts and info on the subject list stuff about new 3.5 features and C# 3 changes at the same time. But C# 3 can be used without .Net 3.5. Does anyone know of a good post describing the changes to ...
For a project I'm working on, the store has two types of products - a real product and a group of products. For this discussion, let's call them "1 T shirt" and "a box of T shirts". For one t-shirt, I need to store the normal attributes - price, sku, size, color, description, etc. For the box of t-shirts I need to ...
Representing products effectively in a system that includes both individual items and collections requires careful consideration of how you want to manage these products and the operations you'll be performing on them, like reporting and order management. Here are some suggestions on how to structure your models for `S...
8,888
[ { "from": "human", "value": "For a project I'm working on, the store has two types of products - a real product and a group of products. \nFor this discussion, let's call them \"1 T shirt\" and \"a box of T shirts\". For one t-shirt, I need to store the normal attributes - price, sku, size, color, descrip...
I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word. Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not having "some special phrase".
Yes, you can search for a text string in a Word 2007 file (.docx) using Python. One of the most popular libraries for handling .docx files in Python is `python-docx`. This library allows you to read the content of Word documents easily, and you can check for the presence of a specific text string. Here's a step-by-ste...
9,929
[ { "from": "human", "value": "I'd like to search a Word 2007 file (.docx) for a text string, e.g., \"some special phrase\" that could/would be found from a search within Word. \nIs there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not...
When using the Entity Framework, does ESQL perform better than Linq to Entities? I'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I would like to get a full idea of the pro's/con's of using either method.
When comparing Entity SQL (ESQL) and LINQ to Entities in the context of Entity Framework, there are several factors to consider in terms of performance, usability, and features. Here’s a breakdown of the pros and cons of both approaches: ### LINQ to Entities #### Pros: 1. **Strongly Typed Queries**: Since LINQ is int...
6,238
[ { "from": "human", "value": "When using the Entity Framework, does ESQL perform better than Linq to Entities? \nI'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I would like to get a full idea o...
Is it possible to use the Asp.Net MVC framework within SharePoint sites?
Yes, it is possible to use the ASP.NET MVC framework within SharePoint sites, but there are some considerations and limitations to keep in mind. ### 1. **SharePoint Add-ins / SharePoint Framework**: - You can create SharePoint Add-ins (formerly called Apps) that can use ASP.NET MVC. These add-ins run outside the Sh...
11,703
[ { "from": "human", "value": "Is it possible to use the Asp.Net MVC framework within SharePoint sites?\n" }, { "from": "gpt", "value": "Yes, it is possible to use the ASP.NET MVC framework within SharePoint sites, but there are some considerations and limitations to keep in mind.\n\n### 1. **Shar...
Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).
Compiling Cairo and its dependencies (libpng, zlib, and pixman) using Visual C++ involves several steps. Here is a guide on how to do that: ### Prerequisites 1. **Visual Studio**: Make sure you have a compatible version of Visual Studio installed. Visual Studio 2015 or later is recommended as they support modern C++ ...
5,047
[ { "from": "human", "value": "Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008.\nSo, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).\n" }, { ...
I've been somewhat spoiled using Eclipse and java. I started using vim to do C coding in a linux environment, is there a way to have vim automatically do the proper spacing for blocks? So after typing a { the next line will have 2 spaces indented in, and a return on that line will keep it at the same indentation, an...
Yes, you can configure Vim to automatically handle indentation and spacing for C coding (or any other programming language) by setting appropriate options in your Vim configuration file (`.vimrc`). Here’s how you can set up Vim to achieve the indentation behavior you described: 1. **Open your `.vimrc` file**: This fil...
10,329
[ { "from": "human", "value": "I've been somewhat spoiled using Eclipse and java. I started using vim to do C coding in a linux environment, is there a way to have vim automatically do the proper spacing for blocks? \nSo after typing a { the next line will have 2 spaces indented in, and a return on that lin...
I need a pure .Net persistent hashtable/binarytree, functionally similar to berkeley-db Java edition. Functionally it should opperate in a similar maner to a DHT such memcached and velocity etc but it doesn't have to be distributed. In essence I am looking for a persistent hashtable. Does anyone have any ideas or sugg...
If you're looking for a pure .NET solution that provides a persistent hashtable or a similar data structure, you have several options. Here are a few suggestions that could fit your requirements: 1. **LiteDB**: - LiteDB is a lightweight, serverless, and simple NoSQL database for .NET. It uses a BSON document store ...
8,984
[ { "from": "human", "value": "I need a pure .Net persistent hashtable/binarytree, functionally similar to berkeley-db Java edition.\nFunctionally it should opperate in a similar maner to a DHT such memcached and velocity etc but it doesn't have to be distributed. In essence I am looking for a persistent has...
I have create a WCF service and am utilising netMsmqBinding binding. This is a simple service that passes a Dto to my service method and does not expect a response. The message is placed in an MSMQ, and once picked up inserted into a database. What is the best method to make sure no data is being lost. I have tried the...
To ensure that no data is lost when using a WCF service with MSMQ and to implement your desired error handling strategy, you will need to handle message processing failures effectively. Unfortunately, your setup on Windows XP and Windows Server 2003 with MSMQ 3.0 limits some of the newer features for handling poison me...
8,782
[ { "from": "human", "value": "I have create a WCF service and am utilising netMsmqBinding binding.\nThis is a simple service that passes a Dto to my service method and does not expect a response. The message is placed in an MSMQ, and once picked up inserted into a database.\nWhat is the best method to make s...
I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in .NET. I'm not having any problems retrieving data from the database, but what do real people do when they need to edit data and put it b...
Transitioning from VB6/Access to .NET and SQL Server can indeed seem overwhelming, but there are robust tools and frameworks within .NET that simplify working with databases. The following are some common approaches and best practices for editing, updating, and appending data to a SQL Server database in a .NET applicat...
3,950
[ { "from": "human", "value": "I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in .NET. \nI'm not having any problems retrieving data from the database, but what do real people d...
Every time a user posts something containing < or > in a page in my web application, I get this exception thrown. I don't want to go into the discussion about the smartness of throwing an exception or crashing an entire web application because somebody entered a character in a text box, but I am looking for an elegant ...
To handle HTML-encoded characters in your web application gracefully while ensuring security and preventing exceptions when users submit text containing `<` or `>`, you can follow a few approaches. Below is a recommended solution: ### 1. Use a Custom HTTP Module You can create a custom HTTP module to intercept incomi...
8,350
[ { "from": "human", "value": "Every time a user posts something containing < or > in a page in my web application, I get this exception thrown.\nI don't want to go into the discussion about the smartness of throwing an exception or crashing an entire web application because somebody entered a character in a ...
I want to write a tool that helps me search pdf/chm/djvu files in linux. Any pointers on how to go about it? The major problem is reading/importing data from all these files. Can this be done with C and shell scripting?
Creating a tool to search through PDF, CHM, and DJVU files on Linux can be a rewarding project. To accomplish this, you will need to handle reading the different file formats, extracting text from them, and then implementing a search mechanism. Here's how you can approach the project: ### 1. Understanding File Formats...
7,084
[ { "from": "human", "value": "I want to write a tool that helps me search pdf/chm/djvu files in linux. Any pointers on how to go about it? \nThe major problem is reading/importing data from all these files. Can this be done with C and shell scripting? \n" }, { "from": "gpt", "value": "Creating a ...
I have a page results page (you get there after submitting your search query elsewhere) whit a whole bunch of gridviews for different type of data objects. Obviously, some of the queries take longer than the others. How can I make each gridview render as soon as it has the data it needs? This has been tricky for me bec...
To achieve the behavior where each GridView renders as soon as it has the data it needs, while considering both Page Load and Postback events, you may need to implement a few changes in your approach. Since the standard ObjectDataSource does indeed bind automatically during page load and postback, you'll need to take s...
8,692
[ { "from": "human", "value": "I have a page results page (you get there after submitting your search query elsewhere) whit a whole bunch of gridviews for different type of data objects.\nObviously, some of the queries take longer than the others. How can I make each gridview render as soon as it has the data...
I'm writing an interactive function that I'd like to have remember the last argument the user supplied and use it as the default. (defun run-rake (param) (interactive "sTask: ") (shell-command (format "rake %s" task))) The first time the function is invoked I want it to remember the argument the user supplied so...
To create an interactive function in Emacs Lisp that remembers the last argument supplied by the user, you can utilize a variable to store the last input. This variable will be checked when the function is called to determine if it should use the stored value as the default argument. Here’s how you can modify your `r...
11,440
[ { "from": "human", "value": "I'm writing an interactive function that I'd like to have remember the last argument the user supplied and use it as the default. \n(defun run-rake (param)\n (interactive \"sTask: \")\n (shell-command (format \"rake %s\" task)))\n\nThe first time the function is invoked I wan...
I've added a callback to an IHTMLElement instance but when the IDispatch::Invoke is called for the event, there are never any arguments (i.e. the pDispParams->cArgs and pDispParams->cNamedArgs are always 0). For example, I add a callback for an onmouseup event. From what I can tell, a callback for this event is suppose...
When working with events in MSHTML and specifically using `IDispatch` for event callbacks, it's important to understand how the parameters are passed when an event occurs. In the case of events like `onmouseup`, it is indeed correct that the event handler should typically receive an event object (like `MouseEvent`). Ho...
8,172
[ { "from": "human", "value": "I've added a callback to an IHTMLElement instance but when the IDispatch::Invoke is called for the event, there are never any arguments (i.e. the pDispParams->cArgs and pDispParams->cNamedArgs are always 0). For example, I add a callback for an onmouseup event. From what I can t...
I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me? I was writing it like this: &:visited:hover attribute: foo
In SASS, you're on the right track with using the `&` selector to refer to the current element, but the pseudo-classes for visited and hover states should be applied in a different order. The way you wrote it implies a nested selector that doesn't quite work as intended. You want to create a rule that applies styles t...
12,885
[ { "from": "human", "value": "I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me?\nI was writing it like this:\n &:visited:hover\n attribute: foo\n\n" }, { "from": "gpt", ...
I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is the best way to do it? I'm thinking about including this file as a resource, then parse it at a runtime with regex to recover version number, but may...
Given your constraints, there are a few approaches you could take to use the version number defined in your C++ header file within your C# project. Here are some recommendations: ### 1. Preprocessing Step with a Script Create a simple script (in Python, PowerShell, or any other language you're comfortable with) that r...
9,943
[ { "from": "human", "value": "I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is the best way to do it?\nI'm thinking about including this file as a resource, then parse it at a runtime wit...
I'm fresh out of college and have been working in C++ for some time now. I understand all the basics of C++ and use them, but I'm having a hard time grasping more advanced topics like pointers and classes. I've read some books and tutorials and I understand the examples in them, but then when I look at some advanced ...
It's completely normal to struggle with advanced concepts like pointers and classes in C++, especially when transitioning from basic to more complex programming. Many developers face this challenge, and there are several strategies and resources that can help you improve your understanding. ### Strategies to Improve Y...
9,335
[ { "from": "human", "value": "I'm fresh out of college and have been working in C++ for some time now. I understand all the basics of C++ and use them, but I'm having a hard time grasping more advanced topics like pointers and classes. I've read some books and tutorials and I understand the examples in the...
I have the ISO week and year but how do I correctly convert that into two dates representing the start and end of that week?
To convert an ISO week and year into the start and end dates of that week, you can follow these steps: 1. **Understand ISO Weeks**: In the ISO calendar system, weeks start on Monday and the first week of the year is the week that contains the first Thursday of the year. This means that the week can sometimes belong to...
8,520
[ { "from": "human", "value": "I have the ISO week and year but how do I correctly convert that into two dates representing the start and end of that week?\n" }, { "from": "gpt", "value": "To convert an ISO week and year into the start and end dates of that week, you can follow these steps:\n\n1. ...
I came across a controller in an older set of code (Rails 1.2.3) that had the following in a controller: class GenericController > ApplicationController # filters and such model :some_model Although the name of the model does not match the name of the model, is there any reason to specify this? Or is this som...
In Rails 1.2.3, the `model` method is not a standard method provided by Rails itself; it is likely a custom method defined within the application or a part of a specific plugin. The purpose of declaring a model in this manner would depend on the implementation of that custom method. In later versions of Rails, especia...
9,682
[ { "from": "human", "value": "I came across a controller in an older set of code (Rails 1.2.3) that had the following in a controller:\nclass GenericController > ApplicationController\n # filters and such\n model :some_model\n\nAlthough the name of the model does not match the name of the model, is the...
I want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with a dynamically assigned new open TCP port. I know that TcpClient will assign a new client side port when I open a connection to a given server. Is there a simple way to find the next open TCP port in .NET? I need the actual number...
To dynamically find an open TCP port in .NET, you can create a temporary `TcpListener` and retrieve the assigned port number before closing it. This is an effective way to ensure that you get an available port without having to manually check each one. Below is a code example demonstrating how to find an open TCP port ...
11,360
[ { "from": "human", "value": "I want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with a dynamically assigned new open TCP port.\nI know that TcpClient will assign a new client side port when I open a connection to a given server.\nIs there a simple way to find the next open...
I have a script which contacts a few sources and tell them "the IP-address XXX.XXX.XXX.XXX is my current one". My test web server has a dynamic IP-address through DHCP and amongst other things it needs to update a DDNS entry when its IP-address changes. However it's not the only thing it does, so I will need to run my ...
Yes, you can indeed run a custom script using `dhclient` hooks to update your DDNS entry whenever your server's IP address changes. In `dhclient`, you can utilize the `dhclient-exit-hooks` and `dhclient-enter-hooks` to run custom scripts. ### Steps to create a custom script: 1. **Create Your Custom Script:** Crea...
7,907
[ { "from": "human", "value": "I have a script which contacts a few sources and tell them \"the IP-address XXX.XXX.XXX.XXX is my current one\". My test web server has a dynamic IP-address through DHCP and amongst other things it needs to update a DDNS entry when its IP-address changes. However it's not the on...
Is there a tool for Windows XP and Vista (built-in or otherwise ideally freeware/OSS) that can notify the user when the CPU is above a (configurable) threshold for some (configurable) duration? I am particularly interested in a minimalist tool that fits the following bill and in order of importance (which a lot of the ...
Finding a minimalist tool that meets all of your criteria for monitoring CPU usage on Windows XP and Vista can be challenging, but there are a few options you could consider. Here are some recommendations: 1. **Process Lasso**: - **Description**: While primarily a process management tool that allows users to contro...
10,406
[ { "from": "human", "value": "Is there a tool for Windows XP and Vista (built-in or otherwise ideally freeware/OSS) that can notify the user when the CPU is above a (configurable) threshold for some (configurable) duration?\nI am particularly interested in a minimalist tool that fits the following bill and i...
I've been trying to figure this out for about two weeks. I'm able to create email items in people's folders, read the folders, all that stuff but for the life of me I can not get anything to work with the calendars. I can provide examples of the XML I'm sending to WebDav but hoping someone out there has done this and h...
Working with calendars in WebDAV can be challenging due to the complexity of the calendar data and the specific requirements of the WebDAV protocol. If you're trying to create or manipulate calendar items through a WebDAV interface, it usually involves sending properly formatted XML requests. Here is a basic outline o...
7,156
[ { "from": "human", "value": "I've been trying to figure this out for about two weeks. I'm able to create email items in people's folders, read the folders, all that stuff but for the life of me I can not get anything to work with the calendars.\nI can provide examples of the XML I'm sending to WebDav but ho...
I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding? E.g. <?xml version="1.0" encoding="utf-8"?> <xml> <value>受</value> </xml> to <?xml version="1.0" encoding="Windows-1252"?> <xml> <value>&#27544;</value> </xml> I deserialize the XML and then attem...
When dealing with XML containing Unicode characters, it's important to remember that ANSI encoding (like Windows-1252) cannot represent all Unicode characters. If the XML includes characters outside of the ANSI range, they will often be replaced with question marks (`?`) when serialized. In your case, the character "受...
8,440
[ { "from": "human", "value": "I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?\nE.g.\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xml>\n<value>受</value>\n</xml>\n\nto\n<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<xml>\n<value>&#...
Why is it that they decided to make String immutable in Java and .NET (and some other languages)? Why didn't they make it mutable?
The decision to make strings immutable in languages like Java and .NET comes from several design considerations that prioritize safety, performance, and simplicity. Here are some of the key reasons why immutability was chosen: ### 1. **Thread Safety** - **Concurrency**: Immutable objects are inherently thread-safe. Wh...
9,809
[ { "from": "human", "value": "Why is it that they decided to make String immutable in Java and .NET (and some other languages)? Why didn't they make it mutable?\n" }, { "from": "gpt", "value": "The decision to make strings immutable in languages like Java and .NET comes from several design consid...
Our project uses Cruise Control to both build and hot deploy a web application to a remote server (via FTP) running Tomcat in the form of a .war file. Unfortunately, "hot" deploys don't appear to work properly, causing us to reboot Tomcat in response to each deployment. We would really like to do this auto-magically,...
Automating the restart of Tomcat after deploying a .war file can be done by creating a batch script that handles both the deployment via FTP and the Tomcat restart. You can then configure CruiseControl to execute this script after the build process. Here’s a high-level approach you can follow: ### Step 1: Create a Ba...
9,570
[ { "from": "human", "value": "Our project uses Cruise Control to both build and hot deploy a web application to a remote server (via FTP) running Tomcat in the form of a .war file. Unfortunately, \"hot\" deploys don't appear to work properly, causing us to reboot Tomcat in response to each deployment. We w...
When I first started using revision control systems like CVS and SVN, I didn't really understand the concepts of the "trunk", branching, merging and tagging. I'm now starting to understand these concepts, and really get the importance and power behind them. So, I'm starting to do it properly. Or so I think... This is w...
It's great to see you diving deeper into version control concepts! You're on the right track with your understanding of trunk, branches, merging, and tagging. Let's clarify these concepts further and refine your repository layout in the context of using Subversion (SVN). ### Key Concepts: 1. **Trunk**: The main line ...
7,032
[ { "from": "human", "value": "When I first started using revision control systems like CVS and SVN, I didn't really understand the concepts of the \"trunk\", branching, merging and tagging. I'm now starting to understand these concepts, and really get the importance and power behind them.\nSo, I'm starting t...
I'm actually working at MOSS 2007 project where I have to import data from an external data source (WebService) via an application in the Business Data Catalog. The application definition was created with BDC Meta Man and was imported successfully into the Business Data Catalog without any errors. I've first tested th...
Hi Flo, It sounds like you're encountering a frustrating issue with the Business Data Catalog (BDC) in MOSS 2007 where your external data source is not appearing in the BDC web parts for certain sites. Here are some steps and considerations that may help you troubleshoot and potentially resolve this issue: 1. **Check...
8,505
[ { "from": "human", "value": "I'm actually working at MOSS 2007 project where I have to import data from an external data source (WebService) via an application in the Business Data Catalog. The application definition was created with BDC Meta Man and was imported successfully into the Business Data Catalog ...
What is best practises for communicating events from a usercontrol to parent control/page i want to do something similar to this: MyPage.aspx: <asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceholder" runat="server"> <uc1:MyUserControl ID="MyUserControl1" runat="server" OnSomeEvent="MyUserControl...
The approach you’re using for event handling in your User Control is indeed a common and effective practice. However, there are some best practices and improvements you can consider to make your implementation more robust and maintainable. ### Best Practices for Communicating Events from a User Control to a Parent Con...
9,514
[ { "from": "human", "value": "What is best practises for communicating events from a usercontrol to parent control/page i want to do something similar to this:\nMyPage.aspx:\n<asp:Content ID=\"Content1\" ContentPlaceHolderID=\"MainContentPlaceholder\" runat=\"server\">\n <uc1:MyUserControl ID=\"MyUserContro...
I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid. Basically, in my editor, I have a Save button and this TreeView control: what I want is when I am editing a node's label in the TreeView, if I click on the ...
To commit the label you are editing in a `TreeView` control when clicking the Save button, you can handle the editing process manually. The typical approach involves listening for the edit action in the `TreeView`, and when the Save button is clicked, checking if there is an active editing session. Here's a general ap...
6,903
[ { "from": "human", "value": "I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid.\nBasically, in my editor, I have a Save button and this TreeView control: what I want is when I am editing a node's...