instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields.
so my form looks something like:
MyForm extends ActionForm {
private String name;
private int id;
private Thing thing;
...getters/setters...
}
In the JSP I can reference the POJO's ... | In Struts 1.x, submitting forms that contain complex objects (like your `Thing` POJO) can indeed lead to issues, particularly with `BeanUtils.populate`, which is responsible for populating your ActionForm properties from the request parameters. The default behavior of `BeanUtils` expects simple property names, and it d... | 5,067 | [
{
"from": "human",
"value": "I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. \nso my form looks something like:\nMyForm extends ActionForm {\n private String name;\n private int id;\n private Thing thing;\n\n ...getters/sett... |
Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path.
Example:
When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might ... | To reference images in a CSS file dynamically across different environments in an ASP.NET application, you can utilize the concept of a relative path. However, since CSS files don't have direct access to ASP.NET's server-side features, you cannot use `ResolveClientUrl` directly within a CSS file.
Instead, you can defi... | 5,553 | [
{
"from": "human",
"value": "Assume I have an \"images\" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. \nExample:\nWhen in development, the path of ~/Images/Test.gif might resolve to /MyApp/Im... |
Simple as the title states: Can you use only Java commands to take a screenshot and save it? Or, do I need to use an OS specific program to take the screenshot and then grab it off the clipboard?
| Yes, you can take a screenshot and save it using only Java commands without needing to rely on OS-specific programs or the clipboard. Java's `java.awt` package provides the functionality needed to capture the screen and save it as an image file. Below is a simple example demonstrating how to do this:
```java
import ja... | 5,061 | [
{
"from": "human",
"value": "Simple as the title states: Can you use only Java commands to take a screenshot and save it? Or, do I need to use an OS specific program to take the screenshot and then grab it off the clipboard?\n"
},
{
"from": "gpt",
"value": "Yes, you can take a screenshot and sa... |
I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a List<string>.
| To select 5 random elements from a generic list (e.g., a `List<string>`), you can use the following algorithm in C#. This approach will ensure that you select unique elements:
1. Shuffle the list.
2. Take the first 5 elements from the shuffled list.
Here is a simple implementation:
```csharp
using System;
using Syst... | 4,618 | [
{
"from": "human",
"value": "I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a List<string>.\n"
},
{
"from": "gpt",
"value": "To select 5 random elements from a generic list (e.g., a `List<string>`), you can use the fo... |
In my limited experience with them executable requirements (i.e. specifying all requirements as broken automated tests) have proven to be amazingly successful. I've worked on one project in which we placed a heavy emphasis on creating high-level automated tests which exercised all the functionality of a given use case... | It's great to hear that you've had such positive experiences with executable requirements and automated tests! This approach, often referred to as Behavior-Driven Development (BDD) or Specification by Example, can indeed lead to significant improvements in both development speed and confidence in code changes. Here are... | 4,221 | [
{
"from": "human",
"value": "In my limited experience with them executable requirements (i.e. specifying all requirements as broken automated tests) have proven to be amazingly successful. I've worked on one project in which we placed a heavy emphasis on creating high-level automated tests which exercised ... |
How can I find out the date a MS SQL Server 2000 object was last modified?
I need to get a list of all the views, procs, functions etc that were modified since Aug 15th. In sysObjects I can see the date objects were created but I need to know when they were last altered.
NB: this is an SQL 2000 database.
| In SQL Server 2000, you can find out the last modified date of objects (such as views, stored procedures, and functions) using the `sysobjects` and `syscolumns` system tables. However, the `sysobjects` table does not directly store the last modified date for objects like views or stored procedures. Instead, you can use... | 4,407 | [
{
"from": "human",
"value": "How can I find out the date a MS SQL Server 2000 object was last modified?\nI need to get a list of all the views, procs, functions etc that were modified since Aug 15th. In sysObjects I can see the date objects were created but I need to know when they were last altered.\nNB: ... |
I remember back when MS released a forum sample application, the design of the application was like this:
/Classes/User.cs
/Classes/Post.cs
...
/Users.cs
/Posts.cs
So the classes folder had just the class i.e. properties and getters/setters.
The Users.cs, Post.cs, etc. have the actual methods that access the Data Acces... | You're absolutely right in your observations about the design of the sample application and its implications for object-oriented programming (OOP). Let's unpack this a bit.
### Design Overview
In the structure you've described, the application separates data models (the `Classes` folder with `User.cs`, `Post.cs`, etc... | 4,495 | [
{
"from": "human",
"value": "I remember back when MS released a forum sample application, the design of the application was like this:\n/Classes/User.cs\n/Classes/Post.cs\n...\n/Users.cs\n/Posts.cs\nSo the classes folder had just the class i.e. properties and getters/setters.\nThe Users.cs, Post.cs, etc. ha... |
I've got an MDI application written in Delphi 2006 which runs XP with the default theme.
Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window?
I've tried setting the BorderStyle of the MDIChildren to bsSizeToolWin but they are still rendered as normal F... | In Delphi 2006, when you're dealing with MDI applications, the appearance of MDI child forms is influenced by both the form's properties and the system's theme settings. If you want to reduce the height of the title bar on your MDI child forms, the `BorderStyle` property set to `bsSizeToolWin` is typically a good appro... | 4,213 | [
{
"from": "human",
"value": "I've got an MDI application written in Delphi 2006 which runs XP with the default theme. \nIs there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? \nI've tried setting the BorderStyle of the MDIChildren to bsSizeTool... |
I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings.
Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasions and that they might have been... | Calculating the similarity between two line strings that represent paths on a map is a common problem in fields such as geographic information systems (GIS), computer vision, and pattern recognition. Below are several approaches and algorithms you could consider for this task:
1. **Frechet Distance**:
The Frechet d... | 3,563 | [
{
"from": "human",
"value": "I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings.\nNow, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separa... |
Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pattern can be used to change a design?
In other words, are there... | The "Gang of Four" (GoF) book on design patterns is indeed a foundational text for understanding common solutions to recurring design problems in software development. However, recognizing when to apply a design pattern and understanding how to adapt your design to incorporate them can be nuanced. Here are some insight... | 4,763 | [
{
"from": "human",
"value": "Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pattern can be used to c... |
What is reflection, and why is it useful?
I'm particularly interested in Java, but I assume the principles are the same in any language.
| Reflection is a powerful feature in programming languages, including Java, that allows a program to inspect and manipulate its own structure and behavior at runtime. This includes the ability to examine classes, interfaces, methods, fields, and their metadata.
### Key Concepts of Reflection
1. **Introspection**: Refl... | 2,537 | [
{
"from": "human",
"value": "What is reflection, and why is it useful?\nI'm particularly interested in Java, but I assume the principles are the same in any language.\n"
},
{
"from": "gpt",
"value": "Reflection is a powerful feature in programming languages, including Java, that allows a program... |
I want to write a command that specifies "the word under the cursor" in VIM. For instance, let's say I have the cursor on a word and I make it appear twice. For instance, if the word is "abc" and I want "abcabc" then I could type:
:s/\(abc\)/\1\1/
But then I'd like to be able to move the cursor to "def" and use th... | In Vim, you can use the special sequence `\%#` to reference the current cursor position in the substitute command. However, a more flexible approach for your specific use case, where you want to duplicate the word under the cursor, is to use the following command:
```vim
:s/\<C-r><C-w>\<C-w\>/\0\0/
```
Here's a break... | 6,921 | [
{
"from": "human",
"value": "I want to write a command that specifies \"the word under the cursor\" in VIM. For instance, let's say I have the cursor on a word and I make it appear twice. For instance, if the word is \"abc\" and I want \"abcabc\" then I could type: \n:s/\\(abc\\)/\\1\\1/\n\nBut then I'd ... |
I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:
svn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'
I worked around it by:
Committing all the other changed files, omitting... | The `svn: Checksum mismatch` error occurs when Subversion (SVN) detects that the file in your working copy does not match the expected checksum stored in the repository. This mismatch can happen for several reasons:
1. **Corruption in the working copy**: The file might have been corrupted due to a hardware issue, disk... | 4,823 | [
{
"from": "human",
"value": "I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:\nsvn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'\nI worked around it by:\n\nCom... |
What's the DOS FINDSTR equivalent for PowerShell? I need to search a bunch of log files for "ERROR".
| In PowerShell, you can use the `Select-String` cmdlet, which is equivalent to the DOS `FINDSTR` command, to search through text files for specific patterns. If you want to search for the term "ERROR" in a bunch of log files, you can use the following command:
```powershell
Select-String -Path "C:\path\to\logs\*.log" -... | 5,319 | [
{
"from": "human",
"value": "What's the DOS FINDSTR equivalent for PowerShell? I need to search a bunch of log files for \"ERROR\".\n"
},
{
"from": "gpt",
"value": "In PowerShell, you can use the `Select-String` cmdlet, which is equivalent to the DOS `FINDSTR` command, to search through text fil... |
What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'?
The reason why I want to do this is becuase I want to modify the data within the bea... | To detach a specific JPA Entity Bean that you acquired through an `EntityManager`, you can use the `EntityManager.detach()` method. This method will remove the entity from the persistence context, meaning that any changes made to that entity will not be persisted to the database when you call `flush()` on the `EntityMa... | 4,520 | [
{
"from": "human",
"value": "What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'?\nThe reason why I want to do this is becuas... |
is it legal for a thread to call this.start() inside its own constructor? and if so what potential issues can this cause? I understand that the object wont have fully initialized until the constructor has run to completion but aside from this are there any other issues?
| Yes, it is legal for a thread to call `this.start()` inside its own constructor in Java. However, doing so can lead to several potential issues, primarily due to the fact that the object is not fully initialized when the `start()` method is called.
### Potential Issues
1. **Incomplete Initialization**: As you pointed... | 4,023 | [
{
"from": "human",
"value": "is it legal for a thread to call this.start() inside its own constructor? and if so what potential issues can this cause? I understand that the object wont have fully initialized until the constructor has run to completion but aside from this are there any other issues? \n"
}... |
I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me.
I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience.
Any good links besides Scott's Northwind traders sample?
| Certainly! Transitioning from Castle MonoRail to ASP.NET MVC can be smooth, especially since you already have experience with the MVC pattern. Here are some great resources and sample projects that can help you get started with ASP.NET MVC:
1. **ASP.NET MVC Official Documentation**:
- The [official ASP.NET document... | 4,463 | [
{
"from": "human",
"value": "I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. \nI understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. \nAny good links besides Scot... |
I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process:
Clicks button
Method checks for updates, count is returned.
If greater than 0, then ask the user if they want to install using MessageBox.Show().
If yes, it runs... | The issue you're experiencing stems from the fact that the `MessageBox` dialog box does not have enough time to be cleared from the UI before your update loop begins processing. The `BeginInvoke` method schedules the method to be executed on the UI thread but does not wait for it to complete. As a result, the processin... | 4,504 | [
{
"from": "human",
"value": "I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process:\n\nClicks button\nMethod checks for updates, count is returned.\nIf greater than 0, then ask the user if they want to ins... |
I've been trying to understand how Ruby blocks work, and to do that I've been trying to implement them in C.
One easy way to implement closures is to pass a void* to the enclosing stack to the closure/function but Ruby blocks also seem to handle returns and break statements from the scope that uses the block.
loop do
... | Implementing Ruby blocks or Java-like closures in C, especially considering their behavior with returns and breaks, is indeed a challenge but can be achieved with careful design. Ruby blocks are often thought of as "first-class" functions, and they can capture the lexical scope of where they are defined, allowing acces... | 1,672 | [
{
"from": "human",
"value": "I've been trying to understand how Ruby blocks work, and to do that I've been trying to implement them in C.\nOne easy way to implement closures is to pass a void* to the enclosing stack to the closure/function but Ruby blocks also seem to handle returns and break statements fro... |
I want to write an onClick event which submits a form several times, iterating through selected items in a multi-select field, submitting once for each.
How do I code the loop?
I'm working in Ruby on Rails and using remote_function() to generate the JavaScript for the ajax call.
| To achieve the functionality of submitting a form multiple times, each time with a different selected item from a multi-select field in Ruby on Rails, you'll want to use JavaScript to loop through the selected options and send an AJAX request for each one. Here's a step-by-step breakdown of how to implement this.
1. *... | 3,005 | [
{
"from": "human",
"value": "I want to write an onClick event which submits a form several times, iterating through selected items in a multi-select field, submitting once for each. \nHow do I code the loop?\nI'm working in Ruby on Rails and using remote_function() to generate the JavaScript for the ajax c... |
When using the app_offline.htm feature of ASP.NET, it only allows html, but no images. Is there a way to get images to display without having to point them to a different url on another site?
| When using the `app_offline.htm` feature in ASP.NET, you're correct that the file can only be a static HTML file, and it doesn't serve any other resources like images, CSS, or JavaScript from the same application. However, you can still include images in your `app_offline.htm` page by ensuring they are accessible from ... | 4,951 | [
{
"from": "human",
"value": "When using the app_offline.htm feature of ASP.NET, it only allows html, but no images. Is there a way to get images to display without having to point them to a different url on another site?\n"
},
{
"from": "gpt",
"value": "When using the `app_offline.htm` feature ... |
Is there a free or open source library to read Excel files (.xls) directly from a C# program?
It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to elim... | Yes, there are several free or open-source libraries available that allow you to read Excel files (.xls) directly from a C# program. One of the most popular and lightweight libraries for reading Excel files is **NPOI**.
### NPOI
NPOI is a .NET library that can read and write Microsoft Office formats, including .xls ... | 5,089 | [
{
"from": "human",
"value": "Is there a free or open source library to read Excel files (.xls) directly from a C# program? \nIt does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting ... |
Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding content:
Development team adding code.
Business team adding simple web pages.
For sanity and organization, we would like for the business team to add their web pages to a sub-folder in the project:
Root: for pages of development team
Conten... | Yes, you can accomplish the desired URL behavior using ISAPI Rewrite rules. ISAPI Rewrite is a powerful tool that allows you to create rules for URL rewriting based on patterns, making it possible to manipulate requests before they reach your application.
Here’s how you can set this up to achieve the desired URL struc... | 4,037 | [
{
"from": "human",
"value": "Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding content: \n\nDevelopment team adding code. \nBusiness team adding simple web pages. \n\nFor sanity and organization, we would like for the business team to add their web pages to a sub-folder in the project: ... |
I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be?
The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by a colleague).
Using Visual Studio 2005 on ... | When you're experiencing issues with your DLL not being recognized by your application as a COM object, despite it being marked for COM registration, it indicates that there might be some problems with the registration process. Here are several potential causes and solutions to consider:
### 1. Registration Issues
- ... | 4,208 | [
{
"from": "human",
"value": "I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be?\nThe COM registration does not work on Vista (confirmed myself) and on XP (confirmed by ... |
Typically in a large network a computer needs to operate behind an authenticated proxy - any connections to the outside world require a username/password which is often the password a user uses to log into email, workstation etc.
This means having to put the network password in the apt.conf file as well as typically th... | In environments where you need to use authenticated proxies, especially when dealing with sensitive information like usernames and passwords, it can be challenging to keep those credentials secure, particularly when other users may have access to the same configuration files. Here are some potential approaches to obscu... | 2,031 | [
{
"from": "human",
"value": "Typically in a large network a computer needs to operate behind an authenticated proxy - any connections to the outside world require a username/password which is often the password a user uses to log into email, workstation etc.\nThis means having to put the network password in... |
Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method.
I would like to modify the following LINQ to SQL query:
using (NorthwindContext northwind = new NorthwindCo... | To achieve the SQL customization you're looking for while using LINQ to SQL, you would typically need to extend the LINQ to SQL framework as you suggested. Unfortunately, the framework does not provide built-in extensibility methods for modifying SQL behavior like specifying table hints directly in the query syntax.
H... | 2,137 | [
{
"from": "human",
"value": "Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method.\nI would like to modify the following LINQ to SQL query:\nusing (N... |
Here is the scenario:
I'm writing an app that will watch for any changes in a specific directory. This directory will be flooded with thousands of files a minute each with an "almost" unique GUID. The file format is this:
GUID.dat where GUID == xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(the internal contents aren't relevant, but ... | The scenario you're dealing with—watching a directory for rapid file changes and ensuring unique GUIDs for incoming files—presents a few challenges, especially when working with the .NET `FileSystemWatcher` class. The issues with buffer overflow and ensuring GUID uniqueness can be approached with a combination of strat... | 2,289 | [
{
"from": "human",
"value": "Here is the scenario:\nI'm writing an app that will watch for any changes in a specific directory. This directory will be flooded with thousands of files a minute each with an \"almost\" unique GUID. The file format is this:\nGUID.dat where GUID == xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ... |
When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:
PCC-S-02014, Encountered the symbol "warning" when expecting one of the following: (bla bla bla).
Can I somehow convince Pro*C to ignore the thing if it doesn't know what to do with it? I can't remove the #warning d... | The error you're encountering indicates that Pro*C does not recognize the `#warning` directive in your precompilation context. The `#warning` directive is specific to C and is not a standard preprocessor directive that Pro*C expects or understands.
Here are some possible workarounds to resolve the issue:
1. **Use `#... | 5,291 | [
{
"from": "human",
"value": "When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:\n\nPCC-S-02014, Encountered the symbol \"warning\" when expecting one of the following: (bla bla bla).\n\nCan I somehow convince Pro*C to ignore the thing if it doesn't know wh... |
I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer:
1) ORM (if so, which one?)
2) Linq2Sql
3) Stored Procedures
4) Parametrized Queries
I really need a solution that... | Given your requirements and the current state of the database, let's evaluate each option considering the need for a dynamic solution capable of frequent changes:
### 1. **ORM (Object-Relational Mapping)**
Using an ORM can help simplify data access and reduce the amount of boilerplate code you have to write. It abstra... | 2,980 | [
{
"from": "human",
"value": "I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer:\n1) ORM (if so, which one?)\n2) Linq2Sql\n3) Stored Procedures\n4) Param... |
Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line?
| Flushing the disk write cache data directly from the command line in Windows is not a straightforward process, as it typically involves low-level disk management functions that are not exposed through standard command line tools. However, you can use a couple of methods to ensure that any cached writes are flushed to d... | 5,044 | [
{
"from": "human",
"value": "Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line?\n"
},
{
"from": "gpt",
"value": "Flushing the disk write cache data directly from ... |
The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are however very scared of c-compiler bugs (f... | Upgrading from GCC 3.4.6 to a newer version, especially GCC 4.x, can provide significant benefits in terms of performance, optimizations, and support for newer C standards. However, it's wise to be cautious about potential compiler bugs and compatibility issues.
GCC 4.3.2 is generally considered a stable release, and ... | 3,652 | [
{
"from": "human",
"value": "The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are ... |
There are several ways to iterate over a result set. What are the tradeoff of each?
| Iterating over a result set can be done in various ways, each with its own trade-offs in terms of performance, memory usage, simplicity, and use case suitability. Below are some common methods to iterate over a result set along with their trade-offs:
1. **Simple Looping (e.g., `for` loop):**
- **Pros:**
- Easy... | 2,746 | [
{
"from": "human",
"value": "There are several ways to iterate over a result set. What are the tradeoff of each?\n"
},
{
"from": "gpt",
"value": "Iterating over a result set can be done in various ways, each with its own trade-offs in terms of performance, memory usage, simplicity, and use case ... |
The reason I ask is that Stack Overflow has been Slashdotted, and Redditted.
First, what kinds of effect does this have on the servers that power a website? Second, what can be done by system administrators to ensure that their sites remain up and running as best as possible?
| When a website like Stack Overflow experiences high traffic from being "Slashdotted" (linked from Slashdot) or "Redditted" (linked from Reddit), it can lead to a surge in visitors that exceeds the normal capacity of the site's servers. Here are some effects this can have, as well as strategies that system administrator... | 3,525 | [
{
"from": "human",
"value": "The reason I ask is that Stack Overflow has been Slashdotted, and Redditted.\nFirst, what kinds of effect does this have on the servers that power a website? Second, what can be done by system administrators to ensure that their sites remain up and running as best as possible?\n... |
I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window tit... | To access the colors used by the MFC Feature Pack at runtime, especially when you are using the Office 2007 styles, you can utilize the `CMFCVisualManager` class to get the color values. This class provides various static member functions to retrieve colors used in the visual styles, including the toolbar colors.
Here... | 4,376 | [
{
"from": "human",
"value": "I'm updating some of our legacy C++ code to use the \"MFC feature pack\" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearanc... |
When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too?
So is:
With (NoLock, ReadUnCommitted)
the same as:
With (ReadUnCommitted)
| In SQL Server, the `READUNCOMMITTED` isolation level and the `NOLOCK` table hint are effectively equivalent in that they both allow for reading uncommitted data, meaning that they do not place shared locks and allow dirty reads.
When you specify `WITH (NOLOCK)` for a table in your query, it tells SQL Server to use th... | 4,080 | [
{
"from": "human",
"value": "When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too?\nSo is:\nWith (NoLock, ReadUnCommitted)\n\nthe same as:\nWith (ReadUnCommitted)\n\n"
},
{
"from": "gpt",
"value": "In SQL Server... |
If you declare variables of type byte or short and attempt to perform arithmetic operations on these, you receive the error "Type mismatch: cannot convert int to short" (or correspondingly "Type mismatch: cannot convert int to byte").
byte a = 23;
byte b = 34;
byte c = a + b;
In this example, the compile error is on ... | In languages like Java, when you perform arithmetic operations (like addition) on byte or short variables, the result is automatically promoted to an `int`. This is because arithmetic operations in Java are designed to prevent overflow and ensure that the result can fit into a larger data type.
In your example:
```ja... | 6,462 | [
{
"from": "human",
"value": "If you declare variables of type byte or short and attempt to perform arithmetic operations on these, you receive the error \"Type mismatch: cannot convert int to short\" (or correspondingly \"Type mismatch: cannot convert int to byte\"). \nbyte a = 23;\nbyte b = 34;\nbyte c = a... |
Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself.
| Certainly! However, I need a bit more context about what specific assignment or concept you are referring to for the C# method. Common topics include:
- Variable assignments
- Object assignments
- Delegates or events
- LINQ assignments
- Asynchronous programming
Please specify the particular topic or assignment you a... | 8,369 | [
{
"from": "human",
"value": "Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself. \n"
},
{
"from": "gpt",
"value": "Certainly! However, I need a bit more context about what specific... |
I have a web site in asp.net that uses a master page. In this master page I have a multiview control with one view that has all the content for the content pages and one view that has some local content to the master page where I show error messages from all content pages.
In this error view I have a asp.net Label cont... | The issue of the Label control in your master page being `null` during the `Page_Load` event of your content pages can occur for a few reasons. Here are some potential explanations and troubleshooting steps:
1. **Lifecycle of ASP.NET Web Forms**:
- The ASP.NET page lifecycle is complex, and controls are only availa... | 1,738 | [
{
"from": "human",
"value": "I have a web site in asp.net that uses a master page. In this master page I have a multiview control with one view that has all the content for the content pages and one view that has some local content to the master page where I show error messages from all content pages.\nIn t... |
What types of applications have you used model checking for?
What model checking tool did you use?
How would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering higher quality software?
In the course of my studies, I had a chance to use Spin, and it aroused my c... | Model checking is a formal verification technique that systematically checks whether a model of a system meets a given specification, typically expressed in temporal logic. It has been used in various domains, including:
1. **Hardware Design**: Verifying digital circuits and hardware protocols, ensuring that they beha... | 3,756 | [
{
"from": "human",
"value": "\nWhat types of applications have you used model checking for?\nWhat model checking tool did you use?\nHow would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering higher quality software? \n\nIn the course of my studies, I... |
I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop:
var iWeeks = 6;
for (int w = 0; w < iWeeks; w++) {
This works fine, however, some month will only have 5 weeks and in some rare cases, 4.
How can I calculate the number of rows that will be re... | To calculate the number of rows (weeks) required to display a month in a calendar, you can follow these steps:
1. **Determine the first day of the month** to know which day of the week it falls on (Sunday to Saturday).
2. **Determine the total number of days in the month**.
3. **Calculate the last day of the month** a... | 3,668 | [
{
"from": "human",
"value": "I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop:\nvar iWeeks = 6;\nfor (int w = 0; w < iWeeks; w++) {\n\nThis works fine, however, some month will only have 5 weeks and in some rare cases, 4.\nHow can ... |
X Windows has special processes called Window Managers that manage the layout of windows and decorations like their title bar, control buttons etc. Such processes use an X Windows API to detect events related to windows sizes and positions.
Are there any consistent ways for writing such processes for Microsoft Windows ... | Writing a window manager-like application for Microsoft Windows or macOS that manages window decorations, layout, and events can be done using public APIs. However, it's essential to note that these operating systems have more restrictions than X Windows, and "true" window managers as seen in X Windows are not availabl... | 3,630 | [
{
"from": "human",
"value": "X Windows has special processes called Window Managers that manage the layout of windows and decorations like their title bar, control buttons etc. Such processes use an X Windows API to detect events related to windows sizes and positions.\nAre there any consistent ways for wri... |
I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access.
Where is this information displayed?
| In Team Foundation Server (TFS), the HelpText field in custom work items is designed to provide users with guidance on how to fill out the fields of that work item type. However, it is important to note that the HelpText is not always prominently displayed in the user interface.
Here's where you might expect to see He... | 4,531 | [
{
"from": "human",
"value": "I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. \nWhere is this information displayed?\n"
},
{
"from": "gpt",
"value": "In Team Foundation Server (T... |
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
| You can use the `arp` command to retrieve the MAC address associated with an IP address on your local network, and you can run that command from within a Python script. The `arp` command displays the ARP table, which contains mappings of IP addresses to MAC addresses.
Here’s a basic outline of how you can do this in P... | 5,042 | [
{
"from": "human",
"value": "I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?\n"
},
{
"from": "gpt",
"value": "You can u... |
I'm using TinyMCE in an ASP.Net project, and I need a spell check. The only TinyMCE plugins I've found use PHP on the server side, and I guess I could just break down and install PHP on my server and do that, but quite frankly, what a pain. I don't want to do that.
As it turns out, Firefox's built-in spell check will w... | If you’re looking for a rich-text editor that integrates smoothly with built-in browser spell checking without requiring server-side scripting or additional plugins, consider the following options:
1. **Quill**: Quill is a powerful rich text editor that supports built-in browser spell checking. It’s easy to implement ... | 3,814 | [
{
"from": "human",
"value": "I'm using TinyMCE in an ASP.Net project, and I need a spell check. The only TinyMCE plugins I've found use PHP on the server side, and I guess I could just break down and install PHP on my server and do that, but quite frankly, what a pain. I don't want to do that.\nAs it turns ... |
How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend?
I'm specifically thinking here of a case where you have a fairly data-intensive program and will be doing a data refresh or update at least ... | When comparing the performance overhead of using C# with LINQ versus custom optimized queries in low-level C, especially with a SQL Server 2008 backend, several factors must be considered. Here's a breakdown of the key points regarding performance, overhead, and general considerations:
### 1. Abstraction Level
- **C# ... | 1,368 | [
{
"from": "human",
"value": "How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend?\nI'm specifically thinking here of a case where you have a fairly data-intensive program and will b... |
For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block.
What do you use?
Why?
System.Web.Caching
Is this safe to use outside of web apps? I've seen mixed information, but I think... | When considering caching for a .NET component that will be used in both web applications and rich client applications, the choice between `System.Web.Caching` and the Enterprise Library Caching Application Block is indeed significant. Let's analyze the two options in detail:
### System.Web.Caching
#### Pros:
1. **Bui... | 2,543 | [
{
"from": "human",
"value": "For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block.\n\nWhat do you use?\nWhy?\n\nSystem.Web.Caching\nIs this safe to use outside of web ... |
I'm using FBOs in my OpenGL code and I'm seeing compilation errors on GL\_FRAMEBUFFER\_INCOMPLETE\_DUPLICATE\_ATTACHMENT\_EXT. What's the cause of this and how do I fix it?
| The error `GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT` indicates that you have attached the same image (texture or renderbuffer) to multiple attachments of your framebuffer object (FBO). This error typically occurs during the framebuffer completeness check after you call `glCheckFramebufferStatus`.
### Causes:... | 2,208 | [
{
"from": "human",
"value": "I'm using FBOs in my OpenGL code and I'm seeing compilation errors on GL\\_FRAMEBUFFER\\_INCOMPLETE\\_DUPLICATE\\_ATTACHMENT\\_EXT. What's the cause of this and how do I fix it?\n"
},
{
"from": "gpt",
"value": "The error `GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMEN... |
I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.
| In Visual Studio, the concept of a "workspace" in Eclipse is typically represented by a "solution." A solution can contain one or more projects and is essentially the container for your development work.
To set the default location for your solutions or projects in Visual Studio, you can change the settings so that wh... | 4,930 | [
{
"from": "human",
"value": "I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.\n"
},
{
"from": "gpt",
"value":... |
How do I find the 'temp' directory in Linux? I am writing a platform neutral C++ function that returns the temp directory. In Mac and Windows, there is an API that returns these results. In Linux, I'm stumped.
| In Linux, the location of the temporary directory can typically be found in a couple of standard locations, but there isn't a single, universally accepted method like in Windows or macOS. Here are some common approaches you can use to find the temporary directory in Linux:
1. **Use Environment Variables**:
The most... | 3,170 | [
{
"from": "human",
"value": "How do I find the 'temp' directory in Linux? I am writing a platform neutral C++ function that returns the temp directory. In Mac and Windows, there is an API that returns these results. In Linux, I'm stumped.\n\n"
},
{
"from": "gp... |
I wonder if anyone uses commercial/free java obfuscators on his own commercial product. I know only about one project that actually had an obfuscating step in the ant build step for releases.
Do you obfuscate? And if so, why do you obfuscate?
Is it really a way to protect the code or is it just a better feeling for the... | Obfuscation is a common practice among developers and companies that want to protect their intellectual property (IP) and prevent reverse engineering of their code. While not foolproof, obfuscation can serve as an additional layer of protection for sensitive algorithms, proprietary logic, and business rules embedded in... | 3,492 | [
{
"from": "human",
"value": "I wonder if anyone uses commercial/free java obfuscators on his own commercial product. I know only about one project that actually had an obfuscating step in the ant build step for releases.\nDo you obfuscate? And if so, why do you obfuscate?\nIs it really a way to protect the ... |
I know that just using rand() is predictable, if you know what you're doing, and have access to the server.
I have a project that is highly dependent upon choosing a random number that is as unpredictable as possible. So I'm looking for suggestions, either other built-in functions or user functions, that can generate a... | If you are looking for a better way to generate random numbers in your project, especially to avoid predictability associated with the `rand()` function, you have a few options, especially in PHP. Here are some suggestions:
### 1. Use `random_int()`
PHP 7 introduced the `random_int()` function, which is cryptographic... | 3,430 | [
{
"from": "human",
"value": "I know that just using rand() is predictable, if you know what you're doing, and have access to the server.\nI have a project that is highly dependent upon choosing a random number that is as unpredictable as possible. So I'm looking for suggestions, either other built-in functi... |
I want to have a "select-only" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control.
My initial googling of this turned up an overly complex, misguided suggestion to capture the KeyPress event.
| To create a "select-only" ComboBox in a Windows Forms application where typing is disabled and the user can only select from the dropdown list, you can set the `DropDownStyle` property of the ComboBox to `ComboBoxStyle.DropDownList`. This approach is straightforward and effectively prevents users from typing anything i... | 5,086 | [
{
"from": "human",
"value": "I want to have a \"select-only\" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control.\nMy initial googling of this turned up an overly complex, misguided suggestion to capture the KeyPress even... |
Compare
String.Format("Hello {0}", "World");
with
"Hello {0}".Format("World");
Why did the .Net designers choose a static method over an instance method? What do you think?
| The two expressions you've provided represent different ways of formatting strings in C#. The first one uses the `String.Format` method, which is a static method, while the second one implies an instance method on a string object (though it should be noted that `Format` is not a built-in instance method in C#).
### Co... | 3,075 | [
{
"from": "human",
"value": "Compare\nString.Format(\"Hello {0}\", \"World\");\n\nwith\n\"Hello {0}\".Format(\"World\");\n\nWhy did the .Net designers choose a static method over an instance method? What do you think?\n"
},
{
"from": "gpt",
"value": "The two expressions you've provided represent... |
So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the "best" way to get line by line remote debugging of server side web app code. I'd like to be able to set ... | Remote debugging in Visual Studio, especially with classic ASP and ISAPI Extensions, can be a bit challenging due to the differences in technology and the limitations of older versions like VS2008. However, here's a structured approach to help you achieve line-by-line debugging:
### 1. Debugging ASP.NET Code
For ASP.... | 753 | [
{
"from": "human",
"value": "So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the \"best\" way to get line by line remote debugging of server side... |
I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData. The field in the database is a TEXT field. My function is crafted based on MS's example here:
http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx.
I've setup the environment, made the connection, and prepared my statement succes... | When using `SQLBindParameter` for a TEXT field with the intention of using `SQLPutData`, you need to set the parameters correctly. The error you are encountering, "Invalid precision value," is often related to how the parameter types and sizes are defined during binding.
Here’s how to properly bind a parameter for a T... | 3,923 | [
{
"from": "human",
"value": "I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData. The field in the database is a TEXT field. My function is crafted based on MS's example here:\nhttp://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx.\nI've setup the environment, made the c... |
I've got a project using Maven 2 as the build tool. Now I am using Netbeans 6 as my IDE and really want to be able to use the profiler. Is there any way I can get this to work?
| Using NetBeans 6 with Maven 2 can be a bit tricky since integration support for Maven projects might not be as robust as with later versions of NetBeans. However, you can still utilize the profiler for your Maven project by following these steps:
### Steps to Configure Maven 2 with NetBeans 6 Profiler
1. **Open Your ... | 3,058 | [
{
"from": "human",
"value": "I've got a project using Maven 2 as the build tool. Now I am using Netbeans 6 as my IDE and really want to be able to use the profiler. Is there any way I can get this to work?\n"
},
{
"from": "gpt",
"value": "Using NetBeans 6 with Maven 2 can be a bit tricky sinc... |
I have a control that is modelled on a ComboBox. I want to render the control so that the control border looks like that of a standard Windows ComboBox. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when the control is disabled.
Just to be clea... | To achieve proper rendering for a disabled ComboBox control that matches the standard Windows appearance, you need to use the `VisualStyleRenderer` class effectively. While you've noted that the `VisualStyleElement.TextBox` is used for the text part of your ComboBox, you're right in observing that the border rendering ... | 2,522 | [
{
"from": "human",
"value": "I have a control that is modelled on a ComboBox. I want to render the control so that the control border looks like that of a standard Windows ComboBox. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when... |
I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable
One caveat is that we "may" migrate from a .NET platform to linux "soon"... | Converting performance-critical applications from VB.NET to C# and adopting the MVP pattern is a solid approach, especially if you're looking to improve maintainability and testability. Your idea of handling computationally expensive tasks in native C/C++ is also reasonable. Here are some insights to your questions:
#... | 3,961 | [
{
"from": "human",
"value": "I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable\nOne caveat is that we \"may\" ... |
Does there exist a website service or set of scripts that will tell you whether your web page badly configured if your goal is to be internationally friendly?
To be more precise, I'm wondering if something like this exists:
Checking URL: http://www.example.com
GET / HTTP/1.0
Accept-Charset: utf8
...
HTTP/1.0 200 OK
Ch... | Yes, there are several tools and services that can help you evaluate the internationalization (i18n) and localization (l10n) readiness of your web page. These tools can check for issues related to character encoding, language support, and other aspects that can affect the accessibility and usability of your site for us... | 5,459 | [
{
"from": "human",
"value": "Does there exist a website service or set of scripts that will tell you whether your web page badly configured if your goal is to be internationally friendly?\nTo be more precise, I'm wondering if something like this exists:\nChecking URL: http://www.example.com\nGET / HTTP/1.0\... |
I have got the following situation. On a machine there is a Fritz ISDN card. There is a process that is responsible for playing a certain wave file on this device's wave out (ISDN connection is made at startup and made persistent). The scenario is easy, whenever needed the process calls waveOutWrite() on the previously... | The issue you’re experiencing with the `MM_WOM_DONE` message being sent immediately after calling `waveOutWrite()`—despite the audio file being longer than zero length—could stem from a variety of factors, both related to the software and the hardware involved. Here are some possibilities to consider and investigate:
... | 2,322 | [
{
"from": "human",
"value": "I have got the following situation. On a machine there is a Fritz ISDN card. There is a process that is responsible for playing a certain wave file on this device's wave out (ISDN connection is made at startup and made persistent). The scenario is easy, whenever needed the proce... |
Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality.
I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to start.
| The average download speed for users can vary significantly based on geographical location, the type of internet connection, and the time of day. However, as of late 2023, a rough estimate for average download speeds in various regions might look something like this:
- **United States**: Approximately 150 to 200 Mbps
... | 5,688 | [
{
"from": "human",
"value": "Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality.\nI know i might be comparing apples with oranges but I'm just looking for something to get a basis fo... |
I have two arrays of System.Data.DataRow objects which I want to compare.
The rows have two columns A and B. Column A is a key and I want to find out which rows have had their B column changed and which rows have been added or deleted.
How do I do this in PowerShell?
| You can use PowerShell to compare two arrays of `System.Data.DataRow` objects by creating a hash table to track the changes based on column A (the key). Here's how you can achieve this:
1. **Create a hash table for each array of DataRow objects, using Column A as the key.**
2. **Compare the hash tables to identify add... | 3,208 | [
{
"from": "human",
"value": "I have two arrays of System.Data.DataRow objects which I want to compare. \nThe rows have two columns A and B. Column A is a key and I want to find out which rows have had their B column changed and which rows have been added or deleted. \nHow do I do this in PowerShell?\n"
},... |
Is there a function in python to split a word into a list of single letters? e.g:
s = "Word to Split"
to get
wordlist = ['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l', 'i', 't']
| Yes, you can easily split a string into a list of its individual characters in Python using the `list()` function. Here’s how you can do it with your example:
```python
s = "Word to Split"
wordlist = list(s)
print(wordlist)
```
This will output:
```
['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l', 'i', 't']
`... | 7,656 | [
{
"from": "human",
"value": "Is there a function in python to split a word into a list of single letters? e.g:\ns = \"Word to Split\"\n\nto get\nwordlist = ['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l', 'i', 't']\n\n"
},
{
"from": "gpt",
"value": "Yes, you can easily split a string into... |
I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?
| To use OpenGL in your wxWidgets application, you'll need to create an OpenGL context within a wxWidgets window. wxWidgets provides a class called `wxGLCanvas` that simplifies working with OpenGL. Here’s how you can enable and use OpenGL in your wxWidgets application:
### Steps to Enable OpenGL in wxWidgets:
1. **Incl... | 1,686 | [
{
"from": "human",
"value": "I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?\n"
},
{
"from": "gpt",
"value": "To use OpenGL in your wxWidgets applic... |
I am using a rich text editor on a web page. .NET has feature that prevent one from posting HTML tags, so I added a JavaScript snippet to change the angle brackets to and alias pair of characters before the post. The alias is replaced on the server with the necessary angle bracket and then stored in the database. Wit... | Certainly! Your approach to handling HTML tags in a rich text editor by converting angle brackets to alias pairs before submission is a common workaround, but there are indeed better and more robust ways to handle this situation, especially in the context of modern web development. Here are some alternatives and best p... | 3,240 | [
{
"from": "human",
"value": "I am using a rich text editor on a web page. .NET has feature that prevent one from posting HTML tags, so I added a JavaScript snippet to change the angle brackets to and alias pair of characters before the post. The alias is replaced on the server with the necessary angle brac... |
Does anyone have the secret formula to resizing transparent images (mainly GIFs) without ANY quality loss - what so ever?
I've tried a bunch of stuff, the closest I get is not good enough.
Take a look at my main image:
http://www.thewallcompany.dk/test/main.gif
And then the scaled image:
http://www.thewallcompany.dk/te... | Resizing transparent images, particularly GIFs, without quality loss can be challenging due to the nature of indexed colors and the limitations of the GIF format. However, there are techniques to improve the quality of your resized images. Here are some ideas that you can implement in your resizing process:
### 1. Use... | 1,388 | [
{
"from": "human",
"value": "Does anyone have the secret formula to resizing transparent images (mainly GIFs) without ANY quality loss - what so ever?\nI've tried a bunch of stuff, the closest I get is not good enough.\nTake a look at my main image:\nhttp://www.thewallcompany.dk/test/main.gif\nAnd then the ... |
We have a SQL Server 2005 SP2 machine running a large number of databases, all of which contain full-text catalogs. Whenever we try to drop one of these databases or rebuild a full-text index, the drop or rebuild process hangs indefinitely with a MSSEARCH wait type. The process can’t be killed, and a server reboot is r... | The issue you’re experiencing with SQL Server 2005 SP2 where the drop or rebuild process hangs with a `MSSEARCH` wait type may indeed relate to improperly removed full-text catalogs. Here are steps you can take to identify problematic full-text catalogs without having to remove all of them:
### Step 1: Re-enable Full-... | 2,819 | [
{
"from": "human",
"value": "We have a SQL Server 2005 SP2 machine running a large number of databases, all of which contain full-text catalogs. Whenever we try to drop one of these databases or rebuild a full-text index, the drop or rebuild process hangs indefinitely with a MSSEARCH wait type. The process ... |
What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site?
Thanks!
| The browser tag for iPhone typically contains the identifier “iPhone” in the User-Agent string. This allows websites to detect when they are being accessed by an iPhone and potentially adjust their content or layout accordingly.
For example, a User-Agent string for an iPhone might look something like this:
```
Mozill... | 3,705 | [
{
"from": "human",
"value": "What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site?\nThanks!\n"
},
{
"from": "gpt",
"value": "The browser tag for iPhone typically contains the identifier “iPhone” in the User-Agent string. This allows websites to... |
I recently installed Ubuntu on a VirtualBox VM it installed just fine (much easier than on VirtualPC). However I'm unable to get internet access from the guest OS (ie. Ubuntu). Can anyone give me any pointers on how I might enable this?
The Host OS is Windows Vista and the hardware is an IBM Lenovo.
| To enable internet access on your Ubuntu guest OS running in VirtualBox on a Windows Vista host, you need to properly configure the network settings for your virtual machine. Here are the steps you can follow:
### Step 1: Check VirtualBox Network Settings
1. **Shut down the Ubuntu VM** if it's running.
2. Open **Virt... | 4,566 | [
{
"from": "human",
"value": "I recently installed Ubuntu on a VirtualBox VM it installed just fine (much easier than on VirtualPC). However I'm unable to get internet access from the guest OS (ie. Ubuntu). Can anyone give me any pointers on how I might enable this?\nThe Host OS is Windows Vista and the ha... |
What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. I w... | Managing database schema changes efficiently across multiple environments and projects is a common challenge, especially in a team setting. Here are some of the best practices and tools to track and automate database schema changes, while integrating them with Subversion (SVN) and ensuring compatibility with your LAMP ... | 407 | [
{
"from": "human",
"value": "What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're st... |
I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.
? => causes the variable not to be found in th... | The issues you're encountering when using special characters in your Rails application stem from how data is processed and encoded before being sent in an HTTP request. Here’s a breakdown of how to address each issue:
### 1. Handling Special Characters
To correctly pass special characters in your parameters, you need ... | 4,202 | [
{
"from": "human",
"value": "I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.\n\n? =... |
I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?
Edit: If you are interested there is a follow up ... | Linking to a single solution-wide `AssemblyInfo.cs` file can help you maintain consistent assembly-level attributes across multiple projects in your solution. Here are some best practices for implementing this and guidelines on which attributes should be in the shared file versus project-specific files:
### Best Pract... | 3,503 | [
{
"from": "human",
"value": "I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?\n\nEdit: ... |
I have a tree encoded in a MySQL database as edges:
CREATE TABLE items (
num INT,
tot INT,
PRIMARY KEY (num)
);
CREATE TABLE tree (
orig INT,
term INT
FOREIGN KEY (orig,term) REFERENCES items (num,num)
)
For each leaf in the tree, items.tot is set by someone. For interior nodes, items.t... | You're tackling a fascinating problem with tree structures in a relational database! Maintaining an aggregated value like `tot` in a tree where both leaves and internal nodes can change adds complexity, especially with the limitations and behaviors of SQL and triggers.
### Possible Approaches
1. **Event Sourcing with... | 2,703 | [
{
"from": "human",
"value": "I have a tree encoded in a MySQL database as edges:\nCREATE TABLE items (\n num INT,\n tot INT,\n PRIMARY KEY (num)\n );\nCREATE TABLE tree (\n orig INT,\n term INT\n FOREIGN KEY (orig,term) REFERENCES items (num,num)\n )\n\nFor each leaf in the tree, ite... |
I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.
I have:
marked the Register for COM interop option in the project properties,
changed the ComVisible setting in the AssemblyInfo.cs file,
added these lines to the ISS script:
[Files]
Source: c:\temp\1\MyDLL.dll; Flags: dontcopy
[Code... | When working with Inno Setup to call functions from a .NET DLL, there are several important considerations to take into account, especially when the DLL is a .NET assembly designed for COM interop. Here are some steps and checks that might help you resolve the issue:
### Steps to Resolve the Issue
1. **Ensure the DLL... | 2,141 | [
{
"from": "human",
"value": "I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.\nI have:\n\nmarked the Register for COM interop option in the project properties,\n\nchanged the ComVisible setting in the AssemblyInfo.cs file,\n\nadded these lines to the ISS script:\n[Files]\nS... |
When opening Adobe Acrobat Pro, whether it be through Applescript or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the "Don't Show Again" option when opening a document using Applescript?
Photoshop and Illustrator Applescript libraries have ways of se... | As of my last knowledge update in October 2023, Adobe Acrobat does not provide a direct way to suppress the introductory dialog through AppleScript or through its application settings, apart from the manual "Don't Show Again" option. Unfortunately, there isn't an exposed scripting method like those found in Adobe Photo... | 5,005 | [
{
"from": "human",
"value": "When opening Adobe Acrobat Pro, whether it be through Applescript or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the \"Don't Show Again\" option when opening a document using Applescript? \nPhotoshop and Illus... |
Our application is interfacing with a lot of web services these days. We have our own package that someone wrote a few years back using UTL_HTTP and it generally works, but needs some hard-coding of the SOAP envelope to work with certain systems. I would like to make it more generic, but lack experience to know how man... | UTL_DBWS is a PL/SQL package introduced in Oracle Database 10g to support web services, primarily for working with SOAP-based web services in a more structured and less error-prone way than manually constructing HTTP requests with UTL_HTTP.
### Stability and Flexibility:
1. **Stability**: UTL_DBWS is generally conside... | 2,027 | [
{
"from": "human",
"value": "Our application is interfacing with a lot of web services these days. We have our own package that someone wrote a few years back using UTL_HTTP and it generally works, but needs some hard-coding of the SOAP envelope to work with certain systems. I would like to make it more gen... |
I'm trying to use NIS for authentication on a st of machines. I had to change one of the user ID numbers for a user account on the NIS server (I changed the userid for username from 500 to 509 to avoid a conflict with a local user account with id 500 on the clients). The problem is that it has not updated properly on t... | It seems like you've encountered an issue with the NIS client not properly updating the cached information for the user ID after you modified it on the NIS server. The fact that `ypcat` shows the updated information while `ypmatch` does not suggests that the client is not recognizing the latest changes in the NIS maps.... | 4,776 | [
{
"from": "human",
"value": "I'm trying to use NIS for authentication on a st of machines. I had to change one of the user ID numbers for a user account on the NIS server (I changed the userid for username from 500 to 509 to avoid a conflict with a local user account with id 500 on the clients). The problem... |
Does emacs have something like vi's “set number”, so that each line starts with its line number?
| Yes, Emacs can display line numbers similar to how `vi` does with the `set number` command. In Emacs, you can enable line numbering globally or for individual buffers.
To enable line numbers globally, you can add the following line to your Emacs configuration file (usually `.emacs` or `init.el`):
```elisp
(global-dis... | 6,392 | [
{
"from": "human",
"value": "Does emacs have something like vi's “set number”, so that each line starts with its line number?\n"
},
{
"from": "gpt",
"value": "Yes, Emacs can display line numbers similar to how `vi` does with the `set number` command. In Emacs, you can enable line numbering globa... |
I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant.
I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the MS Access help system is using some sort of... | It sounds like the file associations for XML files have been altered, causing the Access help system to open XML content with XML Notepad instead of rendering it properly. You can try the following steps to fix this issue:
### Step 1: Restore Default File Associations
1. **Change the File Association:**
- Right-cl... | 3,789 | [
{
"from": "human",
"value": "I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant.\nI have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the M... |
For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G.
| To find tables that have foreign keys pointing to a given table (in this case, the table `foo`) in Oracle 10g, you can query the `USER_CONSTRAINTS` and `USER_CONS_COLUMNS` views. Here's a query that will provide the list of tables with foreign keys referencing the `foo` table:
```sql
SELECT
a.table_name AS referen... | 3,828 | [
{
"from": "human",
"value": "For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G.\n"
},
{
"from": "gpt",
"value": "To find tables that have foreign keys pointing to a given table (in this case, the table `foo`) in Or... |
I have a Flex ComboBox that gets populated by a dataprovider all is well...
I would now like to add a default " -- select a item --" option at the 0 index, how can I do this and still use a dataprovider? I have not seen any examples of such, but I can't imagine this being hard...
| You can add a default " -- select an item --" option to a Flex ComboBox while still using a data provider by using a combination of an Array (or ArrayCollection) and modifying the data provider to include your default item.
Here's a simple way to do that:
1. Create an Array or ArrayCollection to hold your items, and ... | 3,520 | [
{
"from": "human",
"value": "I have a Flex ComboBox that gets populated by a dataprovider all is well...\nI would now like to add a default \" -- select a item --\" option at the 0 index, how can I do this and still use a dataprovider? I have not seen any examples of such, but I can't imagine this being har... |
I have a string coming from a table like "can no pay{1},as your payment{2}due on {3}". I want to replace {1} with some value , {2} with some value and {3} with some value .
Is it Possible to replace all 3 in one replace function ? or is there any way I can directly write query and get replaced value ? I want to repla... | In Oracle, you cannot directly replace multiple placeholders in a string in one `REPLACE` function call. However, you can achieve the desired outcome by chaining multiple `REPLACE` functions together or using a more advanced string manipulation technique such as `REGEXP_REPLACE` if you prefer a more flexible solution.
... | 3,810 | [
{
"from": "human",
"value": "I have a string coming from a table like \"can no pay{1},as your payment{2}due on {3}\". I want to replace {1} with some value , {2} with some value and {3} with some value .\nIs it Possible to replace all 3 in one replace function ? or is there any way I can directly write quer... |
I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?
| To accomplish the task of firing a button event from a component (such as a user control) bound to a repeater and communicating back to the main application which file should be played, you can use events and delegates in your application. Below is a step-by-step guide on how to set this up.
### Step 1: Define the Eve... | 3,739 | [
{
"from": "human",
"value": "I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?\n"
},
{
"from": "gpt",
... |
What is the reason for the following warning in some C++ compilers?
No newline at end of file
Why should I have an empty line at the end of a source/header file?
| The warning "No newline at end of file" is issued by some C++ compilers and tools to inform the developer that the last line of the source or header file does not end with a newline character (`\n`). While this may seem trivial, there are several reasons why it is often recommended to include a newline at the end of fi... | 6,426 | [
{
"from": "human",
"value": "What is the reason for the following warning in some C++ compilers?\n\nNo newline at end of file\n\nWhy should I have an empty line at the end of a source/header file?\n"
},
{
"from": "gpt",
"value": "The warning \"No newline at end of file\" is issued by some C++ co... |
Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, SQL Server for argument's sake)?
| When deciding between stored procedures and ad hoc queries for executing SQL against a database like SQL Server, there are several factors to consider that can influence best practices. Each approach has its advantages and disadvantages, and the best choice often depends on the specific context and requirements of your... | 1,722 | [
{
"from": "human",
"value": "Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, SQL Server for argument's sake)?\n"
},
{
"from": "gpt",
"value":... |
I get an Access is Denied error message when I use the strong name tool to create a new key to sign a .NET assembly. This works just fine on a Windows XP machine but it does not work on my Vista machine.
PS C:\users\brian\Dev\Projects\BELib\BELib> sn -k keypair.snk
Microsoft (R) .NET Framework Strong Name Utility Ve... | The "Access is denied" error you're encountering when using the Strong Name Tool (`sn.exe`) on Windows Vista can be caused by several factors, even when running your command prompt or PowerShell with elevated permissions. Here are a few things you can check and try to resolve the issue:
1. **File Permissions**: Make s... | 2,992 | [
{
"from": "human",
"value": "I get an Access is Denied error message when I use the strong name tool to create a new key to sign a .NET assembly. This works just fine on a Windows XP machine but it does not work on my Vista machine.\nPS C:\\users\\brian\\Dev\\Projects\\BELib\\BELib> sn -k keypair.snk\n\nMi... |
I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer checks in code, it makes a compile.
Now we're at a place where we can start giving our application to the testers. We'd like to use ClickOnce to distribute the application, with the idea being that when a tester goes to test ... | To set up CruiseControl.NET to work with ClickOnce and automatically distribute the latest build to your testers, you'll need to follow a few steps to integrate ClickOnce publishing into your existing Continuous Integration (CI) process. Below are the steps you can take to achieve this:
### Step 1: Prepare Your ClickO... | 1,509 | [
{
"from": "human",
"value": "I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer checks in code, it makes a compile. \nNow we're at a place where we can start giving our application to the testers. We'd like to use ClickOnce to distribute the application, with the i... |
I've been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it's been going great! However, occasionally my FoxPro IDE will change the case of a file extension without warning where "program.prg" becomes "program.PRG") TortoiseSVN apparently takes ... | Subversion (SVN) inherently handles filenames in a case-sensitive manner due to its origins in Unix-like systems. This can lead to issues on Windows, which uses a case-insensitive file system. As you've noticed, when a file's case is changed, SVN may interpret that as the file being deleted and a new file being created... | 4,497 | [
{
"from": "human",
"value": "I've been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it's been going great! However, occasionally my FoxPro IDE will change the case of a file extension without warning where \"program.prg\" becomes \"... |
I'm writing a C/C++ DLL and want to export certain functions which I've done before using a .def file like this
LIBRARY "MyLib"
EXPORTS
Foo
Bar
with the code defined as this, for example:
int Foo(int a);
void Bar(int foo);
However, what if I want to declare an overloaded method of Foo() like:
int Foo(int a, int b... | In C and C++, function overloading allows you to define multiple functions with the same name but different parameter lists. However, when you are exporting these functions in a DLL, especially using a module definition (.def) file, it can be challenging because the .def file does not support function overloading direc... | 2,447 | [
{
"from": "human",
"value": "I'm writing a C/C++ DLL and want to export certain functions which I've done before using a .def file like this\nLIBRARY \"MyLib\"\nEXPORTS\n Foo\n Bar\n\nwith the code defined as this, for example:\nint Foo(int a);\nvoid Bar(int foo);\n\nHowever, what if I want to declare an ... |
I need a good understanding of the inner workings of System.Web.Routing.
Usually we define the RoutesTable. But how does it do the routing?
The reason I'm asking it is that I want to pass the routing to subapps. What I want to see working is a way of passing the current request to mvc apps that work in other AppDomains... | To understand how `System.Web.Routing` works and how you might extend it for your scenario, let's delve into the basic concepts of routing, how it functions within an ASP.NET MVC application, and then how you could approach passing requests to MVC apps in other AppDomains.
### How `System.Web.Routing` Works
1. **Rout... | 824 | [
{
"from": "human",
"value": "I need a good understanding of the inner workings of System.Web.Routing.\nUsually we define the RoutesTable. But how does it do the routing?\nThe reason I'm asking it is that I want to pass the routing to subapps. What I want to see working is a way of passing the current reques... |
I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a better one then please submit an answer.
H... | To create a regular expression that matches Java method declarations, including those where the opening brace `{` can be on a new line, we need to adjust your regex accordingly. Here’s a refined version:
```regex
\b(?:public|protected|private|static|final|synchronized|native|abstract|default|strictfp)?\s*(?:\w+\s+)+\w... | 4,877 | [
{
"from": "human",
"value": "I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a b... |
We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works.
The problem we are seeing is that it expects the requests to be formatted using Web Services Security, so we are doi... | To address the challenge of interacting with a SOAP service that requires secured requests while allowing unsecured responses in WCF, you have to adjust the WCF configuration to accommodate the security requirements without enforcing expectations on the response.
### Steps to Configure WCF for Secure Requests with Uns... | 2,317 | [
{
"from": "human",
"value": "We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works.\nThe problem we are seeing is that it expects the requests to be formatted ... |
I have built an MSI that I would like to deploy, and update frequently. Unfortunately, when you install the MSI, and then try to install a newer version of the same MSI, it fails with a message like "Another version of this product is already installed. Installation of this version cannot continue..." appears. The MSI ... | When deploying MSI packages using Visual Studio 2008 Setup Projects, there are specific considerations and configurations that you need to account for in order to facilitate version upgrades. Here’s what you need to do to enable your MSI to be updated correctly:
### Key Steps for Proper Versioning in Visual Studio 200... | 3,664 | [
{
"from": "human",
"value": "I have built an MSI that I would like to deploy, and update frequently. Unfortunately, when you install the MSI, and then try to install a newer version of the same MSI, it fails with a message like \"Another version of this product is already installed. Installation of this ver... |
I would like to create a database backed interactive AJAX webapp which has a custom (specific kind of events, editing) calendaring system. This would involve quite a lot of JavaScript and AJAX, and I thought about Google Web Toolkit for the interface and Ruby on Rails for server side.
Is Google Web Toolkit reliable and... | Creating an interactive AJAX web application with a custom calendaring system using free tools is certainly feasible! Let's break down your questions and considerations for using Google Web Toolkit (GWT) versus other approaches like jQuery.
### Google Web Toolkit (GWT) Considerations
**Reliability and Suitability:**
... | 2,167 | [
{
"from": "human",
"value": "I would like to create a database backed interactive AJAX webapp which has a custom (specific kind of events, editing) calendaring system. This would involve quite a lot of JavaScript and AJAX, and I thought about Google Web Toolkit for the interface and Ruby on Rails for server... |
I have a simple setter method for a property and null is not appropriate for this particular property. I have always been torn in this situation: should I throw an IllegalArgumentException, or a NullPointerException? From the javadocs, both seem appropriate. Is there some kind of an understood standard? Or is this jus... | In Java, when you're dealing with a setter method for a property that does not accept `null` values, the convention is to throw an `IllegalArgumentException`. Here's why:
1. **Meaning of Exceptions**:
- `NullPointerException` is typically reserved for situations where a method has attempted to use `null` in a way t... | 3,895 | [
{
"from": "human",
"value": "I have a simple setter method for a property and null is not appropriate for this particular property. I have always been torn in this situation: should I throw an IllegalArgumentException, or a NullPointerException? From the javadocs, both seem appropriate. Is there some kind o... |
I use this tool called Lazy C++ which breaks a single C++ .lzz file into a .h and .cpp file. I want Makepp to expect both of these files to exist after my rule for building .lzz files, but I'm not sure how to put two targets into a single build line.
| To handle the situation where you want to ensure that both a `.h` and a `.cpp` file are generated from a `.lzz` file using Makepp, you can make use of multiple targets in a Makepp rule.
Here's an example of how you can define a rule that takes a `.lzz` file as input and produces both a `.h` and a `.cpp` file as output... | 5,572 | [
{
"from": "human",
"value": "I use this tool called Lazy C++ which breaks a single C++ .lzz file into a .h and .cpp file. I want Makepp to expect both of these files to exist after my rule for building .lzz files, but I'm not sure how to put two targets into a single build line.\n"
},
{
"from": "gpt... |
I could only find the function confirm() that gives OK/Cancel buttons. Is there any way to give Yes/No buttons?
| In JavaScript, the built-in `confirm()` function only provides OK/Cancel buttons and does not allow for customization of the button labels. If you want to create a dialog with Yes/No buttons, you'll need to use a custom modal dialog. You can achieve this using HTML, CSS, and JavaScript.
Here’s a simple example of how ... | 3,349 | [
{
"from": "human",
"value": "I could only find the function confirm() that gives OK/Cancel buttons. Is there any way to give Yes/No buttons?\n"
},
{
"from": "gpt",
"value": "In JavaScript, the built-in `confirm()` function only provides OK/Cancel buttons and does not allow for customization of t... |
SQL Server Version 2000.
We've a bunch of desktops talking to MSSQL Server. When looking for a specific record, some desktops return the correct data, but some do not.
The SQL Command is "SELECT * FROM PODORDH WHERE ([NO]=6141)"
On one or two desktops, this returns a record. On the server and on all other desktops, no... | When you encounter a situation in SQL Server where the same query returns different results on different machines, there are several potential causes to investigate:
1. **Database Connection**:
- **Different Database**: Ensure that all desktops are pointing to the same database on the SQL Server. You can check the ... | 3,399 | [
{
"from": "human",
"value": "SQL Server Version 2000.\nWe've a bunch of desktops talking to MSSQL Server. When looking for a specific record, some desktops return the correct data, but some do not. \nThe SQL Command is \"SELECT * FROM PODORDH WHERE ([NO]=6141)\"\nOn one or two desktops, this returns a recor... |
When you are starting a personal programming project, what is your first step? I'm trying to start a project thats just an idea at the moment. I get lots of these and I dive right into the code and after a while just completely lose interest and or just forget about the project.
When you are starting, what is your firs... | Starting a personal programming project can be both exciting and challenging, especially when trying to maintain motivation and see it through to completion. Here’s a structured approach to kickstart your project in a way that increases the chances of success:
### 1. **Define Your Idea Clearly**
- **Write It Down:*... | 2,692 | [
{
"from": "human",
"value": "When you are starting a personal programming project, what is your first step? I'm trying to start a project thats just an idea at the moment. I get lots of these and I dive right into the code and after a while just completely lose interest and or just forget about the project.... |
What is it?
How do I implement connection pooling with MS SQL?
What are the performance ramifications when
Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)?
Executing a few queries that take a long time (10+ min)?
Are there any best practices?
| ### What is Connection Pooling?
Connection pooling is a technique used to manage database connections efficiently. Instead of opening and closing a database connection for every request, a connection pool maintains a set of established connections. When an application needs to execute a query, it can reuse an existing... | 442 | [
{
"from": "human",
"value": "\nWhat is it?\nHow do I implement connection pooling with MS SQL?\nWhat are the performance ramifications when\n\nExecuting many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)?\nExecuting a few queries that take a long time (10+ m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.