instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
It's really all in the title, but here's a breakdown for anyone who is interested in Evolutionary Algorithms:
In an EA, the basic premise is that you randomly generate a certain number of organisms (which are really just sets of parameters), run them against a problem, and then let the top performers survive.
You then... | Your question on optimal repopulation percentages in Evolutionary Algorithms (EAs) is quite interesting and certainly a topic of ongoing research and experimentation. Your current approach of keeping the top 10% of performers and allocating 30% for crossbreeds, 30% for mutations, and 30% for new organisms is a solid st... | 16,321 | [
{
"from": "human",
"value": "It's really all in the title, but here's a breakdown for anyone who is interested in Evolutionary Algorithms:\nIn an EA, the basic premise is that you randomly generate a certain number of organisms (which are really just sets of parameters), run them against a problem, and then... |
I've written up a weekly-review GTD checklist for myself in TiddlyWiki, using CheckboxPlugin. After I'm finished with it each week, I'd like to click one link to uncheck (reset) all of the items on it, so it's ready for the next use.
I'm storing the check information as tags on a separate tiddler page. I should be able... | To accomplish the task of resetting your GTD checklist in TiddlyWiki by removing tags from a separate tiddler, you'll want to create a button or link that, when clicked, executes a JavaScript function to remove those tags. Here's a general approach you can follow:
### Step 1: Identify the Tiddler
Make sure you know t... | 15,568 | [
{
"from": "human",
"value": "I've written up a weekly-review GTD checklist for myself in TiddlyWiki, using CheckboxPlugin. After I'm finished with it each week, I'd like to click one link to uncheck (reset) all of the items on it, so it's ready for the next use.\nI'm storing the check information as tags on... |
I'm developing an integration testing framework for a data intensive J2EE enterprise application and I'm trying to decide upon a strategy for initializing and populating the database. We have a fairly complex model.
The system will have to:
Initialize the system itself
Load users
Load application test data
The test... | Developing an integration testing framework for a data-intensive J2EE enterprise application can be a complex task, especially when it comes to initializing and populating the database. Here’s a strategy you might consider that addresses the various aspects you’ve mentioned.
### Strategy Overview
1. **Database Initia... | 14,868 | [
{
"from": "human",
"value": "I'm developing an integration testing framework for a data intensive J2EE enterprise application and I'm trying to decide upon a strategy for initializing and populating the database. We have a fairly complex model.\nThe system will have to:\n\nInitialize the system itself \nLoa... |
This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first line which matches, and then add a summary message for remaining consecutive lines which match pattern ... | Your Python code is a good start for the task you're trying to achieve! However, there are a few improvements and fixes that can be made. Let's review your code and I'll provide a corrected version along with explanations.
### Issues in the Original Code
1. **Type Checking**: The way you're checking for string type us... | 17,284 | [
{
"from": "human",
"value": "This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first line which matches, and then add a summary message for remaini... |
I have a class that defines the names of various session attributes, e.g.
class Constants {
public static final String ATTR_CURRENT_USER = "current.user";
}
I would like to use these constants within a JSP to test for the presence of these attributes, something like:
<%@ taglib prefix="c" uri="http://java.sun.com/... | In JSP, when you're working with Java constants, especially when you want to access them within JSTL (JavaServer Pages Standard Tag Library), it can be a bit tricky due to the way EL (Expression Language) operates.
Here's a breakdown of how to correctly access your constant and assign a value to a local variable usin... | 16,550 | [
{
"from": "human",
"value": "I have a class that defines the names of various session attributes, e.g.\nclass Constants {\n public static final String ATTR_CURRENT_USER = \"current.user\";\n}\n\nI would like to use these constants within a JSP to test for the presence of these attributes, something like:... |
I know there's no standard C function to do this. I was wondering what are the techniques to to this on Windows and *nix? (Windows XP is my most important OS to do this on right now.)
| To clarify your question, it seems you are looking for techniques to perform a specific task, though it wasn't explicitly stated what that task is. Since you're asking about methods for both Windows and Unix-like systems, I'll assume you're interested in techniques that generally apply to file handling, process managem... | 13,728 | [
{
"from": "human",
"value": "I know there's no standard C function to do this. I was wondering what are the techniques to to this on Windows and *nix? (Windows XP is my most important OS to do this on right now.)\n"
},
{
"from": "gpt",
"value": "To clarify your question, it seems you are looki... |
Is there any way to change the default datatype when importing an Excel file into Access? (I'm using Access 2003, by the way).
I know that I sometimes have the freedom to assign any datatype to each column that is being imported, but that could only be when I'm importing non-Excel files.
EDIT: To be clear, I understan... | When importing Excel files into Access, it can indeed be frustrating when Access does not allow you to change the default data types assigned to the columns, especially when it misinterprets the data. Here are several strategies to address this issue:
1. **Adjust the Source Data in Excel**: Before importing the Excel ... | 18,707 | [
{
"from": "human",
"value": "Is there any way to change the default datatype when importing an Excel file into Access? (I'm using Access 2003, by the way).\nI know that I sometimes have the freedom to assign any datatype to each column that is being imported, but that could only be when I'm importing non-Ex... |
I am actually loading a page as a modal dialog box as window.showModalDialog("url.aspx"). The first time the modal dialog is poped up the page load event gets called. When i close it and call the same again, the Control does not come to the PageLoad. Instead the page pops up with the previous values in all its controls... | The behavior you’re experiencing with `window.showModalDialog` is related to how the browser caches the modal dialog's content. When you open the modal dialog for the first time, the page is loaded and the server-side `Page_Load` event is executed. However, subsequent opens of the modal dialog may show the cached conte... | 18,917 | [
{
"from": "human",
"value": "I am actually loading a page as a modal dialog box as window.showModalDialog(\"url.aspx\"). The first time the modal dialog is poped up the page load event gets called. When i close it and call the same again, the Control does not come to the PageLoad. Instead the page pops up w... |
Any suggestion how I can document my Perl code? What do you use and what tools are available to help me?
Which module do you use to convert pod to html?
| Documenting your Perl code is essential for maintaining clarity and improving collaboration, especially when the codebase grows or when working with others. One of the best practices for documenting Perl code is to use Plain Old Documentation (POD), which is a simple and powerful way to embed documentation directly wit... | 17,795 | [
{
"from": "human",
"value": "Any suggestion how I can document my Perl code? What do you use and what tools are available to help me?\nWhich module do you use to convert pod to html?\n"
},
{
"from": "gpt",
"value": "Documenting your Perl code is essential for maintaining clarity and improving co... |
I have a WPF Window which has a among other controls hosts a Frame. In that frame I display different pages. Is there way to make a dialog modal to only a page? When I'm showing the dialog it should not be possible to click on any control on the page but it should be possible to click on a control on the same window th... | In WPF, a modal dialog typically restricts interaction to the entire parent window and all its content, including any child pages hosted within a Frame. However, you can achieve the effect of a modal dialog that restricts interaction to a specific page within a Frame by using a combination of overlays and event handlin... | 15,045 | [
{
"from": "human",
"value": "I have a WPF Window which has a among other controls hosts a Frame. In that frame I display different pages. Is there way to make a dialog modal to only a page? When I'm showing the dialog it should not be possible to click on any control on the page but it should be possible to... |
I am wanting to find the distance between two different points. This I know can be accomplished with the great circle distance.
http://www.meridianworlddata.com/Distance-calculation.asp
Once done, with a point and distance I would like to find the point that distance north, and that distance east in order to create a b... | To find the distance between two points on the Earth's surface using the great circle distance formula, you can use the Haversine formula, which calculates the distance between two points given their latitude and longitude in degrees.
### Haversine Formula
The Haversine formula is defined as:
\[
d = 2r \cdot \arcsin... | 12,893 | [
{
"from": "human",
"value": "I am wanting to find the distance between two different points. This I know can be accomplished with the great circle distance.\nhttp://www.meridianworlddata.com/Distance-calculation.asp\nOnce done, with a point and distance I would like to find the point that distance north, an... |
How to unit test the windows workflows?
| Unit testing Windows Workflow Foundation (WF) workflows involves verifying that individual components of your workflow function as intended. Here are some strategies and best practices to effectively unit test workflows:
### 1. **Break Down Workflows into Activities**
- Create custom activities that can be independ... | 16,018 | [
{
"from": "human",
"value": "How to unit test the windows workflows?\n"
},
{
"from": "gpt",
"value": "Unit testing Windows Workflow Foundation (WF) workflows involves verifying that individual components of your workflow function as intended. Here are some strategies and best practices to effect... |
What might be the best way to start programming using boost lambda libraries.
| Boost Lambda is a part of the larger Boost C++ Libraries, which provides a way to create inline anonymous functions (or lambda expressions) for use in algorithms, data structures, and other applications in C++. Here's a step-by-step guide on how to get started with programming using Boost Lambda libraries:
### Step 1:... | 14,695 | [
{
"from": "human",
"value": "What might be the best way to start programming using boost lambda libraries.\n"
},
{
"from": "gpt",
"value": "Boost Lambda is a part of the larger Boost C++ Libraries, which provides a way to create inline anonymous functions (or lambda expressions) for use in algor... |
How do I get command line utilities like ping to use the default proxy in Windows XP.
proxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working.
Update: I am behind a proxy and would like a way to check if a site is up or not hence trying to use ping! Also would like a way to telne... | In Windows XP, command-line utilities like `ping` and `telnet` do not directly respect the system-wide proxy settings configured in Internet Explorer (IE). This is because these tools do not use the Windows HTTP stack, which means they won’t automatically route traffic through the proxy server set in IE.
### Using `pi... | 13,497 | [
{
"from": "human",
"value": "How do I get command line utilities like ping to use the default proxy in Windows XP.\nproxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working.\nUpdate: I am behind a proxy and would like a way to check if a site is up or not hence trying ... |
I'm setting up a server to offer JIRA and SVN. I figure, I'll use LDAP to keep the identity management simple.
So, before I write one.... is there a good app out there to let users change their ldap password? I want something that lets a user authenticate with ldap and update their password. A form with username,... | Yes, there are several applications and libraries that can help you implement a user interface for changing LDAP passwords without having to create your own from scratch. Here are a few options you can consider:
1. **Gluu Server**: Gluu is an open-source identity and access management platform that includes features f... | 18,967 | [
{
"from": "human",
"value": "I'm setting up a server to offer JIRA and SVN. I figure, I'll use LDAP to keep the identity management simple. \nSo, before I write one.... is there a good app out there to let users change their ldap password? I want something that lets a user authenticate with ldap and upd... |
I have just found a static nested interface in our code-base.
class Foo {
public static interface Bar {
/* snip */
}
/* snip */
}
I have never seen this before. The original developer is out of reach. Therefore I have to ask SO:
What are the semantics behind a static interface? What would change, i... | In Java, when you define a nested interface (or class) within another class, it is by default static. This means that it does not have a reference to an instance of the enclosing class. In your case, the `Bar` interface is a static nested interface within the `Foo` class. Here's what you should know:
### Semantics of ... | 18,882 | [
{
"from": "human",
"value": "I have just found a static nested interface in our code-base.\nclass Foo {\n public static interface Bar {\n /* snip */\n }\n /* snip */\n}\n\nI have never seen this before. The original developer is out of reach. Therefore I have to ask SO:\nWhat are the semanti... |
How do I define nested class in Java Script.
Here is the code snippet I have:
objA = new TestA();
function TestB ()
{
this.testPrint = function ()
{
print ( " Inside testPrint " );
}
}
function TestA ()
{
var myObjB = new TestB();
}
Now I am trying to access testPrint using objA
objA.myObjB.testPrint... | In JavaScript, to define a nested class (or, more accurately, to have a class or function contain instances of other classes/functions), you need to make sure that the nested instance is accessible from the outside. In your current code, `myObjB` is defined as a local variable inside the `TestA` function, so it is not ... | 18,082 | [
{
"from": "human",
"value": "How do I define nested class in Java Script. \nHere is the code snippet I have:\nobjA = new TestA();\n\nfunction TestB ()\n{\n this.testPrint = function ()\n {\n print ( \" Inside testPrint \" );\n }\n}\n\nfunction TestA ()\n{\n var myObjB = new TestB();\n}\n\nNow I am... |
I'm using the HTML5 <canvas> element in Firefox 2.0.0.16 and in Safari 3.1.2, both on my iMac. (I've tried this in Firefox 3.0 on Windows as well, also to no avail.) The tag looks like this:
<td>
<canvas id="display"
width="500px"
height="500px">
</canvas>
</td>
I have a button to "activa... | The behavior you are encountering is related to how focus works with the `<canvas>` element in HTML5. In general, the `<canvas>` element is not focusable by default because it does not have any interactive content. Unlike input elements or buttons, the `<canvas>` does not receive focus unless explicitly defined to do s... | 20,196 | [
{
"from": "human",
"value": "I'm using the HTML5 <canvas> element in Firefox 2.0.0.16 and in Safari 3.1.2, both on my iMac. (I've tried this in Firefox 3.0 on Windows as well, also to no avail.) The tag looks like this: \n<td>\n <canvas id=\"display\"\n width=\"500px\"\n height=\"500p... |
As a hobby I'm interesting in programming an Ethernet-connected LED sign to scroll messages across a screen. But I'm having trouble making a UDP sender in VB.NET (I am using 2008 currently).
Now the sign is nice enough to have a specifications sheet on programming for it.
But an example of a line to send to it (page 3)... | To create a properly formatted packet to send to your LED sign using UDP in VB.NET, you need to ensure that you're correctly representing the hex values as bytes, rather than encoding them as ASCII characters. Here's how you can modify your code to accomplish this:
1. Create a `List(Of Byte)` to hold the byte values.
... | 16,778 | [
{
"from": "human",
"value": "As a hobby I'm interesting in programming an Ethernet-connected LED sign to scroll messages across a screen. But I'm having trouble making a UDP sender in VB.NET (I am using 2008 currently).\nNow the sign is nice enough to have a specifications sheet on programming for it.\nBut ... |
What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of returning zero).
| In C++, you can parse a `char*` string into an `int` using the `std::stoi` function, which provides a robust way to convert a string to an integer, along with built-in error handling. However, since you have a `char*`, you'll first need to convert it to a `std::string`. Here's an example of how to do this with clear er... | 18,300 | [
{
"from": "human",
"value": "What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of returning zero).\n"
},
{
"from": "gpt",
"value": "In C++, you can parse a `char*` string into an `int` using the `std::stoi` function, which pr... |
Is there a way in PHP to make HTTP calls and not wait for a response? I don't care about the response, I just want to do something like file_get_contents(), but not wait for the request to finish before executing the rest of my code. This would be super useful for setting off "events" of a sort in my application, or tr... | Yes, in PHP you can make HTTP calls without waiting for a response by using several methods. Here are a few common approaches to achieve this:
### 1. Using `fsockopen` or `stream_socket_client`
You can use `fsockopen` or `stream_socket_client` to create a non-blocking socket connection to send the HTTP request. Here'... | 19,096 | [
{
"from": "human",
"value": "Is there a way in PHP to make HTTP calls and not wait for a response? I don't care about the response, I just want to do something like file_get_contents(), but not wait for the request to finish before executing the rest of my code. This would be super useful for setting off \"... |
I'm a newbie when it comes to SQL. When creating a stored procedure with parameters as such:
@executed bit,
@failure bit,
@success bit,
@testID int,
@time float = 0,
@name varchar(200) = '',
@description varchar(200) = '',
@executionDate... | In T-SQL, when defining default values for parameters in a stored procedure, your syntax is correct. Parameters can indeed have default values, and using defaults like `''` for string types is acceptable. However, there are a few things to note regarding your C# code and SQL parameter handling:
1. **Setting Parameter ... | 18,832 | [
{
"from": "human",
"value": "I'm a newbie when it comes to SQL. When creating a stored procedure with parameters as such:\n@executed bit,\n@failure bit,\n@success bit,\n@testID int,\n @time float = 0,\n@name varchar(200) = '',\n@desc... |
I thought I'd offer this softball to whomever would like to hit it out of the park. What are generics, what are the advantages of generics, why, where, how should I use them? Please keep it fairly basic. Thanks.
| Generics are a feature of many programming languages that allow you to define classes, interfaces, and methods with a placeholder for the data type they operate on. Instead of specifying a concrete data type, you use a type parameter (like `T`, `E`, or `K`) that can be replaced with any actual data type when you use it... | 16,439 | [
{
"from": "human",
"value": "I thought I'd offer this softball to whomever would like to hit it out of the park. What are generics, what are the advantages of generics, why, where, how should I use them? Please keep it fairly basic. Thanks.\n"
},
{
"from": "gpt",
"value": "Generics are a feature... |
When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?
| Reducing the file sizes of large JavaScript and CSS files can significantly improve the performance of a web application. Here are several strategies to achieve this:
### 1. Minification
- **JavaScript Minification:** Use tools like UglifyJS, Terser, or Google Closure Compiler to remove whitespace, comments, and unnec... | 15,587 | [
{
"from": "human",
"value": "When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?\n"
},
{
"from": "gpt",
"value": "Reducing the file sizes of large JavaScript and CSS files can significantly improve the performance of a web application. Here... |
Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool?
Thanks in advance.
| Yes, you can easily create a table in SQL Server 2005 from an Excel spreadsheet using a few different methods. Here are some commonly used approaches:
### Method 1: Import Data Wizard
SQL Server Management Studio (SSMS) provides an Import and Export Wizard that can help you import data from an Excel file into a SQL Se... | 18,610 | [
{
"from": "human",
"value": "Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool?\nThanks in advance.\n"
},
{
"from": "gpt",
"value": "Yes, you can easily create a table in SQL Server 2005 from an Excel spreadsheet using a few diffe... |
I wonder whether there is a workaround for using the standard XmlSiteMapProvider within a non asp.net application, like WinForm/Console or, in my case, VS Unit Test one.
The following code fails, because it cannot create a path to the .sitemap file inside a private GetConfigDocument method.
XmlSiteMapProvider provider ... | The `XmlSiteMapProvider` is part of the ASP.NET framework, and its design assumes a web application environment. When using it in a non-web context like a WinForms, Console application, or a unit test, you may run into challenges, especially since it relies on configuration settings that are typically found in an ASP.N... | 17,658 | [
{
"from": "human",
"value": "I wonder whether there is a workaround for using the standard XmlSiteMapProvider within a non asp.net application, like WinForm/Console or, in my case, VS Unit Test one.\nThe following code fails, because it cannot create a path to the .sitemap file inside a private GetConfigDoc... |
We're working on a rich client (written in Flex) that is connected to a Java backend, using both RMI and JMS. I was thinking about implementing the client in a DDD fashion so that it has Repositories for the CRUD operations on the domain objects.
The problem is however that all backend communication happens asynchronou... | Implementing a repository pattern in a rich client application using DDD principles can be challenging, especially with asynchronous communication. Here are the two options you've considered, along with some additional suggestions and ideas for caching:
### Option 1: Return the AsyncToken
**Pros:**
- Maintains a clea... | 17,243 | [
{
"from": "human",
"value": "We're working on a rich client (written in Flex) that is connected to a Java backend, using both RMI and JMS. I was thinking about implementing the client in a DDD fashion so that it has Repositories for the CRUD operations on the domain objects.\nThe problem is however that all... |
I need to recursively search directories and replace a string (say http://development:port/URI) with another (say http://production:port/URI) in all the files where ever it's found. Can anyone help?
It would be much better if that script can print out the files that it modified and takes the search/replace patterns as ... | Certainly! You can achieve this using a simple Python script that recursively searches through directories for files and replaces occurrences of a specified string. The script will take the search and replace patterns as input parameters and print out the files that were modified.
Here's a sample Python script that do... | 18,288 | [
{
"from": "human",
"value": "I need to recursively search directories and replace a string (say http://development:port/URI) with another (say http://production:port/URI) in all the files where ever it's found. Can anyone help?\nIt would be much better if that script can print out the files that it modified... |
I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html. I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application
| To serve your XHTML documents with the correct `Content-Type` header of `application/xhtml+xml`, you will need to configure your web server or application server accordingly. The steps to achieve this can vary depending on the server you are using. Here are some common setups:
### For Apache
If you're using Apache, y... | 20,076 | [
{
"from": "human",
"value": "I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html. I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application\n"
},
{
"... |
I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible?
Bonus question: how would I do it if the stream was in mp3 or other format?
This is for windows in nativ... | Yes, it is possible to play audio data as you read it from a socket in native C++. For WAV files, you can use the Windows Multimedia API (WinMM) to handle audio playback. If you're working with MP3 or other formats, you may need additional libraries, as WinMM does not directly support them.
### Playing WAV Data from a... | 13,397 | [
{
"from": "human",
"value": "I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible?\nBonus question: how would I do it if the stream was in mp3 or ... |
Using reflection in .Net, what is the differnce between:
if (foo.IsAssignableFrom(typeof(IBar)))
And
if (foo.GetInterface(typeof(IBar).FullName) != null)
Which is more appropriate, why?
When could one or the other fail?
| In .NET, reflection allows you to inspect the types of objects at runtime. The expressions you've provided relate to checking type compatibility with interfaces, but they do so in different ways. Let's break down both expressions:
### 1. `foo.IsAssignableFrom(typeof(IBar))`
- **Purpose**: This checks if an instance of... | 16,015 | [
{
"from": "human",
"value": "Using reflection in .Net, what is the differnce between:\n if (foo.IsAssignableFrom(typeof(IBar)))\n\nAnd\n if (foo.GetInterface(typeof(IBar).FullName) != null)\n\nWhich is more appropriate, why?\nWhen could one or the other fail?\n"
},
{
"from": "gpt",
"value": ... |
I've seen a few examples on how to do build deployment, however I have something unique that I'd like to do:
Deploy the build to a folder that has the build number (eg. Project\Builds\8423)
Alter the version number in the .NET AssmblyInfo.cs to match the build number
Has anyone done this before with .NET projects usi... | Yes, you can accomplish your requirements using NAnt and CruiseControl.NET by following these steps:
1. **Setting Up CruiseControl.NET**: First, ensure that your CruiseControl.NET server is properly set up and configured to trigger builds based on your repository changes.
2. **Using NAnt for Build Automation**: You w... | 12,844 | [
{
"from": "human",
"value": "I've seen a few examples on how to do build deployment, however I have something unique that I'd like to do:\n\nDeploy the build to a folder that has the build number (eg. Project\\Builds\\8423)\nAlter the version number in the .NET AssmblyInfo.cs to match the build number\n\nHa... |
i've been programming a while in D (http://www.digitalmars.com/d/) now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...).
Do you have any suggestions?
P.S: gdb did not work.
| If you are looking for a good development environment for D programming that supports code completion and debugging features, here are some suggestions:
1. **Visual Studio Code with D Language Extension**:
- **Code Completion**: You can install the D Language extension, which provides features like code completion,... | 13,241 | [
{
"from": "human",
"value": "i've been programming a while in D (http://www.digitalmars.com/d/) now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...).\nDo you have any suggestions?\nP.S: gdb did ... |
What is the difference between using the Runnable and Callable interfaces when designing a concurrent thread in Java, why would you choose one over the other?
| In Java, both the `Runnable` and `Callable` interfaces are used to define tasks that can be executed by a thread. However, there are some key differences between the two that can influence your decision on which one to use. Here are the main differences and considerations:
### Key Differences:
1. **Return Value**:
... | 17,616 | [
{
"from": "human",
"value": "What is the difference between using the Runnable and Callable interfaces when designing a concurrent thread in Java, why would you choose one over the other?\n"
},
{
"from": "gpt",
"value": "In Java, both the `Runnable` and `Callable` interfaces are used to define t... |
How can I combine the followings to fight spam and at the same time minimize annoyance imposed to the user?
In registration page, sending an email to verify the email address
In registration page, use CAPTCHA
In every post page, use CAPTCHA
Feel free to add new items to the list, and please tell your suggested scheme... | To effectively fight spam while minimizing user annoyance, we can prioritize the user experience by implementing the following scheme:
1. **Email Verification on Registration** - This ensures that the user has provided a valid email address and adds a layer of verification to prevent fake registrations.
2. **CAPTCHA o... | 19,208 | [
{
"from": "human",
"value": "How can I combine the followings to fight spam and at the same time minimize annoyance imposed to the user?\n\nIn registration page, sending an email to verify the email address\nIn registration page, use CAPTCHA\nIn every post page, use CAPTCHA\n\nFeel free to add new items to ... |
What is the best way to determine whether there is an available Internet connection for a WinForms app. (Programatically of course) I want to disable/hide certain functions if the user is not connected to the Internet.
| To determine if there is an available internet connection in a WinForms application, you can use the `System.Net.NetworkInformation` namespace, which provides network-related functionality. Specifically, the `NetworkInterface` class can be used to check the network status and determine if any network interfaces are up.... | 18,526 | [
{
"from": "human",
"value": "What is the best way to determine whether there is an available Internet connection for a WinForms app. (Programatically of course) I want to disable/hide certain functions if the user is not connected to the Internet.\n"
},
{
"from": "gpt",
"value": "To determine if... |
I've inherited a flash project (my first) that has many existing symbols in the library. They are organized in a large complex hierarchy of folders. Often, I find a reference to a symbol in actionscript code, but can't find the symbol in the library. The "Find" feature only searches for instances of a symbol. If none e... | In Adobe Flash (now Adobe Animate), there are a few methods you can use to find symbols in the library, especially if you're dealing with a complex hierarchy of folders:
1. **Library Search Bar**: If you're using a version of Adobe Animate that includes a search bar at the top of the Library panel, you can enter the n... | 20,063 | [
{
"from": "human",
"value": "I've inherited a flash project (my first) that has many existing symbols in the library. They are organized in a large complex hierarchy of folders. Often, I find a reference to a symbol in actionscript code, but can't find the symbol in the library. The \"Find\" feature only se... |
When is it better to use a List vs a LinkedList?
| When deciding whether to use a `List` (typically implemented as an array-based structure, like an `ArrayList` in Java or a list in Python) versus a `LinkedList` (a data structure made up of nodes that each contain a value and a reference to the next node), it's important to consider the characteristics and performance ... | 18,619 | [
{
"from": "human",
"value": "When is it better to use a List vs a LinkedList?\n"
},
{
"from": "gpt",
"value": "When deciding whether to use a `List` (typically implemented as an array-based structure, like an `ArrayList` in Java or a list in Python) versus a `LinkedList` (a data structure made u... |
I need to serialize the System.Configuration.SettingsProperty and System.Configuration.SettingsPropertyValue class object through WCF.
| To serialize `System.Configuration.SettingsProperty` and `System.Configuration.SettingsPropertyValue` class objects through WCF, you need to follow a few steps to ensure that these classes can be properly serialized and deserialized. The default WCF serialization mechanisms may not work directly with these classes, sin... | 14,464 | [
{
"from": "human",
"value": "I need to serialize the System.Configuration.SettingsProperty and System.Configuration.SettingsPropertyValue class object through WCF.\n"
},
{
"from": "gpt",
"value": "To serialize `System.Configuration.SettingsProperty` and `System.Configuration.SettingsPropertyValu... |
After installing Oracle XE, something in Oracle is listening on port 8080. I am not sure if they have an Apache HTTPD, a Tomcat, or something else. But how can I disable it?
| Oracle XE (Express Edition) comes with a built-in web interface that typically listens on port 8080. This is usually powered by the Oracle Application Express (APEX) service, which provides a web-based interface for managing the database. If you want to disable the service that is listening on port 8080, you can follow... | 18,423 | [
{
"from": "human",
"value": "After installing Oracle XE, something in Oracle is listening on port 8080. I am not sure if they have an Apache HTTPD, a Tomcat, or something else. But how can I disable it?\n"
},
{
"from": "gpt",
"value": "Oracle XE (Express Edition) comes with a built-in web interf... |
I've been looking at the DropBox Mac client and I'm currently researching implementing a similar interface for a different service.
How exactly do they interface with finder like this? I highly doubt these objects represented in the folder are actual documents downloaded on every load? They must dynamically download ... | To implement a Finder integration similar to Dropbox on macOS, you'll want to consider using a combination of technologies and APIs provided by Apple. Dropbox uses a mechanism known as **file system virtualization** or **file system abstraction** to present its cloud files in a way that makes them look like local files... | 17,499 | [
{
"from": "human",
"value": "I've been looking at the DropBox Mac client and I'm currently researching implementing a similar interface for a different service. \nHow exactly do they interface with finder like this? I highly doubt these objects represented in the folder are actual documents downloaded on e... |
I'm doing some profiling on a 1.1 app and have identified a problem. It seems that this function is taking forever to load on a certain page:
ParserCacheItem System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String, String, HttpContext)
I've searched around with no luck about what this does. Does anyone ... | The `CompileAndGetParserCacheItem` method in ASP.NET is part of the page lifecycle and is responsible for compiling a page or user control's markup and code-behind into an executable format. It does this by checking if a compiled version of the page or control is already available in the cache. If it is, it retrieves i... | 17,927 | [
{
"from": "human",
"value": "I'm doing some profiling on a 1.1 app and have identified a problem. It seems that this function is taking forever to load on a certain page:\nParserCacheItem System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String, String, HttpContext)\nI've searched around with... |
I need to open a popup Window to a cross domain content. I should not allow the user either to access or close the parent window, till i am done with Child window.
The main issue with Modal window is that stops any asynchrnous process running on the main window. For example, timers and auto refresh wont be working in ... | Creating a popup window that restricts user interaction with the parent window while still allowing asynchronous processes (like timers and auto-refresh) to run in the parent window can be challenging due to browser security policies and user experience considerations.
Here's a high-level overview of how you could ach... | 17,098 | [
{
"from": "human",
"value": "I need to open a popup Window to a cross domain content. I should not allow the user either to access or close the parent window, till i am done with Child window. \nThe main issue with Modal window is that stops any asynchrnous process running on the main window. For example, t... |
I am coming from Java and am currently working on a C# project. What is the recommended way to go about a) unit testing existing C# code and b) accomplishing TDD for C# development?
Also is there an equivalent to EMMA / EclEmma (free yet powerful code coverage tool) for Visual Studio and C# code?
| Welcome to C#! Transitioning from Java to C# can be smooth, especially with your background in unit testing and TDD (Test-Driven Development). Here’s how you can approach both unit testing existing C# code and implementing TDD, as well as code coverage tools available for C#.
### a) Unit Testing Existing C# Code
1. *... | 15,719 | [
{
"from": "human",
"value": "I am coming from Java and am currently working on a C# project. What is the recommended way to go about a) unit testing existing C# code and b) accomplishing TDD for C# development?\nAlso is there an equivalent to EMMA / EclEmma (free yet powerful code coverage tool) for Visual ... |
I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what?
| Yes, you can definitely perform image processing in Python, and there are several libraries available that make it relatively easy to work with images. Here are some of the most popular libraries for image processing in Python:
1. **Pillow (PIL Fork)**:
- Pillow is a user-friendly library that allows you to open, ... | 14,303 | [
{
"from": "human",
"value": "I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what?\n"
},
{
"from": "gpt",
"value": "Yes, you can definitely perform image processing in Python, and there are several libraries... |
In certain cases, I can't seem to get components to receive events.
[edit]
To clarify, the example code is just for demonstration sake, what I was really asking was if there was a central location that a listener could be added, to which one can reliably dispatch events to and from arbitrary objects.
I ended up using ... | In your scenario, you're encountering an issue with event propagation between components that have different parent containers. This is a common challenge when dealing with pop-ups or components that are not nested within the same display hierarchy.
### Event Dispatching in Flash/Flex
In Flex, events dispatched from... | 14,388 | [
{
"from": "human",
"value": "In certain cases, I can't seem to get components to receive events.\n[edit] \nTo clarify, the example code is just for demonstration sake, what I was really asking was if there was a central location that a listener could be added, to which one can reliably dispatch events to an... |
I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me?
| Of course! However, I need a bit more context about what you're referring to. Are you dealing with a programming language (like Python, JavaScript, etc.)? Are there specific terms, functions, or concepts you're seeing that you find confusing? If you can provide a snippet of the script or clarify what "both of them" ref... | 23,106 | [
{
"from": "human",
"value": "I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me?\n"
},
{
"from": "gpt",
"value": "Of course! However, I need a bit more context about what you're referring to. Are you dealing w... |
My code needs to run all networking routines in a separate NSThread.
I have got a library, which I pass a callback routine for communication:
my thread code
library
my callback (networking)
library
my thread code
My callback routine must POST some data to an HTTP server (NSURLConnection), wait for the ... | Using `NSURLConnection` in a separate `NSThread` requires a proper setup to handle the asynchronous nature of network requests. You'll need to start a run loop in the thread where you perform the networking tasks, and once you receive a response, you can post a notification to the main thread to update the UI. Here's a... | 13,545 | [
{
"from": "human",
"value": "My code needs to run all networking routines in a separate NSThread.\nI have got a library, which I pass a callback routine for communication:\nmy thread code\n library\n my callback (networking)\n library\nmy thread code\n\nMy callback routine must POST some data t... |
Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one.
| It's great that you were honest during your interview! Understanding the difference between symbolic links (symlinks) and hard links is important for working with file systems, and here’s a detailed explanation to help clarify these concepts:
### Symbolic Links (Symlinks)
- **Definition**: A symbolic link is a referen... | 18,908 | [
{
"from": "human",
"value": "Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one.\n"
},
{
"from": "gpt",
"value": "It's great that you... |
I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:
public function PrintStackTrace() {
try {
throw new Error('StackTrace');
} catch (e:Error) {
trace(e.getStackTrace());
}
}
I like to know if there are other way to do... | In ActionScript 3.0, obtaining a stack trace can indeed be done using the `Error` class, as you've shown in your example. The `getStackTrace()` method provides a string representation of the stack trace when an `Error` object is created and thrown.
Here are a few alternative approaches or additional methods you can co... | 16,139 | [
{
"from": "human",
"value": "I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:\npublic function PrintStackTrace() {\n try {\n throw new Error('StackTrace');\n } catch (e:Error) {\n trace(e.getStackTrace());\n }... |
I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL.
Ideally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happen ... | You're correct that directly accessing the URL of a page loaded in an iframe from a different origin is restricted due to the same-origin policy in web browsers. This is a security feature designed to prevent potential attacks and data leaks. Unfortunately, there isn't a way to circumvent these restrictions using JavaS... | 11,930 | [
{
"from": "human",
"value": "I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL.\nIdeally I would like to be able to load the iframes current url into a textbox with javascript. I rea... |
I've seen a lot of questions around that use improperly the expression "C/C++".
The reasons in my opinion are:
Newbie C and C++ programmers probably don't understand the difference between the two languages.
People don't really care about it since they want a generic, quick and "dirty" answer
While C/C++ could somet... | You make valid points regarding the use of the expression "C/C++" and the confusion it can create. Here are a few key considerations to think about:
1. **Fundamental Differences**: C and C++ are indeed distinct languages with different paradigms. C is a procedural programming language, while C++ incorporates object-or... | 20,393 | [
{
"from": "human",
"value": "I've seen a lot of questions around that use improperly the expression \"C/C++\".\nThe reasons in my opinion are: \n\nNewbie C and C++ programmers probably don't understand the difference between the two languages.\nPeople don't really care about it since they want a generic, qu... |
IOKit and the DiskArbitration framework can tell me a lot of things about mounted volumes on a mac, but they don't seem to be able to differentiate between HFS+ and HFS Standard volumes.
The IOKit/DA keys Content, DAVolumeKind and DAMediaContent are always Apple_HFS and hfs for both HFS Standard and HFS+ volumes.
disk... | You're correct in noting that the IOKit and DiskArbitration frameworks can provide a lot of information about mounted volumes, but they may not differentiate between HFS Standard (also known as HFS) and HFS+ (also known as HFS Plus or Mac OS Extended) volumes. Both frameworks refer to these file systems as "Apple_HFS" ... | 18,459 | [
{
"from": "human",
"value": "IOKit and the DiskArbitration framework can tell me a lot of things about mounted volumes on a mac, but they don't seem to be able to differentiate between HFS+ and HFS Standard volumes. \nThe IOKit/DA keys Content, DAVolumeKind and DAMediaContent are always Apple_HFS and hfs fo... |
I would like a constraint on a SQL Server 2000 table column that is sort of a combination of a foreign key and a check constraint. The value of my column must exist in the other table, but I am only concerned with values in the other table where one of its columns equal a specified value. The simplified tables are:
... | In SQL Server 2000, there is no built-in functionality to create a foreign key constraint with a condition based on values from another table. Foreign key constraints can only reference a complete row in the parent table without conditions. However, you can implement the desired logic using a combination of triggers.
... | 17,419 | [
{
"from": "human",
"value": "I would like a constraint on a SQL Server 2000 table column that is sort of a combination of a foreign key and a check constraint. The value of my column must exist in the other table, but I am only concerned with values in the other table where one of its columns equal a speci... |
How do I correct for floating point error in the following physical simulation:
Original point (x, y, z),
Desired point (x', y', z') after forces are applied.
Two triangles (A, B, C) and (B, C, D), who share edge BC
I am using this method for collision detection:
For each Triangle
If the original point is in fron... | To correct for floating-point errors in your collision detection algorithm while ensuring that a point does not inadvertently bypass collision checks between two triangles sharing an edge, you may consider the following approaches:
### 1. **Use a Margin of Error (Bounding Box)**
One of the most straightforward methods... | 15,149 | [
{
"from": "human",
"value": "How do I correct for floating point error in the following physical simulation:\n\nOriginal point (x, y, z),\nDesired point (x', y', z') after forces are applied.\nTwo triangles (A, B, C) and (B, C, D), who share edge BC\n\nI am using this method for collision detection:\nFor ea... |
Using Maven 1.x with just the bundled/standard plugins, what configuration is necessary to build an executable Jar?
Answers should cover:
including dependencies in target Jar
proper classpath configuration to make dependency Jars accessible
| To build an executable JAR file using Maven 1.x, you will need to configure your `project.xml` to properly package your application along with its dependencies. The key components for creating an executable JAR include setting up the appropriate plugins, specifying the main class for execution, and packaging the depend... | 13,407 | [
{
"from": "human",
"value": "Using Maven 1.x with just the bundled/standard plugins, what configuration is necessary to build an executable Jar?\nAnswers should cover:\n\nincluding dependencies in target Jar\nproper classpath configuration to make dependency Jars accessible\n\n"
},
{
"from": "gpt",
... |
This is not "exactly" a programming question, but it's highly related. We are writing an app that sends out email invitations for a client (no, it's not spam). Their designer gave us an HTML and CSS template to use which is fine. The problem is that it looks like crap in Outlook 2007 because Microsoft decided to use... | You're right that email rendering can be a significant challenge, especially with clients like Outlook 2007 that use different rendering engines. When it comes to statistics about email client usage, there are a few resources that can provide insights into the current trends.
1. **Litmus**: Litmus regularly publishes ... | 18,332 | [
{
"from": "human",
"value": "This is not \"exactly\" a programming question, but it's highly related. We are writing an app that sends out email invitations for a client (no, it's not spam). Their designer gave us an HTML and CSS template to use which is fine. The problem is that it looks like crap in Ou... |
An interesting issue came up recently. We came across some code that is using hashCode() as a salt source for MD5 encryption but this raises the question: will hashCode() return the same value for the same object on different VMs, different JDK versions and operating systems? Even if its not guaranteed, has it change... | The `hashCode()` method in Java, particularly for the `String` class, is indeed not guaranteed to produce the same value across different Java Virtual Machines (JVMs), JDK versions, or operating systems.
### 1. **String.hashCode() Implementation**
The `String.hashCode()` method is defined in the `String` class as foll... | 17,508 | [
{
"from": "human",
"value": "An interesting issue came up recently. We came across some code that is using hashCode() as a salt source for MD5 encryption but this raises the question: will hashCode() return the same value for the same object on different VMs, different JDK versions and operating systems? ... |
Say I have:
void Render(void(*Call)())
{
D3dDevice->BeginScene();
Call();
D3dDevice->EndScene();
D3dDevice->Present(0,0,0,0);
}
This is fine as long as the function I want to use to render is a function or a static member function:
Render(MainMenuRender);
Render(MainMenu::Render);
However, I really wa... | To enable your `Render` function to accept both regular functions, static member functions, and instance methods of a class, you can use `std::function` along with `std::bind`. This approach allows you to easily encapsulate the different types of callable entities you might want to pass in, including instance methods w... | 12,664 | [
{
"from": "human",
"value": "Say I have:\nvoid Render(void(*Call)())\n{\n D3dDevice->BeginScene();\n Call();\n D3dDevice->EndScene();\n D3dDevice->Present(0,0,0,0);\n}\n\nThis is fine as long as the function I want to use to render is a function or a static member function:\nRender(MainMenuRende... |
I have a single-threaded application that loads several assemblies at runtime using the following:
objDLL = Assembly.LoadFrom(strDLLs[i]);
I would like the assemblies loaded in this manner to use the same log4net.ILog reference as the rest of the assemblies do. But it appears the runtime loaded assemblies have a diffe... | When loading assemblies at runtime using `Assembly.LoadFrom`, those assemblies may not automatically share the same logging configuration or the same logger instance unless certain considerations are made. Here’s how you can ensure that your dynamically loaded assemblies can use the same `log4net.ILog` instance and con... | 14,723 | [
{
"from": "human",
"value": "I have a single-threaded application that loads several assemblies at runtime using the following:\nobjDLL = Assembly.LoadFrom(strDLLs[i]);\n\nI would like the assemblies loaded in this manner to use the same log4net.ILog reference as the rest of the assemblies do. But it appear... |
I'm looking to convert a SQL like statement on the fly to the equivalent regex i.e.
LIKE '%this%'
LIKE 'Sm_th'
LIKE '[C-P]arsen'
What's the best approach to doing this?
P.S. I'm looking to do this on the .Net Framework (C#).
| Converting SQL `LIKE` patterns to equivalent regular expressions (regex) can be tricky due to the differences in syntax and semantics between the two. Below is a guide and some code in C# to help you perform these conversions.
### SQL LIKE Patterns
1. **`%`**: Matches zero or more characters.
2. **`_`**: Matches exac... | 14,395 | [
{
"from": "human",
"value": "I'm looking to convert a SQL like statement on the fly to the equivalent regex i.e. \nLIKE '%this%'\nLIKE 'Sm_th'\nLIKE '[C-P]arsen'\n\nWhat's the best approach to doing this?\nP.S. I'm looking to do this on the .Net Framework (C#).\n"
},
{
"from": "gpt",
"value": "C... |
I am returning XML data from the Yahoo GeoPlanet web service using HttpWebRequest.
I am loading the XML using
XPathDocument doc = new XPathDocument(HttpWebResponse.GetResponseStream())
Next comes:
XPathNavigator nav = doc.CreateNavigator();
If I do nav.Select("places"); or nav.Select("/places"); or nav.Select("//pl... | The issue you're experiencing with XPath is likely related to how you're specifying the XPath expression and the structure of the XML document returned by the Yahoo GeoPlanet web service. Here are some insights and steps to help you troubleshoot and correct your XPath queries:
1. **Understanding the XML Structure**: F... | 18,496 | [
{
"from": "human",
"value": "I am returning XML data from the Yahoo GeoPlanet web service using HttpWebRequest. \nI am loading the XML using \nXPathDocument doc = new XPathDocument(HttpWebResponse.GetResponseStream())\n\nNext comes:\nXPathNavigator nav = doc.CreateNavigator();\n\nIf I do nav.Select(\"places... |
Changing a value prompt to a multi-select value prompt in Report studio, provide single select functionality. How can i get multi-select functionality?
| To convert a single-select value prompt to a multi-select value prompt in IBM Cognos Report Studio while ensuring that it retains single select functionality (in case that's required for specific reports or scenarios), you can follow these steps:
### Steps to Create a Multi-Select Value Prompt:
1. **Open Your Report*... | 18,487 | [
{
"from": "human",
"value": "Changing a value prompt to a multi-select value prompt in Report studio, provide single select functionality. How can i get multi-select functionality?\n"
},
{
"from": "gpt",
"value": "To convert a single-select value prompt to a multi-select value prompt in IBM Cogn... |
I've had a go at solving the Eternity puzzle (1,000,000 GBP prize) and Netflix Prize ($1,000,000) in the past. I didn't win either, but they motivated me to find out about a new area.
What other contests with prizes do you know about / have competed in yourself?
| There are several notable contests and competitions across various fields that offer substantial prizes. Here are a few examples:
1. **Ansari X Prize**: A $10 million prize for the first privately funded group to launch a reusable manned spacecraft into space twice within two weeks.
2. **The Netflix Prize**: As you m... | 19,351 | [
{
"from": "human",
"value": "I've had a go at solving the Eternity puzzle (1,000,000 GBP prize) and Netflix Prize ($1,000,000) in the past. I didn't win either, but they motivated me to find out about a new area. \nWhat other contests with prizes do you know about / have competed in yourself?\n"
},
{
... |
I have a table in a MSSQL database that looks like this:
Timestamp (datetime)
Message (varchar(20))
Once a day, a particular process inserts the current time and the message 'Started' when it starts. When it is finished it inserts the current time and the message 'Finished'.
What is a good query or set of statements t... | To achieve the desired functionality, you can use a combination of SQL statements to check the conditions you've specified. Here’s a query that checks for the presence of the 'Started' and 'Finished' messages for a specific date and raises an error if the data is invalid:
```sql
DECLARE @CountStarted INT;
DECLARE @Cou... | 14,904 | [
{
"from": "human",
"value": "I have a table in a MSSQL database that looks like this:\nTimestamp (datetime)\nMessage (varchar(20))\n\nOnce a day, a particular process inserts the current time and the message 'Started' when it starts. When it is finished it inserts the current time and the message 'Finished'... |
What is the Perl equivalent of strlen()?
| In Perl, the equivalent of the `strlen()` function from languages like C is the `length` function. You can use it to get the length of a string. Here's a simple example:
```perl
my $string = "Hello, world!";
my $length = length($string);
print "The length of the string is: $length\n";
```
In this example, `length($st... | 22,623 | [
{
"from": "human",
"value": "What is the Perl equivalent of strlen()?\n"
},
{
"from": "gpt",
"value": "In Perl, the equivalent of the `strlen()` function from languages like C is the `length` function. You can use it to get the length of a string. Here's a simple example:\n\n```perl\nmy $string ... |
Is it possible to split large ASP.NET-pages into pieces? JSP has the jsp:include directive. Is there any equivivalent in ASP.NET
I'm not interested in reusing the pieces. I just want to organize the HTML/ASP code.
Isn't User Controls and Master Pages overkill for doing this?
| Yes, in ASP.NET, you can certainly split large pages into smaller pieces to improve organization and maintainability. While User Controls and Master Pages are common methods for code reuse and layout consistency, they can indeed be seen as overkill if your goal is simply to structure a single page better without needin... | 18,105 | [
{
"from": "human",
"value": "Is it possible to split large ASP.NET-pages into pieces? JSP has the jsp:include directive. Is there any equivivalent in ASP.NET\nI'm not interested in reusing the pieces. I just want to organize the HTML/ASP code.\nIsn't User Controls and Master Pages overkill for doing this?\n... |
I have a table with many millions of rows. I need to find all the rows with a specific column value. That column is not in an index, so a table scan results.
But would it be quicker to add an index with the column at the head (prime key following), do the query, then drop the index?
I can't add an index permanently as ... | Creating an index temporarily to expedite a specific query can indeed improve performance, especially if the table contains millions of rows. However, whether this approach is worthwhile depends on several factors:
1. **Index Creation Time**: The time it takes to create the index can be significant, especially for lar... | 11,143 | [
{
"from": "human",
"value": "I have a table with many millions of rows. I need to find all the rows with a specific column value. That column is not in an index, so a table scan results.\nBut would it be quicker to add an index with the column at the head (prime key following), do the query, then drop the i... |
Since Unicode lacks a series of zero width sorting characters, I need to determine equivalent characters that will allow me to force a certain order on a list that is automatically sorted by character values. Unfortunately the list items are not in an alphabetical order, nor is it acceptable to prefix them with visible... | To sort items using invisible characters in a way that they appear in a specific order, you can use zero-width characters from Unicode. Here are a few characters you can consider:
1. **Zero Width Space (U+200B)**: This character takes up no width and is often used in text to control formatting without adding visible s... | 19,839 | [
{
"from": "human",
"value": "Since Unicode lacks a series of zero width sorting characters, I need to determine equivalent characters that will allow me to force a certain order on a list that is automatically sorted by character values. Unfortunately the list items are not in an alphabetical order, nor is ... |
We are sending out Word documents via email (automated system, not by hand). The email is sent to the user, and CC'd to me.
We are getting reports that some users are having the attachments come through corrupted, though when we open the copy that is CC'd to me, it opens fine.
When the user forwards us the copy they re... | The issue you're encountering with the corrupted Word document attachments could indeed be related to the charset encoding in the MIME type specified in the email headers.
### Explanation of the Problem:
1. **Charset Definition**: In the original email, the `Content-Type` specifies `charset="utf-8"`. This means the e... | 15,351 | [
{
"from": "human",
"value": "We are sending out Word documents via email (automated system, not by hand). The email is sent to the user, and CC'd to me.\nWe are getting reports that some users are having the attachments come through corrupted, though when we open the copy that is CC'd to me, it opens fine.\... |
While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size - ??
| When working with files in C++ using `ofstream`, there's no direct built-in function to check the size of the file you are writing to while writing. However, you can monitor the file size using a couple of methods and understand the limits imposed by the operating system.
### Linux Maximum File Size
On Linux, the max... | 17,876 | [
{
"from": "human",
"value": "While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size - ??\n"
},
{
"from": "gpt",
"value": "When working with files in C++ using `ofstream`, there's no direct built-... |
Publishing and/or collaborative applications often involve the sharing of access to resources. In a portal a user may be granted access to certain content as a member of a group or because of explicit access. The complete set of content could include public content, group membership content, and private user content. O... | Your questions touch on the complexities of managing access control in applications that handle sensitive or restricted resources. Let’s break down both of your questions.
### 1. Efficiently Performing Authorization on Available Resources
To efficiently perform authorization on a list of available resources, you can ... | 14,267 | [
{
"from": "human",
"value": "Publishing and/or collaborative applications often involve the sharing of access to resources. In a portal a user may be granted access to certain content as a member of a group or because of explicit access. The complete set of content could include public content, group member... |
I've been learning CSS for a while now, but the simplified layout below is still a little beyond me, so I am asking whether anyone knows of a model for such a layout, or would have an explanation to make this work.
The page should have 3 bands or blocks:
header, bottom, and content.
The 'header' would start at left 0,... | Hi Mike!
Creating a layout with fixed header and footer using CSS is definitely achievable. Below is a simple example of how you can set up your layout with the requirements you've described.
You can achieve this layout using CSS Flexbox along with some basic styling. Here is the HTML and CSS code that demonstrates ... | 17,315 | [
{
"from": "human",
"value": "I've been learning CSS for a while now, but the simplified layout below is still a little beyond me, so I am asking whether anyone knows of a model for such a layout, or would have an explanation to make this work.\nThe page should have 3 bands or blocks:\nheader, bottom, and co... |
Here's a question to expose my lack of experience: I have a method DoSomething() which throws an exception if it doesn't manage to do it cleanly. If it fails, I try the less accurate method DoSomethingApproximately() several times in the hope that it will find a sufficiently good solution; if this also fails I finally ... | The approach you've described, while functional, can indeed be improved for both readability and maintainability. Let's address each of your questions one by one.
### 1. Is the current pattern acceptable, or is there a more elegant way?
Your current pattern is a form of exception handling, but it can be refactored fo... | 11,349 | [
{
"from": "human",
"value": "Here's a question to expose my lack of experience: I have a method DoSomething() which throws an exception if it doesn't manage to do it cleanly. If it fails, I try the less accurate method DoSomethingApproximately() several times in the hope that it will find a sufficiently goo... |
A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results?
I need to be able to integrate with a search platform being provided by a private vendor who is exposing his functionality as a web service. So, I'm just loo... | Certainly! To call a web service from within the JBoss Seam framework, you'll typically use a combination of Java's JAX-WS (Java API for XML Web Services) or JAX-RS (Java API for RESTful Web Services) depending on whether you're working with SOAP or RESTful web services.
Here, I'll provide you with sample code for bot... | 5,468 | [
{
"from": "human",
"value": "A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results?\nI need to be able to integrate with a search platform being provided by a private vendor who is exposing his functi... |
We have a pair of applications. One is written in C# and uses something like:
string s = "alpha\r\nbeta\r\ngamma\r\ndelta";
// Actually there's wrapper code here to make sure this works.
System.Windows.Forms.Clipboard.SetDataObject(s, true);
To put a list of items onto the clipboard. Another application (in WinBa... | The issue you're encountering seems quite peculiar, especially since it only affects one user in an otherwise consistent environment. Here are several troubleshooting steps and potential solutions to consider:
1. **User-Specific Settings**: Investigate if there are any user-specific settings or configurations in their... | 19,451 | [
{
"from": "human",
"value": "We have a pair of applications. One is written in C# and uses something like:\n string s = \"alpha\\r\\nbeta\\r\\ngamma\\r\\ndelta\";\n // Actually there's wrapper code here to make sure this works.\n System.Windows.Forms.Clipboard.SetDataObject(s, true);\n\nTo put a list of it... |
I'm using Internet Explorer 8 beta 2.
Client performs POST on http://alpha/foo
Server responds with redirect to http://beta/bar
Client performs GET on http://beta/bar
Server responds with redirect to http://beta/baz and sets cookie
Client performs GET on http://beta/baz including cookie
Server provides response
User... | The behavior you're experiencing with Internet Explorer 8 beta 2 seems to be related to how it handles cookies, particularly when dealing with redirects and "Open in new window" actions. Given that this is a known issue in this beta version of IE, there might not be a reliable fix. However, here are some workarounds yo... | 18,692 | [
{
"from": "human",
"value": "I'm using Internet Explorer 8 beta 2. \n\nClient performs POST on http://alpha/foo\nServer responds with redirect to http://beta/bar\nClient performs GET on http://beta/bar\nServer responds with redirect to http://beta/baz and sets cookie\nClient performs GET on http://beta/baz... |
Given the following HTML:
<select name="my_dropdown" id="my_dropdown">
<option value="1">displayed text 1</option>
</select>
How do I grab the string "displayed text 1" using Javascript/the DOM?
| You can grab the string "displayed text 1" from the `<select>` element using JavaScript by accessing the selected option. Here is how you can do it:
```javascript
// Get the <select> element by its id
var selectElement = document.getElementById('my_dropdown');
// Get the text of the selected option
var selectedText =... | 22,969 | [
{
"from": "human",
"value": "Given the following HTML:\n<select name=\"my_dropdown\" id=\"my_dropdown\">\n<option value=\"1\">displayed text 1</option>\n</select>\n\nHow do I grab the string \"displayed text 1\" using Javascript/the DOM?\n"
},
{
"from": "gpt",
"value": "You can grab the string \... |
Suppose I have one list:
IList<int> originalList = new List<int>();
originalList.add(1);
originalList.add(5);
originalList.add(10);
And another list...
IList<int> newList = new List<int>();
newList.add(1);
newList.add(5);
newList.add(7);
newList.add(11);
How can I update originalList so that:
If the int appears ... | To achieve your goal of updating `originalList` based on the contents of `newList`, you can use LINQ for a concise and efficient solution in C#. Here's how you can do it with minimal code:
```csharp
IList<int> originalList = new List<int> { 1, 5, 10 };
IList<int> newList = new List<int> { 1, 5, 7, 11 };
// Retain onl... | 16,913 | [
{
"from": "human",
"value": "Suppose I have one list:\nIList<int> originalList = new List<int>();\noriginalList.add(1);\noriginalList.add(5);\noriginalList.add(10);\n\nAnd another list... \nIList<int> newList = new List<int>();\nnewList.add(1);\nnewList.add(5);\nnewList.add(7); \nnewList.add(11);\n\nHow ca... |
The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?
The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be f... | To create a variable similar to `__debug__` that can be set before importing other modules and accessed by them, you can use a simple approach by defining your variable in a specific module and then ensuring that all other modules import it from there. Here's how you can do it:
1. **Create a dedicated module**: Create... | 19,688 | [
{
"from": "human",
"value": "The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?\nThe variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one... |
I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):
In the .pas file of a form, I would change the form to inherit ... | It sounds like you encountered some common issues when working with form inheritance in Delphi 7. Here are the issues you faced and your proposed solutions, which can help others facing similar challenges in their Delphi projects:
### Issue 1: Inheriting Components from Ancestor Form
**Problem:** When you change the ... | 17,579 | [
{
"from": "human",
"value": "I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):\n\nIn the .pas file of ... |
I am using SQL Server 2005. I want to constrain the values in a column to be unique, while allowing NULLS.
My current solution involves a unique index on a view like so:
CREATE VIEW vw_unq WITH SCHEMABINDING AS
SELECT Column1
FROM MyTable
WHERE Column1 IS NOT NULL
CREATE UNIQUE CLUSTERED INDEX unq_idx ... | Your current approach using a view with a unique index is a valid solution to enforce uniqueness for a column while allowing NULLs in SQL Server 2005. However, there's a more straightforward approach that you can consider using a filtered unique index, which is simpler and cleaner.
### Filtered Unique Index Approach
... | 21,793 | [
{
"from": "human",
"value": "I am using SQL Server 2005. I want to constrain the values in a column to be unique, while allowing NULLS.\nMy current solution involves a unique index on a view like so:\nCREATE VIEW vw_unq WITH SCHEMABINDING AS\n SELECT Column1\n FROM MyTable\n WHERE Column1 IS NO... |
Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?
| In Eclipse 3.4, refactoring tools like "Rename" can automatically update accessor and mutator (getter and setter) methods when you rename the variables they are associated with. However, this behavior might not be automatic for all cases, especially if your accessors/mutators are not following the standard naming conve... | 19,395 | [
{
"from": "human",
"value": "Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?\n"
},
{
"from": "gpt",
"value": "In Eclipse 3.4, refactoring tools like \"Rename\" can automatically update accessor and mutator (getter a... |
For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe's content.
specifically, I am accessing the content like this:
$("some_iframe_id").get(0).contentWindow.document
I tested it and it worked.
On some of the ... | The "Access is denied" error you are experiencing when trying to access the content of an iframe can be particularly tricky, especially when using Internet Explorer (IE). Here are several factors and solutions that might help you troubleshoot and resolve the issue:
1. **Same-Origin Policy**: Ensure that the iframe is ... | 17,541 | [
{
"from": "human",
"value": "For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe's content. \nspecifically, I am accessing the content like this:\n$(\"some_iframe_id\").get(0).contentWindow.document... |
Documentation can be found here
It says in the example:
onDrop:
Called whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Event. You can extract additional information about the drop – like if the ... | Certainly! The callback function for `onDrop` receives three parameters: the draggable element, the droppable element, and the event. While the example you provided uses `element` to refer only to the draggable element, you can reference the droppable element by specifying another parameter.
Here's a modified version ... | 19,045 | [
{
"from": "human",
"value": "Documentation can be found here\nIt says in the example:\nonDrop:\nCalled whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Event. You can extract addition... |
I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network.
After renaming the server, the Sharepoint sites have many errors and do not run.
| When you clone a virtual machine (VM) that is running SharePoint, there are a number of configuration issues that can arise, especially related to network identity, database connections, and services. Here are the key steps to avoid errors and ensure a smooth setup when creating a new VM for SharePoint development:
##... | 12,589 | [
{
"from": "human",
"value": "I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network.\nAfter renaming the server, the Sharepoint sites have many errors and do not run.\n"
},
{
"f... |
In the application we have something about 30 types of objects that are created repeatedly.
Some of them have long life (hours) some have short (milliseconds).
Objects could be created in one thread and destroyed in another.
Does anybody have any clue what could be good pooling technique in the sense of minimal cre... | Designing a pooling system that minimizes latency, reduces lock contention, and maintains efficient memory utilization requires careful consideration of your application's threading model, object lifetimes, and specific requirements. Based on your appendices and requirements, here are some recommendations on how to des... | 16,358 | [
{
"from": "human",
"value": "\nIn the application we have something about 30 types of objects that are created repeatedly. \nSome of them have long life (hours) some have short (milliseconds). \nObjects could be created in one thread and destroyed in another.\n\nDoes anybody have any clue what could be good... |
I need something in between a full text search and an index search:
I want to search for text in one column of my table (probably there will be an index on the column, too, if that matters).
Problem is, I want to search for words in the column, but I don't want to match parts.
For example, my column might contain bus... | To achieve the desired behavior of searching for whole words while ignoring partial matches, you can use a combination of `LIKE` with patterns and possibly regular expressions, depending on your SQL database. However, since you specifically asked for LINQ as well as SQL, I will provide solutions for both.
### SQL Solu... | 13,124 | [
{
"from": "human",
"value": "I need something in between a full text search and an index search:\nI want to search for text in one column of my table (probably there will be an index on the column, too, if that matters).\nProblem is, I want to search for words in the column, but I don't want to match parts.... |
In the past I've done web application development using Visual Studio. Initially I'd use the design view, editing the page visually. But over time I learned more and more (X)HTML, CSS, and Javascript. I became familiar with the tags for ASP.NET server controls and their common attributes.
I got to the point where I'd d... | It's great to hear about your experience with web application development and your proficiency in hand-coding HTML, CSS, and JavaScript. Given your background, here are some considerations regarding whether you should use Dreamweaver or Notepad++:
### 1. **Your Workflow**
- Since you are comfortable with hand-codin... | 18,554 | [
{
"from": "human",
"value": "In the past I've done web application development using Visual Studio. Initially I'd use the design view, editing the page visually. But over time I learned more and more (X)HTML, CSS, and Javascript. I became familiar with the tags for ASP.NET server controls and their common a... |
I have an SQL reporting server report which has 5 parameters which permit nullable values. The user may enter values for any of the fields. I need to enforce the condition that the user must enter at least one out of five parameter values (any one is required).
****Note**: I need to do this in SQL Server reports itsel... | To enforce a condition where at least one of the five parameters must be provided in SQL Server Reporting Services (SSRS), you can use the following approach:
### Steps to Implement Validation:
1. **Create the Parameters**:
- Assume you have five parameters named `@Param1`, `@Param2`, `@Param3`, `@Param4`, and `@P... | 16,953 | [
{
"from": "human",
"value": "I have an SQL reporting server report which has 5 parameters which permit nullable values. The user may enter values for any of the fields. I need to enforce the condition that the user must enter at least one out of five parameter values (any one is required). \n****Note**: I n... |
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework.
My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship.
I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct as... | In Entity Framework, the behavior you’re encountering with navigation properties being `null` is likely due to the way that Entity Framework handles lazy loading, eager loading, and explicit loading.
By default, when you retrieve entities from the database, only the properties of those entities are populated, and navi... | 15,128 | [
{
"from": "human",
"value": "Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. \nMy test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship.\nI then used the Entity Data Model wizard to auto-generate the EDM from the databas... |
Possible Duplicate:
SVN plugins for Eclipse - Subclipse vs. Subversive
I've been using Subclipse (an SVN plugin for Eclipse), for quite a while, but have become increasingly unhappy with it. I notice that Tortoise SVN is available as an Eclipse plugin and am considering using that instead within Eclipse (I already u... | When it comes to SVN integration in Eclipse, both Subclipse and Subversive are the most popular options. Here’s a brief overview of each, as well as the TortoiseSVN Eclipse plugin:
### 1. **Subclipse**
- **Pros**:
- Mature and stable plugin.
- Good integration with Eclipse.
- Active development and regular upda... | 20,794 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nSVN plugins for Eclipse - Subclipse vs. Subversive \n\nI've been using Subclipse (an SVN plugin for Eclipse), for quite a while, but have become increasingly unhappy with it. I notice that Tortoise SVN is available as an Eclipse plugin and am considering u... |
Here at work, we are working on a newsletter system that our clients can use. As an intern one of my jobs is to help with the smaller pieces of the puzzle. In this case what I need to do is scan the logs of the email server for bounced messages and add the emails and the reason the email bounced to a "bad email databas... | Your Perl script is almost there, but there are a few areas that need adjustments to work correctly and efficiently. Here’s a step-by-step breakdown of the improvements and fixes:
1. **Correct the shebang line:** It looks like there's a small typo in the shebang line. It should be `#!/usr/bin/perl`.
2. **Reading from... | 16,047 | [
{
"from": "human",
"value": "Here at work, we are working on a newsletter system that our clients can use. As an intern one of my jobs is to help with the smaller pieces of the puzzle. In this case what I need to do is scan the logs of the email server for bounced messages and add the emails and the reason ... |
Any hints on parsing / converting / operating on hex values in c# ?
In particular I want to cast a decimal int to hex and then output as a string...
| In C#, you can easily convert a decimal integer to a hexadecimal string using the built-in methods. Here are some hints and examples to help you parse, convert, and operate on hexadecimal values.
### Converting Decimal to Hexadecimal
To convert a decimal integer to a hexadecimal string, you can use the `ToString` met... | 17,588 | [
{
"from": "human",
"value": "Any hints on parsing / converting / operating on hex values in c# ?\nIn particular I want to cast a decimal int to hex and then output as a string... \n"
},
{
"from": "gpt",
"value": "In C#, you can easily convert a decimal integer to a hexadecimal string using the b... |
I have a templated class defined (in part) as
template <class T> MyClass
{
public:
void DoSomething(){}
};
If I want to call DoSomething from another class, but be able to do this for multiple 'T' types in the same place, I am stuck for an idea as method functions pointers are uniquely constrained to the class type... | To achieve your goal of calling the `DoSomething()` method from multiple instantiations of a templated class, you can use polymorphism with a base class that provides a common interface. You can then use this interface to store pointers or references to the derived class objects in a way that allows for calling `DoSome... | 11,729 | [
{
"from": "human",
"value": "I have a templated class defined (in part) as\ntemplate <class T> MyClass\n{\npublic:\n void DoSomething(){}\n};\n\nIf I want to call DoSomething from another class, but be able to do this for multiple 'T' types in the same place, I am stuck for an idea as method functions poi... |
Everything I have read says that when making a managed stored procedure, to right click in Visual Studio and choose deploy. That works fine, but what if I want to deploy it outside of Visual Studio to a number of different locations? I tried creating the assembly with the dll the project built in SQL, and while it did ... | Yes, you can deploy a managed stored procedure outside of Visual Studio directly within SQL Server using T-SQL commands. The key steps involve creating the assembly and then creating the stored procedures from that assembly. Here’s how you can do it step by step:
### Step 1: Create the Assembly
First, you need to upl... | 17,820 | [
{
"from": "human",
"value": "Everything I have read says that when making a managed stored procedure, to right click in Visual Studio and choose deploy. That works fine, but what if I want to deploy it outside of Visual Studio to a number of different locations? I tried creating the assembly with the dll th... |
In IIS 6, I can use the Web Service Extensions folder in Inetmgr to allow/prohibit isapi filters, such as ASP.net. I want to be able to do this programmatically (in particular, from an installer script/exe).
Any ideas?
| To programmatically manage Web Service Extensions in IIS 6, you can use the `ADSUTIL.VBS` script that is included with IIS 6. This script allows you to manipulate IIS settings via the Windows Script Host (WSH). You can enable or disable ISAPI filters like ASP.NET through this script.
Here’s a step-by-step guide on how... | 15,658 | [
{
"from": "human",
"value": "In IIS 6, I can use the Web Service Extensions folder in Inetmgr to allow/prohibit isapi filters, such as ASP.net. I want to be able to do this programmatically (in particular, from an installer script/exe).\n\nAny ideas?\n"
},
{
"from": "gpt",
"value": "To programma... |
Since, for various reasons, I can't use IIS for an ASP.NET website I'm developing, I run Cassini from the command line to test the site. However, after installing Visual Studio 2008 SP1, I get a System.Net.Sockets.SocketException when I try to start up the web server. Is anyone else having this problem, and if so, ho... | The `System.Net.Sockets.SocketException` you are encountering when trying to start Cassini (the ASP.NET Development Server) after installing Visual Studio 2008 SP1 could stem from a few different issues. Here are some steps you can take to troubleshoot and potentially fix the problem:
1. **Check for Port Conflicts**:
... | 20,330 | [
{
"from": "human",
"value": "Since, for various reasons, I can't use IIS for an ASP.NET website I'm developing, I run Cassini from the command line to test the site. However, after installing Visual Studio 2008 SP1, I get a System.Net.Sockets.SocketException when I try to start up the web server. Is anyon... |
How do I use the softkeys with a CDialog based application in windows mobile 6 via MFC?
I have a CDialog based Windows Mobile 6 (touchscreen) Professional app that I am workign on.
The default behavior of a CDialog based app in WM6 Professional is to not use any softkeys by default... I want to map the softkeys to "Can... | To implement softkeys in a CDialog-based application in Windows Mobile 6 using MFC, you can use the `SHCreateMenuBar` function to create a simple menu bar that will allow you to handle the softkey functionality. Below is a basic example of how to map the softkeys to "OK" and "Cancel" actions in your dialog class.
### ... | 14,219 | [
{
"from": "human",
"value": "How do I use the softkeys with a CDialog based application in windows mobile 6 via MFC?\nI have a CDialog based Windows Mobile 6 (touchscreen) Professional app that I am workign on.\nThe default behavior of a CDialog based app in WM6 Professional is to not use any softkeys by de... |
Does anyone know of a good (preferably open source) library for dealing with the Modbus protocol? I have seen a few libraries, but I am looking for some people's personal experiences, not just the top ten Google hits. I figure there has to be at least one other person who deals with PLCs and automation hardware like I ... | Certainly! There are several open-source libraries for dealing with the Modbus protocol, and a few have gained popularity in the automation and PLC community. Here are some libraries based on personal experiences and community feedback:
1. **libmodbus**:
- **Language**: C
- **Description**: This is a well-docume... | 12,962 | [
{
"from": "human",
"value": "Does anyone know of a good (preferably open source) library for dealing with the Modbus protocol? I have seen a few libraries, but I am looking for some people's personal experiences, not just the top ten Google hits. I figure there has to be at least one other person who deals ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.