instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Looking for an example in linq about how to insert a row of a gridview into datacontext.
| To insert a new row from a `GridView` into a DataContext using LINQ to SQL, you'll typically want to do the following steps:
1. Bind your `GridView` to a data source.
2. Allow users to edit a row or add a new row in the `GridView`.
3. Capture the data from the row and insert it into your DataContext.
Here’s a simple ... | 28,941 | [
{
"from": "human",
"value": "Looking for an example in linq about how to insert a row of a gridview into datacontext. \n"
},
{
"from": "gpt",
"value": "To insert a new row from a `GridView` into a DataContext using LINQ to SQL, you'll typically want to do the following steps:\n\n1. Bind your `Gr... |
What is SSL and how does it relate to HTTPS?
| SSL, or Secure Sockets Layer, is a standard technology used to establish a secure, encrypted connection between a web server and a web browser. It ensures that any data transferred between the server and the client remains private and secure. Although SSL has largely been replaced by its successor, TLS (Transport Layer... | 36,077 | [
{
"from": "human",
"value": "What is SSL and how does it relate to HTTPS?\n"
},
{
"from": "gpt",
"value": "SSL, or Secure Sockets Layer, is a standard technology used to establish a secure, encrypted connection between a web server and a web browser. It ensures that any data transferred between ... |
I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary.
Is there a Maven plugin to accomplish thi... | To achieve completely automated integration testing for a Maven project that involves starting an external program, you can consider a few approaches using Maven plugins or configuration. Here's a common solution:
### 1. Use the `exec-maven-plugin`
The `exec-maven-plugin` can be used to start the external program bef... | 24,686 | [
{
"from": "human",
"value": "I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary. \... |
I can't stand HTML intermixed with other code. I'm working on a codebase that has to remain in PHP, and I don't want to touch an HTML template with a proverbial pole. So what I'm currently doing looks like this:
<?php
$page = new html_page('My wonderful page');
$page->add_contents(new html_tag('p', 'It works', array('i... | Creating dynamic classes for HTML tags in PHP is an interesting approach to managing HTML content without mixing it directly into your PHP code. The concept involves utilizing PHP's magic methods and dynamic class creation capabilities. Below, I'll provide you with a way to implement this idea using a basic factory pat... | 33,846 | [
{
"from": "human",
"value": "I can't stand HTML intermixed with other code. I'm working on a codebase that has to remain in PHP, and I don't want to touch an HTML template with a proverbial pole. So what I'm currently doing looks like this:\n<?php\n$page = new html_page('My wonderful page');\n$page->add_con... |
include('adodb5/adodb.inc.php');
$myServer = "localhost";
$myUser = "root";
$myPass = "root";
$myDB = "database";
//create an instance of the ADO connection object
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
//define connection stri... | The code you've shared seems to attempt to connect to a Microsoft SQL Server database using the ADO (ActiveX Data Objects) via COM in PHP. However, it seems you may be experiencing issues with the ADO connection, which could stem from several sources.
Here are a few potential issues and solutions:
### 1. PHP COM Exte... | 32,991 | [
{
"from": "human",
"value": " include('adodb5/adodb.inc.php');\n\n $myServer = \"localhost\";\n $myUser = \"root\";\n $myPass = \"root\";\n $myDB = \"database\";\n\n //create an instance of the ADO connection object\n $conn = new COM(\"ADODB.Connection\") or... |
Is there a way to set repository config variables through the gitosis conf instead of going into each repository and editing the conf values directly?
| Yes, you can set repository configuration variables in gitosis using the `gitosis.conf` file. Instead of modifying the configuration of each repository directly, you can specify settings in the `gitosis.conf` file that will apply to each repository. However, keep in mind that the options you can set may depend on the s... | 36,354 | [
{
"from": "human",
"value": "Is there a way to set repository config variables through the gitosis conf instead of going into each repository and editing the conf values directly?\n"
},
{
"from": "gpt",
"value": "Yes, you can set repository configuration variables in gitosis using the `gitosis.c... |
I created a GridView in an ASP.NET application and used the Auto Format tool to apply an attractive style. Now I'm moving the style markup to the CSS sheet and I'm having a weird problem where the text in the header row isn't the correct color (it should be white but it shows up a bright blue). This problem only show... | The issue you're experiencing with the header text color when sorting is likely due to the CSS styles applied by the ASP.NET GridView when it enables sorting. When sorting is turned on, the GridView generates additional markup, including sort arrows that may apply their own styles. These styles can sometimes override y... | 35,837 | [
{
"from": "human",
"value": "I created a GridView in an ASP.NET application and used the Auto Format tool to apply an attractive style. Now I'm moving the style markup to the CSS sheet and I'm having a weird problem where the text in the header row isn't the correct color (it should be white but it shows u... |
I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for Flas... | Hi Cameron,
Creating a room in Sandy 3D and implementing basic physics can be an interesting project! While Sandy 3D is primarily focused on rendering 3D graphics in Flash, it does not have built-in physics functionality. However, you can manage simple collision detection on your own to prevent the player from walking... | 37,744 | [
{
"from": "human",
"value": "I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into somet... |
I have a requirement to develop a .NET-based application whose data requirements are likely to exceed the 4 gig limit of SQL 2005 Express Edition.
There may be other customers of the same application (in the future) with a requirement to use a specific DB platform (such as Oracle or SQL Server) due to in-house DBA expe... | Given your requirements and constraints, let's break down your considerations regarding both the RDBMS choice and the ORM tool.
### RDBMS Recommendation
1. **PostgreSQL**
- Pros:
- Highly extensible and supports advanced data types and performance features.
- Strong support for standards and has a rich ... | 36,180 | [
{
"from": "human",
"value": "I have a requirement to develop a .NET-based application whose data requirements are likely to exceed the 4 gig limit of SQL 2005 Express Edition.\nThere may be other customers of the same application (in the future) with a requirement to use a specific DB platform (such as Orac... |
Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site.
However instead of having a generic overall score, we will display the total amount of "thumbs up" and "thumbs down". The overall score will be needed for filtering purposes... | Implementing a voting system for comments on a forum site with separate "thumbs up" and "thumbs down" votes can be a great way to engage users and improve content quality. Here’s a structured approach to implement this functionality:
### 1. Database Design
**Tables:**
- **Comments Table:**
- `id`: Primary Key
... | 28,499 | [
{
"from": "human",
"value": "Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site.\nHowever instead of having a generic overall score, we will display the total amount of \"thumbs up\" and \"thumbs down\". The overa... |
Is there a way to get MVEL 2.0 ( http://mvel.codehaus.org/ ) to work with functions with optional parameters?
I would like to be able to eval this:
trunc('blahblah',2)
but also
trunc('blahblah',2,'[...]');
Now i have tried:
def trunc(param1,param2,param3) { ... impl ... }
That gives an exception if i try to call it wi... | In MVEL, function overloading (having multiple functions with the same name but different parameters) is not supported. This means that you cannot define two versions of a function with different numbers of parameters, as the second definition will overwrite the first.
However, you can achieve optional parameters by u... | 36,638 | [
{
"from": "human",
"value": "Is there a way to get MVEL 2.0 ( http://mvel.codehaus.org/ ) to work with functions with optional parameters?\nI would like to be able to eval this:\ntrunc('blahblah',2)\nbut also\ntrunc('blahblah',2,'[...]');\nNow i have tried: \ndef trunc(param1,param2,param3) { ... impl ... }... |
How do I add radio buttons as my parameter type in SSRS reports?
Thanks in advance,
Anna
| Hi Anna,
Adding radio buttons as a parameter type in SQL Server Reporting Services (SSRS) can be accomplished by configuring a multi-value parameter or using a single-valued parameter. Here's a step-by-step guide to help you set it up:
### Step 1: Create a Parameter
1. **Open Your Report**: Open your SSRS report in ... | 35,731 | [
{
"from": "human",
"value": "How do I add radio buttons as my parameter type in SSRS reports?\nThanks in advance,\nAnna\n"
},
{
"from": "gpt",
"value": "Hi Anna,\n\nAdding radio buttons as a parameter type in SQL Server Reporting Services (SSRS) can be accomplished by configuring a multi-value p... |
I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my question is how should I store the password that is needed to create a NetworkCrednetial object?
The application doesn't have a login but I could setup an option that allows the user to enter their email credenti... | Storing user credentials securely is a critical concern for any application that handles sensitive information, such as email passwords. Here are some strategies and best practices for handling this situation:
### 1. **User Input and Temporary Storage**
If your application does not need to store user credentials perma... | 32,780 | [
{
"from": "human",
"value": "I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my question is how should I store the password that is needed to create a NetworkCrednetial object?\nThe application doesn't have a login but I could setup an option that all... |
I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office file server using:
FileSystemObject.FolderExists("\\servername\path")
If this is not found the program switches to offline mode and saves its output to the local hard disk (for later transfer), instead ... | In VBA, using `FileSystemObject.FolderExists` to check for the existence of a network folder can sometimes result in long wait times if the network path is unreachable. To handle this more efficiently, you can use some alternative approaches.
### Alternative Methods for Checking Network Path Existence
1. **Using `Dir... | 34,071 | [
{
"from": "human",
"value": "I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office file server using:\nFileSystemObject.FolderExists(\"\\\\servername\\path\")\n\nIf this is not found the program switches to offline mode and saves its output to t... |
My company uses StarTeam for source control and CR management, but I would really like to switch to Subversion for source control. For those of you that know ClearQuest and ClearCase, StarTeam has the ability to create tickets, which can later be associated with code changes.
Are there any similar products that integr... | There are several tools that can integrate well with Subversion (SVN) for source control and issue tracking, and while Trac is one of the more popular options, there are others that you might find more suitable. Here are some alternatives, including both free and commercial options:
### Free Options
1. **Redmine**:
... | 32,860 | [
{
"from": "human",
"value": "My company uses StarTeam for source control and CR management, but I would really like to switch to Subversion for source control. For those of you that know ClearQuest and ClearCase, StarTeam has the ability to create tickets, which can later be associated with code changes.\n... |
I'm learning UML by trying to simulate how a car service garage works with diagrams and documentation. One problem I have is with postcondition (or rather, GOTO) statements.
Is the dashed line << include >> relationship only for preconditions? Can Use-case bubbles connect to eachother and follow a logic path?
So this i... | It's great to hear that you're learning UML (Unified Modeling Language) by simulating a car service garage! Let's break down your questions regarding use cases and relationships.
1. **Use Case Relationships**:
- The `<<include>>` relationship in UML is used to indicate that a use case (the base use case) includes t... | 35,853 | [
{
"from": "human",
"value": "I'm learning UML by trying to simulate how a car service garage works with diagrams and documentation. One problem I have is with postcondition (or rather, GOTO) statements.\nIs the dashed line << include >> relationship only for preconditions? Can Use-case bubbles connect to ea... |
I'm evaluating Microsoft Team Foundation Server for my customer, who currently uses Visual SourceSafe and nothing else. They have explicitly expressed a desire to implement a more rigid and process-driven environment as their application is in production and they have future releases to consider.
The particular areas I... | When evaluating alternatives to Microsoft Team Foundation Server (TFS), it’s essential to ensure that the selected tools can collectively meet your customer’s requirements for configuration management, change management, release management, incident and problem management, document management, code analysis, testing, r... | 35,357 | [
{
"from": "human",
"value": "I'm evaluating Microsoft Team Foundation Server for my customer, who currently uses Visual SourceSafe and nothing else. They have explicitly expressed a desire to implement a more rigid and process-driven environment as their application is in production and they have future rel... |
I completed a python script using pyuno which successfully converted a document/ xls / rtf etc to a pdf.
Then I needed to update a mssql database, due to open office currently supporting python 2.3, it's ancientness, lacks support for decent database libs. So I have resorted to using Jython, this way im not burdened do... | To convert your Python PyUNO code to Jython and fix the issues you're facing, let’s address your concerns one by one:
### 1. Importing the correct classes
It seems that your imports are not being recognized, specifically the classes from the `com.sun.star.frame` package. This can happen if your classpath isn’t set co... | 31,555 | [
{
"from": "human",
"value": "I completed a python script using pyuno which successfully converted a document/ xls / rtf etc to a pdf.\nThen I needed to update a mssql database, due to open office currently supporting python 2.3, it's ancientness, lacks support for decent database libs. So I have resorted to... |
How do I push my content to the top of the page to not cover up the ad, but to cover the menu and myspace links. I want to do something similar to: http://www.myspace.com/sensesfail and http://www.myspace.com/attackx2. Thanks.
| To adjust the positioning of your content on a MySpace profile (or a similar platform), you can utilize CSS (Cascading Style Sheets) to manipulate the layout. Here’s a general approach you can follow to push your content to the top of the page without overlapping the advertisement while covering the menu and MySpace li... | 38,215 | [
{
"from": "human",
"value": "How do I push my content to the top of the page to not cover up the ad, but to cover the menu and myspace links. I want to do something similar to: http://www.myspace.com/sensesfail and http://www.myspace.com/attackx2. Thanks.\n"
},
{
"from": "gpt",
"value": "To adju... |
How can I read the status of the battery on my MacBookPro from my own application?
Googling has so far only revealed APIs for device drivers to handle power events - there's nothing about user-land processes accessing this information.
thanks.
| To read the battery status of your MacBook Pro from a user application, you can use the `IOBattery` framework, which allows you to access battery information from user space. Here's how you can do it using Swift or Objective-C.
### Using Swift
If you are developing in Swift, you can access battery information using t... | 30,895 | [
{
"from": "human",
"value": "How can I read the status of the battery on my MacBookPro from my own application?\nGoogling has so far only revealed APIs for device drivers to handle power events - there's nothing about user-land processes accessing this information.\nthanks.\n"
},
{
"from": "gpt",
... |
I'm just interested in people's opinions. When using nullable types in C# what is the best practice way to test for null:
bool isNull = (i == null);
or
bool isNull = !i.HasValue;
Also when assigning to a non-null type is this:
long? i = 1;
long j = (long)i;
better than:
long? i = 1;
long j = i.Value;
| When working with nullable types in C#, both approaches to checking for `null` are valid, but they have slightly different implications regarding readability and clarity.
### Testing for Null
1. **Using `i == null`:**
```csharp
bool isNull = (i == null);
```
This is straightforward and clearly conveys the... | 37,358 | [
{
"from": "human",
"value": "I'm just interested in people's opinions. When using nullable types in C# what is the best practice way to test for null:\nbool isNull = (i == null);\n\nor\nbool isNull = !i.HasValue;\n\nAlso when assigning to a non-null type is this:\nlong? i = 1;\nlong j = (long)i;\n\nbetter t... |
When supporting a new web app in an enterprise environment, it is often necessary to log in as a specific user in order to diagnose a real or perceived problem they are having. Two opposing issues apply here:
Best practice is to use hashed or encrypted passwords, not clear text. Sometimes, there is a third-party SSO (... | In an enterprise environment, particularly in large organizations with stringent security and privacy regulations, diagnosing issues that require impersonating a user can indeed be complex. Here are several strategies to handle this situation:
### 1. **User Impersonation Feature**
- **Implement Impersonation:** Con... | 30,255 | [
{
"from": "human",
"value": "When supporting a new web app in an enterprise environment, it is often necessary to log in as a specific user in order to diagnose a real or perceived problem they are having. Two opposing issues apply here:\n\nBest practice is to use hashed or encrypted passwords, not clear te... |
Is there any difference between a volatile Object reference and AtomicReference in case I would just use get() and set()-methods from AtomicReference?
| Yes, there are important differences between using a `volatile` object reference and an `AtomicReference` in Java, even if you only use the `get()` and `set()` methods from `AtomicReference`.
### Volatile Object Reference
1. **Visibility**: A `volatile` variable ensures that updates to that variable are visible to all... | 36,667 | [
{
"from": "human",
"value": "Is there any difference between a volatile Object reference and AtomicReference in case I would just use get() and set()-methods from AtomicReference?\n"
},
{
"from": "gpt",
"value": "Yes, there are important differences between using a `volatile` object reference an... |
What's a good rule of thumb for naming methods that return properties/attributes/members of an object? If an object has some immutable quality "blarg", should a method that returns that quality be called "blarg()" or "getBlarg()"? The Java API, for example, is inconsistent: most properties are accessed through "get" ... | When it comes to naming conventions for methods that return properties or attributes of an object, there are several factors to consider. Here are some guidelines and considerations:
1. **Consistency**: The most important rule is to be consistent within your codebase. If you decide to use "get" prefixes for some prope... | 35,961 | [
{
"from": "human",
"value": "What's a good rule of thumb for naming methods that return properties/attributes/members of an object? If an object has some immutable quality \"blarg\", should a method that returns that quality be called \"blarg()\" or \"getBlarg()\"? The Java API, for example, is inconsiste... |
I am a new user of Extjs library, I created a grid successfully and it works just fine, now I want to use Ext.grid.GridFilters to add filtering to my grid, however I don't see this class in the Extjs source code files, where I can get the required files?
| The `Ext.grid.GridFilters` plugin for Ext JS is part of the Ext JS package, but it may not be included by default in some versions or distributions, especially in the newer versions of Ext JS (like Ext JS 6 and above), where many features are modularized.
Here are the steps you can follow to include filtering in your ... | 35,429 | [
{
"from": "human",
"value": "I am a new user of Extjs library, I created a grid successfully and it works just fine, now I want to use Ext.grid.GridFilters to add filtering to my grid, however I don't see this class in the Extjs source code files, where I can get the required files?\n"
},
{
"from": ... |
I have a JList that holds a bunch of strings . I would like it to act like a Set , so that it will only hold unique values . Is there any way to achieve this without checking that a new string doesn't already exist there ?
| To make a `JList` act like a `Set` (ensuring that it only holds unique values) in Java Swing, you will need to use a `Set` to maintain the unique values and a model that reflects this behavior. The most common approach is to use a `DefaultListModel` along with a `Set` (like a `HashSet`) to keep track of the unique valu... | 35,574 | [
{
"from": "human",
"value": "I have a JList that holds a bunch of strings . I would like it to act like a Set , so that it will only hold unique values . Is there any way to achieve this without checking that a new string doesn't already exist there ?\n"
},
{
"from": "gpt",
"value": "To make a `... |
All of our C++ headers use a .h extension. Eclipse thinks these are C headers and flags them with lots of syntax errors on things like classes and namespaces.
I've tried to change the file type association from:
Preferences > C/C++ > File types
but it's "locked".
Interestingly, "*.h" is associated with both C and C++ ... | To resolve the issue of Eclipse treating `.h` files as C headers rather than C++ headers, you can follow these steps to modify the file association settings. If the settings are "locked" in the preferences, it typically means you may need to adjust the way the workspace is configured or how the C/C++ project is set up.... | 34,069 | [
{
"from": "human",
"value": "All of our C++ headers use a .h extension. Eclipse thinks these are C headers and flags them with lots of syntax errors on things like classes and namespaces.\nI've tried to change the file type association from:\nPreferences > C/C++ > File types\n\nbut it's \"locked\".\nInteres... |
I am trying to develop an online translation service (sort of a personal challenge) but I have been looking for any guidelines or any way to see how it should be done and so far I have come up with nothing so. In a nutshell, does anybody knows where to find a service, code or explanation of how online translation works... | Creating an online translation service can be a rewarding challenge! Here are some guidelines, resources, and methods you can consider while developing your translation service:
### 1. **Understand Translation Methods:**
- **Rule-Based Translation (RBT):** This method uses grammatical rules and dictionaries for tra... | 33,839 | [
{
"from": "human",
"value": "I am trying to develop an online translation service (sort of a personal challenge) but I have been looking for any guidelines or any way to see how it should be done and so far I have come up with nothing so. In a nutshell, does anybody knows where to find a service, code or ex... |
Any idea anyone? Is it possible that we specify the name of the form input field?
How to go about doing that?
| Yes, you can specify the name of a form input field in HTML by using the `name` attribute on the input elements. The `name` attribute is important because it defines the key that will be used when submitting form data to the server. Here's a simple example to illustrate how to specify the name of an input field:
### H... | 35,782 | [
{
"from": "human",
"value": "Any idea anyone? Is it possible that we specify the name of the form input field?\nHow to go about doing that?\n"
},
{
"from": "gpt",
"value": "Yes, you can specify the name of a form input field in HTML by using the `name` attribute on the input elements. The `name`... |
With the age of text messages and things like that, what's a good way to store phone numbers in a database?
In the USA, text messages are handled by phone numbers but in other countries I hear they use email addresses so I guess there needs to be a way to differentiate between countries that use cell phone numbers as t... | Storing phone numbers in a database, especially with the considerations of different formats and internationalization, requires careful planning to ensure consistency, validity, and ease of use. Here’s a systematic approach you can take:
### 1. Use E.164 Format
The E.164 format is an international standard for phone n... | 37,255 | [
{
"from": "human",
"value": "With the age of text messages and things like that, what's a good way to store phone numbers in a database?\nIn the USA, text messages are handled by phone numbers but in other countries I hear they use email addresses so I guess there needs to be a way to differentiate between ... |
Thanks for answers,Actually I am not puzzled about draw 1024*768 pixels is slower than 100* 100 pixels... It is so simple a logic..
Which made me puzzled is that DrawImage's interpolation algorithm may be very slow, while there exists lots of better algorithm, and its decoder seems can decode from a jpg with a certain... | It's great that you're delving into the performance characteristics of image rendering! There are several factors involved when it comes to rendering images, especially when dealing with different resolutions and image formats like JPEG. Let's break down your observations and concerns.
### 1. Decoding vs. Drawing
Whe... | 32,581 | [
{
"from": "human",
"value": "\nThanks for answers,Actually I am not puzzled about draw 1024*768 pixels is slower than 100* 100 pixels... It is so simple a logic..\nWhich made me puzzled is that DrawImage's interpolation algorithm may be very slow, while there exists lots of better algorithm, and its decoder... |
I'm trying to create a template class to insulate the users from a data type. I would have preferred to use an adapter class, but the function signatures needed to change requiring a template.
In the code sample below(not the actual project just a simplified version to illustrate the problem), while in the main routin... | The errors you're experiencing in the given code relate to how template specializations are handled and accessed in C++. Here's an explanation of the issues and a way to simplify your design:
### Explanation of Compilation Errors
1. **Accessing Nested Types**: When you declare `IntAdapter` inside the specialization o... | 29,676 | [
{
"from": "human",
"value": "I'm trying to create a template class to insulate the users from a data type. I would have preferred to use an adapter class, but the function signatures needed to change requiring a template.\nIn the code sample below(not the actual project just a simplified version to illustr... |
We have a service that runs methods used for data import/export at specified intervals. To test these methods we have a little application with a single button that, when clicked, instantiates the import/export class and invokes the desired method. Nothing fancy. I would like create a more robust test application th... | Creating a more robust testing application for your import/export service in VB.NET (especially targeting .NET 2.0) is a good idea to monitor the progress of long-running operations in real-time. Using a message queuing mechanism is one way to do this, but there are simpler approaches you can take without introducing u... | 33,830 | [
{
"from": "human",
"value": "We have a service that runs methods used for data import/export at specified intervals. To test these methods we have a little application with a single button that, when clicked, instantiates the import/export class and invokes the desired method. Nothing fancy. I would like... |
I am making an app that scrolls information on the desktop. The window is transparent. I am starting out simple, trying to find the lowest CPU use for animating things and I am starting with a simple TextBlock.
On my development machine, I get a very smooth animation across the screen setting the Canvas.Left property... | It sounds like you're encountering some interesting challenges with the performance of your application's animation across different hardware configurations. Here are several suggestions and considerations that might help you diagnose and address the choppiness you're experiencing:
### 1. Frame Rate and Timer Resoluti... | 35,871 | [
{
"from": "human",
"value": "I am making an app that scrolls information on the desktop. The window is transparent. I am starting out simple, trying to find the lowest CPU use for animating things and I am starting with a simple TextBlock.\nOn my development machine, I get a very smooth animation across t... |
I 'd like to use Criteria for my SQL query.
I have 3 tables "home", "person" and a third table "liveIn" for correspondance between home and person.
My sql query is
"select home.id
from home, person, liveIn
where home.country = 'Japan'
and person.id = '15'
and liveIn.Homeid = home.id
and liveIn.PersonId = person.id"
A l... | It looks like you want to use SQL criteria to query data from the `home`, `person`, and `liveIn` tables based on specific conditions. Your current SQL query is using an implicit join, which is valid but can be clearer if you use an explicit `JOIN` syntax.
Here's how you can rewrite your SQL query using `JOIN`:
```sq... | 38,634 | [
{
"from": "human",
"value": "I 'd like to use Criteria for my SQL query.\nI have 3 tables \"home\", \"person\" and a third table \"liveIn\" for correspondance between home and person.\nMy sql query is\n\"select home.id\nfrom home, person, liveIn\nwhere home.country = 'Japan'\nand person.id = '15'\nand liveI... |
I need to write some registration data (unique computer number, and corresponding activation code).
The Computer Number needs to be visible from other programs and all accounts ({Admin|Non Admin} with User Access Control turned {On|Off} )
It's acceptable to write the Computer Number and Activation Code only from an Adm... | To achieve your goals for storing registration data (Computer Number and Activation Code) in a way that meets your requirements regarding User Access Control (UAC), you can follow these guidelines:
### 1. Storage Location
To make the Computer Number and Activation Code visible to all users regardless of their account... | 34,394 | [
{
"from": "human",
"value": "I need to write some registration data (unique computer number, and corresponding activation code).\nThe Computer Number needs to be visible from other programs and all accounts ({Admin|Non Admin} with User Access Control turned {On|Off} )\nIt's acceptable to write the Computer ... |
Given a week-day (1-7), how can I calculate what that week-day's last date was?
Example: Today is Wednesday, 2008/11/12, and I want to know what last Friday's date was.
| To calculate the last date of a specific weekday given a particular date, you can follow these steps:
1. **Identify the Current Date and Weekday**: You know the current date (in your example, it's 2008/11/12) and its corresponding weekday (Wednesday, which is 3 if you count Monday as 1).
2. **Identify the Target Week... | 34,476 | [
{
"from": "human",
"value": "Given a week-day (1-7), how can I calculate what that week-day's last date was?\nExample: Today is Wednesday, 2008/11/12, and I want to know what last Friday's date was.\n"
},
{
"from": "gpt",
"value": "To calculate the last date of a specific weekday given a particu... |
I'm attempting to register an anonymous function when a user clicks a cell in an HTML table. Here's some of the raw, unadulterated code:
document.getElementById(
"course"+displayed_year_index+occurrences_indices[displayed_year_index]).onclick =
eval("function() {PrintReceipt("+result.years[result_year_inde... | The issue you're facing stems from the fact that the `eval` function is trying to create a new function within a loop, but it captures the variable `index` by reference. This means all your anonymous functions will end up using the same value for `index` — the final value after the loop has completed.
Instead of using... | 39,433 | [
{
"from": "human",
"value": "I'm attempting to register an anonymous function when a user clicks a cell in an HTML table. Here's some of the raw, unadulterated code:\ndocument.getElementById(\n \"course\"+displayed_year_index+occurrences_indices[displayed_year_index]).onclick =\n eval(\"function(... |
Is it possible to send a HTTP REDIRECT response from inside the XFire SOAP server instead of a regular response?
I need this in order to redirect the client to another server based on some checking of method parameters.
Also, is redirect handling something that major SOAP clients support? I know HttpClient does, but I'... | Yes, it is possible to send an HTTP REDIRECT response from inside the XFire SOAP server, though this is not a common practice in SOAP services. SOAP is generally designed for remote procedure calls and expects a response to the method call rather than HTTP redirection. However, if you need to implement such behavior, y... | 37,508 | [
{
"from": "human",
"value": "Is it possible to send a HTTP REDIRECT response from inside the XFire SOAP server instead of a regular response?\nI need this in order to redirect the client to another server based on some checking of method parameters.\nAlso, is redirect handling something that major SOAP clie... |
I am a junior programmer. Since my supervisor told me to sit in with the client, I joined. I saw the unsatisfied face of the client despite the successful (from my programmer's perspective) delivery of the project!
Client: You could have included this!
Us: Was not in the specification!
Client: Common Sense!
As a progra... | In this situation, it's important to recognize that effective communication and a clear understanding of client expectations are crucial elements of successful project delivery. Here’s how you could respond as a junior programmer, while also considering your role and the dynamics at play:
1. **Acknowledge the Concern*... | 37,647 | [
{
"from": "human",
"value": "I am a junior programmer. Since my supervisor told me to sit in with the client, I joined. I saw the unsatisfied face of the client despite the successful (from my programmer's perspective) delivery of the project!\nClient: You could have included this!\nUs: Was not in the speci... |
I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:
purchased >= date_sub(now() ,interval 7 day)
However, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). So basically, throughout the week the result... | To retrieve entries from a table for the last full week (from midnight Saturday to midnight Saturday), you can use a combination of MySQL date functions to calculate the start and end of the previous week.
Here’s how you can achieve that:
1. **Calculate the start of the previous week (Saturday midnight)**
2. **Calcul... | 36,589 | [
{
"from": "human",
"value": "I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:\npurchased >= date_sub(now() ,interval 7 day)\n\nHowever, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). ... |
What is the equivalent of varchar(max) in MySQL?
| In MySQL, the equivalent of SQL Server's `varchar(max)` is `TEXT`.
Here's a brief overview of the types you can use in MySQL for large variable-length strings:
- **VARCHAR(n)**: A variable-length string with a maximum length of `n` characters (up to 65,535 bytes if using a single-byte character set).
- **TEXT**: A s... | 39,872 | [
{
"from": "human",
"value": "What is the equivalent of varchar(max) in MySQL?\n"
},
{
"from": "gpt",
"value": "In MySQL, the equivalent of SQL Server's `varchar(max)` is `TEXT`. \n\nHere's a brief overview of the types you can use in MySQL for large variable-length strings:\n\n- **VARCHAR(n)**: ... |
I'm new to Jquery and I'm trying to use a div container to load a URL, however, I want to give a user an option to close it with an X sign on the top right corner like in Amazon.com. What's the best way to accomplish this?
Here's what I have and seems clumsy to figure out where the top right corner is and place the ima... | To create a div container that loads a URL and has a close button in the top right corner, you can follow a structured approach using jQuery and a bit of CSS. Here’s a clean solution that will help you implement this feature.
### HTML Structure
First, create the HTML structure for your container and close button:
``... | 29,559 | [
{
"from": "human",
"value": "I'm new to Jquery and I'm trying to use a div container to load a URL, however, I want to give a user an option to close it with an X sign on the top right corner like in Amazon.com. What's the best way to accomplish this?\nHere's what I have and seems clumsy to figure out where... |
I have already tried PreRenderComplete and unload is too late
| It sounds like you're working with an ASP.NET Web Forms application and looking for a suitable event to execute code just before the page is rendered, but you've found that `PreRenderComplete` is not fitting your needs, and the `Unload` event is too late.
If you need to perform some logic just before the page renderi... | 36,318 | [
{
"from": "human",
"value": "I have already tried PreRenderComplete and unload is too late\n"
},
{
"from": "gpt",
"value": "It sounds like you're working with an ASP.NET Web Forms application and looking for a suitable event to execute code just before the page is rendered, but you've found that... |
I'm a hesitant upgrader when it comes to development tools. For roughly half of my product I still use D7, and for others D2006.
The truth is, although Unicode support is more than welcomed and very useful, it could cause me more troubles than gains with my current projects (they are more-or-less Unicode ready already)... | Upgrading your development tools can provide several advantages beyond just Unicode support. Here are some major incentives to consider:
### 1. **Enhanced Language Features**
- **Modern Language Constructs**: Newer versions of programming languages introduce more efficient and expressive syntax, including features ... | 36,353 | [
{
"from": "human",
"value": "I'm a hesitant upgrader when it comes to development tools. For roughly half of my product I still use D7, and for others D2006.\nThe truth is, although Unicode support is more than welcomed and very useful, it could cause me more troubles than gains with my current projects (th... |
I heard a lot about makefiles and how they simplify the compilation process. I'm using VS2008. Can somebody please suggest some online references or books where I can find out more about how to deal with them?
| Certainly! Makefiles are a great way to automate the build process for software projects. Here are some resources that can help you learn more about Makefiles and how to effectively use them:
### Online References
1. **GNU Make Manual**:
- The official documentation for GNU Make is a comprehensive guide that covers... | 37,060 | [
{
"from": "human",
"value": "I heard a lot about makefiles and how they simplify the compilation process. I'm using VS2008. Can somebody please suggest some online references or books where I can find out more about how to deal with them?\n"
},
{
"from": "gpt",
"value": "Certainly! Makefiles a... |
If I have the LINQ objects:
public class SampleDataContext : DataContext {
public Table<Customer> Customers { get { return this.GetTable<Customer>(); } }
public SampleDataContext( string connectionString ) : base( connectionString ) { }
}
[Table( Name="dbo.tblCustomers" )]
public class Customer {
private G... | To achieve the desired functionality of tracking changes to the `Customer` object without directly passing a `DataContext` instance into your method, you can create a singleton or a static property that provides a centralized way to access your `DataContext` instance. Here's how you might implement it:
1. **Create a S... | 36,692 | [
{
"from": "human",
"value": "If I have the LINQ objects:\npublic class SampleDataContext : DataContext {\n public Table<Customer> Customers { get { return this.GetTable<Customer>(); } }\n public SampleDataContext( string connectionString ) : base( connectionString ) { }\n}\n\n[Table( Name=\"dbo.tblCus... |
In Xcode, I can edit my preprocessor macros in the project settings. I want to create a macro that refers to an environment variable. Basically, I want to be able to refer to $SRC_ROOT in my code. What I currently have in my macros is:
SRC_ROOT=${SRC_ROOT}
but it isn't working.
| In Xcode, if you want to create a preprocessor macro that refers to an environment variable like `SRC_ROOT`, you need to ensure that the variable is correctly passed to the preprocessor at compile time. However, Xcode does not directly support referencing shell variables (like those in bash) in the preprocessor macros.... | 36,499 | [
{
"from": "human",
"value": "In Xcode, I can edit my preprocessor macros in the project settings. I want to create a macro that refers to an environment variable. Basically, I want to be able to refer to $SRC_ROOT in my code. What I currently have in my macros is:\nSRC_ROOT=${SRC_ROOT}\n\nbut it isn't worki... |
This is a question that was sparked by Rob Walker's answer here.
Suppose I declare a class/struct like so:
struct
{
char A;
int B;
char C;
int D;
};
Is it safe to assume that these members will be declared in exactly that order in memory, or is this a compiler dependent thing? I'm asking because I ha... | In both C and C++, the order of the members in a struct (or class) is guaranteed to be the same as the order in which they are declared. This means that the compiler will allocate the members in memory in the same order, regardless of the underlying platform or compiler being used. However, there are important consider... | 36,324 | [
{
"from": "human",
"value": "This is a question that was sparked by Rob Walker's answer here.\nSuppose I declare a class/struct like so:\nstruct\n{ \n char A;\n int B;\n char C;\n int D;\n};\n\nIs it safe to assume that these members will be declared in exactly that order in memory, or is this a... |
I just started getting into BizTalk at work and would love to keep using everything I've learned about DDD, TDD, etc. Is this even possible or am I always going to have to use the Visio like editors when creating things like pipelines and orchestrations?
| Welcome to the world of BizTalk! It's great to hear that you want to integrate principles like Domain-Driven Design (DDD) and Test-Driven Development (TDD) into your BizTalk projects. While BizTalk is known for its visual design interfaces, you can indeed apply some modern development practices to your BizTalk projects... | 33,928 | [
{
"from": "human",
"value": "I just started getting into BizTalk at work and would love to keep using everything I've learned about DDD, TDD, etc. Is this even possible or am I always going to have to use the Visio like editors when creating things like pipelines and orchestrations?\n"
},
{
"from": ... |
In php I need to get the contents of a url (source) search for a string "maybe baby love you" and if it does not contain this then do x.
| To accomplish your task in PHP, you can use the `file_get_contents()` function to fetch the contents of a URL and then use the `strpos()` function to check if the string "maybe baby love you" is present in the content. If the string is not found, you can execute your desired action (represented here as `doX()`). Here's... | 37,715 | [
{
"from": "human",
"value": "In php I need to get the contents of a url (source) search for a string \"maybe baby love you\" and if it does not contain this then do x.\n"
},
{
"from": "gpt",
"value": "To accomplish your task in PHP, you can use the `file_get_contents()` function to fetch the con... |
Does anyone have any experience migrating from one DBMS to another? If you have done this, why did you do it? Features? Cost? Corporate Directive?
At times, I've worked with DBAs who insisted that we not use features specific to a DBMS (for example, CLR Stored Procedures in SQL Server.) The DBAs point is, if we use t... | Migrating from one DBMS to another is a common challenge that organizations face, and the reasons for such migrations can vary widely. Here are some common motivations and experiences related to DBMS migration:
### Reasons for Migrating:
1. **Cost**:
- Companies might switch from a commercial DBMS to an open-sour... | 35,225 | [
{
"from": "human",
"value": "Does anyone have any experience migrating from one DBMS to another? If you have done this, why did you do it? Features? Cost? Corporate Directive?\nAt times, I've worked with DBAs who insisted that we not use features specific to a DBMS (for example, CLR Stored Procedures in SQ... |
I have shell script which starts with:
sdir=`dirname $0`
sdir=`(cd "$sdir/"; pwd)`
And this usually gets expanded (with 'sh -h') into
++ dirname /opt/foo/bin/bar
+ sdir=/opt/foo/bin
++ cd /opt/foo/bin/
++ pwd
+ sdir=/opt/foo/bin
but for single user for single combination of parameters in expands into (note two lines... | The behavior you're observing, where the `pwd` command unexpectedly returns multiple lines, can be puzzling, especially in a shell script context. However, it's likely related to how the input to the script is being handled or how the shell environment is set up for that particular user. Here are a few things to consid... | 34,543 | [
{
"from": "human",
"value": "I have shell script which starts with:\nsdir=`dirname $0`\nsdir=`(cd \"$sdir/\"; pwd)`\n\nAnd this usually gets expanded (with 'sh -h') into \n++ dirname /opt/foo/bin/bar\n+ sdir=/opt/foo/bin\n++ cd /opt/foo/bin/\n++ pwd\n+ sdir=/opt/foo/bin\n\nbut for single user for single com... |
I'm programming something that allows users to store documents and pictures on a webserver, to be stored and retrieved later. When users upload files to my server, PHP tells me what filetype it is based on the extension. However, I'm afraid that users could rename a zip file as somezipfile.png and store it, thus keep... | Yes, it's a good practice to validate the actual contents of uploaded files instead of solely relying on file extensions, as users can easily rename files to bypass checks. Here are several methods you can use to validate the uploaded file types in PHP:
### 1. **MIME Type Checking:**
You can use the `finfo_file()` fun... | 31,077 | [
{
"from": "human",
"value": "I'm programming something that allows users to store documents and pictures on a webserver, to be stored and retrieved later. When users upload files to my server, PHP tells me what filetype it is based on the extension. However, I'm afraid that users could rename a zip file a... |
I've been trying to find a way to load my WCF service configuration (that huge BLOB of XML config data) from an alternate source - not the standard web.config / app.config.
We're running in a restricted environment where we don't have access to the server's file system, and thus we cannot make tweaks and changes to ou... | Yes, you can certainly load WCF service configurations from an alternate source such as a SQL Server database. While WCF does not provide a built-in "config provider" for loading configurations from sources like databases, you can achieve this by implementing a custom solution. Below are steps and a basic example of ho... | 35,598 | [
{
"from": "human",
"value": "I've been trying to find a way to load my WCF service configuration (that huge BLOB of XML config data) from an alternate source - not the standard web.config / app.config. \nWe're running in a restricted environment where we don't have access to the server's file system, and th... |
I'm fairly new to WPF and I've come across a problem that seems a bit tricky to solve. Basically I want a 4x4 grid thats scalable but keeps a square (or any other arbitrary) aspect ratio. This actually seems quite tricky to do, which surprises me because I would imagine its a reasonably common requirement.
I start wi... | You're definitely on the right track by using a `Viewbox` to maintain the aspect ratio of your grid, but you can modify your approach to incorporate scrolling capabilities when the content is too large for the available window space.
Instead of placing your `Viewbox` within a `StackPanel`, which does not support scrol... | 37,472 | [
{
"from": "human",
"value": "I'm fairly new to WPF and I've come across a problem that seems a bit tricky to solve. Basically I want a 4x4 grid thats scalable but keeps a square (or any other arbitrary) aspect ratio. This actually seems quite tricky to do, which surprises me because I would imagine its a ... |
How else might you compare two arrays ($A and $B )and reduce matching elements out of the first to prep for the next loop over the array $A?
$A = array(1,2,3,4,5,6,7,8);
$B = array(1,2,3,4);
$C = array_intersect($A,$B); //equals (1,2,3,4)
$A = array_diff($A,$B); //equals (5,6,7,8)
Is this the simplest way or i... | The method you're using with `array_intersect()` and `array_diff()` is quite efficient for comparing and modifying arrays in PHP. However, if you're looking for alternative approaches, there are a few other ways you could achieve the same results, though they may not necessarily be simpler. Here are a couple of options... | 36,674 | [
{
"from": "human",
"value": "How else might you compare two arrays ($A and $B )and reduce matching elements out of the first to prep for the next loop over the array $A?\n$A = array(1,2,3,4,5,6,7,8);\n$B = array(1,2,3,4);\n\n$C = array_intersect($A,$B); //equals (1,2,3,4)\n$A = array_diff($A,$B); //e... |
Back in 2000 (when .NET was unleashed upon us IIRC) it was an innovative cutting edge language (last time I used it was 2003).
From what I read though, Sun has only evolved the language exceedingly slowly. I've even read that where the language has evolved, such as the addition of Generics, developers have complained a... | Your perceptions touch on some common sentiments within the developer community regarding the evolution of Java and the competition with C#. Let's break down the points you've made.
1. **Java's Evolution**: It is true that Java has evolved more slowly compared to some newer languages. While significant features have b... | 37,532 | [
{
"from": "human",
"value": "Back in 2000 (when .NET was unleashed upon us IIRC) it was an innovative cutting edge language (last time I used it was 2003).\nFrom what I read though, Sun has only evolved the language exceedingly slowly. I've even read that where the language has evolved, such as the addition... |
Our team is developing a rather big ASP.NET web project which initially started in ASP.NET 1.0 and was ported several times to all new versions of .NET.
We made extensively use of User Controls (ascx). But in retrospect I doubt that it was a good decision. A very small percentage of these controls are reused (resuable)... | It's great to hear that your team is actively evaluating the architecture of your ASP.NET web project! The choice between using User Controls (ASCX) and implementing everything in ASPX pages largely depends on the specific requirements of your application, the complexity of your UI, and your team's development practice... | 34,815 | [
{
"from": "human",
"value": "Our team is developing a rather big ASP.NET web project which initially started in ASP.NET 1.0 and was ported several times to all new versions of .NET.\nWe made extensively use of User Controls (ascx). But in retrospect I doubt that it was a good decision. A very small percenta... |
I've got a bunch of properties which I am going to use read/write locks on. I can implement them either with a try finally or a using clause.
In the try finally I would acquire the lock before the try, and release in the finally. In the using clause, I would create a class which acquires the lock in its constructor, an... | Both methods you’ve outlined for using `ReaderWriterLock` in C# have their pros and cons, and the choice between them can depend on various factors including code readability, maintainability, and error-proneness. Let’s discuss each method, their benefits, and drawbacks.
### Method 1: Try-Finally
```csharp
static Rea... | 33,614 | [
{
"from": "human",
"value": "I've got a bunch of properties which I am going to use read/write locks on. I can implement them either with a try finally or a using clause.\nIn the try finally I would acquire the lock before the try, and release in the finally. In the using clause, I would create a class whic... |
Can I ascertain the name of the stored procedure that caused the trigger to fire from within the trigger?
| In SQL Server, you cannot directly obtain the name of the stored procedure that caused a trigger to fire. Triggers are designed to respond to DML (Data Manipulation Language) operations such as INSERT, UPDATE, or DELETE, and they do not have access to the context of the caller (i.e., the stored procedure or other code ... | 36,103 | [
{
"from": "human",
"value": "Can I ascertain the name of the stored procedure that caused the trigger to fire from within the trigger?\n"
},
{
"from": "gpt",
"value": "In SQL Server, you cannot directly obtain the name of the stored procedure that caused a trigger to fire. Triggers are designed ... |
I have been working on a wrapper for a COM object that can only take and return strings. The interface for the COM object looks like this:
interface IMapinfo
{
void Do(string cmd);
string Eval(string cmd);
}
Now I have made classes that wrap up basic functions like so:
public class Tab... | Your approach to using mocking in unit tests is a good start, but there are a few adjustments you need to make to properly set up your tests, especially since you are trying to mock an interface that your `Table` class relies on.
Here’s a step-by-step guide on how to mock the `IMapinfo` interface using Moq, and then u... | 34,954 | [
{
"from": "human",
"value": "I have been working on a wrapper for a COM object that can only take and return strings. The interface for the COM object looks like this:\n interface IMapinfo\n {\n void Do(string cmd);\n string Eval(string cmd);\n }\n\nNow I have made classes that wrap ... |
Are SQL Server timeouts (SELECT queries, in particular) logged in the ERRORLOG file?
Background is a customer with a web site having occasional "Request timeout" messages, looking to me assuming that the timeout is caused by a database timeout. There are no timeout errors in the ERRORLOG in question.
| In SQL Server, query timeouts for SELECT statements (and other types of queries) are generally not logged in the SQL Server ERRORLOG file. Timeouts for queries can occur for a variety of reasons, including network issues, client-side settings, or the way the application is designed to handle timeouts.
Here are a few p... | 36,890 | [
{
"from": "human",
"value": "Are SQL Server timeouts (SELECT queries, in particular) logged in the ERRORLOG file?\nBackground is a customer with a web site having occasional \"Request timeout\" messages, looking to me assuming that the timeout is caused by a database timeout. There are no timeout errors in... |
There is div named "dvUsers". there is an anchor tag "lnkUsers".
When one clicks on anchortag, the div must open like a popup div just below it.
Also the divs relative position should be maintained at window resize and all.
How to do that using javascript/jquery?
| To create a popup-like div that opens below an anchor tag and maintains its position when the window is resized, you can use jQuery to handle the click event and CSS for styling. Below is a simple implementation for your requirement:
### HTML Structure
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=... | 35,170 | [
{
"from": "human",
"value": "There is div named \"dvUsers\". there is an anchor tag \"lnkUsers\".\nWhen one clicks on anchortag, the div must open like a popup div just below it.\nAlso the divs relative position should be maintained at window resize and all.\nHow to do that using javascript/jquery?\n"
},
... |
More detail to my question:
HTML and JavaScript are called "client-side code".
C# and VB in the code behind files are termed "server-side code".
So what is inline-asp, and 'runat=server' code blocks called?
<!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>
...
// This is c... | The inline ASP code and the `<asp:Label>` control that you have provided in your example are best described as **"mixed-mode" or "server-side code with embedded inline scripting."** Here’s a breakdown of the terminology:
1. **Client-side Code**:
- This includes HTML, CSS, and JavaScript that is executed on the cli... | 36,925 | [
{
"from": "human",
"value": "More detail to my question:\nHTML and JavaScript are called \"client-side code\".\nC# and VB in the code behind files are termed \"server-side code\".\nSo what is inline-asp, and 'runat=server' code blocks called?\n<!-- This is called \"client-side\" -->\n<p>Hello World</p>\n<sc... |
I am fetching data in from an SQL table using a DataSet in VB.Net. When there is data in table, it displays the data properly in the grid, but when there is no data in the table, it only shows the UltraGrid's basic view.
How can I display the column names of the table as headings of the UltraGrid even when there is no... | To display the column names in the UltraGrid even when there is no data in the underlying SQL table, you can manually create the columns in the UltraGrid and bind them to the DataTable. This approach allows you to show the headers without requiring data. Here's how you can do it in VB.Net:
1. First, you will need to c... | 37,009 | [
{
"from": "human",
"value": "I am fetching data in from an SQL table using a DataSet in VB.Net. When there is data in table, it displays the data properly in the grid, but when there is no data in the table, it only shows the UltraGrid's basic view.\nHow can I display the column names of the table as headi... |
I have a very strange bug cropping up right now in a fairly massive C++ application at work (massive in terms of CPU and RAM usage as well as code length - in excess of 100,000 lines). This is running on a dual-core Sun Solaris 10 machine. The program subscribes to stock price feeds and displays them on "pages" configu... | What you are experiencing sounds like a classic case of undefined behavior in a multi-threaded application. Here are several possible causes for the segfaults and data corruption you’re observing:
1. **Stack Corruption:** As you mentioned, writing out of bounds on an array or writing to a stack variable can corrupt th... | 37,395 | [
{
"from": "human",
"value": "I have a very strange bug cropping up right now in a fairly massive C++ application at work (massive in terms of CPU and RAM usage as well as code length - in excess of 100,000 lines). This is running on a dual-core Sun Solaris 10 machine. The program subscribes to stock price f... |
When do you call Microsoft.Security.Application.AntiXss.HtmlEncode? Do you do it when the user submits the information or do you do when you're displaying the information?
How about for basic stuff like First Name, Last Name, City, State, Zip?
| When working with user input and output in web applications, the general best practice is to encode data at the time of output, rather than at the time of input. This means that you should use `Microsoft.Security.Application.AntiXss.HtmlEncode` when you are displaying user-submitted data back to the user, rather than w... | 38,272 | [
{
"from": "human",
"value": "When do you call Microsoft.Security.Application.AntiXss.HtmlEncode? Do you do it when the user submits the information or do you do when you're displaying the information? \nHow about for basic stuff like First Name, Last Name, City, State, Zip?\n"
},
{
"from": "gpt",
... |
What's proper way to connect ODBC datasources and execute some SQL statements?
TQuery and other BDE components can do it, but if I understood correctly they are now deprecated?
| Yes, you are correct that the Borland Database Engine (BDE) and components like `TQuery` that rely on it are considered deprecated in modern Delphi and C++ Builder applications. Instead, you can use the newer and more flexible data access frameworks provided in Delphi, such as FireDAC or the built-in components for ODB... | 23,872 | [
{
"from": "human",
"value": "What's proper way to connect ODBC datasources and execute some SQL statements?\nTQuery and other BDE components can do it, but if I understood correctly they are now deprecated?\n"
},
{
"from": "gpt",
"value": "Yes, you are correct that the Borland Database Engine (B... |
Are there anyone with experiences/examples on releasing early/releasing often for commercial software? Does it work?
I was thinking of VMware where they have a lot of revisions release between each major version. And the installation experience was awful, sometimes they would break the existing VMs and other times the ... | The "release early, release often" principle can be effective for commercial software, but it comes with both benefits and challenges. Here are some insights and examples from various industries that demonstrate how it can be successfully implemented, as well as some pitfalls to avoid.
### Benefits of Early and Freque... | 32,729 | [
{
"from": "human",
"value": "Are there anyone with experiences/examples on releasing early/releasing often for commercial software? Does it work?\nI was thinking of VMware where they have a lot of revisions release between each major version. And the installation experience was awful, sometimes they would b... |
Googling has turned up little to nothing.
I need to develop some heavy stuff in m4 and I'd love to do it in my favorite environment with all the bells and whistles thereof.
There are packages for running m4 on just about every platform, such as windows. So I know at the very least I can create a default project and tes... | If you're looking to develop with `m4` in a more comfortable environment with features like syntax highlighting, code navigation, and potentially debugging, here are some options you might consider:
### 1. **Using an IDE or Text Editor with m4 Support**
Several IDEs and text editors support m4, either natively or thro... | 37,297 | [
{
"from": "human",
"value": "Googling has turned up little to nothing.\nI need to develop some heavy stuff in m4 and I'd love to do it in my favorite environment with all the bells and whistles thereof.\nThere are packages for running m4 on just about every platform, such as windows. So I know at the very l... |
I guess this is a multi-part question.
I can import a 3D model into my WPF application but how do I apply an ambient occlusion shader effect to it?
I know with .NET 3.5 SP1 you can do custom effects but that's limited to pixel shaders and doesn't include vertex shaders.
I think i can do this with an XNA application bu... | Hi Chris,
To address your multi-part question:
### 1. Applying Ambient Occlusion in WPF
WPF, especially in the versions around .NET 3.5 SP1, has some limitations in terms of advanced 3D graphics capabilities compared to dedicated game engines or graphics frameworks. While you can indeed use pixel shaders to achieve ... | 33,396 | [
{
"from": "human",
"value": "I guess this is a multi-part question.\nI can import a 3D model into my WPF application but how do I apply an ambient occlusion shader effect to it? \nI know with .NET 3.5 SP1 you can do custom effects but that's limited to pixel shaders and doesn't include vertex shaders.\nI th... |
Out of curiosity, anyone knows the particulars of the internal implementation of
ListControl.SelectedIndex = (int) <new valueIndex>
VS
ListControl.SelectedValue = <new value>.ToString()
I'm having difficulties with a custom validation object we've built here to process all validation in one sweep. I suspect using ... | The `ListControl` class in .NET, which serves as a base for controls like `ListBox`, `DropDownList`, and `ListView`, provides different mechanisms for selecting items: `SelectedIndex` and `SelectedValue`. Here’s a breakdown of how they work and their implications, especially in terms of event handling.
### SelectedInd... | 34,709 | [
{
"from": "human",
"value": "Out of curiosity, anyone knows the particulars of the internal implementation of \nListControl.SelectedIndex = (int) <new valueIndex>\n\nVS \nListControl.SelectedValue = <new value>.ToString()\n\nI'm having difficulties with a custom validation object we've built here to process... |
For instance, I have a SqlDataSource that loads a list of items. On my form, I've got 3 dropdown boxes that both should contain that same list of values, and then the user can select a different value for each and save.
By hooking up each dropdown list to the same SqlDataSource, the database gets hit three times - one... | Yes, there are more efficient ways to handle this scenario to avoid multiple database calls when populating multiple dropdowns with the same data. Here are a few options:
### 1. Use a Single Data Retrieval Approach
Instead of binding each dropdown directly to the `SqlDataSource`, you can retrieve the data once, store... | 33,256 | [
{
"from": "human",
"value": "For instance, I have a SqlDataSource that loads a list of items. On my form, I've got 3 dropdown boxes that both should contain that same list of values, and then the user can select a different value for each and save.\nBy hooking up each dropdown list to the same SqlDataSourc... |
I know questions of this kind have been asked before, but my situation differs a little.
On my rails app I have to validate the user login against an existing repository and then control authorization to given modules. So, I don't want the solution I go for to generate a model for my users and rely on that. The autheti... | Given your requirements for a custom authentication solution without relying on a user model in your Rails app, you might want to consider the following options:
1. **Devise with Custom Authentication**: While Devise is usually used with a user model, it can be customized for your needs. You can override the sessions ... | 36,649 | [
{
"from": "human",
"value": "I know questions of this kind have been asked before, but my situation differs a little.\nOn my rails app I have to validate the user login against an existing repository and then control authorization to given modules. So, I don't want the solution I go for to generate a model ... |
SQL Server 2005.
I'm adding Foreign Key constraints to the database of an application that allegedly didn't need them. Naturally, the data has become unreliable and there are orphaned entries in the foreign key field.
Setup:
Two tables, TableUser and TableOrder.
TableUser has Primary Key 'UserID', and TableOrder has F... | To find the rows in the `TableOrder` where the `UserID` does not have a matching entry in the `TableUser`, you can use a SQL query with a `LEFT JOIN` or a `NOT EXISTS` clause. Here are two methods you can use:
### Method 1: Using `LEFT JOIN`
You can perform a `LEFT JOIN` between `TableOrder` and `TableUser`, and then... | 37,383 | [
{
"from": "human",
"value": "SQL Server 2005.\nI'm adding Foreign Key constraints to the database of an application that allegedly didn't need them. Naturally, the data has become unreliable and there are orphaned entries in the foreign key field.\nSetup:\nTwo tables, TableUser and TableOrder.\nTableUser h... |
I'm trying to use a .NET assembly from VB6 via interop without placing it in the GAC and without using the /codebase argument for regasm.exe.
From what I understand, when I run regasm.exe on a .NET class library, it creates a registry entry for each class in the class library telling the COM clients they should load ms... | It sounds like you are encountering a common issue when using .NET assemblies with COM Interop without either placing the assembly in the Global Assembly Cache (GAC) or using the `/codebase` argument with `regasm.exe`. Let's break down how `mscoree.dll` resolves .NET assemblies for COM.
When a COM client attempts to c... | 33,791 | [
{
"from": "human",
"value": "I'm trying to use a .NET assembly from VB6 via interop without placing it in the GAC and without using the /codebase argument for regasm.exe.\nFrom what I understand, when I run regasm.exe on a .NET class library, it creates a registry entry for each class in the class library t... |
I'm not sure what this practice is actually called, so perhaps someone can edit the title to more accurately reflect my question.
Let's say we have a site that stores objects of different types. Each type of object has its own database (a database of books and assorted information with its tables, a database of CDs and... | What you're describing sounds like a strategy for managing a **keyword or tagging system** across multiple object types in a database architecture. This approach can have both advantages and disadvantages, depending on the specific requirements of your system, but here are some considerations:
### Advantages:
1. **Ce... | 37,931 | [
{
"from": "human",
"value": "I'm not sure what this practice is actually called, so perhaps someone can edit the title to more accurately reflect my question.\nLet's say we have a site that stores objects of different types. Each type of object has its own database (a database of books and assorted informat... |
I would like to make two database operation in one transaction. Those two operations are
Do one insert operation.
Create one user (using membership - sql membership provider)
I tried TransactionScope but it went to distributed transaction at that line:
-- Membership.CreateUser("test", "password", "test@test... | Using `TransactionScope` in the context of the ASP.NET Membership provider can indeed lead to distributed transactions, particularly because the Membership provider often interacts with different databases or even external resources (like the file system for storing membership data). However, if you want to keep it lig... | 35,912 | [
{
"from": "human",
"value": "I would like to make two database operation in one transaction. Those two operations are\n\nDo one insert operation.\nCreate one user (using membership - sql membership provider)\n\nI tried TransactionScope but it went to distributed transaction at that line:\n -- Membe... |
We are using SSRS 2005 SP1 and the lastest Reportviewer controls.
We are having situations where certain reporting infrastructure exceptions are not being exposed to any of the exception handling routines.
A specific example is when the SQL Server Reporting Services Windows service was unexpectantly stopped due to a VM... | The issue you're encountering with SSRS (SQL Server Reporting Services) and the ReportViewer control not exposing certain exceptions can indeed be frustrating. In the case you've described, it seems that the error handling mechanisms available within the application are not catching the exception raised by the Report S... | 35,861 | [
{
"from": "human",
"value": "We are using SSRS 2005 SP1 and the lastest Reportviewer controls.\nWe are having situations where certain reporting infrastructure exceptions are not being exposed to any of the exception handling routines.\nA specific example is when the SQL Server Reporting Services Windows se... |
I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to Date.toMonth(), Date.toYear() and other deprecated Date methods. All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet (we're using JDK 1.5) and I'm saying they... | The `@deprecated` annotation in Java indeed indicates that a method, class, or field is considered outdated and may be removed in future versions. While deprecated methods may still exist in the current version of the JDK (such as JDK 1.5 in your case), relying on them is not a good practice for several reasons:
1. **... | 37,052 | [
{
"from": "human",
"value": "I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to Date.toMonth(), Date.toYear() and other deprecated Date methods. All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet ... |
Yes, there is a similar question here. However, that question doesn't seem to have code attached to it (though it might have at some point; I see answers alluding to code), and the accepted answer (and other advice) on it aren't getting me where I need to be.
I have a fairly complex, and frankly not-well-designed VB.NE... | It sounds like you're running into an issue related to the lifecycle of ASP.NET web pages and controls. This situation typically occurs when dynamically loaded controls are not properly recreated on postbacks, leading to inconsistent behavior.
### Key Concepts
1. **Control Lifecycle**: In ASP.NET, controls need to be... | 36,421 | [
{
"from": "human",
"value": "Yes, there is a similar question here. However, that question doesn't seem to have code attached to it (though it might have at some point; I see answers alluding to code), and the accepted answer (and other advice) on it aren't getting me where I need to be.\nI have a fairly co... |
I have the following 3 rails classes, which are all stored in one table, using rails' Single table inheritance.
class Template < ActiveRecord::Base
class ThingTemplate < Template
class StockThingTemplate < ThingTemplate
If I have a StockThingTemplate with ID of 150 then I should logically be able to do this:
ThingTemp... | The behavior you're encountering with Single Table Inheritance (STI) in Rails can be influenced by a few factors, especially considering you're using an older version of Rails (1.2). Below are some possible reasons for the inconsistent SQL queries being generated for `ThingTemplate.find(150)`:
1. **Eager Loading and C... | 36,623 | [
{
"from": "human",
"value": "I have the following 3 rails classes, which are all stored in one table, using rails' Single table inheritance.\nclass Template < ActiveRecord::Base\nclass ThingTemplate < Template\nclass StockThingTemplate < ThingTemplate\n\nIf I have a StockThingTemplate with ID of 150 then I ... |
I am having trouble deleting orphan nodes using JPA with the following mapping
@OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "owner")
private List<Bikes> bikes;
I am having the issue of the orphaned roles hanging around the database.
I can use the annotation org.hibernate.annotations.Casca... | In JPA 2.0 and later versions, you can manage orphan removal using the `orphanRemoval` attribute on the `@OneToMany` mapping. This feature allows you to automatically delete child entities (in your case, `Bikes`) when they are removed from the parent's collection, thus helping to avoid orphaned records in the database.... | 36,921 | [
{
"from": "human",
"value": "I am having trouble deleting orphan nodes using JPA with the following mapping\n@OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = \"owner\")\nprivate List<Bikes> bikes;\n\nI am having the issue of the orphaned roles hanging around the database.\nI can us... |
How do I get the full width result for the *nix command "ps"?
I know we can specify something like --cols 1000 but is there anyway I can
the columns and just print out everything?
| In Unix-like systems, the `ps` command is used to display information about running processes. By default, the output of `ps` may be truncated if the terminal window is too narrow. To get the full width result, you can use a couple of methods:
### Method 1: Use `--cols` or `--width`
You can specify a large number for ... | 36,865 | [
{
"from": "human",
"value": "How do I get the full width result for the *nix command \"ps\"?\nI know we can specify something like --cols 1000 but is there anyway I can\nthe columns and just print out everything?\n"
},
{
"from": "gpt",
"value": "In Unix-like systems, the `ps` command is used to ... |
Is there any HTML5 support in IE8? Is it on the IE8 roadmap?
| Internet Explorer 8 (IE8), released in March 2009, has very limited support for HTML5 features. Microsoft primarily focused on improving web standards and introducing some HTML5 elements, but overall, it did not fully embrace HTML5 like more modern browsers did.
Some of the HTML5 features that were partially supported... | 39,207 | [
{
"from": "human",
"value": "Is there any HTML5 support in IE8? Is it on the IE8 roadmap?\n"
},
{
"from": "gpt",
"value": "Internet Explorer 8 (IE8), released in March 2009, has very limited support for HTML5 features. Microsoft primarily focused on improving web standards and introducing some ... |
It's not obvious to me..
| That's completely understandable! What specifically are you finding unclear? I'm here to help clarify any questions or topics you're curious about. | 40,744 | [
{
"from": "human",
"value": "It's not obvious to me..\n"
},
{
"from": "gpt",
"value": "That's completely understandable! What specifically are you finding unclear? I'm here to help clarify any questions or topics you're curious about."
}
] |
I know how to move a layer based on touch. But I would also like to be able to rotate the image.
Is there any sample code that shows how to do this? Or can anyone give me some advice?
Thanks!
| Certainly! To enable rotation along with moving a layer (like an image) based on touch events, you can use gestures to determine the angle of rotation. Below is a simple example using a combination of touch events in a framework like JavaScript with HTML5 canvas. I'll assume you're working with JavaScript, but let me k... | 33,619 | [
{
"from": "human",
"value": "I know how to move a layer based on touch. But I would also like to be able to rotate the image. \nIs there any sample code that shows how to do this? Or can anyone give me some advice?\nThanks!\n"
},
{
"from": "gpt",
"value": "Certainly! To enable rotation along wit... |
Following the JSONRequest proposal, I've found code for the JSONRequest object. However, this object depends on JSONRequestError, and the code for that is nowhere to be found.
Anyone know where I can find the code?
Thanks in advance!
| The JSONRequest proposal was an early effort to standardize the way web applications could request JSON data asynchronously. However, it was ultimately abandoned and did not make it into any official version of JavaScript or ECMAScript.
As a result, you won't find any official or widely used implementation of a `JSONR... | 39,842 | [
{
"from": "human",
"value": "Following the JSONRequest proposal, I've found code for the JSONRequest object. However, this object depends on JSONRequestError, and the code for that is nowhere to be found.\nAnyone know where I can find the code?\nThanks in advance!\n"
},
{
"from": "gpt",
"value":... |
In Python I could've converted it to Unicode and do '(?u)^[\w ]+$' regex search, but PHP doesn't seem to understand international \w, or does it?
| In PHP, the `\w` character class is limited to matching ASCII word characters (letters, digits, and underscores), which means it does not include international characters by default. However, you can use the `u` (UTF-8) modifier in your regular expressions to enable support for Unicode characters.
Here's how you can d... | 39,246 | [
{
"from": "human",
"value": "In Python I could've converted it to Unicode and do '(?u)^[\\w ]+$' regex search, but PHP doesn't seem to understand international \\w, or does it?\n"
},
{
"from": "gpt",
"value": "In PHP, the `\\w` character class is limited to matching ASCII word characters (letter... |
Suppose I have a text file with data separated by whitespace into columns. I want to write a shell script which takes as input a filename and a number N and prints out only that column. With awk I can do the following:
awk < /tmp/in '{print $2}' > /tmp/out
This code prints out the second column.
But how would one wra... | You can create a shell script that uses `awk` and takes a filename and the column number as input arguments. Below is a simple example of how you could implement this:
1. Create a new shell script file. For example, `print_column.sh`.
2. Open the file in a text editor and add the following code:
```bash
#!/bin/bash
... | 38,094 | [
{
"from": "human",
"value": "Suppose I have a text file with data separated by whitespace into columns. I want to write a shell script which takes as input a filename and a number N and prints out only that column. With awk I can do the following:\nawk < /tmp/in '{print $2}' > /tmp/out\n\nThis code prints o... |
Forgive me for probably using the wrong term for this "application mode".
Our application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that.
We change the code to fix this, but unfortu... | In the context of Citrix, the term you're likely referring to is "seamless mode," which allows applications to be launched in a way that they appear on the user's local desktop, rather than as part of the full remote desktop session.
To detect if your application is running under a Citrix environment, you can use spe... | 36,231 | [
{
"from": "human",
"value": "Forgive me for probably using the wrong term for this \"application mode\".\nOur application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that.... |
I'm using the MySQL Query Browser (part of the MySQL GUI Tools) and need to change a field to NULL, but I can't figure out how to do it - if I delete the value it tries to update it to ''. Typing "NULL" makes it try to update to 'NULL' (a string).
I know I could just write a query to do it, but that defeats the entire ... | When using MySQL Query Browser (or similar database management tools), you might encounter issues when trying to set a field to `NULL` directly through the GUI, as the interface typically interprets input in the text box as a string.
Here’s a common workaround to set a field to `NULL` using the GUI:
1. **Select the r... | 39,296 | [
{
"from": "human",
"value": "I'm using the MySQL Query Browser (part of the MySQL GUI Tools) and need to change a field to NULL, but I can't figure out how to do it - if I delete the value it tries to update it to ''. Typing \"NULL\" makes it try to update to 'NULL' (a string).\nI know I could just write a ... |
I have 3 tables (archive has many sections, section (may) belong to many archives):
archive
id PK
description
archive_to_section
archive_id PK FK
section_id PK FK
section
id PK
description
What would the SQL look like to list all the sections that belong a certain archive id?
I am just learning SQL. From what I... | You're correct that you will need to use a `JOIN` to retrieve the sections that belong to a specific archive. Your understanding is right, and the SQL query you provided is almost perfect. Here’s a slightly refined version of the SQL query using table aliases for clarity:
```sql
SELECT s.*
FROM section AS s
INNER JOI... | 34,000 | [
{
"from": "human",
"value": "I have 3 tables (archive has many sections, section (may) belong to many archives):\n\narchive\n\nid PK\ndescription\n\narchive_to_section\n\narchive_id PK FK\nsection_id PK FK\n\nsection\n\nid PK\ndescription\n\n\nWhat would the SQL look like to list all the sections that belon... |
How does PHP handle client connection while doing sleeps?
Or put another way ... what happens if the client closes the connection to the server while a page is being processed?
Does it just kill the process, or does it continue to process the page until the end?
Since I'm not sure of the answers to the above how would ... | In PHP, when a script is executed, it runs in a separate process on the server. The way PHP handles client connections depends on whether the PHP environment is running in a blocking mode (like with Apache in a traditional setup) or in a non-blocking environment (like PHP-FPM or using something like Swoole).
When a PH... | 32,728 | [
{
"from": "human",
"value": "How does PHP handle client connection while doing sleeps?\nOr put another way ... what happens if the client closes the connection to the server while a page is being processed?\nDoes it just kill the process, or does it continue to process the page until the end?\nSince I'm not... |
Is there a way to mount a folder on the hard disk as a device in Finder. The intend here is to provide the user with an easy way to get to a folder that my application uses to store data. I don't want my user to go searching for data in Application Data. I would rather allow them to make this data available as a mounte... | You can achieve the functionality of presenting a folder as a mounted volume in Finder using macOS's `disk arbitrator` APIs to create a disk image. However, it's important to clarify that a disk image will act like a disk volume but does not serve as a direct link to an existing folder.
If your goal is to provide a co... | 38,095 | [
{
"from": "human",
"value": "Is there a way to mount a folder on the hard disk as a device in Finder. The intend here is to provide the user with an easy way to get to a folder that my application uses to store data. I don't want my user to go searching for data in Application Data. I would rather allow the... |
I understand object oriented programming, and have been writing OO programs for a long time. People seem to talk about aspect-oriented programming, but I've never really learned what it is or how to use it. What is the basic paradigm?
This question is related, but doesn't quite ask it:
Aspect-Oriented Programming vs.... | Aspect-Oriented Programming (AOP) is a programming paradigm that complements Object-Oriented Programming (OOP) by allowing separation of cross-cutting concerns. In AOP, the focus is on modularizing aspects of a program that affect multiple parts of the application in a way that is not easily handled by traditional OOP ... | 32,629 | [
{
"from": "human",
"value": "I understand object oriented programming, and have been writing OO programs for a long time. People seem to talk about aspect-oriented programming, but I've never really learned what it is or how to use it. What is the basic paradigm?\nThis question is related, but doesn't qui... |
I'm developing a Java application using Eclipse. My project has two source directories that are both built and then some files are copied into the output folder. From the output directory I then run my application and all works well.
However, I keep having these warnings:
Snapshot from Problems tab in Eclipse http://ww... | To resolve the warnings you're encountering in your Eclipse Java project, you can exclude specific files or directories from the build process. Since you mentioned that these files might have `.svn` extensions or specific filenames, here’s how you can exclude them:
### Exclude Files and Directories from Build
1. **Us... | 36,675 | [
{
"from": "human",
"value": "I'm developing a Java application using Eclipse. My project has two source directories that are both built and then some files are copied into the output folder. From the output directory I then run my application and all works well.\nHowever, I keep having these warnings:\nSnap... |
I've been working on a project that can't be described as 'small' anymore (40+ months), with a team that can't be defined as 'small' anymore (~30 people). We've been using Agile/Scrum (1) practices all along, and a healthy dose of TDD.
I'm not sure if I picked this up from Agile or TDD, more likely a combination of the... | It's commendable that you're looking to improve your team's practices and promote a more efficient development environment. Transitioning a team from a reliance on debugging to a culture of writing maintainable, self-explanatory code can be challenging, but it's certainly possible. Here’s a structured approach to help ... | 27,353 | [
{
"from": "human",
"value": "I've been working on a project that can't be described as 'small' anymore (40+ months), with a team that can't be defined as 'small' anymore (~30 people). We've been using Agile/Scrum (1) practices all along, and a healthy dose of TDD.\nI'm not sure if I picked this up from Agil... |
Is it a good idea (from a design POV) to nest constructor calls for overloaded New or Factory style methods? This is mostly for simple constructors, where each overload builds on the previous one.
MyClass( arg1 ) {
_arg1 = arg1;
_otherField = true;
_color="Blue"
}
MyClass( arg1, arg2) : this(arg1) { ... | Nesting constructor calls or factory methods can be a good design choice when done thoughtfully, as it promotes code reuse and reduces duplication. However, there are some considerations to keep in mind, especially regarding readability and maintainability.
### Benefits of Nesting Constructor Calls:
1. **Code Reuse**... | 33,342 | [
{
"from": "human",
"value": "Is it a good idea (from a design POV) to nest constructor calls for overloaded New or Factory style methods? This is mostly for simple constructors, where each overload builds on the previous one. \nMyClass( arg1 ) { \n _arg1 = arg1; \n _otherField = true; \n _color=\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.