instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm developing an application with two windows:
Window 1: Renders direct draw surfaces
Window 2: I'd like to have it do pure OpenGL calls
I don't want to mix OpenGL and DirectDraw in the same window.
I see from the Open GL FAQ (http://www.opengl.org/resources/faq/technical/mswindows.htm) that you can't mix the API ca... | Yes, it is entirely possible for a single application to have one window using DirectDraw and another window using OpenGL. The key point is that each window is separate and can utilize its own rendering context and API without interfering with one another.
Here's a general approach you can follow to implement this:
1... | 34,221 | [
{
"from": "human",
"value": "I'm developing an application with two windows:\n\nWindow 1: Renders direct draw surfaces\nWindow 2: I'd like to have it do pure OpenGL calls\n\nI don't want to mix OpenGL and DirectDraw in the same window.\nI see from the Open GL FAQ (http://www.opengl.org/resources/faq/technic... |
I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example:
$(function() {
$('div._Foo').bind("mouseover", function(e) {
// Do something exciting
});
});
Of course, this works fine the first time the pag... | When dealing with ASP.NET UpdatePanels and jQuery, the challenge arises because the content inside the UpdatePanel is replaced during partial page updates, which can lead to event handlers being lost after the first load. To ensure your jQuery event handlers remain effective after any partial postbacks, you should bind... | 34,097 | [
{
"from": "human",
"value": "I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example:\n$(function() { \n $('div._Foo').bind(\"mouseover\", function(e) {\n // Do something exciting\n }); \n});\n\... |
The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message:
You can either make the non static method static or make an instance of that class to use its properties.
What the reason behind this? Am not ... | The error you're encountering stems from the distinction between **instance methods** and **static methods** in object-oriented programming, particularly in languages like Java.
### Reason Behind the Error
1. **Instance Methods vs. Static Methods**:
- **Instance Methods**: These methods belong to an instance of a ... | 35,179 | [
{
"from": "human",
"value": "The very common beginner mistake is when you try to use a class property \"statically\" without making an instance of that class. It leaves you with the mentioned error message:\n\nYou can either make the non static method static or make an instance of that class to use its prop... |
UDDI is for locating services on the Internet. Is there anything similar for locating services in a corporate or enterprise environment? For example I might want my program to be able to find a central reporting or policy server without configuration. Is this something I can do with Active Directory? Or do I need to do... | Yes, there are several approaches you can take to locate services in a corporate or enterprise environment, and Active Directory (AD) can indeed be one of those mechanisms, though there are alternatives and complementary solutions.
### Using Active Directory
1. **Service Discovery through AD**: Active Directory can b... | 32,915 | [
{
"from": "human",
"value": "UDDI is for locating services on the Internet. Is there anything similar for locating services in a corporate or enterprise environment? For example I might want my program to be able to find a central reporting or policy server without configuration. Is this something I can do ... |
I'm working on a project and I want to store some easily enumerated information in a table. MySql's enum data type does exactly what I want: http://dev.mysql.com/doc/refman/5.0/en/enum.html . Is there an equivalent in SQL Server 2005?
I know I could store the possible values in a type table with a key, but I'd rather... | SQL Server does not have a direct equivalent to MySQL's `ENUM` data type. However, there are a couple of alternatives you can consider for achieving similar functionality in SQL Server 2005:
1. **Use Check Constraints**: You can create a column of type `VARCHAR` (or `CHAR`) and use a `CHECK` constraint to restrict its... | 34,938 | [
{
"from": "human",
"value": "I'm working on a project and I want to store some easily enumerated information in a table. MySql's enum data type does exactly what I want: http://dev.mysql.com/doc/refman/5.0/en/enum.html . Is there an equivalent in SQL Server 2005?\nI know I could store the possible values ... |
How does one combine several resources for an application (images, sounds, scripts, xmls, etc.) into a single/multiple binary file so that they're protected from user's hands? What are the typical steps (organizing, loading, encryption, etc...)?
This is particularly common in game development, yet a lot of the game fra... | Combining resources into a binary file while protecting them from easy access is a common practice in game development and software distribution. Here’s a general approach outlining the steps you might follow:
### Step 1: Organizing Resources
1. **Organize your assets**: Create a structured directory for all your asse... | 27,884 | [
{
"from": "human",
"value": "How does one combine several resources for an application (images, sounds, scripts, xmls, etc.) into a single/multiple binary file so that they're protected from user's hands? What are the typical steps (organizing, loading, encryption, etc...)?\nThis is particularly common in g... |
I've created a c# webservice that allows our front end support teams to view and update a few selected Active Directory values using system.directoryservices
Fields that I want to update are [job] title, department, telephone and employeeid.
I can use a service account with "delegates rights" to update [job] title, dep... | To update the `employeeID` attribute in Active Directory (AD), you need to ensure that the account you're using has the appropriate permissions to modify that specific attribute. Here’s a general approach you can take to troubleshoot and resolve the issue:
### Steps to Resolve Permission Issues
1. **Identify Attribut... | 32,835 | [
{
"from": "human",
"value": "I've created a c# webservice that allows our front end support teams to view and update a few selected Active Directory values using system.directoryservices\nFields that I want to update are [job] title, department, telephone and employeeid.\nI can use a service account with \"... |
Suppose I have this Windows wchar_t string:
L"\x4f60\x597d"
and
L"\x00e4\x00a0\x597d"
and would like to convert it (not necessarily programmatically; it will be a one-time thing) to GCC/Linux wchar_t format, which is UTF-32 AFAIK. How do I do it? (a general explanation would be nice, but example based on this concret... | To convert a wide character string from the Windows `wchar_t` format (UTF-16) to the GCC/Linux `wchar_t` format (UTF-32), you need to follow these general steps:
1. **Understand the Input**: The Windows `wchar_t` format uses UTF-16 encoding. Characters are represented as UTF-16 code units, where some characters can be... | 26,897 | [
{
"from": "human",
"value": "Suppose I have this Windows wchar_t string:\nL\"\\x4f60\\x597d\"\n\nand\nL\"\\x00e4\\x00a0\\x597d\"\n\nand would like to convert it (not necessarily programmatically; it will be a one-time thing) to GCC/Linux wchar_t format, which is UTF-32 AFAIK. How do I do it? (a general expl... |
I am developing an application using Windows Mobile 5.0, under embedded VC++ 4.0, and using the emulator for debugging. I need to copy some files onto the emulator and planned on using the option to map a directory to the emulator storage card. Problem is, this option is greyed out when I run the emulator. From the e... | To enable the mapping of a directory to the emulator's storage card in the Windows Mobile 5.0 emulator, you'll need to follow a few steps to ensure that your emulator is properly configured to allow this feature. Here's how you can do that:
### Step 1: Start the Emulator with Shared Folder Option
1. **Close the Emula... | 29,925 | [
{
"from": "human",
"value": "I am developing an application using Windows Mobile 5.0, under embedded VC++ 4.0, and using the emulator for debugging. I need to copy some files onto the emulator and planned on using the option to map a directory to the emulator storage card. Problem is, this option is greye... |
As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window.
#!/usr/bin/env php
<?php
echo str_repeat('=', ???);
or
#!/usr/bin/env python
print '=' * ???
or
#!/usr/bin/env bash
x=0
while [ $x -lt ??? ]; do echo -n '='; let x=$x+1 done; echo
| To print an equal sign (`=`) across the entire width of the terminal window, you'll need to determine the terminal's width dynamically. Below are examples for PHP, Python, and Bash scripts that achieve this.
### PHP Script
To get the terminal width in PHP, you can use the `shell_exec` function to run the `tput cols` c... | 35,242 | [
{
"from": "human",
"value": "As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window.\n#!/usr/bin/env php\n<?php\necho str_repeat('=', ???);\n\nor\n#!/usr/bin/env python\nprint '=' * ???\n\nor\n#!/usr/bin/env bash\nx=0\nwhile [ $x -lt ??? ]; do echo... |
I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application.
I have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse the site in a web-browser, I am prompted f... | To resolve the issue of being prompted for a password while trying to access your ASP.NET 2.0 web service application on IIS, you can follow these steps to configure your IIS settings correctly:
1. **Check Anonymous Authentication Settings:**
Make sure that anonymous authentication is enabled for your virtual direc... | 24,791 | [
{
"from": "human",
"value": "I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application. \nI have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse ... |
I am looking to use/connect to a different database for one of my controllers and one model. I posted this hear since on the forums of CI I am getting no response.
I added this in database.php:
$db['tdb']['hostname'] = "localhost";//localhost
$db['tdb']['username'] = "username";//root
$db['tdb']['password'] = "passwo... | You're on the right track with setting up your model to connect to a different database in CodeIgniter. However, the main issue causing the error is that the `$tdb` variable is defined inside the constructor but not made accessible to other methods in the class. Here's how you can fix it:
1. **Define `$tdb` as a class... | 35,535 | [
{
"from": "human",
"value": "I am looking to use/connect to a different database for one of my controllers and one model. I posted this hear since on the forums of CI I am getting no response.\nI added this in database.php:\n$db['tdb']['hostname'] = \"localhost\";//localhost\n\n$db['tdb']['username'] = \"us... |
Cells in DataGridViewComboBoxColumn have ComboBoxStyle DropDownList. It means the user can only select values from the dropdown. The underlying control is ComboBox, so it can have style DropDown. How do I change the style of the underlying combo box in DataGridViewComboBoxColumn. Or, more general, can I have a column i... | In a `DataGridViewComboBoxColumn`, when you set the `ComboBoxStyle` to `DropDownList`, it restricts users to select only from the predefined options without the ability to type in custom values. If you want to allow users to both select from a list and also enter custom values, you will need to change the `ComboBox` st... | 31,063 | [
{
"from": "human",
"value": "Cells in DataGridViewComboBoxColumn have ComboBoxStyle DropDownList. It means the user can only select values from the dropdown. The underlying control is ComboBox, so it can have style DropDown. How do I change the style of the underlying combo box in DataGridViewComboBoxColumn... |
I've got an SQL query that looks like this:
INSERT INTO DB..incident
(
incident_number --nvarchar(10)
)
VALUES
(
N'I?'
)
What does the ? do in the value statement?
EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on insert (we've got a bit of a messed up DB.) G... | In SQL Server, the `?` character itself doesn't have any special meaning and will simply be treated as a literal character when inserted into a string. In the context of your query, `N'I?'` is an `nvarchar` value that contains the characters `I` and `?`.
However, your note about triggers and custom datatypes suggests ... | 35,707 | [
{
"from": "human",
"value": "I've got an SQL query that looks like this:\nINSERT INTO DB..incident\n( \n incident_number --nvarchar(10)\n)\nVALUES \n(\n N'I?'\n)\n\nWhat does the ? do in the value statement?\nEDIT:: Turns out there's some funny business via triggers and custom datatypes that oc... |
I have a table named Info of this schema:
int objectId;
int time;
int x, y;
There is a lot of redundant data in the system - that is, objectId is not UNIQUE. For each objectId there can be multiple entries of time, x, y.
I want to retrieve a list of the latest position of each object. I started out with this query:
SE... | To retrieve the latest position of each object from the `Info` table while ensuring good performance, especially with a large dataset, the best approach is to use a subquery combined with a JOIN, which you've correctly implemented in your tests.
Here’s an optimized query that should yield the desired result:
```sql
S... | 31,707 | [
{
"from": "human",
"value": "I have a table named Info of this schema:\nint objectId;\nint time;\nint x, y;\n\nThere is a lot of redundant data in the system - that is, objectId is not UNIQUE. For each objectId there can be multiple entries of time, x, y.\nI want to retrieve a list of the latest position of... |
Instead of hardcoding the default @author template I would like Eclipse to use user's real name taken from account information (in Linux - but Windows solution is also welcome). Entering it somewhere into Eclipse configuration would be acceptable, too, alas I can't find the right place.
| To configure Eclipse to use your real name as the default `@author` template in comments, you can follow these steps for both Linux and Windows:
### Step 1: Configure Eclipse User Information
1. **Open Eclipse**.
2. Go to **Window > Preferences** (on Windows/Linux) or **Eclipse > Preferences** (on macOS).
3. In the P... | 28,656 | [
{
"from": "human",
"value": "Instead of hardcoding the default @author template I would like Eclipse to use user's real name taken from account information (in Linux - but Windows solution is also welcome). Entering it somewhere into Eclipse configuration would be acceptable, too, alas I can't find the righ... |
I am trying to achieve anonymous personalization in a ASP.net environment. I know that ASP.NET 2.0 provide Profile. However, I want to avoid traffic to the database as much as possible since the site I am working on is a relatively high traffic site.
The other obvious solution is cookie, but given the limitation of co... | To achieve anonymous personalization effectively in an ASP.NET environment while minimizing database traffic, using cookies is a practical approach. Here are some considerations and strategies for storing campaign information in cookies efficiently:
### 1. Cookie Structure
To avoid cookie bloat and manage the stored ... | 23,431 | [
{
"from": "human",
"value": "I am trying to achieve anonymous personalization in a ASP.net environment. I know that ASP.NET 2.0 provide Profile. However, I want to avoid traffic to the database as much as possible since the site I am working on is a relatively high traffic site.\nThe other obvious solution... |
What is the best way to add "copy to clipboard" functionality to a ListView control in WPF?
I tried adding an ApplicationCommands.Copy to either the ListView ContextMenu or the ListViewItem ContextMenu, but the command remains disabled.
Thanks,
Peter
Here is an xaml sample of one of my attempts...
<Window.Resources>
... | To implement a "Copy to Clipboard" functionality in a WPF ListView (or ListBox) using the `ApplicationCommands.Copy`, you need to ensure that the command is properly bound to the right target. In this case, you'll want to set up a command handler that retrieves the selected item's data and copies it to the clipboard.
... | 30,031 | [
{
"from": "human",
"value": "What is the best way to add \"copy to clipboard\" functionality to a ListView control in WPF?\nI tried adding an ApplicationCommands.Copy to either the ListView ContextMenu or the ListViewItem ContextMenu, but the command remains disabled.\nThanks,\nPeter\nHere is an xaml sample... |
I have a client sending me requests without HTTP chunking (they use content-length). When my server responds, chunking is enabled, and the client can't handle this - even though they should be able to as they are using HTTP 1.1.....
I have tried to disable chunking by removing the entry below from the axis2 config ... | When you're dealing with HTTP responses in a Tomcat and Axis2 setup, it's essential to ensure that both the server configuration and the application settings are aligned. If you're encountering issues where responses are still being sent in chunked encoding despite attempting to disable it in the Axis2 configuration, t... | 33,430 | [
{
"from": "human",
"value": "I have a client sending me requests without HTTP chunking (they use content-length). When my server responds, chunking is enabled, and the client can't handle this - even though they should be able to as they are using HTTP 1.1..... \nI have tried to disable chunking by remov... |
I remember reading somewhere that you can provide your own icons without having them pass them through the automatic gloss effect when compiling an iphone app, but I can't remember how to do it, and not sure where it was in the docs. Anyone here remembers?
thanks!
| To provide your own icons for an iPhone app without them being processed through the automatic gloss effect, you need to make sure to include the appropriate settings in your app's Info.plist file. Here's how you can do it:
1. **Create Your Icons:** Prepare your icons at the appropriate sizes. For iOS, this typically ... | 29,241 | [
{
"from": "human",
"value": "I remember reading somewhere that you can provide your own icons without having them pass them through the automatic gloss effect when compiling an iphone app, but I can't remember how to do it, and not sure where it was in the docs. Anyone here remembers?\nthanks!\n"
},
{
... |
I would like to embed Flash Player directly inside a C++ or Java application.
I found an article that describes how to do this for C#:
http://www.adobe.com/devnet/flash/articles/stock_history03.html
Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing me to... | Embedding Flash Player directly in a C++ application, especially for Windows, involves interacting with COM (Component Object Model) and ActiveX controls. Since Adobe Flash Player has been deprecated and is no longer officially supported, I highly recommend looking for alternative solutions, especially if you plan to d... | 30,695 | [
{
"from": "human",
"value": "I would like to embed Flash Player directly inside a C++ or Java application.\nI found an article that describes how to do this for C#:\nhttp://www.adobe.com/devnet/flash/articles/stock_history03.html\nUnfortunately, I have no experience with C#, COM or ActiveX. I need someone t... |
I have some data in the following format:
Salary
Code InTime
1690 09:03:00
1690 09:13:00
1690 09:07:00
1691 08:48:00
1691 08:52:00
1691 08:50:00
1691 08:54:00
1691 08:46:00
1691 09:28:00
1691 08:59:00
1691 08:53:00
1691 09:02:00
1693 08:57:00
1693 09:01:00
1693 08:54... | Yes, you can automate the plotting of the "InTime" data for each salary code using Python, specifically with libraries like `pandas` for data manipulation and `matplotlib` or `seaborn` for visualization. Below, I’ll guide you through the process step by step.
### Step 1: Install Required Libraries
If you haven't insta... | 28,581 | [
{
"from": "human",
"value": "I have some data in the following format:\nSalary\nCode InTime \n1690 09:03:00\n1690 09:13:00\n1690 09:07:00\n1691 08:48:00\n1691 08:52:00\n1691 08:50:00\n1691 08:54:00\n1691 08:46:00\n1691 09:28:00\n1691 08:59:00\n1691 08:53:00\n1691 0... |
I'm using DotNetNuke, so the whole site is basically dynamically driven and I'm clueless to how to go about creating a Google sitemap for it.
Any help will be greatly appreciated.
| Creating a Google Sitemap for a DotNetNuke (DNN) site is a straightforward process, even though DNN sites are dynamic. Here are some steps to help you generate a sitemap effectively:
### 1. **Use a Sitemap Module**
The easiest way to create a sitemap in DotNetNuke is to use a sitemap module. Several modules are availa... | 30,763 | [
{
"from": "human",
"value": "I'm using DotNetNuke, so the whole site is basically dynamically driven and I'm clueless to how to go about creating a Google sitemap for it. \nAny help will be greatly appreciated.\n"
},
{
"from": "gpt",
"value": "Creating a Google Sitemap for a DotNetNuke (DNN) sit... |
We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.
This is the one we've been working to implement: ni... | You're correct in your assessment that the problem lies with how WYSIWYG editors initialize on the page. Typically, these editors rely on JavaScript that runs during the `window.onload` or when the DOM is fully ready to set up their UI components. In an ASP.NET application, when using `UpdatePanel`, partial postbacks d... | 32,760 | [
{
"from": "human",
"value": "We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.\nThis is t... |
Just wondering if there is any way to do the following:
public Interface IDataField
{
object GetValue();
}
public Interface IComplexDataField : IDataField
{
object GetDefaultValue();
}
public class MyBase
{
private IDataField _DataField;
public MyBase()
{
this._DataField = this.CreateDat... | The code you provided has a solid structure for handling different types of data fields using interfaces and inheritance in C#. However, you're facing a situation where the base class exposes a method `GetDataField()` that returns `IDataField`, but in the derived class `MyComplexBase`, you want to override this method ... | 34,224 | [
{
"from": "human",
"value": "Just wondering if there is any way to do the following:\npublic Interface IDataField \n{\n object GetValue();\n}\n\npublic Interface IComplexDataField : IDataField\n{\n object GetDefaultValue();\n}\n\npublic class MyBase\n{\n private IDataField _DataField;\n\n public... |
Basically, I have an iframe embedded in a page and the iframe has some JavaScript routines I need to invoke from the parent page.
Now the opposite is quite simple as you only need to call parent.functionName(), but unfortunately, I need exactly the opposite of that.
Please note that my problem is not changing the sourc... | To invoke a JavaScript function defined within an iframe from the parent page, you can follow these steps. However, it's important to note that this only works if both the parent page and the iframe are served from the same origin due to the same-origin policy in web browsers. If they are not from the same origin, you'... | 32,648 | [
{
"from": "human",
"value": "Basically, I have an iframe embedded in a page and the iframe has some JavaScript routines I need to invoke from the parent page.\nNow the opposite is quite simple as you only need to call parent.functionName(), but unfortunately, I need exactly the opposite of that.\nPlease not... |
I've recently seen occasional problems with stored procedures on a legacy system which displays error messages like this:
Server Message: Number 10901, Severity 17:
This query requires X auxiliary scan
descriptors but currently there are
only Y auxiliary scan descriptors
available. Either raise the value of... | The error message you're encountering in your Sybase database indicates that a query is requiring more auxiliary scan descriptors than are currently available. Auxiliary scan descriptors are part of the query execution environment, and they manage things like temporary storage for intermediate results, especially in co... | 32,206 | [
{
"from": "human",
"value": "I've recently seen occasional problems with stored procedures on a legacy system which displays error messages like this:\n\nServer Message: Number 10901, Severity 17: \n This query requires X auxiliary scan\n descriptors but currently there are\n only Y auxiliary scan desc... |
Question
My question is how can you teach the methods and importance of tidying-up and refactoring code?
Background
I was recently working on a code review for a colleague. They had made some modifications to a long-gone colleagues work. During the new changes, my colleague had tried to refactor items but gave up as so... | Teaching the methods and importance of tidying-up and refactoring code can be quite a rewarding experience, especially when you see a colleague grasp these concepts and improve their coding practices. Here are some strategies that could enhance the teaching process, based on your description of the situation:
### 1. *... | 24,484 | [
{
"from": "human",
"value": "Question\nMy question is how can you teach the methods and importance of tidying-up and refactoring code?\nBackground\nI was recently working on a code review for a colleague. They had made some modifications to a long-gone colleagues work. During the new changes, my colleague h... |
Is there a way to change all the numeric keys to "Name" without looping through the array (a native PHP function)?
[
0 => 'blabla',
1 => 'blabla',
2 => 'blblll',
// etc ...
]
| Yes, you can change all the numeric keys of an associative array in PHP to a specific string, such as "Name", without explicitly looping through the array by using the `array_values()` function along with the `array_map()` function. However, it's important to note that while you might not be explicitly using a loop, PH... | 35,524 | [
{
"from": "human",
"value": "Is there a way to change all the numeric keys to \"Name\" without looping through the array (a native PHP function)?\n[\n 0 => 'blabla',\n 1 => 'blabla',\n 2 => 'blblll',\n // etc ...\n]\n\n"
},
{
"from": "gpt",
"value": "Yes, you can change all the numer... |
I develop and maintain small intranet web apps written in JSP and Java.
They run on a Resin web server, without dedicated httpd like Apache.
Before performing maintenance, I activate a very simple Ajax message to urge users to logout.
What I want is, while I do maintenance, a user trying to log in to that particular ap... | In your scenario, where you want to display a maintenance message for a specific JSP web application while allowing other applications on the same Resin web server to remain operational, you can employ several best practices. Here’s a step-by-step guide to achieve this effectively:
### 1. Custom Error Page
You can cr... | 32,670 | [
{
"from": "human",
"value": "I develop and maintain small intranet web apps written in JSP and Java.\nThey run on a Resin web server, without dedicated httpd like Apache.\nBefore performing maintenance, I activate a very simple Ajax message to urge users to logout.\nWhat I want is, while I do maintenance, a... |
I got a quick question about running a directX application (C++) in a managed environment. I'm attempting to write a MDI tool (in C#) where the background of the parent window would be an embedded render window of directX (C++).
I've read ways that involved writing the C++ into a native dll, however it would be prefer... | Integrating a DirectX application written in C++ into a managed environment like a C# MDI tool can be achieved, though it presents some challenges. There are several approaches you can take to embed a DirectX rendering window into a C# application. Below are some steps and considerations:
### Option 1: Use a Native C+... | 31,090 | [
{
"from": "human",
"value": "I got a quick question about running a directX application (C++) in a managed environment. I'm attempting to write a MDI tool (in C#) where the background of the parent window would be an embedded render window of directX (C++). \nI've read ways that involved writing the C++ int... |
I am working on car dealership business domain model/UML class diagram.
I am new to modeling, so I would like to know how to validate the class diagram. It's very important for me to have an appropriate, if not 100 percent correct, class diagram to use further development (use cases, etc.).
Is it possible to build a co... | Validating a UML class diagram is crucial for ensuring that your model accurately represents the business domain you're working with. While it is certainly possible to create a model that is completely incorrect, more often you'll end up with models that are either appropriate or inappropriate based on various criteria... | 31,789 | [
{
"from": "human",
"value": "I am working on car dealership business domain model/UML class diagram.\nI am new to modeling, so I would like to know how to validate the class diagram. It's very important for me to have an appropriate, if not 100 percent correct, class diagram to use further development (use ... |
How do I configure SSRS/Windows Server 2003, so that I can setup email delivery via a remote SMTP server that requires username and password.
I can configure SSRS with an SMTP address and other parameters, but nowhere is it possible to configure it with smtp username and password.
I have hunted around, but can only fi... | Configuring SQL Server Reporting Services (SSRS) on Windows Server 2003 to send emails using a remote SMTP server that requires authentication can indeed be a challenge, as SSRS does not provide built-in options for SMTP authentication directly. However, you can work around this limitation by setting up an SMTP relay t... | 24,269 | [
{
"from": "human",
"value": "How do I configure SSRS/Windows Server 2003, so that I can setup email delivery via a remote SMTP server that requires username and password.\nI can configure SSRS with an SMTP address and other parameters, but nowhere is it possible to configure it with smtp username and passwo... |
I have an application which allows for multiple NSDocuments to be open. In this application is a single utility window that contains some functionality that I want to apply to the frontmost document.
I am trying to use bindings here, so the trick is how to cleanly bind the user interface of the utility window to the f... | You're grappling with a common challenge when building macOS applications that allow multiple documents to be open at once while maintaining a utility window that is dynamically bound to the frontmost document's model. You want a solution that maintains good structure, adheres to KVO principles, and allows for seamless... | 24,368 | [
{
"from": "human",
"value": "I have an application which allows for multiple NSDocuments to be open. In this application is a single utility window that contains some functionality that I want to apply to the frontmost document.\nI am trying to use bindings here, so the trick is how to cleanly bind the use... |
I need to build a little webapp but I'm not sure what is the best thing to do.
A person that subscribe the petition is signing an email sent to X. This will be also saved to a db in order to show online who subscribed.
The idea is to have a standard text message, the user submit his name and that name goes into the mes... | Building a web application for petition signing can be a great way to engage users and create awareness around a cause. However, as you've noted, there are several considerations to keep in mind regarding email authenticity, user experience, and implementation complexity. Here’s a breakdown of the two main approaches y... | 31,883 | [
{
"from": "human",
"value": "I need to build a little webapp but I'm not sure what is the best thing to do.\nA person that subscribe the petition is signing an email sent to X. This will be also saved to a db in order to show online who subscribed.\nThe idea is to have a standard text message, the user subm... |
We've used both JWebUnit and HttpUnit in the past to do functional tests of web applications. Both of them seem to have issues in handling javascript. We are not particularly interested in testing the javascript at this point, but JWebUnit and HttpUnit tests have broken since we added some small Ajax components (Dojo D... | If you're facing issues with JWebUnit and HttpUnit due to the addition of Ajax components and you're restricted from using browser-based testing tools like Selenium and Watir, there are still some options available to perform functional testing for your web applications without relying on a graphical browser.
1. **Htm... | 34,743 | [
{
"from": "human",
"value": "We've used both JWebUnit and HttpUnit in the past to do functional tests of web applications. Both of them seem to have issues in handling javascript. We are not particularly interested in testing the javascript at this point, but JWebUnit and HttpUnit tests have broken since we... |
Is this possible? I had troubles with SVN clients not being able to access the repository with the following error message:
Repository moved permanently to 'http://svn.example.com/test/'; please relocate
If I added the '/' to the end of the path I was trying to access, it just strips it off again, and shows the same ... | It looks like you're experiencing an issue with Apache's mod_dav_svn and its handling of SVN repository paths. From your description, it seems that when you change the `<Location>` directive from `/svn` to `/`, it causes issues with SVN clients and leads to the "Repository moved permanently" error.
### Why This Happen... | 32,278 | [
{
"from": "human",
"value": "Is this possible? I had troubles with SVN clients not being able to access the repository with the following error message:\n\nRepository moved permanently to 'http://svn.example.com/test/'; please relocate\n\nIf I added the '/' to the end of the path I was trying to access, it ... |
I have been trying to learn how to add testing to existing code -- currently reading reading Working Effectively With Legacy Code. I have been trying to apply some of the principles in JavaScript, and now I'm trying to extract an interface.
In searching for creating interfaces in JavaScript, I can't find a lot -- and ... | In JavaScript, the concept of "interfaces" is not as explicitly defined as it is in statically-typed languages like Java or C#. JavaScript is a dynamically-typed language, which means that you often work with objects and their shapes rather than enforcing specific interfaces. However, you can still achieve the concept ... | 28,569 | [
{
"from": "human",
"value": "I have been trying to learn how to add testing to existing code -- currently reading reading Working Effectively With Legacy Code. I have been trying to apply some of the principles in JavaScript, and now I'm trying to extract an interface.\nIn searching for creating interfaces... |
Obviously (methinks), creating an index on a BIT column is unnecessary. However, if you had a column that you need to search in which every value is likely unique, like BlogPost or StreetAddress or something, then an index seems appropriate (again, methinks).
But what's the cutoff? What if you expect 10,000 rows and yo... | When deciding whether to create an index on a database column, there are a few factors to consider, especially regarding the uniqueness and cardinality of the values in that column. Let's break down your question:
### 1. **Cardinality**:
- Cardinality refers to the uniqueness of the data in a column. High cardinali... | 34,149 | [
{
"from": "human",
"value": "Obviously (methinks), creating an index on a BIT column is unnecessary. However, if you had a column that you need to search in which every value is likely unique, like BlogPost or StreetAddress or something, then an index seems appropriate (again, methinks).\nBut what's the cut... |
I remember when MS was developing Cassini - I believe they rolled it into VS 05/08, so I think this is a Cassini web server question.
I am using Windows XP with Visual Studio 2008, and find it quite inconvenient when I want to test a web page/styling with multiple browsers and multiple OSes. Right now I have to depl... | To allow the integrated development web server (Cassini) in Visual Studio 2008 to be accessible from other computers on your network, you can follow these steps:
1. **Determine Your Machine's IP Address**:
- Open Command Prompt and type `ipconfig` to find your local IP address (usually starts with `192.168.x.x` or ... | 34,051 | [
{
"from": "human",
"value": "I remember when MS was developing Cassini - I believe they rolled it into VS 05/08, so I think this is a Cassini web server question. \nI am using Windows XP with Visual Studio 2008, and find it quite inconvenient when I want to test a web page/styling with multiple browsers an... |
I expected A::~A() to be called in this program, but it isn't:
#include <iostream>
struct A {
~A() { std::cout << "~A()" << std::endl; }
};
void f() {
A a;
throw "spam";
}
int main() { f(); }
However, if I change last line to
int main() try { f(); } catch (...) { throw; }
then A::~A() is called.
I am compil... | The behavior you are observing is indeed consistent with the C++ standard, and it's a result of how exceptions and stack unwinding work in C++.
### Explanation
In your first case:
```cpp
#include <iostream>
struct A {
~A() { std::cout << "~A()" << std::endl; }
};
void f() {
A a;
throw "spam"; // Exception th... | 31,954 | [
{
"from": "human",
"value": "I expected A::~A() to be called in this program, but it isn't:\n#include <iostream>\n\nstruct A {\n ~A() { std::cout << \"~A()\" << std::endl; }\n};\n\nvoid f() {\n A a;\n throw \"spam\";\n}\n\nint main() { f(); }\n\nHowever, if I change last line to \nint main() try { f(); }... |
Is there any way to change the ownership and permission mask for a semaphore on Unix systems directly from the command prompt, without deploying a special program that calls semctl with the IPC_SET option?
| On Unix systems, semaphores are typically managed through the System V IPC (Inter-Process Communication) facilities. The ownership and permission mask for a semaphore can be modified using the `semctl` system call with the `IPC_SET` command, but this requires a program to invoke it.
Unfortunately, there is no built-i... | 29,323 | [
{
"from": "human",
"value": "Is there any way to change the ownership and permission mask for a semaphore on Unix systems directly from the command prompt, without deploying a special program that calls semctl with the IPC_SET option?\n"
},
{
"from": "gpt",
"value": "On Unix systems, semaphores ... |
Does anyone know a good date parser for different languages/locales. The built-in parser of Java (SimpleDateFormat) is very strict. It should complete missing parts with the current date.
For example
if I do not enter the year (only day and month) then the current year should be used.
if the year is 08 then it shou... | For your requirements, you can consider using the Java library called **Java Time** (introduced in Java 8), which provides a more flexible and user-friendly API for date and time handling compared to `SimpleDateFormat`. However, to achieve the specific behavior you described (such as using the current year when it's mi... | 32,116 | [
{
"from": "human",
"value": "Does anyone know a good date parser for different languages/locales. The built-in parser of Java (SimpleDateFormat) is very strict. It should complete missing parts with the current date. \nFor example \n\nif I do not enter the year (only day and month) then the current year sho... |
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are:
Pool. This is a class which allocates memory efficiently, for some definition of 'efficient'. Pool is guaranteed to return a chunk of memory that is alig... | The main concern in the code you've presented is indeed about alignment and the usage of placement new with a raw memory buffer. Let's break down the alignment issues, particularly focusing on the `member_list_store_d` member in the `Aggregate` class and its interaction with the `Obj_list` class.
### Key Points on Ali... | 31,142 | [
{
"from": "human",
"value": "I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are:\n\nPool. This is a class which allocates memory efficiently, for some definition of 'efficient'. Pool is guarante... |
I've noticed that plenty of opensource project doesn't use BITWISE flags anymore, even if it's fully supported by programming enviroment common for web ( php/Mysql).
It's that a "lost practise" for some effective problem, or is just that a lot of php programmers don't know how to handle this type of implementation?
Not... | The declining use of bitwise flags in open-source projects, particularly in PHP and similar web environments, can be attributed to several factors, including shifts in programming paradigms, coding practices, and the evolution of web frameworks. Here are a few reasons for this trend:
### 1. **Increased Readability and... | 32,598 | [
{
"from": "human",
"value": "I've noticed that plenty of opensource project doesn't use BITWISE flags anymore, even if it's fully supported by programming enviroment common for web ( php/Mysql).\nIt's that a \"lost practise\" for some effective problem, or is just that a lot of php programmers don't know ho... |
I want a small (< 30MB) standalone Windows executable (a single file) that creates a window which asks the user for the location of a directory and then launches a different program in that directory.
This executable has to run on XP, Vista, Server 2003, and Server 2008 versions of Windows in 32-bits and 64 bits on x... | Creating a standalone Windows executable that prompts the user for a directory and then launches a program in that directory can be achieved using several approaches. Given your requirements, here are some options, including their viability based on your target systems (Windows XP, Vista, Server 2003, and Server 2008) ... | 32,834 | [
{
"from": "human",
"value": "I want a small (< 30MB) standalone Windows executable (a single file) that creates a window which asks the user for the location of a directory and then launches a different program in that directory. \nThis executable has to run on XP, Vista, Server 2003, and Server 2008 versi... |
I have a game in which you can score from -40 to +40 on each match.
Users are allowed to play any number of matches.
I want to calculate a total score that implicitly takes into account the number of matches played.
Calculating only the average is not fair.
For example, if Peter plays four games and gets 40 points on ... | To create a total score system that accounts for both the match scores and the number of matches played, we can adopt a weighted average approach that balances performance with participation.
One simple method to achieve this is to use a formula that includes both the average score and a penalty or reward based on the... | 33,008 | [
{
"from": "human",
"value": "I have a game in which you can score from -40 to +40 on each match.\nUsers are allowed to play any number of matches.\nI want to calculate a total score that implicitly takes into account the number of matches played.\nCalculating only the average is not fair. \nFor example, if ... |
I have this query statement and want to only get records that has a certain column empty (volunteers_2009.venue_id)
Table is volunteers_2009, column I am looking to see if it is empty: venue_id
Here is the current query:
SELECT volunteers_2009.id, volunteers_2009.comments,
volunteers_2009.choice1, volunteers_2009.c... | To retrieve records from the `volunteers_2009` table where the `venue_id` column is empty (or null), you need to place the `WHERE` clause before the `ORDER BY` clause in your SQL query. Additionally, you should use a single equals sign (`=`) instead of double equals (`==`).
Here’s how you can structure your query cor... | 34,571 | [
{
"from": "human",
"value": "I have this query statement and want to only get records that has a certain column empty (volunteers_2009.venue_id)\nTable is volunteers_2009, column I am looking to see if it is empty: venue_id\nHere is the current query:\nSELECT volunteers_2009.id, volunteers_2009.comments, \n... |
I have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.
I know how to connect to a single database using:
$dbh = mysql_connect($hostname, $username, $password)
or die("... | Yes, you can connect to multiple databases in a single PHP script using multiple `mysql_connect` (or `mysqli_connect` for improved functionality and security) commands. However, the `mysql_*` functions are deprecated and removed in PHP 7 and later, so it is recommended to use the `mysqli` or `PDO` extension for databas... | 33,021 | [
{
"from": "human",
"value": "I have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.\nI know how to connect to a single database using:\n$dbh = mysql_connect($hostna... |
I'm reading The C++ Programming Language. In it Stroustrup states that sizeof(char) == 1 and 1 <= sizeof(bool). The specifics depend on the implementation. Why would such a simple value as a boolean take the same space as a char?
| The statement from Bjarne Stroustrup in "The C++ Programming Language" about `sizeof(char) == 1` and `1 <= sizeof(bool)` reflects a few important points about data types and memory representation in C++.
1. **Size of `char`**: The C++ standard defines `sizeof(char)` to be 1. This means that a `char` is the smallest a... | 34,099 | [
{
"from": "human",
"value": "I'm reading The C++ Programming Language. In it Stroustrup states that sizeof(char) == 1 and 1 <= sizeof(bool). The specifics depend on the implementation. Why would such a simple value as a boolean take the same space as a char?\n"
},
{
"from": "gpt",
"value": "Th... |
I have an MFC app running in WinPE (Windows Preinstallation Environment), and I'm trying to make a method call with a 64-bit value in a ULONGLONG as a parameter. I've determined that the value is correct (ie. 0x1b432d6000) before the call, but is corrupt (ie. 0x432d60000000000a) inside the call. The value is initiall... | Given the scenario you've described, where the value of a `ULONGLONG` (64-bit value) is corrupted during a method call in your MFC application running under WinPE, there are several potential causes and troubleshooting steps to consider:
1. **Stack Corruption**: This might occur if there's a buffer overflow or if othe... | 33,537 | [
{
"from": "human",
"value": "I have an MFC app running in WinPE (Windows Preinstallation Environment), and I'm trying to make a method call with a 64-bit value in a ULONGLONG as a parameter. I've determined that the value is correct (ie. 0x1b432d6000) before the call, but is corrupt (ie. 0x432d60000000000a... |
Is there a standard Java library that handles common file operations such as moving/copying files/folders?
| Yes, the standard Java library provides the `java.nio.file` package, which includes a variety of classes and methods for handling common file operations, such as moving, copying, and deleting files and directories.
### Key Classes in `java.nio.file`:
1. **Path**: Represents the path to a file or directory.
2. **Files... | 34,469 | [
{
"from": "human",
"value": "Is there a standard Java library that handles common file operations such as moving/copying files/folders?\n"
},
{
"from": "gpt",
"value": "Yes, the standard Java library provides the `java.nio.file` package, which includes a variety of classes and methods for handli... |
function main()
{
Hello();
}
function Hello()
{
// How do you find out the caller function is 'main'?
}
Is there a way to find out the call stack?
| Yes, in many programming languages, you can retrieve the call stack information, which allows you to determine the sequence of function calls that led to the current function's execution. The approach to access this information depends on the language you are using.
Here are a couple of ways to find out the caller fu... | 32,785 | [
{
"from": "human",
"value": "function main()\n{\n Hello();\n}\n\nfunction Hello()\n{\n // How do you find out the caller function is 'main'?\n}\n\nIs there a way to find out the call stack?\n"
},
{
"from": "gpt",
"value": "Yes, in many programming languages, you can retrieve the call stack in... |
Background
I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another.
The rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The rays will start in ... | For creating an animated visualization with animated arrows/rays representing transactions between countries, you have several options in Python as well as some other frameworks. Here are some suggestions tailored to your requirements:
### Python Libraries
1. **Matplotlib with FuncAnimation**:
- Matplotlib has an ... | 31,297 | [
{
"from": "human",
"value": "Background\nI have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another. \nThe rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequenc... |
We all know that alerts are bad. If you didn't know it read this
Alerts are used to communicate with the user. So if we don't use them what is a good alternative?
I'd like to get a nice list of good alternatives to choose from when implementing something that requires user communications.
I'll give one myself as an ex... | Absolutely! Using alerts can often disrupt the user experience, so it's great to explore alternative methods for user communication. Here’s a list of alternatives across various scenarios that can help enhance user interactions:
### 1. Inline Validation
**Scenario:** Validating user input during form submission.
**Sol... | 33,418 | [
{
"from": "human",
"value": "We all know that alerts are bad. If you didn't know it read this\nAlerts are used to communicate with the user. So if we don't use them what is a good alternative? \nI'd like to get a nice list of good alternatives to choose from when implementing something that requires user co... |
This is kinda a general question, open for opinions. I've been trying to come up with a good way to design for localization of string resources for a Windows MFC application and related utilities. My wishlist is:
Must preserve string literals in code (as opposed to replacing with macro #define resource ID's), so that ... | It sounds like you've put a lot of thought into your localization solution, and it seems to cover many of the bases in your wishlist. I’d like to add a few ideas and alternative approaches that might align with your goals, especially in terms of static checking and maintainability:
### 1. Use of C++ Templates and `con... | 31,556 | [
{
"from": "human",
"value": "This is kinda a general question, open for opinions. I've been trying to come up with a good way to design for localization of string resources for a Windows MFC application and related utilities. My wishlist is:\n\nMust preserve string literals in code (as opposed to replacing ... |
I have two XML files with two different XSD schemas and different namespaces. They have both an identical substructure. And now i need to copy that node (and all childs) from one XML document to the other one.
Clone would do, if the namespaces were the same. Is there a nice way to do it?
(The substructure will change... | Copying a node from one XML document to another when the schemas (XSD) and namespaces are different can be accomplished using various XML processing techniques. Here's a general approach using Python with the `xml.etree.ElementTree` module, which allows you to manipulate XML easily. If you need to maintain the structur... | 32,158 | [
{
"from": "human",
"value": "I have two XML files with two different XSD schemas and different namespaces. They have both an identical substructure. And now i need to copy that node (and all childs) from one XML document to the other one. \nClone would do, if the namespaces were the same. Is there a nice wa... |
I have got the following code from here to read an Excel file using C# .NET:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
DbCommand command = connection.Cre... | To select only a specific range of rows from an Excel file using an SQL query in C#, you would typically need to use a combination of SQL features to achieve this since Excel does not support typical SQL `LIMIT` or `OFFSET` features. However, you can achieve the desired result by using the `ROW_NUMBER()` function if yo... | 33,500 | [
{
"from": "human",
"value": "I have got the following code from here to read an Excel file using C# .NET:\nstring connectionString = @\"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=\"\"Excel 8.0;HDR=YES;\"\"\";\nDbProviderFactory factory = DbProviderFactories.GetFactory(\"Syste... |
I need to be able to send encrypted data between a Ruby client and a Python server (and vice versa) and have been having trouble with the ruby-aes gem/library. The library is very easy to use but we've been having trouble passing data between it and the pyCrypto AES library for Python. These libraries seem to be fine w... | When dealing with encryption between two different programming languages, you need to ensure that several factors match perfectly across both implementations. Here are a few key aspects to consider when using AES encryption in Ruby and Python:
### 1. Key and Mode of Operation
Make sure that both the Ruby and Python im... | 28,566 | [
{
"from": "human",
"value": "I need to be able to send encrypted data between a Ruby client and a Python server (and vice versa) and have been having trouble with the ruby-aes gem/library. The library is very easy to use but we've been having trouble passing data between it and the pyCrypto AES library for ... |
I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled around and seems other people have asked the same question but never got a de... | Health monitoring in ASP.NET does work with ASMX web services, but there are a few things you need to ensure to get it set up properly. Here are the steps and tips to make sure that unhandled exceptions are logged from your ASMX web service.
### 1. Enable Health Monitoring in `web.config`
Make sure your `web.config` ... | 24,846 | [
{
"from": "human",
"value": "I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled around and seems other people have a... |
I have an ObjectDataSource with an ID of ObjectDataSource1 on a webpage. I also have a gridview in which I am binding the ObjectDataSource.ID to the GridView.DataSourceID. The problem I get is when text is changed in a textbox, the code calls BrokerageTransactions.GetAllWithDt which returns a DataTable. I want to se... | In ASP.NET Web Forms, when you're using data-bound controls like `GridView`, you cannot set both the `DataSourceID` and `DataSource` properties at the same time. The reason for this restriction is that `DataSourceID` specifies a declarative binding to a data source control (like an `ObjectDataSource`), while `DataSourc... | 29,155 | [
{
"from": "human",
"value": "I have an ObjectDataSource with an ID of ObjectDataSource1 on a webpage. I also have a gridview in which I am binding the ObjectDataSource.ID to the GridView.DataSourceID. The problem I get is when text is changed in a textbox, the code calls BrokerageTransactions.GetAllWithDt... |
I would like to know if it is possible,
To extract the userid from an ebay page and insert it into mysql as part of an insert statement? Otherwise what would be the best way to do this?
I have files to import, which contain hundred of ebay auction urls, and I must grab the seller id from each one. Is there an easier wa... | Yes, it is possible to extract the user ID (seller ID) from eBay auction pages and insert it into a MySQL database as part of an insert statement. However, it requires a bit of programming and the use of web scraping techniques, since eBay pages are dynamic and structured in a specific way. Here’s a general approach yo... | 29,713 | [
{
"from": "human",
"value": "I would like to know if it is possible,\nTo extract the userid from an ebay page and insert it into mysql as part of an insert statement? Otherwise what would be the best way to do this?\nI have files to import, which contain hundred of ebay auction urls, and I must grab the sel... |
Hi guys I wrote this code and i have two errors.
Invalid rank specifier: expected ',' or ']'
Cannot apply indexing with [] to an expression of type 'int'
Can you help please?
static void Main(string[] args)
{
ArrayList numbers = new ArrayList();
foreach (int number in new int[12] {10,9,8,7,... | The errors you're encountering are due to syntax issues and incorrect usage of types in your C# code. Let's address each error one by one:
### Error No. 1: Invalid rank specifier
In C#, the correct syntax for initializing an array using the `new` keyword is as follows:
```csharp
new int[] { 10, 9, 8, 7, 6, 5, 4, 3, ... | 33,832 | [
{
"from": "human",
"value": "Hi guys I wrote this code and i have two errors.\n\nInvalid rank specifier: expected ',' or ']' \nCannot apply indexing with [] to an expression of type 'int'\n\nCan you help please?\n static void Main(string[] args)\n {\n ArrayList numbers = new ArrayList();\n\n ... |
I’m using SSIS to synchronize data between two databases. I’ve used SSIS and DTS in the past, but I generally write an application for things of this nature (I’m coder and it just comes easier to me).
In my package I use a SQL Task that returns about 15,000 rows. I’ve hooked that up to a Foreach Container, and within t... | Your experiences with SSIS (SQL Server Integration Services) versus a coded application for data synchronization highlight some of the common pitfalls and performance considerations when using SSIS, especially in a debugging context.
### Common Reasons for Slow SSIS Performance in Debug Mode
1. **User Interface Over... | 28,352 | [
{
"from": "human",
"value": "I’m using SSIS to synchronize data between two databases. I’ve used SSIS and DTS in the past, but I generally write an application for things of this nature (I’m coder and it just comes easier to me).\nIn my package I use a SQL Task that returns about 15,000 rows. I’ve hooked th... |
I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down.
How can I avoid that, or at least handle it, would using Thread.ResetAbort() be useful in such a case?
To explain more here is a rough code sample... | Dealing with a `ThreadAbortException` in an ASP.NET application can be quite tricky, especially since it typically indicates that a thread is being forcibly terminated, which is often the result of a `Response.Redirect` or `Thread.Abort()` call. However, if you're experiencing `ThreadAbortException` while making HTTP r... | 29,401 | [
{
"from": "human",
"value": "I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down.\nHow can I avoid that, or at least handle it, would using Thread.ResetAbort() be useful in such a case?\n... |
I'm going to be writing a chess server and one or more clients for chess and I want to describe the rules of chess (e.g. allowable moves based on game state, rules for when a game is complete) in a programming language independant way. This is a bit tricky since some of the chess rules (e.g. King Castling, en passent, ... | Creating a chess server and clients with a unified and language-independent specification for the rules of chess is a complex task, especially when considering aspects like historical move data and special conditions. However, you can achieve this by defining the rules in a structured format such as YAML or JSON, along... | 18,157 | [
{
"from": "human",
"value": "I'm going to be writing a chess server and one or more clients for chess and I want to describe the rules of chess (e.g. allowable moves based on game state, rules for when a game is complete) in a programming language independant way. This is a bit tricky since some of the ches... |
How can I launch an event that has accessors like this :
public event EventHandler CanExecuteChanged
{
add
{
CommandManager.RequerySuggested += value;
}
remove
{
CommandManager.RequerySuggested -= value;
}
}
If it were a normal event I would launch it by:
C... | In your implementation, you're working with an `ICommand` interface in WPF, which often uses the `CanExecuteChanged` event to notify the command manager that the ability to execute the command has changed. The `CanExecuteChanged` event is invoked by the `CommandManager` whenever it needs to check if a command can be ex... | 31,473 | [
{
"from": "human",
"value": "How can I launch an event that has accessors like this :\npublic event EventHandler CanExecuteChanged\n {\n add\n {\n CommandManager.RequerySuggested += value;\n }\n remove\n {\n CommandManager.RequerySuggested -= value;\n }\n }\... |
I have to deal with very large text files (2 GBs), it is mandatory to read/write them line by line. To write 23 millions of lines using ofstream is really slow so, at the beginning, I tried to speed up the process writing large chunks of lines in a memory buffer (for example 256 MB or 512 MB) and then write the buffer ... | Handling very large text files efficiently can be challenging, especially when it comes to I/O operations. Here are several strategies you can try to improve performance when reading and writing large files in C++:
### 1. Adjust Buffer Sizes
While you have experimented with larger buffers, try experimenting with diffe... | 33,380 | [
{
"from": "human",
"value": "I have to deal with very large text files (2 GBs), it is mandatory to read/write them line by line. To write 23 millions of lines using ofstream is really slow so, at the beginning, I tried to speed up the process writing large chunks of lines in a memory buffer (for example 256... |
I have a Rails app that will post some data to another Rails app. For some reasons I don't want to use ActiveResource, so I used something like:
res = Net::HTTP.post_form(URI.parse('http://localhost:3030/support_requests/new'),
{'from'=>'somebody', 'due'=>'2009-03-31'})
It happens... | In Rails, the authenticity token is part of the CSRF (Cross-Site Request Forgery) protection mechanism. When you send a form submission using `Net::HTTP.post_form`, you're not automatically including the authenticity token that Rails expects for verification. To address this, you need to manually include the token in y... | 29,259 | [
{
"from": "human",
"value": "I have a Rails app that will post some data to another Rails app. For some reasons I don't want to use ActiveResource, so I used something like:\n res = Net::HTTP.post_form(URI.parse('http://localhost:3030/support_requests/new'),\n {'from'=>'s... |
I have over the course of a few projects developed a pattern for creating immutable (readonly) objects and immutable object graphs. Immutable objects carry the benefit of being 100% thread safe and can therefore be reused across threads. In my work I very often use this pattern in Web applications for configuration set... | Your approach to creating immutable objects, particularly in a mutable-to-immutable transition pattern, is interesting and showcases a thoughtful design aimed at enhancing thread safety and predictability within your application. Below are some insights, suggestions for improvements, and existing standards or concepts ... | 32,241 | [
{
"from": "human",
"value": "I have over the course of a few projects developed a pattern for creating immutable (readonly) objects and immutable object graphs. Immutable objects carry the benefit of being 100% thread safe and can therefore be reused across threads. In my work I very often use this pattern ... |
I'm working in C, and I have to concatenate a few things.
Right now I have this:
message = strcat("TEXT ", var);
message2 = strcat(strcat("TEXT ", foo), strcat(" TEXT ", bar));
Now if you have experience in C I'm sure you realize that this gives you a segmentation fault when you try to run it. So how do I work around... | Yes, you're correct that your current approach leads to a segmentation fault because you're trying to use `strcat` on string literals, which are not mutable. Additionally, the way you are nesting `strcat` calls is also problematic because the return values of `strcat` are pointers to the destination string, which can l... | 35,520 | [
{
"from": "human",
"value": "I'm working in C, and I have to concatenate a few things.\nRight now I have this:\nmessage = strcat(\"TEXT \", var);\n\nmessage2 = strcat(strcat(\"TEXT \", foo), strcat(\" TEXT \", bar));\n\nNow if you have experience in C I'm sure you realize that this gives you a segmentation ... |
I generate a XMLDocument based on a dataset by binding the dataset to the XMLDocument object and then display it to user in vb.net. I have a requirement in which certain tags to contain cdata sections rather than text value. After generating the XMLDocument how to change only certain tag to cdata section and keeping al... | In VB.NET, after you've generated an XMLDocument from a DataSet, you can convert specific tags to CDATA sections by traversing the XML structure and modifying the text content of the desired elements. Unfortunately, while binding to a DataSet directly to an XMLDocument doesn't provide a built-in way to specify CDATA se... | 34,132 | [
{
"from": "human",
"value": "I generate a XMLDocument based on a dataset by binding the dataset to the XMLDocument object and then display it to user in vb.net. I have a requirement in which certain tags to contain cdata sections rather than text value. After generating the XMLDocument how to change only ce... |
Is it possible to intercept requests in the ASP.NET MVC Framework (beta 1) in order to interact and inspect them?
I need to attach some logging and in some cases dynamically work out if the URL needs authorizing (like applying the Authorize attribute - but at run-time).
| Yes, in ASP.NET MVC (including the beta versions), you can intercept requests and inspect them using several techniques. One of the most common approaches is to use **Action Filters**. Action filters allow you to run custom logic before or after an action method executes. This can be useful for logging and dynamic auth... | 33,146 | [
{
"from": "human",
"value": "Is it possible to intercept requests in the ASP.NET MVC Framework (beta 1) in order to interact and inspect them?\nI need to attach some logging and in some cases dynamically work out if the URL needs authorizing (like applying the Authorize attribute - but at run-time).\n"
},... |
I am trying to implement position-sensitive zooming inside a JScrollPane. The JScrollPane contains a component with a customized paint that will draw itself inside whatever space it is allocated - so zooming is as easy as using a MouseWheelListener that resizes the inner component as required.
But I also want zooming i... | To achieve position-sensitive zooming in your `JScrollPane` with `FPanel`, you need to calculate how to adjust the viewport (the visible area) of the `JScrollPane` based on the zoom factor and the point the user is zooming into. This can be done by following these steps:
1. **Calculate the Zoom Factor**: Determine how... | 14,686 | [
{
"from": "human",
"value": "I am trying to implement position-sensitive zooming inside a JScrollPane. The JScrollPane contains a component with a customized paint that will draw itself inside whatever space it is allocated - so zooming is as easy as using a MouseWheelListener that resizes the inner compone... |
An application that has been working well for months has stopped picking up the JPA @Entity annotations that have been a part of it for months. As my integration tests run I see dozens of "org.hibernate.MappingException: Unknown entity: com.whatever.OrderSystem" type errors.
It isn't clear to me what's gone wrong here... | It sounds like you're experiencing an issue where Hibernate is unable to recognize your JPA entities, which is leading to the `MappingException` errors you mentioned. Here are several potential causes and solutions that you can investigate:
### 1. Check `persistence.xml` Configuration
Since you're using `persistence.x... | 29,386 | [
{
"from": "human",
"value": "An application that has been working well for months has stopped picking up the JPA @Entity annotations that have been a part of it for months. As my integration tests run I see dozens of \"org.hibernate.MappingException: Unknown entity: com.whatever.OrderSystem\" type errors.\... |
I'm trying to submit a form with javascript. Firefox works fine but IE complains that "Object doesn't support this property or method" on the submit line of this function:
function submitPGV(formName, action)
{
var gvString = "";
pgVisibilities.each(function(pair) {
gvString += pair.key + ":" + pair.va... | The issue you are encountering with Internet Explorer (IE) is likely due to the way the JavaScript is being executed and how certain elements are accessed. Let's go through a few potential problems and their solutions:
### 1. Element Selection
The `$(formName)` and `$('pgv_input')` suggests that you might be using a ... | 33,540 | [
{
"from": "human",
"value": "I'm trying to submit a form with javascript. Firefox works fine but IE complains that \"Object doesn't support this property or method\" on the submit line of this function:\nfunction submitPGV(formName, action)\n{\n var gvString = \"\";\n\n pgVisibilities.each(function(pa... |
When I create a view in SQL Server 2005 and someone later opens it in the GUI modify mode it sometimes completely rearranges my joins. Often to the point it's virtually no longer readable. If I look at it in the GUI it's changed as well from what I originally wrote. Sometimes the join lines no longer even point to a... | The behavior you're encountering when working with SQL Server Management Studio (SSMS) is due to how the graphical query designer interprets and rearranges SQL queries when opened in modify mode. Here are some details and tips to help mitigate these issues:
### Why It Happens:
1. **Graphical Query Designer Optimizati... | 33,476 | [
{
"from": "human",
"value": "When I create a view in SQL Server 2005 and someone later opens it in the GUI modify mode it sometimes completely rearranges my joins. Often to the point it's virtually no longer readable. If I look at it in the GUI it's changed as well from what I originally wrote. Sometimes... |
I have noticed that my particular instance of Trac is not running quickly and has big lags. This is at the very onset of a project, so not much is in Trac (except for plugins and code loaded into SVN).
Setup Info: This is via a SELinux system hosted by WebFaction. It is behind Apache, and connections are over SSL. C... | Improving the performance of Trac can depend on various factors, including your server configuration, database usage, and the plugins you have installed. Here are some general recommendations to help improve the performance of your Trac instance:
1. **Upgrade to the Latest Version**: Ensure that you are using the late... | 27,367 | [
{
"from": "human",
"value": "I have noticed that my particular instance of Trac is not running quickly and has big lags. This is at the very onset of a project, so not much is in Trac (except for plugins and code loaded into SVN).\nSetup Info: This is via a SELinux system hosted by WebFaction. It is behin... |
I'm trying to read a single XML document from stream at a time using dom4j, process it, then proceed to the next document on the stream. Unfortunately, dom4j's SAXReader (using JAXP under the covers) keeps reading and chokes on the following document element.
Is there a way to get the SAXReader to stop reading the str... | When working with XML documents in a stream using dom4j's `SAXReader`, it indeed reads until the end of the entire XML input stream, which can be problematic when you have multiple XML documents in a single stream.
To address this problem, you can either:
1. **Parse One Document at a Time:**
Instead of using a sin... | 32,768 | [
{
"from": "human",
"value": "I'm trying to read a single XML document from stream at a time using dom4j, process it, then proceed to the next document on the stream. Unfortunately, dom4j's SAXReader (using JAXP under the covers) keeps reading and chokes on the following document element.\nIs there a way to... |
Does anyone know of a Java library that provides a useful abstraction for analyzing and manipulating arbitrary relational database schemata? I'm thinking of something that could do things like
LibraryClass dbLib = ...;
DbSchema schema = dbLib.getSchema("my_schema");
List<DbTable> tables = schema.getTables();
and
DbTab... | There are several Java libraries that can help you analyze and manipulate relational database schemata, providing the kind of abstractions you're looking for. Here are a few options:
1. **JOOQ (Java Object Oriented Querying)**:
- JOOQ is a powerful library that allows you to generate Java code from your database sc... | 34,473 | [
{
"from": "human",
"value": "Does anyone know of a Java library that provides a useful abstraction for analyzing and manipulating arbitrary relational database schemata? I'm thinking of something that could do things like\nLibraryClass dbLib = ...;\nDbSchema schema = dbLib.getSchema(\"my_schema\");\nList<Db... |
I'm trying to do a very simple button that changes color based on mouseover, mouseout and
click, I'm doing this in prototype and the weird thing is if I used mouseover and mouseout,
after I clicked on the button, the button wouldn't change to white, seems like it is because of the mouseout, here's my code
$("izzy").obs... | The issue you're encountering is likely due to the fact that after clicking the button, the mouseout event fires, changing the button color back to `#666666`. One way to handle this is to keep track of the button's state (clicked or not) and modify the mouseout behavior accordingly.
Here's one approach to achieve this... | 30,648 | [
{
"from": "human",
"value": "I'm trying to do a very simple button that changes color based on mouseover, mouseout and\nclick, I'm doing this in prototype and the weird thing is if I used mouseover and mouseout,\nafter I clicked on the button, the button wouldn't change to white, seems like it is because of... |
I want to use lucene.net to index records in our database. The records are stored in several different tables and tied together through a records table. Would it be better to index each table separately and tie the search results together in code, or should I tie the records together coming out of the database and pl... | When deciding between indexing records from multiple tables separately or combining them into a single index when using Lucene.NET, there are several factors to consider. Here are the advantages and disadvantages of each approach, as well as some additional suggestions.
### Option 1: Indexing Each Table Separately
**... | 29,399 | [
{
"from": "human",
"value": "I want to use lucene.net to index records in our database. The records are stored in several different tables and tied together through a records table. Would it be better to index each table separately and tie the search results together in code, or should I tie the records t... |
A similar question was already asked (
Performing a Stress Test on Web Application?), but I'd like to test a web application that prevents double-submits and takes some counter-XSRF actions and therefore REQUIRES JavaScripts to be evaluated.
Has anybody done stress tests with web apps that require (and use) JS and any... | Testing a web application that relies heavily on JavaScript and has measures against double submits, such as anti-XSRF tokens, can be challenging with traditional load testing tools like Apache JMeter, which does not execute JavaScript. However, there are several options you can consider to effectively perform stress t... | 31,359 | [
{
"from": "human",
"value": "A similar question was already asked ( \nPerforming a Stress Test on Web Application?), but I'd like to test a web application that prevents double-submits and takes some counter-XSRF actions and therefore REQUIRES JavaScripts to be evaluated.\nHas anybody done stress tests with... |
I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use win32com.client.Dispatch. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:
import win32com.client
app1 = win32com.client.Dispatch( 'Excel.Application' ) # ok
app2 = ... | Visual Studio 2008 does not expose its functionality through the same COM interface that applications like Excel and Word do. Therefore, trying to use `win32com.client.Dispatch` with `'MSDev.Application'` (or similar strings) won't work because Visual Studio does not register itself as a COM object that can be accessed... | 34,254 | [
{
"from": "human",
"value": "I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use win32com.client.Dispatch. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:\nimport win32com.client\napp1 = win32com.client.D... |
One of our newer products is a walk-on video system, in which a character appears in an absolutely positioned DIV and gives a little presentation. We're using Flash 9, AS3. Unfortunately, in order to make him appear in front of the website content, we need to set his Z-index to a value higher than the page content.
On ... | Passing mouse events from a Flash movie to the underlying HTML elements can be tricky, particularly because Flash is designed to capture input events. However, there are a couple of approaches you can consider to allow for interaction with the underlying content without resorting to the "huge ugly JavaScript module" yo... | 34,244 | [
{
"from": "human",
"value": "One of our newer products is a walk-on video system, in which a character appears in an absolutely positioned DIV and gives a little presentation. We're using Flash 9, AS3. Unfortunately, in order to make him appear in front of the website content, we need to set his Z-index to ... |
How to implement CEditListCtrl?. List control with edit capabality (Report/Grid view).
I have a list view in Report View. It has some values. I need to extend this to edit the values present in the list view.
I declared a class which inherits from CListCtrl. And I have handled the two Window messages to start and end t... | To implement an editable CListCtrl (or CEditListCtrl) in MFC (Microsoft Foundation Classes), you can follow a structured approach. You have the right idea by subclassing `CListCtrl` and handling messages to start and end the editing process. Here's a step-by-step guide to help you achieve this, along with an example im... | 30,100 | [
{
"from": "human",
"value": "How to implement CEditListCtrl?. List control with edit capabality (Report/Grid view).\nI have a list view in Report View. It has some values. I need to extend this to edit the values present in the list view.\nI declared a class which inherits from CListCtrl. And I have handled... |
We have a Linux server application that is comprised of a number of open-source tools as well as programs we've written ourselves. Ideally we would like to be able to install this application on any common Linux distribution.
In the past, we've written perl scripts to automate installs of this application. Unfortunatel... | Creating an installer that works across various Linux distributions can indeed be quite challenging due to the differing package management systems, directory structures, and startup services. Here are some strategies and tools you can consider to simplify this process:
### 1. Use a Configuration Management Tool
Usin... | 28,859 | [
{
"from": "human",
"value": "We have a Linux server application that is comprised of a number of open-source tools as well as programs we've written ourselves. Ideally we would like to be able to install this application on any common Linux distribution.\nIn the past, we've written perl scripts to automate ... |
I have an htaccess file that uses mod_rewrite to redirect /controller to /index.php?controller=%controller%
Like this:
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Rewrite current-style URLs of the form 'index.php?controller=x&action=y'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %... | To require HTTP authentication for a specific controller (in this case, `secret`), you can add an additional condition to your `.htaccess` file that checks if the requested path matches `secret`. When it does, the server will prompt for authentication. Here's how to modify your existing `.htaccess` file:
```apache
# V... | 34,187 | [
{
"from": "human",
"value": "I have an htaccess file that uses mod_rewrite to redirect /controller to /index.php?controller=%controller%\nLike this:\n# Various rewrite rules.\n<IfModule mod_rewrite.c>\n RewriteEngine on\n\n # Rewrite current-style URLs of the form 'index.php?controller=x&action=y'.\n Rew... |
As a follow-up to this question, it's trying to find out how to do something like this which should be easy, that especially stops me from getting more used to using Emacs and instead starting up the editor I'm already familiar with. I use the example here fairly often in editing multiple files.
In Ultraedit I'd do Alt... | You can achieve the functionality you're looking for in Emacs by using `query-replace-regexp` combined with `find-dired` or `grep` for searching through multiple files. Here’s a step-by-step guide on how to replace occurrences of `foo\nbar` with `bar\nbaz` in all `.c` and `.h` files in a specified directory and its sub... | 31,374 | [
{
"from": "human",
"value": "As a follow-up to this question, it's trying to find out how to do something like this which should be easy, that especially stops me from getting more used to using Emacs and instead starting up the editor I'm already familiar with. I use the example here fairly often in editin... |
I am trying to call a setTimeout from within a setInterval callback:
function callback()
{
//assign myVar
var myVar = document.getElementById("givenID");
//...
//now wait 2 secs then call some code that uses myVAr
setTimeout("myVar.innerHTML = 'TEST'", 2000);
}
setInterval("callback();", 10000);
setInt... | You're correct that the problem arises because `setTimeout` is attempting to execute a string of code that doesn't have access to the scope of the `myVar` variable when it is executed. One way to solve this is to use a function instead of a string in `setTimeout`, which allows you to pass `myVar` directly and maintain ... | 35,546 | [
{
"from": "human",
"value": "I am trying to call a setTimeout from within a setInterval callback:\nfunction callback()\n{\n //assign myVar\n var myVar = document.getElementById(\"givenID\");\n //...\n //now wait 2 secs then call some code that uses myVAr\n setTimeout(\"myVar.innerHTML = 'TEST'\", ... |
Say if I have a dropdown in a form and I have another nested class inside of this class .
Now what's the best way to access this dropdown from the nested class?
| Accessing a dropdown (or any UI element) from a nested class depends on the framework or technology you are using. However, here are some general approaches for a few common frameworks:
### 1. **Using Event Handlers (JavaScript, React, etc.)**
If you are using a JavaScript-based framework like React, you can pass down... | 30,798 | [
{
"from": "human",
"value": "Say if I have a dropdown in a form and I have another nested class inside of this class .\nNow what's the best way to access this dropdown from the nested class? \n"
},
{
"from": "gpt",
"value": "Accessing a dropdown (or any UI element) from a nested class depends on... |
I'm writing an image processing program to perform real time processing of video frames. It's in C# using the Emgu.CV library (C#) that wraps the OpenCV library dll (unmanaged C++). Now I have to write my own special algorithm and it needs to be as fast as possible.
Which will be a faster implementation of the algorit... | When considering performance for a custom image processing algorithm in C# using the Emgu.CV library, there are a few key points to evaluate between the two options you've mentioned: writing an `unsafe` function in C# or adding the function directly to the OpenCV library and accessing it through Emgu.CV.
1. **Unsafe C... | 33,549 | [
{
"from": "human",
"value": "I'm writing an image processing program to perform real time processing of video frames. It's in C# using the Emgu.CV library (C#) that wraps the OpenCV library dll (unmanaged C++). Now I have to write my own special algorithm and it needs to be as fast as possible. \nWhich will... |
I'm trying to use System.DirectoryServices in a web site project and I'm getting this error:
The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)
My project has a reference to System.DirectoryServices in web.config:
<add assembly="System.Di... | It sounds like you're having an issue with a missing reference to the `System.DirectoryServices` assembly in your web project. Here are several steps to troubleshoot and resolve the problem:
### 1. Check Project References
Make sure that you have added the `System.DirectoryServices` reference to your project correctly... | 34,269 | [
{
"from": "human",
"value": "I'm trying to use System.DirectoryServices in a web site project and I'm getting this error:\n\nThe type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)\n\nMy project has a reference to System.DirectoryServi... |
I take care of critical app in my project. It does stuff related to parsing business msgs (legacy standard), processing them and then storing some results in a DB (another apps picks that up). After more then a year of my work (I've other apps to look after as well) the app is finally stable. I've introduced strict TDD... | It sounds like you have an exciting opportunity to refactor a legacy application into a more maintainable and extensible solution. Given your goals and the constraints you have, here are some high-level design suggestions and patterns to consider:
### High-Level Design Suggestions
1. **Single Responsibility Principle... | 31,724 | [
{
"from": "human",
"value": "I take care of critical app in my project. It does stuff related to parsing business msgs (legacy standard), processing them and then storing some results in a DB (another apps picks that up). After more then a year of my work (I've other apps to look after as well) the app is f... |
I am looking for a good, free (preferred) screen sharing program that works well for pair programming and code review sessions for Windows (Vista x64, Server 2008). It should allow either person take control of the screen and be fairly responsive for text editing over decent broadband connections. Additional features l... | For pair programming and code review sessions, there are several free screen-sharing programs that work well on Windows Vista x64 and Server 2008. Here are some recommendations:
1. **TeamViewer**:
- TeamViewer is free for personal use and allows for remote control and screen sharing. It has features like file tran... | 34,663 | [
{
"from": "human",
"value": "I am looking for a good, free (preferred) screen sharing program that works well for pair programming and code review sessions for Windows (Vista x64, Server 2008). It should allow either person take control of the screen and be fairly responsive for text editing over decent bro... |
I've a a customer using IIS and an application, developed by us, in ASP.NET 1.1.
Monday, for 4 times in a row the following error has appeared:
A process serving application pool 'xxxx' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was 'yyyy'. The data field contains t... | Diagnosing the "A process serving application pool 'xxxx' suffered a fatal communication error with the World Wide Web Publishing Service" error can indeed be challenging, especially since the issue seems to occur in one specific customer's environment rather than universally. Here are some steps you can take to help d... | 33,082 | [
{
"from": "human",
"value": "I've a a customer using IIS and an application, developed by us, in ASP.NET 1.1.\nMonday, for 4 times in a row the following error has appeared:\n\nA process serving application pool 'xxxx' suffered a fatal communication error with the World Wide Web Publishing Service. The proc... |
I am looking for a simple but "good enough" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some "basic information" like:
Names, places, Address and Dates
I've been looking around, and most seems to be on the heavy side and full NLP kind of projects.... | If you're looking for a simple and lightweight Named Entity Recognition (NER) library in Java for extracting basic information such as names, places, addresses, and dates from emails and documents, here are a few recommendations:
1. **Stanford NLP**:
- Although Stanford NLP is a full-featured NLP library, it has re... | 30,908 | [
{
"from": "human",
"value": "I am looking for a simple but \"good enough\" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some \"basic information\" like:\nNames, places, Address and Dates\nI've been looking around, and most seems to be o... |
How do you run an update query in a data source control from a button? I have the data source control with the update query configured in it. I just don't know what to put in the button_click event to make it run.
| To run an update query from a button click event using a data source control in an ASP.NET Web Forms application, you need to call the `Update` method of the data source control (such as `SqlDataSource`, `ObjectDataSource`, etc.). Below is a general guideline on how to do this.
### Example using SqlDataSource
1. **AS... | 33,204 | [
{
"from": "human",
"value": "How do you run an update query in a data source control from a button? I have the data source control with the update query configured in it. I just don't know what to put in the button_click event to make it run.\n"
},
{
"from": "gpt",
"value": "To run an update q... |
I have an xml that looks like this:
<Config>
<A></A>
<Template><B/><C/></Template>
</Config>
and I would like to deserialize it in to get the <Template><B/><C/></Template> bit as a XmlElement or XmlNode. But when I try like this:
public class Config
{
public string A;
public XmlElement Template;
}
the Templ... | When deserializing XML into an object in C#, using plain fields for XML elements can lead to undesired behavior because the XML deserializer often doesn't know how to map complex structures like `XmlElement` or `XmlNode` directly.
To ensure that your `Template` property properly captures all its child elements (in thi... | 35,217 | [
{
"from": "human",
"value": "I have an xml that looks like this:\n<Config>\n<A></A>\n<Template><B/><C/></Template>\n</Config>\n\nand I would like to deserialize it in to get the <Template><B/><C/></Template> bit as a XmlElement or XmlNode. But when I try like this:\npublic class Config\n{\n public strin... |
Our application defines a URL scheme whose resolution is context-sensitive: The content of the URL depends on the state of an in-progress database transaction. As such, to retrieve the content I cannot, for example, open a new database connection. However, I can't see a way to get at external context from the URLStr... | For context-sensitive URL resolution in a Java application, where the URL resolution needs to depend on the state of an in-progress database transaction, your challenge lies in maintaining access to that state within the `URLStreamHandler`. Since a `URLStreamHandler` does not provide a direct way to pass contextual inf... | 31,191 | [
{
"from": "human",
"value": "Our application defines a URL scheme whose resolution is context-sensitive: The content of the URL depends on the state of an in-progress database transaction. As such, to retrieve the content I cannot, for example, open a new database connection. However, I can't see a way t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.