instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
While connecting .NET to sybase server I got this error message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
This has worked properly before. System DSN with same details worked and data connection through vs.net also worked.
I am using VS.NET 2005.
Any suggestions?
| The error message you're seeing, "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified," indicates that the ODBC driver cannot find the data source you specified, or that no driver is configured correctly. Here are some steps you can take to troubleshoot and resolve the issue:
1.... | 34,865 | [
{
"from": "human",
"value": "While connecting .NET to sybase server I got this error message:\n\n[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified\n\nThis has worked properly before. System DSN with same details worked and data connection through vs.net also worked.... |
Has anyone had experience with developing a distributed system as a grid?
By grid, I mean, a distributed system where all nodes are identical and there is no central management, database etc.
How can the grid achieve even distribution of: CPU, Memory, Disk, Bandwidth etc.?
| Yes, developing distributed systems as a grid, where all nodes are identical and there is no central management, is a common architectural pattern in distributed computing. This kind of architecture can be particularly appealing for applications that require high availability, scalability, and resilience. Here are some... | 33,206 | [
{
"from": "human",
"value": "Has anyone had experience with developing a distributed system as a grid?\nBy grid, I mean, a distributed system where all nodes are identical and there is no central management, database etc.\nHow can the grid achieve even distribution of: CPU, Memory, Disk, Bandwidth etc.?\n"
... |
I'm embedding an IE control into my C++ application. The problem is that although system-wide, ClearType is disabled, IE7 has its own separate setting, and unless I specifically disable that too, text inside the IE control will be antialiased while the rest of the app will not.
The same goes for IE7's font size setting... | When embedding an Internet Explorer (IE) control in your application, it indeed behaves independently in terms of some display settings, such as ClearType and font size. Unfortunately, programmatically controlling the ClearType settings and the font size in the IE control directly is not straightforward, as these setti... | 34,726 | [
{
"from": "human",
"value": "I'm embedding an IE control into my C++ application. The problem is that although system-wide, ClearType is disabled, IE7 has its own separate setting, and unless I specifically disable that too, text inside the IE control will be antialiased while the rest of the app will not.\... |
I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run it from a Service, nothing happens. No errors or exceptions are thrown.
I realise that running code in a service is a different scope than run... | The issue you're facing when trying to enable/disable Windows Aero from a Windows Service is primarily due to the limitations imposed by the Windows operating system on services. Windows Services run in a different session than the user interface and often do not have access to the desktop or GUI components, which is l... | 33,044 | [
{
"from": "human",
"value": "I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run it from a Service, nothing happens. No errors or exceptions are thrown.\nI realise that running code ... |
How do I prevent Visual Studio 2008 from automatically creating the "Mixed Platforms" and "Any CPU" solution configurations? We have "Win32" and "x64" configurations and a developer needs to choose between them. However, as soon as anyone makes any changes to the solution VS automatically creates "Mixed Platforms" and ... | To prevent Visual Studio 2008 from automatically creating "Mixed Platforms" and "Any CPU" solution configurations, you can follow these steps:
### Step 1: Remove Unwanted Configurations
1. **Open your solution** in Visual Studio 2008.
2. Go to the **Solution Explorer**.
3. Right-click on your solution and select **Co... | 32,886 | [
{
"from": "human",
"value": "How do I prevent Visual Studio 2008 from automatically creating the \"Mixed Platforms\" and \"Any CPU\" solution configurations? We have \"Win32\" and \"x64\" configurations and a developer needs to choose between them. However, as soon as anyone makes any changes to the solutio... |
I've seen a lot of different takes on this subject so I figured if there's a preferred way on this.
Is there any best practices on how to setup Visual Studio Projects and Solutions in regards to multiple solutions for the same solutions?
For example:
Let's say I have a task that calls for a web app, a console applicati... | Setting up Visual Studio projects and solutions can significantly impact the maintainability and manageability of your codebase. There are several best practices you can follow, particularly in scenarios where you have multiple related projects, such as a web app, a console application, and a shared business logic libr... | 33,245 | [
{
"from": "human",
"value": "I've seen a lot of different takes on this subject so I figured if there's a preferred way on this.\nIs there any best practices on how to setup Visual Studio Projects and Solutions in regards to multiple solutions for the same solutions?\nFor example:\nLet's say I have a task t... |
We been having some discussions on approaches to using the entity framework at work recently. We have a fairly large and complex n-tier web based application, which is due for a major overhaul.
The question is: If we where to starting using the entity framework, would it be better to create one big model, or a set of s... | When deciding between creating one large model or a set of smaller, functional/activity-based models in Entity Framework (EF), there are several factors to consider, especially in the context of a large and complex n-tier web application. Here are some points to consider for both approaches:
### One Big Model
**Pros:... | 34,587 | [
{
"from": "human",
"value": "We been having some discussions on approaches to using the entity framework at work recently. We have a fairly large and complex n-tier web based application, which is due for a major overhaul.\nThe question is: If we where to starting using the entity framework, would it be bet... |
I am trying to draw a domain model or class diagram in UML for car dealership. I am stuck with how to present test drive in the model. One way is to have appointment class and then test-drive as sub class. A dealer also offers after-sale vehicle service so i could have appointment/booking class as super class and then... | To create a UML domain model or class diagram for a car dealership that incorporates test drives, service appointments, and potential customers, let's address your questions step by step.
### 1. Test Drive Representation
**Approach to Test Drive:**
- Having a common **Appointment** class makes sense, especially if y... | 31,648 | [
{
"from": "human",
"value": "I am trying to draw a domain model or class diagram in UML for car dealership. I am stuck with how to present test drive in the model. One way is to have appointment class and then test-drive as sub class. A dealer also offers after-sale vehicle service so i could have appointm... |
Would you please help me in making a rollover effect using jquery, what i want to do is when someone hover over any of the menu items the text slide down and disappear and a picture slides from the top down to the center (e.g. you could see this effect here panda as you can see the picture slide down from the top but t... | To create a rollover effect where the text of a menu item slides up and disappears, while an image slides down from the top, you can use jQuery along with some CSS for styling. Below, I'll provide you with an updated version of your HTML, CSS styles, and the necessary jQuery code.
### Updated HTML
You'll need to add a... | 27,897 | [
{
"from": "human",
"value": "Would you please help me in making a rollover effect using jquery, what i want to do is when someone hover over any of the menu items the text slide down and disappear and a picture slides from the top down to the center (e.g. you could see this effect here panda as you can see ... |
My current setup binds the Text property of my TextBox to a certain Uri object. I'd love to use WPF's inbuilt validation to detect invalid URIs, and proceed from there. But this doesn't seem to be working?
I would imagine that it would throw an exception if I entered, e.g., "aaaa" as a URI. Thus, triggering my current ... | In WPF, when binding to a property of a specific type (in this case, a `Uri`), the binding engine uses a `TypeConverter` to convert the string representation from the `TextBox` to the target type. The conversion process does not throw exceptions in the same way as typical validation might, especially since it will just... | 35,975 | [
{
"from": "human",
"value": "My current setup binds the Text property of my TextBox to a certain Uri object. I'd love to use WPF's inbuilt validation to detect invalid URIs, and proceed from there. But this doesn't seem to be working?\nI would imagine that it would throw an exception if I entered, e.g., \"a... |
I'm trying to implement an Excel Services reporting solution in SharePoint (MOSS). Since the source data is a SharePoint list, this problem is doubly frustrating. I keep bumping up against permissions problems, even though I've enabled virtually everything in sight.
The first error is about refreshing external data... | Setting up an Excel Services reporting solution in SharePoint (MOSS) can be tricky, especially when dealing with permissions and external data connections. Here are some steps and considerations that can help you troubleshoot the issues you’re facing:
### Step 1: Verify Permissions
1. **SharePoint List Permissions**:... | 32,641 | [
{
"from": "human",
"value": "I'm trying to implement an Excel Services reporting solution in SharePoint (MOSS). Since the source data is a SharePoint list, this problem is doubly frustrating. I keep bumping up against permissions problems, even though I've enabled virtually everything in sight. \nThe fir... |
On a recent project I have been working on in C#/ASP.NET I have some fairly complicated JavaScript files and some nifty Style Sheets. As these script resources grow in size it is advisable to minify the resources and keep your web pages as light as possible, of course. I know many developers who hand-feed their JavaSc... | It sounds like you're on the right track for optimizing your web project's workflow and ensuring that your source files remain in sync with their minified counterparts. While there are various tools and libraries available for minifying JavaScript and CSS, automating this process as part of your Continuous Integration ... | 33,593 | [
{
"from": "human",
"value": "On a recent project I have been working on in C#/ASP.NET I have some fairly complicated JavaScript files and some nifty Style Sheets. As these script resources grow in size it is advisable to minify the resources and keep your web pages as light as possible, of course. I know m... |
I have developed about 300 Applications which I would like to provide with multi-language capabilities independent from the Operating System. I have written a just-in-time translator, but that is too slow in applications with many components. What would you suggest I do?
| To provide multi-language capabilities for your applications effectively and efficiently, especially given the scale of 300 applications, you'll want to consider a strategy that improves the performance and maintainability of your localization efforts. Here are several recommendations:
### 1. **Use External Resource F... | 30,846 | [
{
"from": "human",
"value": "I have developed about 300 Applications which I would like to provide with multi-language capabilities independent from the Operating System. I have written a just-in-time translator, but that is too slow in applications with many components. What would you suggest I do?\n"
},... |
I built an application which displays the records from database in the window and checks the the database for new records every couple of seconds. The problem is that the window blinks each time I check for new records and I want to fix it. I have tried to compare the old datatable with the new one and refresh only if ... | To prevent the window from blinking when you're updating the records in your application, it’s important to ensure that you're correctly comparing the contents of the DataTable instances. The issue with the approach you've implemented is that `dtMessages != dtTemp` will always return true because you're comparing two d... | 30,813 | [
{
"from": "human",
"value": "I built an application which displays the records from database in the window and checks the the database for new records every couple of seconds. The problem is that the window blinks each time I check for new records and I want to fix it. I have tried to compare the old datata... |
What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?
How would I separate functional areas into several contracts, would it be best to create an endpoint for each functional area?
Is there any way to keep the source for the different parts apart, b... | When designing a large WCF (Windows Communication Foundation) service with multiple `OperationContracts` and `DataContracts`, there are several best practices to follow to ensure maintainability, clarity, and scalability. Here’s a guide to help you structure and plan your WCF service effectively:
### Best Practices fo... | 30,975 | [
{
"from": "human",
"value": "What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?\nHow would I separate functional areas into several contracts, would it be best to create an endpoint for each functional area? \nIs there any way to keep ... |
I required to write a small web application that allow customer to select predefined layout template in html and be able to modify it. The application need to allow customer to add block text to pre defined area and images. The block texts need to be able to reorder based on customer need. eg. move up , move down or mo... | Creating a web application that allows customers to select, modify, and reorder layout templates requires a mix of HTML, CSS, JavaScript, and potentially a backend technology depending on how you wish to store and manage the templates. Below are the key steps and components you need to consider while building this appl... | 32,674 | [
{
"from": "human",
"value": "I required to write a small web application that allow customer to select predefined layout template in html and be able to modify it. The application need to allow customer to add block text to pre defined area and images. The block texts need to be able to reorder based on cus... |
I'm running SQL Server 2000 and I need to export the SQL Statement from all the DTS objects so that they can be parsed and put into a wiki documentation if needed.
Is there a way to do that?
maybe dumping each DTS object out into a text file with the object name as the file name with the name of the process and the d... | Exporting SQL statements from DTS (Data Transformation Services) packages in SQL Server 2000 can be accomplished using a combination of SQL queries and a script (using VBScript or PowerShell) to handle the file writing. Below is a general approach to achieve your goal:
### Steps to Export SQL Statements from DTS Objec... | 28,158 | [
{
"from": "human",
"value": "I'm running SQL Server 2000 and I need to export the SQL Statement from all the DTS objects so that they can be parsed and put into a wiki documentation if needed. \nIs there a way to do that?\nmaybe dumping each DTS object out into a text file with the object name as the file ... |
We have a Java application that needs to be brought to the foreground when a telecontrol mechanism activates something in the application.
In order to get this, we have realized in the called method of the class which represents the frame of our application (extension of a JFrame) following implementation:
setVisible(t... | The behavior you're experiencing can be attributed to how different versions of Windows manage window focus and z-order, especially in the context of user interaction and system restrictions. Windows XP and Windows 2000, in particular, had more stringent rules about bringing a window to the foreground, especially if it... | 35,829 | [
{
"from": "human",
"value": "We have a Java application that needs to be brought to the foreground when a telecontrol mechanism activates something in the application.\nIn order to get this, we have realized in the called method of the class which represents the frame of our application (extension of a JFra... |
I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the database.
This issue happens sometimes, mostl... | The behavior you're experiencing with the MySQL client application on SLES 9 could indeed stem from several potential causes. Here are some points to consider regarding the issues with processing the result set and potential memory leaks:
1. **Result Set Management**: In general, it is critical to free any result sets... | 33,803 | [
{
"from": "human",
"value": "I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the datab... |
I would like to access the work items in our TFS programmatically. Shouldn't there be an obvious command line tool to extract such information? Or a WebService I can just call? I already have checked into using Excel - this is neat, but I want more hardcore...
| To programmatically access work items in Team Foundation Server (TFS), there are indeed several options you can explore, including using the TFS API, command line tools, or REST APIs.
### 1. **Using TFS Command Line Interface (CLI)**
Microsoft provides a command-line utility called **TFS Command Line Interface** (TF ... | 32,151 | [
{
"from": "human",
"value": "I would like to access the work items in our TFS programmatically. Shouldn't there be an obvious command line tool to extract such information? Or a WebService I can just call? I already have checked into using Excel - this is neat, but I want more hardcore...\n"
},
{
"f... |
The Microsoft unit testing framework has suddenly gone on strike.
When I try to run tests in VS2008, I get a dialog with the message "VSTestHost.exe has stopped working".
I have Visual Studio Team System 2008 (version 9.0.30729.1 SP) running on Vista with all updates applied.
The "Problem reports and solutions" sugges... | It sounds frustrating to be dealing with issues like this when you’re trying to run tests. Here are some suggestions to help you troubleshoot the problem with the Microsoft unit testing framework in Visual Studio 2008:
### 1. Check for Corrupted Files
Sometimes, files can become corrupted. You can try the following:
-... | 32,440 | [
{
"from": "human",
"value": "The Microsoft unit testing framework has suddenly gone on strike.\nWhen I try to run tests in VS2008, I get a dialog with the message \"VSTestHost.exe has stopped working\".\nI have Visual Studio Team System 2008 (version 9.0.30729.1 SP) running on Vista with all updates applied... |
My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss.
For example, my MDB looks something like:
@MessageDriven(mappedName = "ExampleMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.To... | To configure an EJB 3.0 style Message-Driven Bean (MDB) to use a JMS datasource in JBoss 4.2.2, you need to specify the appropriate resource adapter and connection factory in your MDB configuration. The configuration typically requires using JNDI to look up the connection factory that you have defined in your `jms-ds.x... | 27,582 | [
{
"from": "human",
"value": "My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss. \nFor example, my MDB looks something like:\n@MessageDriven(mappedName = \"ExampleMDB\", activationConfig = {\n\n @ActivationConfigProperty(propertyName = \... |
I have written an Eclpise plugin (an Error Parser for the CDT), and it works just fine in the debugger version of eclipse. However I cannot for the life of me figure out how to install the plugin into eclipse. I can export the plugin as a jar file, and it seems to export without errors. I put the plugin jar file int... | It sounds like you're having a challenging time getting your Eclipse plugin to work outside of the development environment. Let's go through some steps to troubleshoot and properly install your Eclipse plugin.
### 1. Verify Plugin Manifest
Ensure that your `MANIFEST.MF` file is correctly set up with all required depen... | 34,409 | [
{
"from": "human",
"value": "I have written an Eclpise plugin (an Error Parser for the CDT), and it works just fine in the debugger version of eclipse. However I cannot for the life of me figure out how to install the plugin into eclipse. I can export the plugin as a jar file, and it seems to export witho... |
I've always been mystified how software vendors can ship their application or game, and then later provide a different set of executables that change the behaviors of the previous build. How is this done? Do the original application and the patch have to adhere to some kind of rule? Or does the patch crawl into the ori... | The process of updating software applications, whether they are games or other types of software, typically involves a few different methods to modify the existing executable or add new features without needing to completely redistribute the original application. Here's a high-level overview of how this can be done:
#... | 35,542 | [
{
"from": "human",
"value": "I've always been mystified how software vendors can ship their application or game, and then later provide a different set of executables that change the behaviors of the previous build. How is this done? Do the original application and the patch have to adhere to some kind of r... |
I have a long running series of operations in a .NET 2.0 BackgroundWorker thread. When I make a call to unmanaged code located in a referenced assembly the UI is frozen until the call completes.
Why is this? Should I not be making these calls from the BackgroundWorker thread?
Yes, it is a COM component but I'm not s... | The issue you are experiencing is likely related to the threading model of the COM component you are calling from your BackgroundWorker thread. In .NET and COM interop, certain types of COM components need to run on a specific thread apartment model, and if they are accessed from a thread that does not match their requ... | 34,672 | [
{
"from": "human",
"value": "I have a long running series of operations in a .NET 2.0 BackgroundWorker thread. When I make a call to unmanaged code located in a referenced assembly the UI is frozen until the call completes.\nWhy is this? Should I not be making these calls from the BackgroundWorker thread?... |
I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first thing that hit me was, "Hey, this is kinda like a closure." I knew this assumption is fundamentally wrong somehow and after a search online I didn't find really any analysis of this comparison.
So why are C-st... | You're not entirely wrong to see some similarities between function pointers in C and closures/lambdas in other languages, but there are fundamental differences that stem from how they are defined and how they operate. Let's break down the key distinctions.
### Function Pointers
1. **Definition**: A function pointer ... | 33,957 | [
{
"from": "human",
"value": "I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first thing that hit me was, \"Hey, this is kinda like a closure.\" I knew this assumption is fundamentally wrong somehow and after a search online I didn't find really any a... |
I'm wanting to add a search box onto my website - which is built using Zend Framework 1.6 - using Zend Search Lucene. The majority of my content is static, and held within Controller Views.
Does anyone have a script that can index content from the views, and add them into the Lucene search database so I can search th... | To integrate a search box on your Zend Framework 1.6 website using Zend Search Lucene, you'll need to create a script that indexes the content from your views and allows for searching through that content. Below is a basic outline of how you can achieve this:
### Step 1: Install Zend Search Lucene
Make sure you have ... | 30,674 | [
{
"from": "human",
"value": "I'm wanting to add a search box onto my website - which is built using Zend Framework 1.6 - using Zend Search Lucene. The majority of my content is static, and held within Controller Views. \nDoes anyone have a script that can index content from the views, and add them into the... |
Lately, I've been pondering the somewhat non-mainstream architecture of building raw XML on the server side, and then using an XSLT stylesheet on the client to transform the XML into the full UI. Of course, a fallback mechanism would have to exist if the client was not capable of client side XSLT, in which case we'd j... | Hi Zach,
Your approach of separating content and presentation using XML and XSLT is certainly an interesting one, and it has its advantages in terms of maintainability and a clean separation of concerns. However, it also comes with its challenges and limitations that you should consider.
### Existing Examples and Use... | 30,769 | [
{
"from": "human",
"value": "Lately, I've been pondering the somewhat non-mainstream architecture of building raw XML on the server side, and then using an XSLT stylesheet on the client to transform the XML into the full UI. Of course, a fallback mechanism would have to exist if the client was not capable ... |
Is it possible to redirect all of the output of a Bourne shell script to somewhere, but with shell commands inside the script itself?
Redirecting the output of a single command is easy, but I want something more like this:
#!/bin/sh
if [ ! -t 0 ]; then
# redirect all of my output to a file here
fi
# rest of script... | Certainly! You can achieve the desired behavior by saving the current standard output (stdout) and standard error (stderr) to file descriptors, then redirecting those outputs to a file if the script is running non-interactively (i.e., when the input is not from a terminal). Here's how you can structure your script:
``... | 37,247 | [
{
"from": "human",
"value": "Is it possible to redirect all of the output of a Bourne shell script to somewhere, but with shell commands inside the script itself?\nRedirecting the output of a single command is easy, but I want something more like this:\n#!/bin/sh\nif [ ! -t 0 ]; then\n # redirect all of ... |
Could somebody please explain to me what happens here?
I am creating a binding in code.
The target object is a UserControl
The target property is a boolean DependencyProperty
The source object is a FrameworkElement and implements INotifyPropertyChanged
The source property is of type ObservableCollection
What happen... | When creating a binding in WPF (Windows Presentation Foundation), it’s important to understand how the binding engine works, especially regarding how `INotifyPropertyChanged` and property dependencies interact. Here are a few things to consider based on the scenario you described:
### 1. **Binding Source Type**
Since... | 35,132 | [
{
"from": "human",
"value": "Could somebody please explain to me what happens here?\nI am creating a binding in code. \nThe target object is a UserControl\nThe target property is a boolean DependencyProperty\nThe source object is a FrameworkElement and implements INotifyPropertyChanged\nThe source property... |
I am on the way to build an ASP.NET MVC application with the latest beta release and I wonder if it is possible to change the default project Layout of
/Views/Home/Index.aspx
/Views/Home/About.aspx
to
/Blog/Views/Home/Index.aspx
/Blog/Views/Home/About.aspx
/Forum/Views/Home/Index.aspx
/Forum/Views/Home/About.aspx
The g... | Yes, it is possible to customize the structure of an ASP.NET MVC application to achieve a separation between different modules or sections like "Blog" and "Forum" while keeping everything within a single web project. You can achieve this by organizing your views and controllers in a way that matches your desired direct... | 32,944 | [
{
"from": "human",
"value": "I am on the way to build an ASP.NET MVC application with the latest beta release and I wonder if it is possible to change the default project Layout of\n/Views/Home/Index.aspx\n/Views/Home/About.aspx\nto\n/Blog/Views/Home/Index.aspx\n/Blog/Views/Home/About.aspx\n/Forum/Views/Hom... |
In my VC++ application I have an embedded browser (MSHTML). It works fine and handles the mouse properly (for instance, clicks and selects are processed OK). However, mouse wheel rotations over the embedded browser do not have any effect. This is my problem.
I am not very familiar with the internals of MSHTML embedding... | The issue you're encountering with the mouse wheel not being recognized in your embedded browser control is indeed related to focus management. In the context of OLE and MSHTML hosting, when the browser control does not have the input focus, it won't process certain messages, such as `WM_MOUSEWHEEL`.
To resolve this,... | 34,721 | [
{
"from": "human",
"value": "In my VC++ application I have an embedded browser (MSHTML). It works fine and handles the mouse properly (for instance, clicks and selects are processed OK). However, mouse wheel rotations over the embedded browser do not have any effect. This is my problem.\nI am not very famil... |
How do you stop race conditions in MySQL? the problem at hand is caused by a simple algorithm:
select a row from table
if it doesn't exist, insert it
and then either you get a duplicate row, or if you prevent it via unique/primary keys, an error.
Now normally I'd think transactions help here, but because the row does... | Race conditions in databases, especially in a high-concurrency environment like MySQL, can lead to duplicate entries or errors when trying to insert rows that violate constraints. Your problem arises when two concurrent processes try to select and insert a row at the same time, resulting in the situation you've describ... | 32,697 | [
{
"from": "human",
"value": "How do you stop race conditions in MySQL? the problem at hand is caused by a simple algorithm:\n\nselect a row from table\nif it doesn't exist, insert it\n\nand then either you get a duplicate row, or if you prevent it via unique/primary keys, an error.\nNow normally I'd think t... |
I am working on modifying an existing spell check plugin for TinyMCE.
This is what is supposed to happen:
1. User hits "space" and the spell check runs.
2. If the word is spelled wrong the word gets wrapped with a span and gets a red underline
what I find happening is that when the user hits space bar the word does g... | It sounds like you're on the right track with trying to manage the cursor position using bookmarks, but you're encountering issues because the cursor is returning to the end of the word after the spell check and formatting.
When you replace the incorrectly spelled word with a wrapped span, the position of the cursor m... | 34,924 | [
{
"from": "human",
"value": "I am working on modifying an existing spell check plugin for TinyMCE. \nThis is what is supposed to happen:\n1. User hits \"space\" and the spell check runs. \n2. If the word is spelled wrong the word gets wrapped with a span and gets a red underline\nwhat I find happening is th... |
I've successfully used the Windows SendMessage method to help me do various things in my text editor, but each time I am just copying and pasting code suggested by others, and I don't really know what it means. There is always a cryptic message number that is a parameter. How do I know what these code numbers mean so... | Understanding the `SendMessage` function and its parameters can indeed feel cryptic at first, but once you break it down, it becomes much clearer. Here's a guide to help you understand the message numbers and how to work with them more effectively.
### 1. What is `SendMessage`?
`SendMessage` is a Windows API function... | 30,307 | [
{
"from": "human",
"value": "I've successfully used the Windows SendMessage method to help me do various things in my text editor, but each time I am just copying and pasting code suggested by others, and I don't really know what it means. There is always a cryptic message number that is a parameter. How ... |
I have an ADO.Net login form as my frontend, and I want to check if the username and password input from the user matches the correct values in the database. How can I accomplish this as easily as possible?
By the way, my user information table in the database is called Login.
| To implement a simple ADO.NET login form that checks if the username and password input from the user match the records in the database, you'll want to follow a few key steps. Here's a basic example demonstrating how you can achieve this using C# and ADO.NET.
### Step 1: Create a SQL Connection
First, you need to set... | 35,124 | [
{
"from": "human",
"value": "I have an ADO.Net login form as my frontend, and I want to check if the username and password input from the user matches the correct values in the database. How can I accomplish this as easily as possible?\nBy the way, my user information table in the database is called Login.\... |
In Java, what is the difference between the twin methods?
public void methodA() throws AnException {
//do something
throw new AnException();
}
public void methodA() {
//do the same thing
throw new AnException();
}
I have a intuition that it has something to do with being a well-designed method (becaus... | Your intuition about the difference between the two method signatures in Java is correct, and it relates primarily to the concept of checked and unchecked exceptions and how they interact with method overriding in Java.
1. **Checked vs. Unchecked Exceptions**:
- In your first method (`public void methodA() throws ... | 36,246 | [
{
"from": "human",
"value": "In Java, what is the difference between the twin methods?\npublic void methodA() throws AnException {\n //do something\n throw new AnException();\n}\n\npublic void methodA() {\n //do the same thing\n throw new AnException();\n}\n\nI have a intuition that it has somet... |
At the risk of becoming the village idiot, can someone explain to me why generics are called generics? I understand their usage and benefits, but if the definition of generic is "general" and generic collections are type safe, then why isn't this a misnomer?
For example, an ArrayList can hold anything that's an object... | Your confusion is quite understandable, and it's a good question! The term "generics" can indeed be a bit misleading if you focus solely on the word "generic" as it relates to "general" or "not specific." However, it can be clarified by looking at what generics actually represent in programming.
### Why "Generics"?
1... | 35,925 | [
{
"from": "human",
"value": "At the risk of becoming the village idiot, can someone explain to me why generics are called generics? I understand their usage and benefits, but if the definition of generic is \"general\" and generic collections are type safe, then why isn't this a misnomer?\nFor example, an ... |
I ran into an interesting behavior recently. It seems that if I override .equals() to take a parameter other than Object, it doesn't get called. Can anyone explain to me why this is happening? It seems to violate my understanding of polymorphism in OOP, but maybe I'm missing something.
Here's much simpler code that ... | The behavior you're observing stems from the way method overriding and method overloading work in Java.
In Java, the `equals()` method is defined in the `Object` class as `public boolean equals(Object obj)`. When you override this method in a subclass, you are essentially providing a new implementation that adheres t... | 36,305 | [
{
"from": "human",
"value": "I ran into an interesting behavior recently. It seems that if I override .equals() to take a parameter other than Object, it doesn't get called. Can anyone explain to me why this is happening? It seems to violate my understanding of polymorphism in OOP, but maybe I'm missing ... |
One thing that bugs me about IE is that when it goes to load a page with an iframe it will wait until the iframe has finished loading before it will render the page. Firefox by contrast will render all the other page elements while the iframe is loading which is really nice if the iframe takes a long time to load beca... | You're correct that Internet Explorer (IE) handles rendering of iframes differently than other browsers like Firefox. This behavior can indeed lead to a poor user experience when loading content in an iframe. Here are a few workarounds that can help provide a better experience while loading iframes in a cross-browser m... | 35,091 | [
{
"from": "human",
"value": "One thing that bugs me about IE is that when it goes to load a page with an iframe it will wait until the iframe has finished loading before it will render the page. Firefox by contrast will render all the other page elements while the iframe is loading which is really nice if ... |
I'm digging into Reflection for the first time and I'm truely stuck. I've googled everything I can think of. I'm 90% where I wanna be now.
I'm trying to return the value of a Property in a custom class through Reflection.
Here's my class declaration:
Public Class Class2
Private newPropertyValue2 As String
Publ... | The issue you're encountering arises from the fact that you're trying to call `GetValue` on the instance of `ObjectCompare` (i.e., `Me`) instead of the actual instance of `Class2` that you created (i.e., `test`). The `GetValue` method needs the object instance from which it should retrieve the property value, and in yo... | 36,918 | [
{
"from": "human",
"value": "I'm digging into Reflection for the first time and I'm truely stuck. I've googled everything I can think of. I'm 90% where I wanna be now.\nI'm trying to return the value of a Property in a custom class through Reflection.\nHere's my class declaration:\nPublic Class Class2\n ... |
I am reading a .csv file and returning its lines in string array. One of the members is manufacturer, for which I have Toyota, Ford, etc.
I want to sort an array (Can be another collection) of the rows, by the value in manufacturer and alphabetical order.
So I'd have:
28437 Ford Fiesta
328 Honda Civic
34949 Toyota Ya... | Sorting data from a CSV file in C# without using a database can be accomplished efficiently using built-in classes and methods in the .NET framework. Here's a straightforward way to do it using classes like `List<T>` and `LINQ`. Below, I'll show you how to read the CSV file, parse it, and then sort it by the manufactur... | 35,033 | [
{
"from": "human",
"value": "I am reading a .csv file and returning its lines in string array. One of the members is manufacturer, for which I have Toyota, Ford, etc.\nI want to sort an array (Can be another collection) of the rows, by the value in manufacturer and alphabetical order.\nSo I'd have:\n28437 F... |
Possible Duplicate:
When creating a new GUI, is WPF the preferred choice over Windows Forms?
What are the advantages and disadvantages between using WPF (Windows Presentation Foundation) over Windows Forms?
What are the considerations that need to be made when choosing between the two?
| When deciding between WPF (Windows Presentation Foundation) and Windows Forms for developing a GUI application, there are several advantages and disadvantages for each framework, as well as key considerations to take into account.
### Advantages of WPF:
1. **Rich User Interface**:
- WPF provides advanced UI capabi... | 31,062 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nWhen creating a new GUI, is WPF the preferred choice over Windows Forms? \n\n\nWhat are the advantages and disadvantages between using WPF (Windows Presentation Foundation) over Windows Forms?\nWhat are the considerations that need to be made when choosing... |
So I have action_mailer_optional_tls (http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls)
and this in my enviroment.rb
ActionMailer::Base.server_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "www.somedomain.com",
:authentication => :plain,
:user_nam... | To allow dynamic switching between email accounts for sending emails in a Rails application, you can define a method within your mailer that sets the `user_name` and `password` on the fly based on the current user (in your case, an admin). Here’s a general approach you could take:
1. **Use ActionMailer Settings Dynami... | 33,523 | [
{
"from": "human",
"value": "So I have action_mailer_optional_tls (http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls)\nand this in my enviroment.rb\nActionMailer::Base.server_settings = {\n :tls => true,\n :address => \"smtp.gmail.com\",\n :port => \"587\",\n :domain => \"www.somed... |
I have a very simple model. I want to add a send email routine to on of the methods for the model:
$this->Email->delivery = 'smtp';
$this->Email->template = 'default';
$this->Email->sendAs = 'text';
$this->Email->from = 'email';
$this->Email->to = 'email';
$this->Email->subject = 'Error';
I've tried putti... | In CakePHP 1.2, the way you handle email sending is slightly different from what you're attempting. You are trying to use the `Email` component, but it seems that you're trying to call it in the context of a model (which does not automatically have access to the controller's components).
Here's a proper way to impleme... | 35,733 | [
{
"from": "human",
"value": "I have a very simple model. I want to add a send email routine to on of the methods for the model:\n$this->Email->delivery = 'smtp';\n$this->Email->template = 'default';\n$this->Email->sendAs = 'text'; \n$this->Email->from = 'email';\n$this->Email->to = 'email';\n$th... |
I would like to programatically convert a Microsoft Word document into XHTML. The language of choice is PHP, so I would appreciate any suggestions with PHP.
The initial idea is trying to convert the doc file into odt, and then use the Odt2Xhtml PHP class to get it into XHTML format.
Any better way to do this?
| Converting a Microsoft Word document (DOC or DOCX) to XHTML can be achieved in several ways using PHP. Your approach to convert DOC to ODT and then to XHTML using the Odt2Xhtml PHP class is a reasonable plan, but there are more direct ways to accomplish the task without the intermediate ODT format.
### Option 1: Using... | 34,911 | [
{
"from": "human",
"value": "I would like to programatically convert a Microsoft Word document into XHTML. The language of choice is PHP, so I would appreciate any suggestions with PHP.\nThe initial idea is trying to convert the doc file into odt, and then use the Odt2Xhtml PHP class to get it into XHTML fo... |
In my views.py, i have a snippit of code like this:
def clean_post_data(form):
for i in form.cleaned_data:
form.cleaned_data[i] = form.cleaned_data[i].rstrip()
def add_product(request):
form = ProductForm(request.POST, request.FILES or None)
image = Image.objects.all()
action = "Add"
if... | The error you're encountering, `'list' object has no attribute 'rstrip'`, suggests that one or more of the values in `form.cleaned_data` are lists, not strings. The `rstrip()` method is used to remove trailing whitespace from the end of a string, but since you're trying to call it on a list, Python raises an error.
In... | 37,416 | [
{
"from": "human",
"value": "In my views.py, i have a snippit of code like this:\ndef clean_post_data(form):\n for i in form.cleaned_data:\n form.cleaned_data[i] = form.cleaned_data[i].rstrip()\n\ndef add_product(request): \n form = ProductForm(request.POST, request.FILES or None)\n image ... |
When an object is instantiated in Java, what is really going into memory?
Are copies of parent constructors included?
Why do hidden data members behave differently than overridden methods when casting?
I understand the abstract explanations that are typically given to get you use this stuff correctly, but how does th... | When you instantiate an object in Java, the Java Virtual Machine (JVM) allocates memory for the object on the heap. Here's a breakdown of what happens:
### 1. Object Memory Allocation
- **Memory Structure**: When an object is created, the JVM allocates a block of memory that is large enough to hold all the instance v... | 33,771 | [
{
"from": "human",
"value": "\nWhen an object is instantiated in Java, what is really going into memory?\nAre copies of parent constructors included?\nWhy do hidden data members behave differently than overridden methods when casting?\n\nI understand the abstract explanations that are typically given to get... |
When using a class that has an enum property, one usually gets a naming conflict between the property name and the enum type. Example:
enum Day{ Monday, Tuesday, ... }
class MyDateClass
{
private Day day;
public Day Day{ get{ return day; } }
}
Since only flags enums should have plural names, naming the enum "D... | Naming conflicts between enums and properties can indeed be a challenge in object-oriented programming. Here are some strategies to help navigate this issue effectively:
### Naming Enums and Properties
1. **Use Descriptive Enum Names**: Instead of using a simple name, you can use more descriptive names for your enums.... | 31,747 | [
{
"from": "human",
"value": "When using a class that has an enum property, one usually gets a naming conflict between the property name and the enum type. Example:\nenum Day{ Monday, Tuesday, ... }\n\nclass MyDateClass\n{\n private Day day;\n\n public Day Day{ get{ return day; } }\n}\n\nSince only flags... |
I have a site that usually has news items at the top of the homepage, and sometimes (for specific periods) will have one or more 'quicklinks' beneath the news items, to guide users to pages of topical interest. Beneath those is the usual blurb.
We have alternative language versions of these sites, which often don't con... | It sounds like you're looking for a more maintainable and scalable way to handle the dynamic layout of your website, especially when considering future changes and internationalization. Here are some suggestions based on best practices for CSS and HTML:
### 1. Use Flexbox or CSS Grid
If you are moving toward a more dy... | 35,659 | [
{
"from": "human",
"value": "I have a site that usually has news items at the top of the homepage, and sometimes (for specific periods) will have one or more 'quicklinks' beneath the news items, to guide users to pages of topical interest. Beneath those is the usual blurb.\nWe have alternative language vers... |
What is the best way to store a user name and password for a Windows Service?
The service has to be able to access an MS SQL Server database on a remote machine. We have to support MS SQL Server authentication (mixed mode) instead of NT Authentication.
| Storing usernames and passwords securely, especially in a Windows Service that connects to a database, requires careful handling to minimize security risks. Here are best practices for securely storing credentials:
### 1. **Use Windows Credential Store**
- The Windows Credential Manager allows you to securely store... | 34,618 | [
{
"from": "human",
"value": "What is the best way to store a user name and password for a Windows Service?\nThe service has to be able to access an MS SQL Server database on a remote machine. We have to support MS SQL Server authentication (mixed mode) instead of NT Authentication. \n"
},
{
"from"... |
I want to create XML file from my Excel file through .NET (c#). My data is in Excel and it will be added in XML file.
Thanks.
Manoj
| Creating an XML file from an Excel file using C# can be accomplished using libraries like `EPPlus` or `ClosedXML` to read the Excel file and then write the XML using `System.Xml`. Below, I'll provide a step-by-step guide along with sample code using `EPPlus`, which is commonly used to work with Excel files in .NET appl... | 33,556 | [
{
"from": "human",
"value": "I want to create XML file from my Excel file through .NET (c#). My data is in Excel and it will be added in XML file.\nThanks.\nManoj\n"
},
{
"from": "gpt",
"value": "Creating an XML file from an Excel file using C# can be accomplished using libraries like `EPPlus` o... |
Step
Administrative / data entry worker opens ?, loads raster image, and using a 'lasso-like' tool (a la Photoshop 'magnetic' if possible) specifies areas of interest / masks.
?
Profit! (i.e., application opens raster image, vector file describing masks, does interesting stuff to areas of interest based on runtime c... | To streamline the steps you're focusing on (opening raster images, creating vector masks, and exporting those masks in a usable format), there are several frameworks, libraries, and tools that could help. Here are some suggestions for both steps 1 and 2 to improve efficiency and keep your options simple for potential f... | 33,831 | [
{
"from": "human",
"value": "Step\n\nAdministrative / data entry worker opens ?, loads raster image, and using a 'lasso-like' tool (a la Photoshop 'magnetic' if possible) specifies areas of interest / masks.\n\n?\n\nProfit! (i.e., application opens raster image, vector file describing masks, does interestin... |
I'm moving from Eclipse to Visual Studio .NET and have found all my beloved hotkeys except two:
in Eclipse you can press ALT-← and ALT-→ to visit recent changes you have made, something I use frequently to go back to where I was in some other file and then return. Apparently in VS.NET the CTRL-- and CTRL-SHIFT-- do th... | Welcome to Visual Studio! Here are some solutions and alternatives for the hotkeys you've mentioned, as well as some customizations you can make to better suit your workflow.
### Navigating Recent Changes
In Visual Studio, you can use the following shortcuts to navigate back and forth between your cursor positions:
... | 36,148 | [
{
"from": "human",
"value": "I'm moving from Eclipse to Visual Studio .NET and have found all my beloved hotkeys except two:\n\nin Eclipse you can press ALT-← and ALT-→ to visit recent changes you have made, something I use frequently to go back to where I was in some other file and then return. Apparently ... |
I have an interesting problem and would appreciate your thoughts for the best solution.
I need to parse a set of logs. The logs are produced by a multi-threaded program and a single process cycle produces several lines of logs.
When parsing these logs I need to pull out specific pieces of information from each process ... | To tackle the problem of parsing logs from a multi-threaded application while minimizing changes to existing parsers, you can follow a design pattern that introduces a buffering mechanism to handle the fragmentation of log lines associated with the same process. Below are the steps you can take:
### 1. Create a Buffer... | 33,076 | [
{
"from": "human",
"value": "I have an interesting problem and would appreciate your thoughts for the best solution.\nI need to parse a set of logs. The logs are produced by a multi-threaded program and a single process cycle produces several lines of logs.\nWhen parsing these logs I need to pull out specif... |
A long time ago when I was a young lat I used to do a lot of assembler and optimization programming. Today I mainly find myself building web apps (it's alright too...). However, whenever I create fields for database tables I find myself using values like 16, 32 & 128 for text fields and I try to combine boolean values ... | When designing a database schema, the choice of field lengths and types can have implications for performance, storage, and data integrity. Let's break down your concerns:
### Text Field Lengths
1. **Field Lengths and Storage**: In many relational databases, specifying a length for text fields (like `VARCHAR(n)`) can... | 30,953 | [
{
"from": "human",
"value": "A long time ago when I was a young lat I used to do a lot of assembler and optimization programming. Today I mainly find myself building web apps (it's alright too...). However, whenever I create fields for database tables I find myself using values like 16, 32 & 128 for text fi... |
My code works great in IE8, Firefox and Safari. But it doesn't work properly in Opera.
What happens is that the DIV is hidden but the space occupied by the DIV remains to appear in my web-page.
<div style=" z-index:-1;height :380; width:760; position:relative; text-align:center" id="new-add">
<object id="banner-fl... | To ensure that the space occupied by the `<div>` disappears when it's hidden, you need to change its `display` property instead of just setting its `visibility`. When you set `visibility` to `'hidden'`, the element is not visible, but it still takes up space in the layout. On the other hand, setting `display` to `'none... | 32,672 | [
{
"from": "human",
"value": "My code works great in IE8, Firefox and Safari. But it doesn't work properly in Opera.\nWhat happens is that the DIV is hidden but the space occupied by the DIV remains to appear in my web-page.\n<div style=\" z-index:-1;height :380; width:760; position:relative; text-align:cen... |
So yeah, I'm a Java guy in this crazy iPhone world. When it comes to memory management I stiill don't have a very good idea of what I'm doing.
I have an app that uses a navigation controller, and when it's time to go on to the next view I have code that looks like this:
UIViewController *myController = [[MyViewControl... | You're correct that memory management in Objective-C, especially if you're coming from a Java background, can feel a bit confusing at first. Let's clarify a few things regarding your implementation.
### Memory Management Rules
As per the memory management rules you quoted:
1. **Ownership**: You own an object if you ... | 31,381 | [
{
"from": "human",
"value": "So yeah, I'm a Java guy in this crazy iPhone world. When it comes to memory management I stiill don't have a very good idea of what I'm doing. \nI have an app that uses a navigation controller, and when it's time to go on to the next view I have code that looks like this:\nUIVie... |
I am creating an integration server for the first time, and although I have two projects in my cruisecontrol config file, only the first one seems to be executing. My config file is pasted below.
<cruisecontrol>
<project name="cc-config">
<triggers>
<intervalTrigger seconds="60" />
</t... | It looks like you've already identified the issue in your configuration file. The typo in the `workingDirectory` tag for the `stable_trunk` project (it was incorrectly written as `workingDirectoy`) would indeed prevent that project from being recognized and executed by CruiseControl.NET.
Here's a corrected version of ... | 32,076 | [
{
"from": "human",
"value": "I am creating an integration server for the first time, and although I have two projects in my cruisecontrol config file, only the first one seems to be executing. My config file is pasted below.\n<cruisecontrol>\n\n <project name=\"cc-config\">\n <triggers>\n ... |
I am starting again with c++ and was thinking about the scope of variables.
If I have a variable inside a function and then I return that variable will the variable not be "dead" when it's returned because the scope it was in has ended?
I have tried this with a function returning a string and it did work.
Can anyone ex... | You're correct to think about variable scope and lifetime in C++. Let's clarify how this works with function returns and local variables.
### Variable Scope and Lifetime
1. **Scope**: The scope of a variable defines where it can be accessed in your code. A variable declared inside a function is local to that function... | 35,284 | [
{
"from": "human",
"value": "I am starting again with c++ and was thinking about the scope of variables.\nIf I have a variable inside a function and then I return that variable will the variable not be \"dead\" when it's returned because the scope it was in has ended?\nI have tried this with a function retu... |
I have a gridview and I need to sort its elements when the user clicks on the header.
Its datasource is a List object.
The aspx is defined this way :
<asp:GridView ID="grdHeader" AllowSorting="true" AllowPaging="false"
AutoGenerateColumns="false" Width="780" runat="server" OnSorting="grdHeader_OnSorting" EnableVi... | The issue you are experiencing with `e.SortDirection` always being set to `Ascending` is likely due to the fact that the GridView is being reinitialized on every postback, and the previous sort state is not being preserved.
To fix this issue, you can store the sort direction in the ViewState. When the header is clicke... | 33,617 | [
{
"from": "human",
"value": "I have a gridview and I need to sort its elements when the user clicks on the header.\nIts datasource is a List object.\nThe aspx is defined this way :\n<asp:GridView ID=\"grdHeader\" AllowSorting=\"true\" AllowPaging=\"false\" \n AutoGenerateColumns=\"false\" Width=\"780\" r... |
I wanna get the Timedate value from another page using request.querystring and then use it an query to compare and pull up the matching datas. The function for the query in linq is:
protected void User_Querytime()
{
DataClasses2DataContext dc1 = new DataClasses2DataContext();
String Data = Request.Query... | It looks like you want to compare a `DateTime` value obtained from a query string to a `DateTime` value stored in a database. The approach you're taking is almost correct, but there are a few adjustments needed in your LINQ query to convert the string to a `DateTime` and then perform the comparison.
In C#, you can use... | 32,520 | [
{
"from": "human",
"value": "I wanna get the Timedate value from another page using request.querystring and then use it an query to compare and pull up the matching datas. The function for the query in linq is:\n protected void User_Querytime()\n {\n DataClasses2DataContext dc1 = new DataClasses2Dat... |
We have a Windows Form application which hosts an IE browser control. Our users run the application and open links to documents stored in MOSS. We are trying to set the application up to pass in credentials of a service account so that we can avoid giving all users access to the MOSS site. We have used code found here ... | When dealing with a scenario where you need to programmatically authenticate to a web service (like MOSS, which is a SharePoint implementation) using a service account in a Windows Forms application hosting an Internet Explorer (IE) browser control, you need to consider how Windows authentication works, especially in a... | 34,675 | [
{
"from": "human",
"value": "We have a Windows Form application which hosts an IE browser control. Our users run the application and open links to documents stored in MOSS. We are trying to set the application up to pass in credentials of a service account so that we can avoid giving all users access to the... |
When developing JavaScript, I tend to separate JavaScript code out into different files and then run a script to concatenate the files and compress or pack the resulting file. In the end, I have one file that I need to include on my production site.
This approach has usually worked, but I've started to run into a prob... | You're encountering a common issue when working with JavaScript's prototypal inheritance and file organization. To solve this issue without being dependent on the order of file concatenation, you can use the following approaches:
### 1. **Use a Factory Method for Class Creation**
You can create a factory function tha... | 33,688 | [
{
"from": "human",
"value": "When developing JavaScript, I tend to separate JavaScript code out into different files and then run a script to concatenate the files and compress or pack the resulting file. In the end, I have one file that I need to include on my production site. \nThis approach has usually w... |
That's basically the question, is there a "right" way to implement operator<< ?
Reading this I can see that something like:
friend bool operator<<(obj const& lhs, obj const& rhs);
is preferred to something like
ostream& operator<<(obj const& rhs);
But I can't quite see why should I use one or the other.
My personal ... | To clarify the usage of `operator<<` in C++, let's delve into the proper implementation and design considerations.
### Correct Signature for `operator<<`
The standard signature for overloading the stream insertion operator (`<<`) in C++ is:
```cpp
std::ostream& operator<<(std::ostream& os, const YourClass& obj);
``... | 32,064 | [
{
"from": "human",
"value": "That's basically the question, is there a \"right\" way to implement operator<< ?\nReading this I can see that something like:\nfriend bool operator<<(obj const& lhs, obj const& rhs);\n\nis preferred to something like \nostream& operator<<(obj const& rhs);\n\nBut I can't quite s... |
I'm trying to create an OleDb connection to an Excel file that is located on a SharePoint server. The example code I'm playing with at the moment throws an OleDb exception "Invalid internet address":
public static void ConnectToRemoteExcelFile()
{
string connectionString = String.Format("Provider=Microsoft.... | As you've discovered, using OleDb to connect directly to an Excel file hosted on a web server (including SharePoint) is not supported. However, you can still access Excel files on a SharePoint server through alternative approaches.
Here are a few options:
### Option 1: Download the File Locally and Connect
You can pr... | 35,585 | [
{
"from": "human",
"value": "I'm trying to create an OleDb connection to an Excel file that is located on a SharePoint server. The example code I'm playing with at the moment throws an OleDb exception \"Invalid internet address\":\npublic static void ConnectToRemoteExcelFile()\n {\n string connect... |
I'm wondering what the best way is to have a "if all else fails catch it".
I mean, you're handling as much exceptions as possible in your application,
but still there are bound to be bugs, so I need to have something that
catches all unhandled exceptions so I can collect information and store
them in a database or subm... | To effectively handle unhandled exceptions in your application, especially in a multi-threaded environment, you can utilize both the `AppDomain.CurrentDomain.UnhandledException` event and the `TaskScheduler.UnobservedTaskException` event, depending on the type of threads you are using. Here's how you can set them up:
... | 31,585 | [
{
"from": "human",
"value": "I'm wondering what the best way is to have a \"if all else fails catch it\".\nI mean, you're handling as much exceptions as possible in your application,\nbut still there are bound to be bugs, so I need to have something that\ncatches all unhandled exceptions so I can collect in... |
I have a 3rd-party library which for various reasons I don't wish to link against yet. I don't want to butcher my code though to remove all reference to its API, so I'd like to generate a dummy implementation of it.
Is there any tool I can use which spits out empty definitions of classes given their header files? It's... | Generating a dummy implementation of a header file can be accomplished with a simple script. While there may not be a dedicated tool specifically for this purpose, you can write a straightforward script in Python or use existing command-line tools like `sed` and `awk` to create an implementation file that provides empt... | 35,638 | [
{
"from": "human",
"value": "I have a 3rd-party library which for various reasons I don't wish to link against yet. I don't want to butcher my code though to remove all reference to its API, so I'd like to generate a dummy implementation of it.\nIs there any tool I can use which spits out empty definitions... |
For example, I have a custom control called SampleControl. To simplify things for this question, pretend I'm making just a Panel Control clone from scratch.
<CC:SampleControl ID="Sample1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Hi"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Bu... | To create a custom ASP.NET control that can contain other server controls like `<asp:Label>` or `<asp:Button>`, you'll want to create a composite control that can manage child controls. The key here is to use the `ControlCollection` and ensure your control properly manages child controls during the ASP.NET page lifecyc... | 33,662 | [
{
"from": "human",
"value": "For example, I have a custom control called SampleControl. To simplify things for this question, pretend I'm making just a Panel Control clone from scratch.\n<CC:SampleControl ID=\"Sample1\" runat=\"server\">\n <asp:Label ID=\"Label1\" runat=\"server\" Text=\"Hi\"></asp:Label... |
I am trying to put version information to my C# GUI framework retrieved from the latest ClearCase label. This was originally done from Visual Soursafe as below.
vssDB = new VSSDatabaseClass();
vssDB.Open( databaseName, "vssadmin", "vssadmin" );
VSSItem item = vssDB.get_VSSItem( @"$\BuildDCP.bat", false );
foreach(VS... | To retrieve version information from ClearCase, you can use the ClearCase API. However, unlike Visual SourceSafe, which has a .NET library available, ClearCase has a more complex setup that typically involves using command-line tools or the ClearCase API with COM or C/C++. Here, I'll provide an approach using the comma... | 34,762 | [
{
"from": "human",
"value": "I am trying to put version information to my C# GUI framework retrieved from the latest ClearCase label. This was originally done from Visual Soursafe as below. \nvssDB = new VSSDatabaseClass();\nvssDB.Open( databaseName, \"vssadmin\", \"vssadmin\" );\nVSSItem item = vssDB.get... |
Wow, I just got back a huge project in C# from outsourced developers and while going through my code review my analysis tool revealed bunches of what it considered bad stuff. One of the more discouraging messages was:
Exceptions.DontSwallowErrorsCatchingNonspecificExceptionsRule : 2106 defects
The developers assure... | You're absolutely right to be concerned about the use of empty catch blocks. In general, catching exceptions without any handling (often referred to as "swallowing" exceptions) is considered a poor practice in software development for several reasons:
1. **Loss of Important Information**: When an exception is caught b... | 33,270 | [
{
"from": "human",
"value": "Wow, I just got back a huge project in C# from outsourced developers and while going through my code review my analysis tool revealed bunches of what it considered bad stuff. One of the more discouraging messages was:\nExceptions.DontSwallowErrorsCatchingNonspecificExceptionsRu... |
I'm interested to center (dynamically) the list/table on page.
Eg I have table with unknown records count (only in runtime will know that)
So how to center it on the page?
| To center a table dynamically in a web page, you can use CSS for styling along with some HTML. The approach I’ll show you will center the table both horizontally and vertically.
Here’s a simple example using HTML and CSS:
### HTML
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta na... | 35,296 | [
{
"from": "human",
"value": "I'm interested to center (dynamically) the list/table on page.\nEg I have table with unknown records count (only in runtime will know that)\nSo how to center it on the page?\n"
},
{
"from": "gpt",
"value": "To center a table dynamically in a web page, you can use CSS... |
I have code similar to the following in many places:
var dbParams = db.ReadParams(memberID, product, GetSubscriptionFields());
Debug.Assert(dbParams.Count == 4);
_memberCode = dbParams[0];
_password = dbParams[1];
_userName = dbParams[2];
_reasonCode = dbParams[3];
ReadParams() returns an array of strings, the number... | In C#, there are several approaches to achieve what you want. Here are a few options you can consider:
### Option 1: Using `out` Parameters
You can modify the `ReadParams` method to take `out` parameters. This way, you can directly get the values without using an array.
Here's how you can define the `ReadParams` met... | 32,705 | [
{
"from": "human",
"value": "I have code similar to the following in many places:\nvar dbParams = db.ReadParams(memberID, product, GetSubscriptionFields());\nDebug.Assert(dbParams.Count == 4);\n\n_memberCode = dbParams[0];\n_password = dbParams[1];\n_userName = dbParams[2];\n_reasonCode = dbParams[3];\n\nRe... |
Mark Up
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Zuhaib.test" %>
<!-- Put IE into quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head run... | To eliminate the 3px gap between your two `<div>` elements in Internet Explorer (IE), you can try a few different methods. The gap is often caused by the way different browsers handle margins, padding, and box models, particularly in quirks mode.
Here's a modified approach you can take to ensure that there’s no gap be... | 34,734 | [
{
"from": "human",
"value": "Mark Up\n<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"test.aspx.cs\" Inherits=\"Zuhaib.test\" %>\n<!-- Put IE into quirks mode -->\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xml... |
Recently developers highlighted that it is bit hard for them to keep track of which document has been updated. And they thus suggested that using SVN to keep track of document changes will be better as they will be able to know if document if being updated when doing checking out of the project.
But i also highlighted... | Using SVN (Subversion) for document management in a development environment can be beneficial in some ways, but it also has several challenges and limitations, especially when dealing with binary files like Word and Excel documents. Here are some pros and cons to consider, along with suggestions for how to address your... | 35,142 | [
{
"from": "human",
"value": "Recently developers highlighted that it is bit hard for them to keep track of which document has been updated. And they thus suggested that using SVN to keep track of document changes will be better as they will be able to know if document if being updated when doing checking ou... |
I have a requirement for an admin user to set up an export directory on the web server, or relative to the web server using a UNC. Is there anything already out there that I can use for this, or must I recurs a limited directories and populate a home-rolled directory browser on the client?
| Setting up an export directory on a web server and allowing an admin user to configure it can be accomplished in various ways. Whether you need to implement a custom solution or utilize existing tools will depend on your specific requirements and environment. Here are a few options you can consider:
### 1. **Using a W... | 35,387 | [
{
"from": "human",
"value": "I have a requirement for an admin user to set up an export directory on the web server, or relative to the web server using a UNC. Is there anything already out there that I can use for this, or must I recurs a limited directories and populate a home-rolled directory browser on... |
Other than for app launch shortcuts, which should only be provided by the O/S, what are the legitimate uses of things like Windows keyboard hooks? It seems to me that we only have problems with things like key loggers because operating systems provide hooks to do things that should not be permitted by anyone under any... | Windows keyboard hooks, while often associated with keyloggers and other malicious activities, can have legitimate uses in various applications. Here are some of those legitimate uses:
1. **Accessibility Software**: Programs designed to help users with disabilities often utilize keyboard hooks to provide custom keyboa... | 37,237 | [
{
"from": "human",
"value": "Other than for app launch shortcuts, which should only be provided by the O/S, what are the legitimate uses of things like Windows keyboard hooks? It seems to me that we only have problems with things like key loggers because operating systems provide hooks to do things that sh... |
Does anyone knows how to detect printable characters in java?
After a while ( trial/error ) I get to this method:
public boolean isPrintableChar( char c ) {
Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
return (!Character.isISOControl(c)) &&
c != KeyEvent.CHAR_UNDEFI... | Your current implementation for detecting printable characters covers a good portion of cases, but there are a few additional considerations you might want to account for. Specifically, not all printable characters are covered by just checking the Unicode blocks and control characters.
Here’s a refined version of your... | 36,382 | [
{
"from": "human",
"value": "Does anyone knows how to detect printable characters in java?\nAfter a while ( trial/error ) I get to this method:\n public boolean isPrintableChar( char c ) {\n Character.UnicodeBlock block = Character.UnicodeBlock.of( c );\n return (!Character.isISOControl(c))... |
I'm working for the first time with Forms Authentication, I'm using an example from the web to learn, I included in my web.config
<authentication mode="Forms">
<forms name="MYWEBAPP.ASPXAUTH" loginUrl="Login.aspx" protection="All" path="/"/>
</authentication>
<authorization>
<deny users="?"/... | The issue you are experiencing is related to how the `GenericPrincipal` class handles role checking in ASP.NET Forms Authentication. Specifically, it checks if a user is in a certain role based on the roles assigned to the user, but it only recognizes roles that are defined within the `UserData` of the `FormsAuthentica... | 34,684 | [
{
"from": "human",
"value": "I'm working for the first time with Forms Authentication, I'm using an example from the web to learn, I included in my web.config\n <authentication mode=\"Forms\">\n <forms name=\"MYWEBAPP.ASPXAUTH\" loginUrl=\"Login.aspx\" protection=\"All\" path=\"/\"/>\n </authen... |
I wrote small Python+Ajax programs (listed at the end) with socket module to study the COMET concept of asynchronous communications.
The idea is to allow browsers to send messages real time each others via my python program.
The trick is to let the "GET messages/..." connection opened waiting for a message to answer ba... | The code you've shared is a basic implementation of the COMET pattern using raw sockets in Python. This approach to real-time messaging can be quite challenging due to the differences in how various browsers handle HTTP requests, especially when it comes to POST requests and the nuances of network communication.
### ... | 28,424 | [
{
"from": "human",
"value": "I wrote small Python+Ajax programs (listed at the end) with socket module to study the COMET concept of asynchronous communications.\nThe idea is to allow browsers to send messages real time each others via my python program.\nThe trick is to let the \"GET messages/...\" connect... |
How do I serialize a 'Type'?
I want to serialize to XML an object that has a property that is a type of an object. The idea is that when it is deserialized I can create an object of that type.
public class NewObject
{
}
[XmlRoot]
public class XmlData
{
private Type t;
public Type T
{
get { return... | To serialize a `Type` in XML using the `XmlSerializer`, you'll need to specify the types that the serializer should expect at runtime. This is done using the `[XmlInclude]` attribute.
However, the `XmlSerializer` cannot serialize the `Type` object directly, but you can serialize its name or assembly-qualified name ins... | 35,168 | [
{
"from": "human",
"value": "How do I serialize a 'Type'?\nI want to serialize to XML an object that has a property that is a type of an object. The idea is that when it is deserialized I can create an object of that type.\npublic class NewObject\n{\n}\n\n[XmlRoot]\npublic class XmlData\n{\n private Typ... |
I've been looking (without great luck) for the perfect reference card with all the basic sorting algos in C (or maybe in pseudo code). Wikipedia is a terrific source of info but this time I'm looking for something definitely more portable (pocket size if possible) and of course printable. Any suggestion would be much a... | Creating a reference card for sorting algorithms in C or pseudo code that is portable and printable is a great idea! Here's a compact overview of some common sorting algorithms presented in pseudo code format. You can easily print this out or create a PDF file for portability.
### Sorting Algorithms Reference Card
##... | 25,181 | [
{
"from": "human",
"value": "I've been looking (without great luck) for the perfect reference card with all the basic sorting algos in C (or maybe in pseudo code). Wikipedia is a terrific source of info but this time I'm looking for something definitely more portable (pocket size if possible) and of course ... |
We have a number of developers located around the world which we need to collaborate with.
Our functionality required is:
Some sort of white board, which multiple users can view, and update.
A private wiki.
A ticket system for managing workload.
A source control system would be nice, but not required.
Ideally this ... | There are several collaboration tools that can meet your requirements for a global team of developers. Below are some options that include a whiteboard, a private wiki, a ticketing system, and some may also offer source control features.
### Free/Hosted Solutions
1. **Trello + Miro + Notion (or Google Docs)**:
- *... | 31,987 | [
{
"from": "human",
"value": "We have a number of developers located around the world which we need to collaborate with.\nOur functionality required is: \n\nSome sort of white board, which multiple users can view, and update.\nA private wiki.\nA ticket system for managing workload.\nA source control system ... |
I am currently a student and trying to design a Visual C++ application to allow me to visually insert an oriented graph in order to create a text file with the graph's matrix. At this point I have created an onClick event to create nodes and have used the form's Paint event to draw the nodes. I have also inserted the ... | Creating an interactive visual C++ application to manage an oriented graph involves several key components, especially when it comes to handling the user interface and drawing connections between nodes. Since you're trying to create a curve for lines between nodes and want to avoid third-party libraries, let's explore ... | 31,108 | [
{
"from": "human",
"value": "I am currently a student and trying to design a Visual C++ application to allow me to visually insert an oriented graph in order to create a text file with the graph's matrix. At this point I have created an onClick event to create nodes and have used the form's Paint event to ... |
I reference another eclipse project from the current project I am working on.
Everything is working fine except when I try to jar up the referenced project and use the jar instead of the eclipse project my project doesn't run properly.
I know this is a bit vague but is there something I might be doing wrong in jaring u... | When you reference another Eclipse project directly, Eclipse takes care of a lot of things automatically, including:
1. **Build Path**: It automatically includes the necessary source folders and libraries in the build path, which may not be included properly when creating a JAR file.
2. **Dependencies**: Eclipse mana... | 37,442 | [
{
"from": "human",
"value": "I reference another eclipse project from the current project I am working on.\nEverything is working fine except when I try to jar up the referenced project and use the jar instead of the eclipse project my project doesn't run properly.\nI know this is a bit vague but is there s... |
I have a folder containing several websites, all using the same assemblies in the GAC. Each website also contains some 'custom' assemblies of their own that refer to the common assemblies.
There is a web.config in this folder, defining common settings for the sites, including the assemblies to load in a <system.web>/<c... | The behavior you're observing regarding the `<runtime>/<assemblyBinding>` section in the `web.config` file is indeed expected and is a common source of confusion when dealing with ASP.NET applications.
Here's a brief overview of how assembly redirection works in .NET:
1. **Assembly Binding Redirects**: Assembly bindi... | 35,393 | [
{
"from": "human",
"value": "I have a folder containing several websites, all using the same assemblies in the GAC. Each website also contains some 'custom' assemblies of their own that refer to the common assemblies.\nThere is a web.config in this folder, defining common settings for the sites, including t... |
What is the best modeling methodology for representing software system. I mean like UML and so on.
Is UML better or is there something better than that out there?
My need is to represent graphically my web application , which is a 3-tier architecture.
I need a engineering model methodology like UML to depict the entir... | When it comes to modeling software systems, UML (Unified Modeling Language) is indeed one of the most widely used methodologies. It offers a standardized way to visualize the design of a system and can effectively represent various aspects of a software application, including its architecture, behavior, and interaction... | 33,935 | [
{
"from": "human",
"value": "What is the best modeling methodology for representing software system. I mean like UML and so on.\nIs UML better or is there something better than that out there?\nMy need is to represent graphically my web application , which is a 3-tier architecture.\nI need a engineering mo... |
I'm trying to deploy my first war file on an existing iplanet 6 install, and the only place in the config directory that specifies what looks like the web app directory is in server.xml:
<PROPERTY name="docroot" value="/usr/local/ns-home/docs"/>
<USERDB id="default"/>
<SEARCH>
<WEBAPP uri="/olc" path="/WWW/ns-h... | Deploying a WAR file in iPlanet Application Server (which is now part of Oracle WebLogic) can sometimes differ from other servlet containers like Tomcat. Here are several things to check and steps you can take to troubleshoot the deployment of your WAR file:
1. **WAR File Location**:
- Confirm that the WAR file is ... | 36,441 | [
{
"from": "human",
"value": "I'm trying to deploy my first war file on an existing iplanet 6 install, and the only place in the config directory that specifies what looks like the web app directory is in server.xml:\n<PROPERTY name=\"docroot\" value=\"/usr/local/ns-home/docs\"/>\n <USERDB id=\"default\"/>\... |
Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example:
user1.domain.example goes to one place
user2.domain.example goes to another?
Or, can I make it so both of these go to the same controller/action with a username parameter?
| Yes, it's possible to create ASP.NET MVC routes that use subdomain information to determine the route or to pass parameters like a username. You can achieve this by customizing your route configuration in the `RouteConfig` file or by using a middleware approach.
### Using Route Configuration
Here’s an example of how ... | 32,010 | [
{
"from": "human",
"value": "Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example:\n\nuser1.domain.example goes to one place\nuser2.domain.example goes to another?\n\nOr, can I make it so both of these go to the same controller/action with a usernam... |
I've recently been lifted out of the .Net world into the Java world and I miss my unit tests.
Using Visual Studio I used NUnit and TestDriven.net to run my unit tests.
What is a comparable system for Java Using Eclipse?
I'm looking specifically for the plugins that will get me going, or a guide on how to do it.
I'm awa... | Welcome to the Java world! If you're coming from a .NET background and are used to a smooth unit testing experience, you'll be happy to know that Eclipse does a great job integrating JUnit. Here's how you can get started with JUnit in Eclipse, along with some plugins that can enhance your experience.
### Setting Up JU... | 29,008 | [
{
"from": "human",
"value": "I've recently been lifted out of the .Net world into the Java world and I miss my unit tests.\nUsing Visual Studio I used NUnit and TestDriven.net to run my unit tests.\nWhat is a comparable system for Java Using Eclipse?\nI'm looking specifically for the plugins that will get m... |
I'm trying to trouble shoot a web service client in my current project. I'm not sure of the platform of the Service Server (Most likely LAMP). I believe there is a fault on their side of the fence as i have eliminated the potential issues with my client. The client is a standard ASMX type web reference proxy auto ge... | To capture the raw SOAP messages (request and responses) in your ASMX client, you can use several approaches. Here are a few methods you can try:
### 1. **Enable WCF Tracing (if applicable)**
If your client is actually using WCF (Windows Communication Foundation) under the hood, you can enable WCF tracing to log the r... | 34,579 | [
{
"from": "human",
"value": "I'm trying to trouble shoot a web service client in my current project. I'm not sure of the platform of the Service Server (Most likely LAMP). I believe there is a fault on their side of the fence as i have eliminated the potential issues with my client. The client is a stand... |
My record sheet app has a menu option for creating a new, blank record sheet. When I open a sheet window, I can open new windows without a problem, using subprocess.Popen() to do it.
However, under Windows (I haven't tested it on other OSes yet), if I open a new window then use the "open file" dialog to populate the fi... | The issue you are encountering may be related to how the environment or the working directory is being set when you're opening the file dialog. When you use `subprocess.Popen()`, it relies on the current working directory and the system's PATH environment variable to find the executable you want to run.
Here are some ... | 34,816 | [
{
"from": "human",
"value": "My record sheet app has a menu option for creating a new, blank record sheet. When I open a sheet window, I can open new windows without a problem, using subprocess.Popen() to do it.\nHowever, under Windows (I haven't tested it on other OSes yet), if I open a new window then use... |
I have a list of n GUIDs and I need to hash them into a single value. This value could be the size of a Guid object or the size of an Int32, it doesn't really matter, but it does need to be statistically unique (say with a probably similar to MD5).
So one approach could be to sort them, concatenate the bytes and take ... | You are correct in noting that creating a hash from a list of GUIDs can be approached in several ways, and each method has its trade-offs in terms of speed, uniqueness, and the possibility of collisions.
### XOR Method
Using XOR to combine the GUIDs is a reasonable approach for producing a hash value, especially give... | 34,996 | [
{
"from": "human",
"value": "I have a list of n GUIDs and I need to hash them into a single value. This value could be the size of a Guid object or the size of an Int32, it doesn't really matter, but it does need to be statistically unique (say with a probably similar to MD5).\nSo one approach could be to ... |
I'm trying to work through the problems on projecteuler.net but I keep running into a couple of problems.
The first is a question of storing large quanities of elements in a List<t>. I keep getting OutOfMemoryException's when storing large quantities in the list.
Now I admit I might not be doing these things in the bes... | When working with large quantities of elements in a `List<T>` in C#, as well as performing operations on large numbers, you may encounter some challenges. Let’s address both of your concerns:
### 1. Storing Large Quantities in a List<T>
When you attempt to store a very large number of elements in a `List<T>`, you may... | 33,950 | [
{
"from": "human",
"value": "I'm trying to work through the problems on projecteuler.net but I keep running into a couple of problems.\nThe first is a question of storing large quanities of elements in a List<t>. I keep getting OutOfMemoryException's when storing large quantities in the list.\nNow I admit I... |
I have a little pet web app project I'd like to show someone who doesn't have an application server themselves (and who has no clue about application servers).
What is the easiest and quickest way for them to get my WAR file running with zero configuration, preferably something I could send along with or bundle with th... | Yes, you can definitely bundle your WAR file with a lightweight application server that requires minimal setup. Here are a couple of options that should work well for your needs:
### 1. **Embedded Jetty**
You can create an embedded Jetty server in a self-contained JAR that will run your WAR file. Jetty is lightweight ... | 33,627 | [
{
"from": "human",
"value": "I have a little pet web app project I'd like to show someone who doesn't have an application server themselves (and who has no clue about application servers).\nWhat is the easiest and quickest way for them to get my WAR file running with zero configuration, preferably something... |
Use case:
A does something on his box and gots stuck. He asks B (remote) for support.
B logs into the session of A, sees all windows, A was seeing and is able to manipulate the GUI.
If A uses Windows it is very convenient to log into a running session e.g. via VNC. But if A uses Linux, AFAIK, this is not possible. Us... | Yes, there are several ways to remotely access and control a running desktop session in Linux, similar to how you would with VNC on Windows. Here are some options:
### 1. **Xrdp with an X11 Desktop Environment**
- **Xrdp** is an open-source implementation of the Remote Desktop Protocol (RDP) that allows you to connect... | 33,706 | [
{
"from": "human",
"value": "Use case:\n\nA does something on his box and gots stuck. He asks B (remote) for support.\nB logs into the session of A, sees all windows, A was seeing and is able to manipulate the GUI.\n\nIf A uses Windows it is very convenient to log into a running session e.g. via VNC. But if... |
We are designing a system with C/C++ back end server and C# .NET front end. We would like to provide a web interface similar to C# .NET front end. Can you please suggest the best way to do it? e.g. Whether to embed the web server in back end server itself? How to have maximum common code between in .NET and web interfa... | Designing a system that has a C/C++ backend server and a C# .NET frontend while also providing a web interface involves several considerations. Here are some suggestions on how to approach this task effectively:
### 1. Architecture
#### Embedding a Web Server
You can embed a lightweight web server within your C/C++ b... | 34,665 | [
{
"from": "human",
"value": "We are designing a system with C/C++ back end server and C# .NET front end. We would like to provide a web interface similar to C# .NET front end. Can you please suggest the best way to do it? e.g. Whether to embed the web server in back end server itself? How to have maximum co... |
I run a series of time consuming operations on a background worker thread. At various stages I update a (windows form) progress bar by invoking a delegate. However, one of the more time operations occurs on a single line of code.
Is it possible to :
a) Update the UI while that single line of code is being executed, o... | In a Windows Forms application, when you perform a long-running operation on a background worker thread, it is crucial to ensure that the UI remains responsive. Let's address your two questions:
### a) Update the UI While Executing a Single Line of Code
When a line of code is being executed, especially if it's time-c... | 34,296 | [
{
"from": "human",
"value": "I run a series of time consuming operations on a background worker thread. At various stages I update a (windows form) progress bar by invoking a delegate. However, one of the more time operations occurs on a single line of code.\nIs it possible to :\na) Update the UI while th... |
Ok let me make an example:
<head>
<script type="text/javascript">
$(document).ready(function(){
$("#options_2").hide();
$("#options_3").hide();
});
</script>
</head>
<body>
<div id="options_1">option 1</div>
<div id="options_2">option 2</div>
<div id="options_3">option 3</div>
<a href="" class="selected">choo... | You can achieve the functionality you described using jQuery to toggle the visibility of the option divs and manage the `selected` class on the links. Here's a modified version of your example that implements this behavior:
```html
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.j... | 32,528 | [
{
"from": "human",
"value": "Ok let me make an example:\n<head>\n<script type=\"text/javascript\">\n$(document).ready(function(){\n\n $(\"#options_2\").hide();\n $(\"#options_3\").hide();\n\n});\n</script>\n</head>\n<body>\n<div id=\"options_1\">option 1</div>\n<div id=\"options_2\">option 2</div>\n<d... |
Is it possible using a server side XML parser to have it create an HTML blob that is then included in an existing HTML page?
| Yes, it is possible to use a server-side XML parser to generate an HTML blob and then include that blob in an existing HTML page. Here’s how this process typically works:
1. **Parse XML on the Server Side:** You would use a server-side language (such as Python, PHP, Node.js, Java, etc.) to read and parse the XML data.... | 29,434 | [
{
"from": "human",
"value": "Is it possible using a server side XML parser to have it create an HTML blob that is then included in an existing HTML page?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use a server-side XML parser to generate an HTML blob and then include that blob in an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.