instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Are C# enums typesafe?
If not what are the implications?
| C# enums are generally considered to be type-safe, but there are nuances to their usage that can lead to situations where type safety is compromised.
### What Makes C# Enums Type-Safe?
1. **Strong Typing**: C# enums are strongly typed, meaning that an enum defined in one context is distinct from an enum defined in an... | 32,400 | [
{
"from": "human",
"value": "Are C# enums typesafe?\nIf not what are the implications? \n"
},
{
"from": "gpt",
"value": "C# enums are generally considered to be type-safe, but there are nuances to their usage that can lead to situations where type safety is compromised.\n\n### What Makes C# Enum... |
I am attempting to rewrite my ForestPad application utilizing WPF for the presentation layer. In WinForms, I am populating each node programmatically but I would like to take advantage of the databinding capabilities of WPF, if possible.
In general, what is the best way to two-way databind the WPF TreeView to an Xml d... | To implement two-way data binding for a WPF `TreeView` connected to an XML document, you can follow a systematic approach. The goal is to create a binding context that can respond to changes in the XML structure and update the TreeView accordingly, while also allowing changes made in the TreeView to be reflected back i... | 29,055 | [
{
"from": "human",
"value": "I am attempting to rewrite my ForestPad application utilizing WPF for the presentation layer. In WinForms, I am populating each node programmatically but I would like to take advantage of the databinding capabilities of WPF, if possible.\nIn general, what is the best way to two... |
I 'm exploring for a browser solution / API that has the following features:
Must support the nowadays default web technologies
Must support client side XSLT
Must support executing arbitrary Javascript on the pages it loads
Must be able to catch events from the web page targeted to the browser or OS (I am specifically... | If you're looking for a browser solution/API that meets your criteria, here are some suggestions to consider:
### 1. Electron
**Overview:** Electron is a framework for building cross-platform desktop applications using web technologies (HTML, CSS, JavaScript). It uses Chromium and Node.js.
**Features:**
- Supports mo... | 39,670 | [
{
"from": "human",
"value": "I 'm exploring for a browser solution / API that has the following features:\n\nMust support the nowadays default web technologies\nMust support client side XSLT\nMust support executing arbitrary Javascript on the pages it loads\nMust be able to catch events from the web page ta... |
I'm working on a JIRA implementation and need to make use of the API.
Does anyone know of an existing .NET wrapper for the JIRA SOAP API?
| Yes, there are several .NET libraries that can help you work with the JIRA API, including the SOAP API. However, it’s worth noting that Atlassian has deprecated the SOAP API in favor of the REST API, so it's highly recommended to consider using the REST API instead if possible.
If you're specifically looking for a .NE... | 40,214 | [
{
"from": "human",
"value": "I'm working on a JIRA implementation and need to make use of the API. \nDoes anyone know of an existing .NET wrapper for the JIRA SOAP API? \n"
},
{
"from": "gpt",
"value": "Yes, there are several .NET libraries that can help you work with the JIRA API, including t... |
I have mixed views about commercial class libraries. Am I better off using a commercial class library or starting from scratch? If buying a library is the way forward which one for a C# developer?
| Choosing between a commercial class library and building your own from scratch depends on several factors, including your project requirements, time constraints, budget, and the specific functionality you need. Here are some pros and cons for each approach, along with some recommendations for commercial libraries suita... | 37,615 | [
{
"from": "human",
"value": "I have mixed views about commercial class libraries. Am I better off using a commercial class library or starting from scratch? If buying a library is the way forward which one for a C# developer?\n"
},
{
"from": "gpt",
"value": "Choosing between a commercial class... |
I've an linux image(debian) running on VMWare ESX 3.1.
Is it possible to copy that image and run it locally on my local VMWare workstation?
how?
| Yes, it is possible to copy a Linux image running on VMware ESX 3.1 and run it locally on your VMware Workstation. To do this, you'll need to follow several steps to properly convert the image and set it up on your local machine. Here's how you can do it:
### Steps to Copy the Image:
1. **Prepare the ESX Environment:... | 38,275 | [
{
"from": "human",
"value": "I've an linux image(debian) running on VMWare ESX 3.1.\nIs it possible to copy that image and run it locally on my local VMWare workstation?\nhow?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to copy a Linux image running on VMware ESX 3.1 and run it locally ... |
I'm going to make an application (in Swing) that uses a tree to visualize a data structure (JTree). A tree will be on the left side of a window. The user will be able to browse a tree. The parameters of every tree node will be displayed on the right side of the window.
The example windows will be looking like this
=... | Validating user input directly in a Swing application can be handled in several ways, especially when you're allowing inline editing of data. Here are some common patterns and practices you can use to achieve this in your application:
### 1. **Field-Level Validation**
If you're using text fields (like `JTextField`), y... | 35,901 | [
{
"from": "human",
"value": "I'm going to make an application (in Swing) that uses a tree to visualize a data structure (JTree). A tree will be on the left side of a window. The user will be able to browse a tree. The parameters of every tree node will be displayed on the right side of the window. \nThe ex... |
When implementing an +initialize or +load method in one of your Objective-C classes, should you always start with this kind of guard?:
@implementation MyClass
+ (void)initialize {
if (self == [MyClass class]) {
...
}
}
...
@end
Seems like code in +load and +initialize usually only wants to be execute... | In Objective-C, both `+initialize` and `+load` methods are special class methods that are called automatically by the runtime under certain conditions. However, they have different semantics and intended use cases, so how you handle them can differ.
### `+initialize`
- **Purpose**: The `+initialize` method is called ... | 39,982 | [
{
"from": "human",
"value": "When implementing an +initialize or +load method in one of your Objective-C classes, should you always start with this kind of guard?:\n@implementation MyClass\n\n+ (void)initialize {\n if (self == [MyClass class]) {\n ...\n }\n}\n\n...\n@end\n\nSeems like code in +... |
I have quite a large list of words in a txt file and I'm trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. So that:
wordone
wordtwo
wordthree
become
able:"wordone"
able:"wordtwo"
able:"wordthree"
How can I do this?
| You can easily achieve this in Notepad++ using the Find and Replace feature with regular expressions. Here's how to do it step by step:
1. **Open your TXT file** in Notepad++.
2. **Open the Find and Replace dialog**:
- Press `Ctrl + H` to open the Replace tab of the Find dialog.
3. **Set up the Replace**:
- In... | 34,951 | [
{
"from": "human",
"value": "I have quite a large list of words in a txt file and I'm trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. So that:\n\nwordone\nwordtwo\nwordthree\n\nbecome\n\nable:\"wordone\"\nable:\"wordtwo\"\nable:\"wordthree\"\... |
I am using .Net framework 2.0 / jQuery to make an Ajax call to a 2.0 web service. No matter what I set the contentType to in the ajax call, the service always returns XML. I want it to return Json!
Here is the call:
$(document).ready(function() {
$.ajax({
type: "POST",
url: "Donat... | The behavior you're experiencing is due to the way ASMX web services work in .NET Framework 2.0. By default, ASMX services return XML responses, and while you can set the content type to indicate that you want JSON, the service itself does not natively support JSON serialization in the same way that later versions (.NE... | 36,757 | [
{
"from": "human",
"value": "I am using .Net framework 2.0 / jQuery to make an Ajax call to a 2.0 web service. No matter what I set the contentType to in the ajax call, the service always returns XML. I want it to return Json!\nHere is the call:\n $(document).ready(function() {\n $.ajax({\n ... |
Does anyone know of any good basic articles for creating Sharepoint Web Parts.
I have found a couple, but most of them jumped in a little quick.
Thanks.
| Certainly! If you're looking to create SharePoint Web Parts and need some foundational resources, here are some good articles and tutorials that start from the basics:
1. **Microsoft Documentation: SharePoint Framework Overview**
- This is the official documentation from Microsoft, which provides a comprehensive ... | 40,073 | [
{
"from": "human",
"value": "Does anyone know of any good basic articles for creating Sharepoint Web Parts.\nI have found a couple, but most of them jumped in a little quick.\nThanks.\n"
},
{
"from": "gpt",
"value": "Certainly! If you're looking to create SharePoint Web Parts and need some found... |
I have written a WPF application that I want to port to Silverlight 2.
My business logic and model (for the M-V-VM design pattern) are packaged into a separate assembly which I am trying to recast as a Silverlight class library.
Unfortunately, the XmlNode class which I use to parse an XML file with model data is not s... | Porting a WPF application to Silverlight 2 can present challenges, especially regarding the differences in the supported classes and libraries. Since you're facing limitations with the XmlNode class in Silverlight, here are some options to consider:
### 1. Using LINQ to XML
Even though you mentioned that LINQ seems ov... | 36,616 | [
{
"from": "human",
"value": "I have written a WPF application that I want to port to Silverlight 2.\nMy business logic and model (for the M-V-VM design pattern) are packaged into a separate assembly which I am trying to recast as a Silverlight class library. \nUnfortunately, the XmlNode class which I use to... |
I have an application that's using Oracle.DataAccess to connect. I've already discovered that the footprint can be lessened by using ODAC 11 with xcopy deployment. That's already a big win.
Ideally, though, we would like to not have to alter any path variables and have all the ODAC files in a subdirectory underneath ... | Yes, it is possible to use Oracle Data Access Components (ODAC) without altering the system PATH variable, allowing you to maintain a more isolated environment for your application. Here are a few strategies you can consider:
### 1. Use a Local Environment Variable in Your Application
You can set a temporary PATH vari... | 40,169 | [
{
"from": "human",
"value": "I have an application that's using Oracle.DataAccess to connect. I've already discovered that the footprint can be lessened by using ODAC 11 with xcopy deployment. That's already a big win.\nIdeally, though, we would like to not have to alter any path variables and have all th... |
I've got the a SQL Server stored procedure with the following T-SQL code contained within:
insert into #results ([ID], [Action], [Success], [StartTime], [EndTime], [Process])
select
'ID' = aa.[ActionID],
'Action' = cast(aa.[Action] as int),
'Success' = aa.[Success],
'StartTime' = aa.[StartTime],
'En... | To determine whether your stored procedure is recompiling every time it is executed, you can use SQL Server Profiler, Extended Events, or built-in dynamic management views (DMVs). Below, I'll describe how you can do this using SQL Server Profiler and DMVs, which are commonly used for monitoring performance issues.
###... | 37,802 | [
{
"from": "human",
"value": "I've got the a SQL Server stored procedure with the following T-SQL code contained within:\ninsert into #results ([ID], [Action], [Success], [StartTime], [EndTime], [Process])\nselect\n 'ID' = aa.[ActionID],\n 'Action' = cast(aa.[Action] as int),\n 'Success' = aa.[Succe... |
Suppose you create a generic Object variable and assign it to a specific instance. If you do GetType(), will it get type Object or the type of the original class?
| When you create a generic `Object` variable and assign it to a specific instance of a derived class, and then you call the `GetType()` method on that variable, it will return the type of the original class, not `Object`.
Here's an example in C# to illustrate this:
```csharp
class BaseClass { }
class DerivedClass : B... | 41,267 | [
{
"from": "human",
"value": "Suppose you create a generic Object variable and assign it to a specific instance. If you do GetType(), will it get type Object or the type of the original class?\n"
},
{
"from": "gpt",
"value": "When you create a generic `Object` variable and assign it to a specific... |
Are there any known methods of finding peers without using a dedicated central server?
ie: If I have peers which are disconnecting and reconnecting to the internet but getting a new IP address each time, and I want to connect to them without setting up a dedicated server to register with.
I was thinking about using pee... | There are several decentralized methods for peer discovery that do not require a dedicated central server. Here are some of the most commonly used techniques:
1. **Bootstrap Nodes**: You can use a small set of well-known bootstrap nodes (which can be hard-coded into your application) to help new peers discover other p... | 37,081 | [
{
"from": "human",
"value": "Are there any known methods of finding peers without using a dedicated central server?\nie: If I have peers which are disconnecting and reconnecting to the internet but getting a new IP address each time, and I want to connect to them without setting up a dedicated server to reg... |
I have several C# projects along with some internal library components that I'm trying to document together. Sandcastle seems to be the place to go to generate documentation from C#. I would like to know which of the two, DocProject or Sandcastle Help File Builder GUI is better and supports the features I need.
I wou... | When choosing between DocProject and Sandcastle Help File Builder (SHFB) for generating documentation for your C# projects, it’s important to consider the specific features and workflow that each tool provides. Here’s a comparison based on your requirements:
### DocProject
- **Overview**: DocProject was a popular tool... | 37,893 | [
{
"from": "human",
"value": "I have several C# projects along with some internal library components that I'm trying to document together. Sandcastle seems to be the place to go to generate documentation from C#. I would like to know which of the two, DocProject or Sandcastle Help File Builder GUI is bette... |
Martin Fowler defines an elegant object model for the scheduling of recurring tasks here, which maps to OO code very nicely. Mapping this to a relational database schema for persistence, however, is tricky.
Can anyone suggest a schema + SQL combination that encapsulates all the functionality he describes, particularly... | To implement Martin Fowler's elegant object model for scheduling recurring tasks in a relational database schema, you can take a structured approach that allows flexibility for temporal expressions while maintaining the integrity and efficiency of relational queries. Below is a suggested schema that incorporates the ne... | 37,546 | [
{
"from": "human",
"value": "Martin Fowler defines an elegant object model for the scheduling of recurring tasks here, which maps to OO code very nicely. Mapping this to a relational database schema for persistence, however, is tricky.\nCan anyone suggest a schema + SQL combination that encapsulates all th... |
Please recommend me a simple web-based document repository for keeping my small company documents (.DOCs, .PDFs) so i can access them from everywhere. There are many available on the internet, but they are heavy and filled with unnecessary features and requirements.
I have little requirements: pleasant interface (AJAX ... | Hi Todor,
For a simple web-based document repository that suits your requirements and can be hosted in a LAMP environment, here are a few recommendations:
1. **Nextcloud**:
- **Description**: Nextcloud is a powerful, open-source platform that allows you to store, share, and sync your documents. It has a user-frien... | 32,472 | [
{
"from": "human",
"value": "Please recommend me a simple web-based document repository for keeping my small company documents (.DOCs, .PDFs) so i can access them from everywhere. There are many available on the internet, but they are heavy and filled with unnecessary features and requirements.\nI have litt... |
In some existing code there is a test to see if the user is running IE, by checking if the object Browser.Engine.trident is defined and returns true.
But how can I determine if the user is running IE6 (or earlier) or IE7 (or later)?
The test is needed inside a JavaScript function so a conditional comment doesn't seem s... | To determine if the user is running Internet Explorer 6 (or earlier) or Internet Explorer 7 (or later) using JavaScript, you can check the `document.documentMode` property, which is supported in IE8 and later. Since you specifically need to check for IE6 and IE7, you can look for the presence of certain properties and ... | 34,978 | [
{
"from": "human",
"value": "In some existing code there is a test to see if the user is running IE, by checking if the object Browser.Engine.trident is defined and returns true.\nBut how can I determine if the user is running IE6 (or earlier) or IE7 (or later)?\nThe test is needed inside a JavaScript funct... |
Overview
I'm working on some Emergency Services reporting and mapping application for California (kind of weird, considering the fires there, right now...). We need to map demographic and emergency data for an internal govt unit.
What we have are all the streets, cities and neighborhoods in California. Each neighborhoo... | Designing a database for emergency services reporting and mapping is indeed a critical task, especially when considering various geographic and demographic factors. Below, I've outlined a suggested design that balances normalization and performance while considering the needs for querying and reporting.
### Suggested ... | 37,318 | [
{
"from": "human",
"value": "Overview\nI'm working on some Emergency Services reporting and mapping application for California (kind of weird, considering the fires there, right now...). We need to map demographic and emergency data for an internal govt unit.\nWhat we have are all the streets, cities and ne... |
I have to run a local shell script (windows/Linux) on a remote machine.
I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B.
The local and remote computers can be either Windows or Unix based system.
Is there a way to run do this using p... | Yes, you can use `plink` (for Windows) or `ssh` (for Linux/Unix) to run a shell script located on a local machine (Machine A) on a remote machine (Machine B). Below are steps on how to achieve this for both Windows and Linux systems.
### Using `plink` on Windows
1. **Download PuTTY**: If you haven't already, download... | 36,376 | [
{
"from": "human",
"value": "I have to run a local shell script (windows/Linux) on a remote machine.\nI have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B.\nThe local and remote computers can be either Windows or Unix based sy... |
Does anyone know how a System.Windows.Forms.Timer affects the host application and the system in general?
A threaded background loop on one hand has a very high CPU usage %, whilst a Timer with a very high tick rate shows no effect in Windows Task Manager.
Does a high tick-rate timer clutter up the Windows Message loop... | A `System.Windows.Forms.Timer` is designed to integrate well with the Windows Forms message loop, which makes it efficient for certain types of applications. However, it operates differently than a traditional threaded background loop, and this can affect system performance in various ways.
### Behavior of `System.Win... | 39,290 | [
{
"from": "human",
"value": "Does anyone know how a System.Windows.Forms.Timer affects the host application and the system in general?\nA threaded background loop on one hand has a very high CPU usage %, whilst a Timer with a very high tick rate shows no effect in Windows Task Manager.\nDoes a high tick-rat... |
Is there a way in MySQL 5 to show only the current user's processes(queries)?
The user has the PROCESS privilege, therefore SHOW PROCESSLIST displays running processes of all users. According to the documentation, SHOW PROCESSLIST does not allow any kind of WHERE syntax, nor did I manage to make it into a subquery.
Of ... | In MySQL, the `SHOW PROCESSLIST` command shows all the currently running processes for all users if you have the `PROCESS` privilege. Unfortunately, as you pointed out, there isn't a way to apply a `WHERE` clause directly in `SHOW PROCESSLIST`, and it doesn't support subqueries either.
However, you can retrieve the s... | 41,109 | [
{
"from": "human",
"value": "Is there a way in MySQL 5 to show only the current user's processes(queries)?\nThe user has the PROCESS privilege, therefore SHOW PROCESSLIST displays running processes of all users. According to the documentation, SHOW PROCESSLIST does not allow any kind of WHERE syntax, nor di... |
Need to locate the following pattern:
The letter I followed by a space then three alpha numerics followed by a space
"I ALN "
"I H21 "
"I 31M "
these items are also followed by a lat/lon that is trapped by this expression:
Dim regex As New Regex("\d{6} \d{7}")
Can the expressions be combined to return a match that woul... | To create a regular expression that combines your specified pattern and the latitude/longitude format, you can use the following regex pattern:
```vb.net
Dim regex As New Regex("I ([A-Z0-9]{3}) \d{6} \d{7}")
```
### Explanation:
1. **I**: Matches the letter "I" literally.
2. **Space**: The literal space character aft... | 37,498 | [
{
"from": "human",
"value": "Need to locate the following pattern:\nThe letter I followed by a space then three alpha numerics followed by a space\n\"I ALN \"\n\"I H21 \"\n\"I 31M \"\nthese items are also followed by a lat/lon that is trapped by this expression:\nDim regex As New Regex(\"\\d{6} \\d{7}\")\nC... |
In IE6 the paragraph following the empty paragraph is displayed with the background color of the empty paragraph, which I'm guessing is wrong! It works correctly in Firefox, but I haven't checked IE7.
Is there a CSS solution to this problem, or do I have to remove the empty element?
(I would rather not have to remove ... | This behavior you’re encountering in Internet Explorer 6 (IE6) is indeed a known quirk of that specific browser when handling CSS background colors for empty elements. In your example, when a `<p>` element has a background color and is followed by an empty `<p>`, IE6 inherits the background color from the previous `<p>... | 39,282 | [
{
"from": "human",
"value": "In IE6 the paragraph following the empty paragraph is displayed with the background color of the empty paragraph, which I'm guessing is wrong! It works correctly in Firefox, but I haven't checked IE7.\nIs there a CSS solution to this problem, or do I have to remove the empty el... |
Is it a best practice to validate JSON?
With both a JSON schema proposal and a JavaScript implementation of a JSON Schema validator, this practice would seem relatively frictionless to implement. So, is it a no-brainer that should be part of any robust application? Or do you employ other preferred strategies to handle... | Validating JSON is indeed a best practice in many situations, particularly when dealing with data interchange between different systems, APIs, or user inputs. Here are several reasons why validating JSON can be considered a "no-brainer" in robust application design:
### Benefits of JSON Validation:
1. **Data Integrit... | 35,906 | [
{
"from": "human",
"value": "Is it a best practice to validate JSON?\nWith both a JSON schema proposal and a JavaScript implementation of a JSON Schema validator, this practice would seem relatively frictionless to implement. So, is it a no-brainer that should be part of any robust application? Or do you e... |
Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why?
Or should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not?
I'm still reading DDD Quickly, and would like to see some good repository... | Implementing domain-driven design (DDD) repositories as singletons can be a nuanced decision and depends on several factors including your application's architecture, concurrency requirements, and the nature of your data access. Let's break down the considerations:
### Singletons for Repositories
**Pros:**
1. **Share... | 38,872 | [
{
"from": "human",
"value": "Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why?\nOr should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not?\nI'm still reading DDD Quickly,... |
We happily use SVN for SCM at work. Currently I've got our binary assets in the same SVN repository as our code. SVN supports very large files (it transmits them 'streamily' to keep memory usage sane), but it is SLOOWWWWW.
What asset management software do you recommend, for about a GB (and growing) worth of assets? ... | For managing binary assets alongside your source code, especially when you're dealing with a large volume and the need for efficient branching and merging, there are several options you can consider:
1. **Git LFS (Large File Storage)**:
- **Description**: Git LFS is an extension for Git that allows you to manage la... | 33,744 | [
{
"from": "human",
"value": "We happily use SVN for SCM at work. Currently I've got our binary assets in the same SVN repository as our code. SVN supports very large files (it transmits them 'streamily' to keep memory usage sane), but it is SLOOWWWWW.\nWhat asset management software do you recommend, for ... |
I'm trying to get my head around AMQP. It looks great for inter-machine (cluster, LAN, WAN) communication between applications but I'm not sure if it is suitable (in architectural, and current implementation terms) for use as a software bus within one machine.
Would it be worth pulling out a current high performance me... | AMQP (Advanced Message Queuing Protocol) is indeed a powerful protocol designed for message-oriented middleware, facilitating communication between different applications, often over a network. However, your concerns about using AMQP for intra-machine communication are quite valid. Here are some insights that may help ... | 38,771 | [
{
"from": "human",
"value": "I'm trying to get my head around AMQP. It looks great for inter-machine (cluster, LAN, WAN) communication between applications but I'm not sure if it is suitable (in architectural, and current implementation terms) for use as a software bus within one machine.\nWould it be worth... |
Has anyone had any experience in setting up peer to peer replication using SQL Server 2005 or 2008?
Specifically, I'm interested in whether other options/alternatives where considered and why P2P replication was ultimately chosen.
If you have used P2P replication:
Did you encounter any issues during synchronization a... | Setting up Peer-to-Peer (P2P) replication in SQL Server 2005 or 2008 can provide a robust solution for environments where multiple servers need to remain synchronized with each other, especially in distributed systems. Below are insights based on common experiences with P2P replication and alternatives.
### Considerat... | 37,418 | [
{
"from": "human",
"value": "Has anyone had any experience in setting up peer to peer replication using SQL Server 2005 or 2008?\nSpecifically, I'm interested in whether other options/alternatives where considered and why P2P replication was ultimately chosen. \nIf you have used P2P replication:\nDid you e... |
Oracle purchased BEA and their WebLogic suite of tools. They still have a competing product in their own 10gAS Application Server. Both are Java EE, enterprise grade, servers. While it make take some time due to maintenance agreements, it would be unusual for them to continue to produce two products within the same arc... | When Oracle acquired BEA Systems in 2008, it indeed gained the WebLogic application server, which has been a popular Java EE application server with a strong market presence. Given that Oracle already had its own 10g Application Server (10gAS), the acquisition raised questions about the future of both products.
### Li... | 39,389 | [
{
"from": "human",
"value": "Oracle purchased BEA and their WebLogic suite of tools. They still have a competing product in their own 10gAS Application Server. Both are Java EE, enterprise grade, servers. While it make take some time due to maintenance agreements, it would be unusual for them to continue to... |
How does the C/C++ compiler manipulate the escape character ["\"] in source code? How is compiler grammar written for processing that character? What does the compiler do after encountering that character?
| In C and C++, the escape character `\` is used to introduce escape sequences, which allow for the representation of special characters in string literals and character constants. This character is integral to how the compiler interprets and processes string and character data.
### Manipulation of Escape Characters
1.... | 38,097 | [
{
"from": "human",
"value": "How does the C/C++ compiler manipulate the escape character [\"\\\"] in source code? How is compiler grammar written for processing that character? What does the compiler do after encountering that character?\n"
},
{
"from": "gpt",
"value": "In C and C++, the escape ... |
In my shop (as I expect it is in most), you have multiple releases of different software components (let's call them foo-client and bar-service). In my cc.net configuration, I currently have one "project" for foo-client at trunk, one project for foo-client version 1.0 and another for foo-client version 1.1.
What I'd r... | In your scenario, it sounds like you're looking for a way to better organize your build dashboard for multiple versions of your software components while maintaining a clear overview. Here's a general approach you can take with various build management frameworks, with a focus on CI/CD tools like Jenkins, GitLab CI, Ci... | 36,056 | [
{
"from": "human",
"value": "In my shop (as I expect it is in most), you have multiple releases of different software components (let's call them foo-client and bar-service). In my cc.net configuration, I currently have one \"project\" for foo-client at trunk, one project for foo-client version 1.0 and ano... |
I just don't get it. Tried on VC++ 2008 and G++ 4.3.2
#include <map>
class A : public std::multimap<int, bool>
{
public:
size_type erase(int k, bool v)
{
return erase(k); // <- this fails; had to change to __super::erase(k)
}
};
int main()
{
A a;
a.erase(0, false);
a.erase(0); // <- f... | The problem you're encountering in your C++ code is due to name hiding and the way inheritance works in C++. When you create a derived class that inherits from a base class, if you define a member function in the derived class with the same name as a member function in the base class, the base class's function is hidde... | 39,958 | [
{
"from": "human",
"value": "I just don't get it. Tried on VC++ 2008 and G++ 4.3.2\n#include <map>\n\n\nclass A : public std::multimap<int, bool>\n{\npublic:\n size_type erase(int k, bool v)\n {\n return erase(k); // <- this fails; had to change to __super::erase(k)\n }\n};\n\nint main()\n{\... |
I'm currently working on a Google Maps project and am implementing a search function. In my search function I'm trying to have content on the side listing which search makers that were just added to the map correspond to each hall. However in assembling this string I run into a problem where my side_bar_html variable w... | It looks like you're trying to build an HTML sidebar to display search results in your Google Maps project. The problem you are encountering is due to the asynchronous nature of the `XMLHttpRequest`. When you call `request.send(null)`, it sends the request and immediately continues to the next lines of code, including ... | 35,320 | [
{
"from": "human",
"value": "I'm currently working on a Google Maps project and am implementing a search function. In my search function I'm trying to have content on the side listing which search makers that were just added to the map correspond to each hall. However in assembling this string I run into a ... |
This is a Rails/ActiveRecord question.
I have a model which basically has to represent events or performances. Each event has many attributions: an attribution is basically something like "In this event, Person X had Role Y".
I concluded that the best way to allow a user to edit this data is by providing a free text fi... | Your situation presents an interesting challenge regarding the validation of your `role_string` attribute in a Rails model. Let's break down your questions and the associated concerns.
### 1. Avoiding Duplicate Logic
You're right in wanting to avoid duplicating the logic between the `role_string=` method and the vali... | 38,433 | [
{
"from": "human",
"value": "This is a Rails/ActiveRecord question.\nI have a model which basically has to represent events or performances. Each event has many attributions: an attribution is basically something like \"In this event, Person X had Role Y\".\nI concluded that the best way to allow a user to ... |
I am using attribute_fu to render a nice block of rows for a particular table.
<%= f.render_associated_form(@foo.bars, :new => 5) %>
I would like to have the bar partial have some notion of a bit of state. (Because the notion is specific to the view, I do not want to externalize this to the Bar model itself and calcu... | It seems like you're trying to maintain mutable state in a partial rendered by `attribute_fu`, which can be a bit tricky due to the way local variables work in Ruby on Rails views. Specifically, the issue arises because local variables passed to partials are read-only within that scope. Therefore, modifying the hash or... | 32,724 | [
{
"from": "human",
"value": "I am using attribute_fu to render a nice block of rows for a particular table.\n<%= f.render_associated_form(@foo.bars, :new => 5) %>\n\nI would like to have the bar partial have some notion of a bit of state. (Because the notion is specific to the view, I do not want to extern... |
I would like to do the following:
when a Sales person assigns a custom entity (let's call it 'Primary Expertise') to an Opportunity in MS CRM 4.0, the system would share the Opportunity with the user that is defined as the Owner of the associated 'Primary Expertise' record.
I would like to do it automatically via workf... | In Microsoft CRM 4.0, workflows have limited capabilities and do not provide built-in steps to share records automatically based on related entity records, such as sharing an Opportunity with the Owner of a related custom entity (like 'Primary Expertise').
You are correct that workflows in MS CRM 4.0 may not have the... | 36,715 | [
{
"from": "human",
"value": "I would like to do the following:\nwhen a Sales person assigns a custom entity (let's call it 'Primary Expertise') to an Opportunity in MS CRM 4.0, the system would share the Opportunity with the user that is defined as the Owner of the associated 'Primary Expertise' record.\nI ... |
I have a mysql database which has grown to over 200 tables in it. I know this isn't a performance problem, but most admin tools I have aren't organized well enough to manage this number of tables easily, and I am thinking of putting some (new) tables into a 2nd database just for my own sanity.
Has anyone else gone down... | Many developers and database administrators have faced similar situations as their databases grow over time. Here are some real-world experiences and considerations regarding the organization of tables across multiple databases versus keeping a monolithic database:
### Pros of Using Multiple Databases
1. **Organizati... | 38,536 | [
{
"from": "human",
"value": "I have a mysql database which has grown to over 200 tables in it. I know this isn't a performance problem, but most admin tools I have aren't organized well enough to manage this number of tables easily, and I am thinking of putting some (new) tables into a 2nd database just for... |
I'm working with Dreamweaver CS3. The question here is what part of the code (listed below) do I need to replicate to have my secondary nav bar utilize the on-click action?
FYI...DW has two menu options or auto insert items...one for roll over images and one for "navbar". DW will only allow you to use the 'navbar' ite... | To have your secondary navigation bar utilize the on-click action similar to your primary navbar in Dreamweaver CS3, you will need to replicate the relevant parts of the code that handle the onClick event along with the MouseOver and MouseOut events.
### What Part of the Code to Insert Manually
Here is a breakdown o... | 36,722 | [
{
"from": "human",
"value": "I'm working with Dreamweaver CS3. The question here is what part of the code (listed below) do I need to replicate to have my secondary nav bar utilize the on-click action? \nFYI...DW has two menu options or auto insert items...one for roll over images and one for \"navbar\". DW... |
I'm designing a system which is receiving data from a number of partners in the form of CSV files. The files may differ in the number and ordering of columns. For the most part, I will want to choose a subset of the columns, maybe reorder them, and hand them off to a parser. I would obviously prefer to be able to trans... | To achieve your goal of transforming CSV files with varying structures into a canonical XML format, there are several approaches and technologies that you can consider:
### 1. **Custom CSV Transformation Library**
You can create a custom transformation library in C# to handle the CSV parsing and transformation. This ... | 37,614 | [
{
"from": "human",
"value": "I'm designing a system which is receiving data from a number of partners in the form of CSV files. The files may differ in the number and ordering of columns. For the most part, I will want to choose a subset of the columns, maybe reorder them, and hand them off to a parser. I w... |
Grasping at straws here... I work with a VB6 desktop system using several 2003-style Access databases (.MDB). Recently, I changed the first function from VB6 to VB.NET, still using an Access database. This is more than a conversion, but a rewrite with additional functionality. It is still fairly simple functionality... | It sounds like you're facing a frustrating performance issue that only affects a small subset of customers. Here are some potential causes and suggestions to troubleshoot and resolve the extreme slowness they are experiencing when loading the DataGridView:
### 1. **Network Latency and Performance**
If these customers ... | 38,896 | [
{
"from": "human",
"value": "Grasping at straws here... I work with a VB6 desktop system using several 2003-style Access databases (.MDB). Recently, I changed the first function from VB6 to VB.NET, still using an Access database. This is more than a conversion, but a rewrite with additional functionality.... |
I am creating a large table dynamically using Javascript.
I have realised the time taken to add a new row grows exponentially as the number of rows increase.
I suspect the Page is getting refreshed in each loop per row (I am also adding input elements of type text on each cell)
Is there a way to stop the page "refreshi... | When dynamically creating large tables with many rows and input elements in JavaScript, performance can indeed suffer due to the frequency of DOM manipulations and excessive calls to `getElementById()`. Here are some strategies to improve performance and avoid page refresh issues:
### 1. Batch DOM Updates
Instead of u... | 36,828 | [
{
"from": "human",
"value": "I am creating a large table dynamically using Javascript.\nI have realised the time taken to add a new row grows exponentially as the number of rows increase.\nI suspect the Page is getting refreshed in each loop per row (I am also adding input elements of type text on each cell... |
We have a C# windows application that needs to be able to connect to a server on a network, download and save a file to a specified location.
We can not use a web service as we can not assume that our clients will have IIS on their server.
The way that I am considering doing it is to FTP onto the server and download t... | When it comes to transferring files between a client and a server without relying on a web service, there are a few different approaches you could consider aside from FTP. Here are some options along with answers to your specific questions:
### 1. Using FTP with Windows Credentials
To use Windows credentials for FTP a... | 37,989 | [
{
"from": "human",
"value": "We have a C# windows application that needs to be able to connect to a server on a network, download and save a file to a specified location.\nWe can not use a web service as we can not assume that our clients will have IIS on their server. \nThe way that I am considering doing ... |
I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed.
My question is: How can I configure CSS Tidy to combine all of... | To configure CSS Tidy to simply combine your CSS files into one without any additional processing or optimization, you will want to focus on settings that prevent any modifications to the CSS content itself. Since you're directly editing the `csstidy()` function in the class, make sure to carefully adjust the settings ... | 35,789 | [
{
"from": "human",
"value": "I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed.\nMy question is: How ... |
I'm a Scrum newbie and looking to implement Scrum in my company. Obtaining buy-in is not a problem, it is my company and the developers are more than happy to work like this.
The problem is that 75% of our revenue is derived from fixed length/fixed price projects.
Ken Schwaber in his book, Agile Project Management wit... | Implementing Scrum in a fixed-length or fixed-price project can indeed be challenging due to the inherent uncertainty and the traditional mindset surrounding such projects. However, many organizations have successfully navigated this terrain by adopting specific strategies. Here are several approaches that others have ... | 37,366 | [
{
"from": "human",
"value": "I'm a Scrum newbie and looking to implement Scrum in my company. Obtaining buy-in is not a problem, it is my company and the developers are more than happy to work like this.\nThe problem is that 75% of our revenue is derived from fixed length/fixed price projects. \nKen Schwabe... |
I have the following table
<td class="style2">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Location</asp:ListItem>
<asp:ListItem>Name</asp:ListItem>
<asp:ListItem>SSN</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
... | To achieve the desired functionality of adding additional rows of dropdown filters when the `btnAdd` button is clicked, you can create these controls dynamically in the code-behind file. This approach allows you to add and manage the controls without having to define all of them statically in your ASPX markup. Below ar... | 35,682 | [
{
"from": "human",
"value": "I have the following table\n<td class=\"style2\">\n <asp:DropDownList ID=\"DropDownList1\" runat=\"server\">\n <asp:ListItem>Location</asp:ListItem>\n <asp:ListItem>Name</asp:ListItem>\n <asp:ListItem>SSN</asp:ListItem>\n </asp:DropDownList>\n <asp:... |
I want to diaplay message boxes that looks good, with the possibillity to use bold/italic text and text with different colors. The standard MessageBox.Show doesn't provide this functionality.
I have been trying to create a message box using the WebBrowser control to display nicely formatted text using HTML-syntax. But ... | Creating a custom message box in Windows Forms that supports HTML-style formatting and dynamically sizes itself based on the content can be achieved using a `Form` with a `WebBrowser` control. Below, I'll guide you through the steps to implement this:
1. **Create a new Form for the Custom Message Box.**
2. **Add a We... | 36,142 | [
{
"from": "human",
"value": "I want to diaplay message boxes that looks good, with the possibillity to use bold/italic text and text with different colors. The standard MessageBox.Show doesn't provide this functionality.\nI have been trying to create a message box using the WebBrowser control to display nic... |
I get a 404 response from .Net MVC when I try to make a request where my search term ends with a . (period). This is the route that I'm using:
routes.MapRoute(
"Json",
"Remote.mvc/{action}/{searchTerm}/{count}",
new { controller="Remote", count=10}
);
The sea... | In ASP.NET MVC, routes can sometimes behave unexpectedly when it comes to certain characters like periods ('.'). This is because the period is often treated as a file extension separator, and when a URL ends with a period, the routing system may interpret it as a request for a resource that doesn’t exist, resulting in ... | 39,831 | [
{
"from": "human",
"value": "I get a 404 response from .Net MVC when I try to make a request where my search term ends with a . (period). This is the route that I'm using:\nroutes.MapRoute(\n \"Json\",\n \"Remote.mvc/{action}/{searchTerm}/{count}\",\n new { contr... |
as a follow up on my previous question
Having a function with combined generic bounds such as:
<T extends Foo & Bar> void doStuff(T argument) {
//do stuff wich should only be done if arguments is both foo and bar
}
Because this is not castable from a unspecified object, you need to have knowledge of some object whic... | Your concerns regarding the use of combined generic bounds and how it may lead to tight coupling in your codebase are quite valid. Let's break this down:
### Understanding the Problem
1. **Generic Bounds and Type Safety**: The approach you're using (`<T extends Foo & Bar>`) ensures that the type `T` must implement bo... | 38,372 | [
{
"from": "human",
"value": "as a follow up on my previous question\nHaving a function with combined generic bounds such as:\n<T extends Foo & Bar> void doStuff(T argument) {\n //do stuff wich should only be done if arguments is both foo and bar\n}\n\nBecause this is not castable from a unspecified object,... |
Is there a way to find out when in a LAN anyone plugs in a pendrive to the USB port?
Programatically (in C# preferably) or through some tool. Basically I'd imagine a client application sits on each terminal and monitors the USB ports and sends the information to the server.
a.) Can I get the details of the file(s) be... | Monitoring USB port usage on a LAN can be challenging, especially if you're looking to log activities without the direct cooperation of the users (i.e., without a client application). However, I can guide you on how to approach this issue.
### A. Using a Client Application
Creating a client application that runs on e... | 37,516 | [
{
"from": "human",
"value": "Is there a way to find out when in a LAN anyone plugs in a pendrive to the USB port? \nProgramatically (in C# preferably) or through some tool. Basically I'd imagine a client application sits on each terminal and monitors the USB ports and sends the information to the server. \n... |
I have a HTML application, partially HTML, partially VBscript, disguised as a form. What it does is it opens a few local files, runs a DOS box containing GAWK and presents a text file as its result. I wish to expand upon it by letting it create a bitmap image with the results in a stacked bar graph, for instance as a .... | To create a bitmap image (like a .BMP file) with a stacked bar graph using results from your HTML application, you can follow these general steps:
### Step 1: Understanding the Requirements
1. **Gather Data**: Ensure that you can retrieve the necessary data/results from your existing HTML/VBScript application.
2. **Ch... | 37,921 | [
{
"from": "human",
"value": "I have a HTML application, partially HTML, partially VBscript, disguised as a form. What it does is it opens a few local files, runs a DOS box containing GAWK and presents a text file as its result. I wish to expand upon it by letting it create a bitmap image with the results in... |
I'm writing a Python application that takes a command as an argument, for example:
$ python myapp.py command1
I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like:
myapp/
__ini... | Your approach to dynamically import command modules using `__import__` is valid, and it provides a good balance between extensibility and simplicity. However, there are more idiomatic ways to achieve the same functionality in Python that are easier to read and maintain.
One commonly used technique involves using the `... | 37,845 | [
{
"from": "human",
"value": "I'm writing a Python application that takes a command as an argument, for example:\n$ python myapp.py command1\n\nI want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The... |
I have an ASPX page where I am uploading an image to server for on a serverside button click event. In my page, it will show the available image if it exists. When I upload an image, it will replace the old one with the new one. Now after uploading also the same image is getting displayed. How can tackle this? I used ... | To solve the problem of the uploaded image not being refreshed correctly after the upload, you can take a couple of approaches. It appears that the current logic is trying to reload the page after the upload but may be encountering issues because it also involves posting the page again.
### 1. Update the Image Source... | 39,123 | [
{
"from": "human",
"value": "I have an ASPX page where I am uploading an image to server for on a serverside button click event. In my page, it will show the available image if it exists. When I upload an image, it will replace the old one with the new one. Now after uploading also the same image is gettin... |
(ANSWER) How to export some Geography data from a Microsoft Sql Server 2008.
You'll need to use the command line argument BCP to dump the data in it's original (native) format to a binary file. Then on the other server you can bulk insert this binary data back into a table of the same strucutre.
here's some code.
Expor... | To export and import geography data from Microsoft SQL Server 2008, the BCP (Bulk Copy Program) utility is a useful tool for handling this in its native format. Here’s a clear and concise guide for both exporting and importing the data.
### Exporting Geography Data
You can use the BCP command in the command line to e... | 37,956 | [
{
"from": "human",
"value": "(ANSWER) How to export some Geography data from a Microsoft Sql Server 2008.\nYou'll need to use the command line argument BCP to dump the data in it's original (native) format to a binary file. Then on the other server you can bulk insert this binary data back into a table of t... |
I have
<bean id="dao" class="......">
<property name="foo">
<props>
<prop key="me">Homer</prop>
<props>
<property>
</bean>
I want to use my current properties file, name-value pair, to change "Homer"
I cannot figure it out...
| To use an external properties file to populate the value for the `foo` property in your Spring configuration, you can make use of the `PropertyPlaceholderConfigurer` or the `@Value` annotation in a Spring application. Below is an example of how to do this using an XML configuration.
### Step 1: Create a Properties Fil... | 39,695 | [
{
"from": "human",
"value": "I have\n <bean id=\"dao\" class=\"......\"> \n <property name=\"foo\">\n <props>\n <prop key=\"me\">Homer</prop>\n <props>\n <property>\n </bean>\n\nI want to use my current properties file, name-value pair, to change \"Homer\"\nI cannot ... |
Is it possible to deploy a website using git push? I have a hunch it has something to do with using git hooks to perform a git reset --hard on the server side, but how would I go about accomplishing this?
| Yes, it is indeed possible to deploy a website using `git push`, and you can use Git hooks to automate the deployment process on the server side. Below is a basic outline of how you can set this up using a `post-receive` hook.
### Prerequisites
1. You have a server with Git installed.
2. You have SSH access to the ser... | 34,462 | [
{
"from": "human",
"value": "Is it possible to deploy a website using git push? I have a hunch it has something to do with using git hooks to perform a git reset --hard on the server side, but how would I go about accomplishing this?\n"
},
{
"from": "gpt",
"value": "Yes, it is indeed possible to... |
A similar question was asked here, but it was specific to .NET 3.5. Specifically, I'm looking for the following:
What is the correct way to determine which .NET Framework versions and service packs are installed?
Is there a list of registry keys that can be used?
Are there any dependencies between Framework versions?
... | To determine which .NET Framework versions and service packs are installed on a Windows machine, you can use the Windows Registry, as the .NET Framework versions are recorded in specific keys. Below are the details you need to achieve this:
### 1. Registry Keys to Check
The versions of the .NET Framework are stored i... | 26,157 | [
{
"from": "human",
"value": "A similar question was asked here, but it was specific to .NET 3.5. Specifically, I'm looking for the following:\n\nWhat is the correct way to determine which .NET Framework versions and service packs are installed?\nIs there a list of registry keys that can be used?\nAre there ... |
I have a multiple platform application set, with some applications running on Linux and some on Windows. I want to accomplish the following build:
Server L runs CruiseControl with Project A, a Linux-only server application. This should build first.
If Project A builds successfully, it needs to somehow kick off...
Pro... | This scenario you're describing is definitely achievable with proper orchestration between CruiseControl and CruiseControl.NET. Here’s a step-by-step approach to accomplish this multi-platform build and integration:
### 1. Setup CruiseControl on Server L for Project A
- **Configure Project A**: Make sure CruiseControl... | 34,533 | [
{
"from": "human",
"value": "I have a multiple platform application set, with some applications running on Linux and some on Windows. I want to accomplish the following build:\nServer L runs CruiseControl with Project A, a Linux-only server application. This should build first.\nIf Project A builds succes... |
First of all, I will admit I am a novice to web services, although I'm familiar with HTML and basic web stuff. I created a quick-and-dirty web service using Python that calls a stored procedure in a MySQL database, that simply returns a BIGINT value. I want to return this value in the web service, and I want to gener... | SOAPpy does not automatically generate WSDL files, but you can manually create a WSDL file to define the web service interface and the expected data types. Below is an example WSDL that you can use as a starting point based on your description of the web service. The WSDL defines a single operation that matches the `ge... | 35,627 | [
{
"from": "human",
"value": "First of all, I will admit I am a novice to web services, although I'm familiar with HTML and basic web stuff. I created a quick-and-dirty web service using Python that calls a stored procedure in a MySQL database, that simply returns a BIGINT value. I want to return this valu... |
I am just getting started with IoC containers so apologies if this is a stupid question.
I have code like the following in an app
internal static class StaticDataHandlerFactory
{
public static IStaticDataHandler CreateHandler(StaticDataUpdate staticDataUpdate)
{
if (staticDataUpdate.Item... | You're on the right track in considering how an IoC (Inversion of Control) container can simplify your code and eliminate the need for explicit factory logic like the one you've shown.
In your example, the `StaticDataHandlerFactory` uses a series of `if` statements to determine which specific implementation of `IStat... | 35,411 | [
{
"from": "human",
"value": "I am just getting started with IoC containers so apologies if this is a stupid question.\nI have code like the following in an app\ninternal static class StaticDataHandlerFactory\n {\n public static IStaticDataHandler CreateHandler(StaticDataUpdate staticDataUpdate)\n ... |
Similar to List<> OrderBy Alphabetical Order, we want to sort by one element, then another. we want to achieve the functional equivalent of
SELECT * from Table ORDER BY x, y
We have a class that contains a number of sorting functions, and we have no issues sorting by one element.
For example:
public class MyClas... | To achieve the equivalent of a SQL `ORDER BY x, y` in C# using the `List<T>.Sort` method, you can create a custom comparison function that compares the two properties sequentially. This allows you to sort the list first by `x` and then by `y` within items that have the same `x` value.
Here's how you can implement this... | 37,761 | [
{
"from": "human",
"value": "Similar to List<> OrderBy Alphabetical Order, we want to sort by one element, then another. we want to achieve the functional equivalent of \nSELECT * from Table ORDER BY x, y \n\nWe have a class that contains a number of sorting functions, and we have no issues sorting by one... |
This is a broad question, so let me narrow it a bit. I am a graphic designer entering the world of web design. I'm not totally green in this field, but I know enough to know that I have a lot to learn. From friends and from posts on this site I realize there is often a harmful disconnect between design and development.... | Transitioning from graphic design to web design is an exciting journey, and your awareness of the disconnect between design and development is a great starting point. Here are some potential pitfalls to avoid as you work on the client login/password portal, along with some general tips to ensure smooth collaboration wi... | 37,933 | [
{
"from": "human",
"value": "This is a broad question, so let me narrow it a bit. I am a graphic designer entering the world of web design. I'm not totally green in this field, but I know enough to know that I have a lot to learn. From friends and from posts on this site I realize there is often a harmful d... |
A.Event1 := nil;
A.Event2 := nil;
try
...
finally
A.Event1 := MyEvent1;
A.Event2 := MyEvent2;
end;
Can something go wrong with it?
EDIT:
I've accepted Barry's answer because it answered exactly what I asked, but Vegar's answer is also correct depending on the scenario, sadly I can't accept both.
| The provided code snippet sets two event references (`Event1` and `Event2`) of an object `A` to `nil` in a `try` block, and then reassigns them to `MyEvent1` and `MyEvent2` in a `finally` block. This construct is generally used to ensure that resources are released or cleaned up properly even if an exception occurs dur... | 38,296 | [
{
"from": "human",
"value": "A.Event1 := nil;\nA.Event2 := nil;\ntry\n ...\nfinally\n A.Event1 := MyEvent1;\n A.Event2 := MyEvent2;\nend;\n\nCan something go wrong with it?\nEDIT:\nI've accepted Barry's answer because it answered exactly what I asked, but Vegar's answer is also correct depending on the s... |
How much can a developer charge for an iPhone app like Twitterrific?
I want to know this because I need such an application with the same functionality for a new community website. I can do Ruby but have no experience with Objective-C. So it would be interesting for me if I should start reading books about iPhone progr... | The cost of developing an iPhone app like Twitterrific can vary widely based on several factors, including the complexity of the app, the developer's experience, the region in which they are located, and the specific features you want to include.
Here are some general considerations:
1. **Cost Range**:
- Freelanc... | 36,661 | [
{
"from": "human",
"value": "How much can a developer charge for an iPhone app like Twitterrific?\nI want to know this because I need such an application with the same functionality for a new community website. I can do Ruby but have no experience with Objective-C. So it would be interesting for me if I sho... |
what is the easiest way to remove the "T" from the result?
I want the result to be "YYYY/MM/DD HH/MM/SS"
the vb.net code is really straight forward
xmlDoc = New Xml.XmlDataDocument(data_set)
xslTran = New Xml.Xsl.XslCompiledTransform
xslTran.Load(strXslFile)
writer = New Xml.XmlTextWrite... | To remove the "T" from a date string in VB.NET, you can apply a transformation in your XSLT. If your XML contains a date formatted like `YYYY-MM-DDTHH:MM:SS`, you would use XSLT to change that format to `YYYY/MM/DD HH:MM:SS`.
Here’s how you can modify your XSLT to achieve this:
### Example XSLT
Assuming you have the ... | 39,088 | [
{
"from": "human",
"value": "what is the easiest way to remove the \"T\" from the result?\nI want the result to be \"YYYY/MM/DD HH/MM/SS\"\nthe vb.net code is really straight forward\n xmlDoc = New Xml.XmlDataDocument(data_set)\n xslTran = New Xml.Xsl.XslCompiledTransform\n xslTran.Load... |
I have used getopt in Python and was hoping there would be something similar in Java.
Please give a reason why your answer is better than the others.
| In Java, while there isn't a built-in library equivalent to Python's `getopt`, the Java ecosystem provides several robust libraries that offer command-line argument parsing. One of the most popular and widely used libraries is Apache Commons CLI.
### Advantages of Apache Commons CLI over Other Options
1. **Simplicity... | 36,765 | [
{
"from": "human",
"value": "I have used getopt in Python and was hoping there would be something similar in Java.\nPlease give a reason why your answer is better than the others.\n"
},
{
"from": "gpt",
"value": "In Java, while there isn't a built-in library equivalent to Python's `getopt`, the ... |
I prefer to use jQuery with my ASP.NET MVC apps than the Microsoft Ajax library. I have been adding a parameter called "mode" to my actions, which I set in my ajax calls. If it is provided, I return a JsonViewResult. If it isn't supplied, I assume it was a standard Http post and I return a ViewResult.
I'd like to be ab... | Certainly! You can create an extension method to determine if a request is an AJAX request in your ASP.NET MVC application. The jQuery AJAX requests typically set the `X-Requested-With` header to `XMLHttpRequest`. You can use this header to check if the request is an AJAX call, allowing you to eliminate the need for an... | 38,400 | [
{
"from": "human",
"value": "I prefer to use jQuery with my ASP.NET MVC apps than the Microsoft Ajax library. I have been adding a parameter called \"mode\" to my actions, which I set in my ajax calls. If it is provided, I return a JsonViewResult. If it isn't supplied, I assume it was a standard Http post a... |
When scripting in bash or any other shell in *NIX, while running a command that will take more than a few seconds, a progress bar is needed.
For example, copying a big file, opening a big tar file.
What ways do you recommend to add progress bars to shell scripts?
| Adding a progress bar to shell scripts in a Unix-like environment can enhance user experience, especially for long-running commands. Here are several methods you can use to implement progress bars in shell scripts:
### 1. **Using `pv` (Pipe Viewer)**
`pv` is a tool that allows you to monitor the progress of data thro... | 37,630 | [
{
"from": "human",
"value": "When scripting in bash or any other shell in *NIX, while running a command that will take more than a few seconds, a progress bar is needed.\nFor example, copying a big file, opening a big tar file.\nWhat ways do you recommend to add progress bars to shell scripts?\n"
},
{
... |
Consider the following:
irb(main):001:0> class A
irb(main):002:1> def initialize
irb(main):003:2> @string = "my string"
irb(main):004:2> end
irb(main):005:1> def to_s
irb(main):006:2> puts @string
irb(main):007:2> end
irb(main):008:1> end
=> nil
irb(main):009:0> a = A.new
=> #<A:0x2ea606c @string="my string">
irb(main)... | In Ruby, the `puts` method is used to output strings, but when you pass an object to `puts`, it first calls the object's `to_s` method to convert it to a string representation. If the `to_s` method does not return a string but instead returns `nil` or if it prints something itself (using `puts`), the default behavior o... | 40,804 | [
{
"from": "human",
"value": "Consider the following:\nirb(main):001:0> class A\nirb(main):002:1> def initialize\nirb(main):003:2> @string = \"my string\"\nirb(main):004:2> end\nirb(main):005:1> def to_s\nirb(main):006:2> puts @string\nirb(main):007:2> end\nirb(main):008:1> end\n=> nil\nirb(main):009:0> a = ... |
I'm stuck on what appears to be a CSS/z-index conflict with the YouTube player. In Firefox 3 under Windows XP, Take a look at this page: http://spokenword.org/program/21396 Click on the Collect button and note that the pop-up <div> appears under the YouTube player. On other browsers the <div> appears on top. It has a z... | It looks like you're dealing with a common issue regarding z-index and the behavior of embedded objects, like the YouTube player. In Firefox and other browsers, objects and plugins can sometimes have a higher stacking context than regular HTML elements, which can cause them to appear on top of elements with higher z-in... | 39,692 | [
{
"from": "human",
"value": "I'm stuck on what appears to be a CSS/z-index conflict with the YouTube player. In Firefox 3 under Windows XP, Take a look at this page: http://spokenword.org/program/21396 Click on the Collect button and note that the pop-up <div> appears under the YouTube player. On other brow... |
This is more of an generic XML Schema question, but if and how do you specify
field dependencies in an XML Schema. For example, how would I say fieldB is
required, if fieldA is provided ???
| XML Schema Definition (XSD) does not natively support specifying conditional dependencies between elements, such as making one element required based on the presence of another. However, you can achieve this requirement by using a combination of `xs:choice` and `xs:sequence` to model the conditional structure.
### Ex... | 39,501 | [
{
"from": "human",
"value": "This is more of an generic XML Schema question, but if and how do you specify\nfield dependencies in an XML Schema. For example, how would I say fieldB is\nrequired, if fieldA is provided ???\n"
},
{
"from": "gpt",
"value": "XML Schema Definition (XSD) does not nativ... |
I don't want to use Mac or Windows at work but I have a lot of work in Photoshop when I have to create an HTML page from a Photoshop design.
What is the best way to use Photoshop CS3 in Linux, Wine, virtualization, ... ???
| Using Photoshop CS3 on a Linux system can be challenging since it's a Windows application, but there are several methods to get it running. Here are some options you can consider:
1. **Wine**:
- **Install Wine**: Wine allows you to run Windows applications on Linux. You can install it using your package manager (e.... | 39,063 | [
{
"from": "human",
"value": "I don't want to use Mac or Windows at work but I have a lot of work in Photoshop when I have to create an HTML page from a Photoshop design.\nWhat is the best way to use Photoshop CS3 in Linux, Wine, virtualization, ... ???\n"
},
{
"from": "gpt",
"value": "Using Phot... |
I'm trying to convert an Excel document into a table in SQL 2005. I found the link below and am wondering if it looks like a solution. If so, what would the @excel_full_file_name syntax be and where would the path be relative to?
http://www.siccolo.com/Articles/SQLScripts/how-to-create-sql-to-convert-Excel_to_table.... | The link you provided offers a method to import data from an Excel file into SQL Server 2005 using T-SQL. The `@excel_full_file_name` variable in the script is intended to hold the full path to the Excel file you want to import.
### Syntax for `@excel_full_file_name`
The syntax for `@excel_full_file_name` would typica... | 40,140 | [
{
"from": "human",
"value": "I'm trying to convert an Excel document into a table in SQL 2005. I found the link below and am wondering if it looks like a solution. If so, what would the @excel_full_file_name syntax be and where would the path be relative to? \nhttp://www.siccolo.com/Articles/SQLScripts/ho... |
I'm a complete beginner when it comes to programming. I'm taking a stab at PHP, and have seen how powerful the frameworks can be. But should I even consider trying to work with a framework until I have a strong grasp of PHP itself?
Note: I'd most likely be using CodeIgnitor, but the question applies to any of the frame... | It's great that you're taking the initiative to learn PHP and explore frameworks! Here’s a breakdown of whether you should dive into a framework like CodeIgniter or focus on mastering PHP first:
### Pros of Learning a Framework Early:
1. **Real-World Applications**: Frameworks often provide built-in tools and feature... | 36,068 | [
{
"from": "human",
"value": "I'm a complete beginner when it comes to programming. I'm taking a stab at PHP, and have seen how powerful the frameworks can be. But should I even consider trying to work with a framework until I have a strong grasp of PHP itself?\nNote: I'd most likely be using CodeIgnitor, bu... |
I'm using the built-in SpellCheck for the WPF RichTextBox and would like to ignore spelling errors for some text runs (validated paths). What is the best way of doing this?
| To ignore spelling errors for certain text runs in a WPF `RichTextBox` while still utilizing the built-in spell checking feature, you can utilize the `SpellCheck` properties combined with `TextRange` and `Run` elements. Specifically, you can set the `SpellCheck.IsEnabled` property to `false` for specific `Run` elements... | 38,907 | [
{
"from": "human",
"value": "I'm using the built-in SpellCheck for the WPF RichTextBox and would like to ignore spelling errors for some text runs (validated paths). What is the best way of doing this?\n"
},
{
"from": "gpt",
"value": "To ignore spelling errors for certain text runs in a WPF `Ri... |
I have set up Synergy on Unix systems with no problems, however when I set up a Synergy server on a Windows Server 2003 box using I get an error message that the mouse cursor is locked when trying to move to the client system. I use a Microsoft Natural keyboard in case that matters (seems Scroll Lock might be involved... | The issue you're experiencing with Synergy on Windows Server 2003, where the mouse cursor is locked and unable to move to the client system, can be caused by several factors. Here are some troubleshooting steps and considerations that might help resolve the problem:
1. **Scroll Lock**: Synergy uses the Scroll Lock key... | 37,641 | [
{
"from": "human",
"value": "I have set up Synergy on Unix systems with no problems, however when I set up a Synergy server on a Windows Server 2003 box using I get an error message that the mouse cursor is locked when trying to move to the client system. I use a Microsoft Natural keyboard in case that mat... |
If you put up an NSAlert while your app is in the background your dock icon starts bouncing and keeps on bouncing until you switch back.
I find this annoying.
Does anyone know how disable that for a single app?
| In macOS, when an application presents an NSAlert while it is in the background, the app's dock icon may bounce to alert the user. Unfortunately, there is no built-in way to disable the bouncing behavior specifically for a single application. However, there are a few approaches you could consider:
### 1. Use Modal Ale... | 37,272 | [
{
"from": "human",
"value": "If you put up an NSAlert while your app is in the background your dock icon starts bouncing and keeps on bouncing until you switch back. \nI find this annoying. \nDoes anyone know how disable that for a single app? \n"
},
{
"from": "gpt",
"value": "In macOS, when an ... |
Here's a code snippet. . .
<form name="FinalAccept" method="get"><br>
<input type="radio" name="YesNo" value="Yes" onclick="/accept"> Yes<br>
<input type="radio" name="YesNo" value="No" onclick="/accept"> No<br>
Clearly, what I'm trying to do is call the routine linked to /accept when the user clicks on the radio bu... | It looks like you're trying to trigger a routine or function when a radio button is clicked, but the current approach is not the correct way to handle this in HTML/JavaScript.
The `onclick` attribute is typically used to call JavaScript functions, not directly to point to a URL. If you want to call a routine when a ra... | 39,836 | [
{
"from": "human",
"value": "Here's a code snippet. . .\n<form name=\"FinalAccept\" method=\"get\"><br>\n\n<input type=\"radio\" name=\"YesNo\" value=\"Yes\" onclick=\"/accept\"> Yes<br>\n\n<input type=\"radio\" name=\"YesNo\" value=\"No\" onclick=\"/accept\"> No<br>\n\nClearly, what I'm trying to do is cal... |
I am looking for a way to get the essence or the most important aspect of a webpage? If I provide a URL, is there any external service which can accomplish this? I am not looking for snap.com like service as it provides a snapshot.
I might be willing to even implement such a system on my own. For beginning I do not wan... | Extracting the essence or most important aspects of a webpage can be approached in several ways. You can use existing services or implement your own solution with some initial effort. Here are a few suggestions:
### Existing Services
1. **Summarization APIs**: There are several APIs that can summarize text. Some popu... | 39,323 | [
{
"from": "human",
"value": "I am looking for a way to get the essence or the most important aspect of a webpage? If I provide a URL, is there any external service which can accomplish this? I am not looking for snap.com like service as it provides a snapshot.\nI might be willing to even implement such a sy... |
How do I execute the following shell command using the Python subprocess module?
echo "input data" | awk -f script.awk | sort > outfile.txt
The input data will come from a string, so I don't actually need echo. I've got this far, can anyone explain how I get it to pipe through sort too?
p_awk = subprocess.Popen(["awk... | To execute the specified shell command using Python's `subprocess` module, you will want to set up a pipeline that includes both the `awk` and `sort` commands. You can achieve this by chaining the processes using the `subprocess.Popen` function.
Here's how you can do it:
1. Start the `awk` process and pipe its output... | 38,149 | [
{
"from": "human",
"value": "How do I execute the following shell command using the Python subprocess module?\necho \"input data\" | awk -f script.awk | sort > outfile.txt\n\nThe input data will come from a string, so I don't actually need echo. I've got this far, can anyone explain how I get it to pipe th... |
I want to test that application A (legacy) and application B (current) are sending the same SQL to the database. Is there an easy way to check the generated SQL?
I'm not too concerned with minor syntax differences.
| Yes, there are a few methods you can use to capture and compare the SQL generated by both applications. Here are some common approaches:
### 1. **Database Query Logging**
Many databases offer built-in query logging features. You can enable query logging to capture all the SQL statements that the database receives. Her... | 38,098 | [
{
"from": "human",
"value": "I want to test that application A (legacy) and application B (current) are sending the same SQL to the database. Is there an easy way to check the generated SQL?\nI'm not too concerned with minor syntax differences.\n"
},
{
"from": "gpt",
"value": "Yes, there are a ... |
I'm looking for a fast language (ie. a language that can be compiled natively to achieve performance not more than 3 or 4 times slower than C), which supports portable continuations. By this I mean a continuation that can be serialized on one computer, and deserialized on another.
I know that SISC can do this (a Schem... | If you're looking for a language that offers both fast native performance (close to C) and support for portable continuations (with serialization capabilities), there are a few options you might consider:
1. **Racket**: Racket is a descendant of Scheme and offers robust support for first-class continuations. Racket ha... | 39,297 | [
{
"from": "human",
"value": "I'm looking for a fast language (ie. a language that can be compiled natively to achieve performance not more than 3 or 4 times slower than C), which supports portable continuations. By this I mean a continuation that can be serialized on one computer, and deserialized on anoth... |
Possible Duplicate:
Symbolic simplification in Haskell (using recursion?)
The simplifications I have in mind are
0*e = e*0 = 0
1*e = e*1 = 0+e = e+0 = e-0 = e
and simplifying constant subexpressions, e.g. Plus (Const 1) (Const 2) would become Const 3. I would not expect variables (or variables and constants) to be ... | To implement symbolic simplification in Haskell, you can define an algebraic expression data type and write a recursive simplification function. Here’s an example of how you might achieve this:
### Step 1: Define the Expression Data Type
First, we define a data type to represent mathematical expressions:
```haskell
... | 39,468 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nSymbolic simplification in Haskell (using recursion?) \n\nThe simplifications I have in mind are\n0*e = e*0 = 0\n1*e = e*1 = 0+e = e+0 = e-0 = e\n\nand simplifying constant subexpressions, e.g. Plus (Const 1) (Const 2) would become Const 3. I would not exp... |
When I call a static method like:
Something.action();
Since a instance isn't created how long will the Class of the static method be held in memory?
If I call the same method will the Class be reloaded for each call since no instance exists?
And are only individual static methods loaded when called or are all the meth... | In Java (and similar object-oriented languages), when you call a static method like `Something.action()`, the class `Something` is loaded into memory if it hasn't been loaded already. Here are the details regarding how classes and their static methods are handled in memory:
1. **Class Loading**: When the JVM encounter... | 40,528 | [
{
"from": "human",
"value": "When I call a static method like:\nSomething.action();\n\nSince a instance isn't created how long will the Class of the static method be held in memory?\nIf I call the same method will the Class be reloaded for each call since no instance exists?\nAnd are only individual static ... |
When using Html.ActionLink passing a string containing the # char renders it like it is but if you UrlEncode it renders as %2523.
I believe it's a bug. MVC Beta Release.
Is it really a bug?
http://example.com/test# is rendered as
http://example.com/test%2523 instead of
http://example.com/test%2523
| The issue you're experiencing with `Html.ActionLink` and the way it handles the `#` character (hash) in the URL is not necessarily a bug but rather a characteristic of how URLs and encoding work in ASP.NET MVC.
### Explanation
1. **URL Encoding**: The `#` character is a special character in URLs that denotes the begi... | 37,869 | [
{
"from": "human",
"value": "When using Html.ActionLink passing a string containing the # char renders it like it is but if you UrlEncode it renders as %2523.\nI believe it's a bug. MVC Beta Release.\nIs it really a bug?\nhttp://example.com/test# is rendered as \nhttp://example.com/test%2523 instead of \nht... |
I am trying to deserialize a stream but I always get this error "End of Stream encountered before parsing was completed"?
Here is the code:
//Some code here
BinaryFormatter b = new BinaryFormatter();
return (myObject)b.Deserialize(s);//s---> is a Stream object that has been fill up with data som... | The error "End of Stream encountered before parsing was completed" typically indicates that the deserialization process is trying to read more data from the stream than is available, which can occur due to a few reasons. Below are some suggestions to help you troubleshoot and resolve this issue:
1. **Ensure the Stream... | 39,963 | [
{
"from": "human",
"value": "I am trying to deserialize a stream but I always get this error \"End of Stream encountered before parsing was completed\"?\nHere is the code:\n //Some code here\n BinaryFormatter b = new BinaryFormatter();\n return (myObject)b.Deserialize(s);//s---> is a St... |
I know this is a longshot but I was wondering if anyone knows if this is possible.
| Of course! Please go ahead and share what you're wondering about, and I'll do my best to help you. | 40,855 | [
{
"from": "human",
"value": "I know this is a longshot but I was wondering if anyone knows if this is possible.\n"
},
{
"from": "gpt",
"value": "Of course! Please go ahead and share what you're wondering about, and I'll do my best to help you."
}
] |
When I add the textBox.TextChanged to watch list I get a message saying The event 'System.Windows.Forms.Control.TextChanged'
can only appear on the left hand side of += or -=
Is there any way to check what event's are called on text change?
| The error message you're encountering indicates that you're trying to add the `TextChanged` event to a watch list, which isn't directly valid in the context you're using. The `TextChanged` event is an event of a control (like a `TextBox` in WinForms), and you can only work with it using event handlers, specifically by ... | 35,143 | [
{
"from": "human",
"value": "When I add the textBox.TextChanged to watch list I get a message saying The event 'System.Windows.Forms.Control.TextChanged'\ncan only appear on the left hand side of += or -=\nIs there any way to check what event's are called on text change?\n"
},
{
"from": "gpt",
"... |
I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn't seem to be an option to do list.Clone().
Is there an easy way around this?
| In C#, the `List<T>` class does not provide a built-in `Clone` method. However, you can easily create a clone of a list containing cloneable objects by creating a new list and adding cloned items to it. Here's how you can do that:
First, ensure that the objects in your list implement a cloning method, typically by imp... | 35,643 | [
{
"from": "human",
"value": "I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn't seem to be an option to do list.Clone().\nIs there an easy way around this?\n"
},
{
"from": "gpt",
"value": "In C#, the `List<T>` class does... |
I have a C# Visual Studio project (.csproj) that has a reference to the Framework64 version of System.Data. When I try to build using MSBuild/Team Foundation Server (TFS) on another machine, it fails as the 64-bit DLL doesn't exist.
Should I bind to the Framework version, or will this limit me when running on 64-bit... | In a typical .NET project, you should aim to reference assemblies in a way that is agnostic to the platform (32-bit or 64-bit) whenever possible. Here's how you can handle references to the `System.Data` assembly in your C# project to avoid the issues you are encountering:
### 1. Use Framework Version Binding
Instead... | 37,868 | [
{
"from": "human",
"value": "I have a C# Visual Studio project (.csproj) that has a reference to the Framework64 version of System.Data. When I try to build using MSBuild/Team Foundation Server (TFS) on another machine, it fails as the 64-bit DLL doesn't exist. \nShould I bind to the Framework version, or... |
I have a fairly large database with with a column that has strings that are for the most part really just ints, e.g. "1234" or "345". However some of them have strings prepended to them (of varying length), so e.g. "a123" or "abc123".
Is there a smart way to create a new column with just the integer values? Thus, "abc... | Yes, you can achieve this directly in SQL using a combination of string functions. If your database system supports it, you can use a combination of `REGEXP_REPLACE` (or equivalent functions) or use other string functions to extract the integer part of the strings.
Here are examples for a few popular SQL databases:
#... | 39,048 | [
{
"from": "human",
"value": "I have a fairly large database with with a column that has strings that are for the most part really just ints, e.g. \"1234\" or \"345\". However some of them have strings prepended to them (of varying length), so e.g. \"a123\" or \"abc123\".\nIs there a smart way to create a n... |
Could someone explain why this works in C#.NET 2.0:
Nullable<DateTime> foo;
if (true)
foo = null;
else
foo = new DateTime(0);
...but this doesn't:
Nullable<DateTime> foo;
foo = true ? null : new DateTime(0);
The latter form gives me an compile error "Type of conditional expression ... | The difference in behavior you're experiencing between the two code snippets in C# relates to how the compiler infers types for conditional expressions.
### Explanation of the Two Snippets:
1. **First Snippet:**
```csharp
Nullable<DateTime> foo;
if (true)
foo = null;
else
foo = new DateTime(... | 39,597 | [
{
"from": "human",
"value": "Could someone explain why this works in C#.NET 2.0:\n Nullable<DateTime> foo;\n if (true)\n foo = null;\n else\n foo = new DateTime(0);\n\n...but this doesn't:\n Nullable<DateTime> foo;\n foo = true ? null : new DateTime(0);\n\nThe latter form gives ... |
I have created the following style for a listbox that will have an image displayed next to some text:
<Style x:Key="ImageListBoxStyle" TargetType="{x:Type ListBox}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.Horizontal... | In your existing style for the `ListBox`, you are using a `ContentPresenter` to display the text of each item. To apply a different style (such as changing the `FontWeight` and `Foreground`) when an item is selected, you can utilize the `ContentPresenter.Resources` section to define a local style for the text inside th... | 31,101 | [
{
"from": "human",
"value": "I have created the following style for a listbox that will have an image displayed next to some text:\n<Style x:Key=\"ImageListBoxStyle\" TargetType=\"{x:Type ListBox}\">\n <Setter Property=\"SnapsToDevicePixels\" Value=\"true\"/>\n <Setter Property=\"BorderThickness\" Val... |
For large n (see below for how to determine what's large enough), it's safe to treat, by the central limit theorem, the distribution of the sample mean as normal (gaussian) but I'd like a procedure that gives a confidence interval for any n. The way to do that is to use a Student T distribution with n-1 degrees of fre... | To compute a confidence interval for the mean of a stream of data points without storing all the previously encountered data, you can maintain the first and second moments (the sample mean and sample variance) using a method called Welford's algorithm. This approach allows you to update these moments incrementally as y... | 37,849 | [
{
"from": "human",
"value": "For large n (see below for how to determine what's large enough), it's safe to treat, by the central limit theorem, the distribution of the sample mean as normal (gaussian) but I'd like a procedure that gives a confidence interval for any n. The way to do that is to use a Stude... |
Marked a javascript file as "Embedded resource"
Added WebResource attribute to my AssemblyInfo class
Now i'm trying to output the embedded javascript to my master page. All I'm getting is a "Web Resource not found" from the web resource url.
Project Assembly Name:
CompanyProduct
Project Default Namespace:
Company.Prod... | It seems like you're trying to include an embedded JavaScript file in your ASP.NET application but are facing issues with the "Web Resource not found" error. Let's go through the steps to troubleshoot and ensure everything is set up correctly.
### 1. **Check Namespace and Assembly Name**
Make sure that the namespace ... | 38,552 | [
{
"from": "human",
"value": "Marked a javascript file as \"Embedded resource\"\nAdded WebResource attribute to my AssemblyInfo class\nNow i'm trying to output the embedded javascript to my master page. All I'm getting is a \"Web Resource not found\" from the web resource url.\nProject Assembly Name:\nCompan... |
What's the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter null values?
| In a standard Windows Forms application, the `DateTimePicker` control does not support null values directly, as it is designed to always hold a valid `DateTime` value. However, you can modify its behavior to allow for null values by using a few techniques. Here are two common approaches:
### Option 1: Use a Nullable D... | 35,360 | [
{
"from": "human",
"value": "What's the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter null values?\n"
},
{
"from": "gpt",
"value": "In a standard Windows Forms application, the `DateTimePicker` control does not support null values directly, as i... |
Greetings!
If I have XML such as this:
<Root>
<AlphaSection>
.
.
.
</AlphaSection>
<BetaSection>
<Choices>
<SetA>
<Choice id="choice1">Choice One</Choice>
<Choice id="choice2">Choice Two</Choice>
</SetA>
<SetB>
... | To retrieve all the `Choice` items within the `BetaSection` of your XML document, you can use LINQ to XML in C#. The issue with your current query is that you're trying to filter the `Choices` elements instead of directly targeting the `Choice` elements themselves.
Here's how you can achieve it correctly:
```csharp
v... | 39,838 | [
{
"from": "human",
"value": "Greetings!\nIf I have XML such as this:\n<Root>\n <AlphaSection>\n .\n .\n .\n </AlphaSection>\n\n <BetaSection>\n <Choices>\n <SetA>\n <Choice id=\"choice1\">Choice One</Choice> \n <Choice id=\"choice2\">Choice T... |
are there any free Team Foundation Server sites we can use for our private development? Please don't say CodePlex (which I love) because that means the code is all opensource.
Lastly, I also understand that some people might raise the issue of having their private code hosted somewhere by people they do not know, etc..... | As of my last knowledge update in October 2023, Microsoft no longer offers a free Team Foundation Server (TFS) hosting service. However, there are alternatives you might consider for hosting private development projects without incurring costs, or at least at a very low cost:
1. **Azure DevOps Services**: Microsoft of... | 40,260 | [
{
"from": "human",
"value": "are there any free Team Foundation Server sites we can use for our private development? Please don't say CodePlex (which I love) because that means the code is all opensource.\nLastly, I also understand that some people might raise the issue of having their private code hosted s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.