instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes).
I'm using:
Process.GetCurrentProcess().PrivateMemorySize64
However, the Process object has several different properties that let me read the memory space used:
Paged, NonPaged, PagedSystem, NonPagedSystem,... | When monitoring the memory usage of a .NET server process for logging and estimation purposes, it's important to choose the right metric based on what you need to measure. Below is a brief explanation of the various memory properties provided by the `Process` class in .NET, along with recommendations:
1. **PrivateMemo... | 3,270 | [
{
"from": "human",
"value": "I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes).\nI'm using:\nProcess.GetCurrentProcess().PrivateMemorySize64\n\nHowever, the Process object has several different properties that let me read the memory space used:\... |
I'm building an application against some legacy, third party libraries, and having problems with the linking stage. I'm trying to compile with Visual Studio 9. My compile command is:
cl -DNT40 -DPOMDLL -DCRTAPI1=_cdecl
-DCRTAPI2=cdecl -D_WIN32 -DWIN32 -DWIN32_LEAN_AND_MEAN -DWNT -DBYPASS_FLEX -D_INTEL=1 -DIPLIB=none ... | The errors you are encountering (LNK2019 unresolved external symbol) are indeed often related to mismatches in the way different parts of the code are compiled and linked, particularly with respect to C++ symbol mangling and the runtime libraries being used. Since these unresolved symbols are related to the C++ standar... | 3,072 | [
{
"from": "human",
"value": "I'm building an application against some legacy, third party libraries, and having problems with the linking stage. I'm trying to compile with Visual Studio 9. My compile command is:\ncl -DNT40 -DPOMDLL -DCRTAPI1=_cdecl\n-DCRTAPI2=cdecl -D_WIN32 -DWIN32 -DWIN32_LEAN_AND_MEAN -... |
How does one go about authoring a Regular Expression that matches against all strings that are valid URIs, while failing to match against all strings that are invalid URIs?
To be specific about what I am referencing when I say URI, I have added a link below for the most current URI RFC standard. It defines the entity t... | Creating a regular expression to validate URIs according to the RFC 3986 specification can be quite complex, as the rules governing the structure of URIs are intricate. However, we can create a regular expression that captures most valid URIs according to the general structure defined in the RFC.
Here's a refined regu... | 2,264 | [
{
"from": "human",
"value": "How does one go about authoring a Regular Expression that matches against all strings that are valid URIs, while failing to match against all strings that are invalid URIs?\nTo be specific about what I am referencing when I say URI, I have added a link below for the most current... |
In the application I am writing I have a Policy class. There are 4 different types of Policy. Each Policy is weighted against the other Policies such that PolicyA > PolicyB > PolicyC > PolicyD.
Who's responsibility is it to implement the logic to determine whether one Policy is greather than another? My initial thou... | The Single Responsibility Principle (SRP) states that a class should have one reason to change, meaning that a class should have only one responsibility or purpose. In the context of your `Policy` class, overloading the `>` and `<` operators to implement the logic for comparing policies can be viewed in different ways ... | 3,684 | [
{
"from": "human",
"value": "In the application I am writing I have a Policy class. There are 4 different types of Policy. Each Policy is weighted against the other Policies such that PolicyA > PolicyB > PolicyC > PolicyD.\nWho's responsibility is it to implement the logic to determine whether one Policy ... |
On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that:
[08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (CBS). MSI returned e... | It sounds like you're experiencing some issues with the installation of the .NET Framework 3.5 SP1 on your Windows Vista machine. The error message you received indicates that there may be a problem with the installation of .NET Framework 2.0 SP1, which is a prerequisite for .NET Framework 3.5.
Here are a few steps yo... | 561 | [
{
"from": "human",
"value": "On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that: \n[08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .... |
Extreme Programming, Scrum and Test Driven Development definitely seem to be the most popular Agile methods at the moment. But someone recently suggested that I take a look at Feature Driven Development.
Have you ever used this method with any success? What are the advantages of using it?
| Feature Driven Development (FDD) is indeed one of the Agile methodologies that focuses on delivering tangible, working software features in a structured way. While less popular than methods like Scrum or Extreme Programming, FDD has its own strengths and can be particularly effective in certain contexts. Here are some ... | 3,242 | [
{
"from": "human",
"value": "Extreme Programming, Scrum and Test Driven Development definitely seem to be the most popular Agile methods at the moment. But someone recently suggested that I take a look at Feature Driven Development.\nHave you ever used this method with any success? What are the advantages o... |
My current project is to write a web application that is an equivalent of an existing desktop application.
In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users know what ... | To handle the scenario you're describing in a web application while minimizing the loss of keystrokes during transitions, you have a few options. Let's explore both AJAX and other techniques:
### 1. **AJAX Form Loading**
Using AJAX is indeed a common solution to avoid full page reloads and maintain the user's input. ... | 3,192 | [
{
"from": "human",
"value": "My current project is to write a web application that is an equivalent of an existing desktop application. \nIn the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to... |
I need to call a web service written in .NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have).
The information that I received from the service provider included WSDL, a policyCache.config file, some sample C# code, and a sample applicati... | Calling a .NET web service with WS-Security from Java can be tricky, especially when dealing with the policies and security requirements defined by the service. Below are steps that you can take to generate a Java client using Apache Axis2, while handling WS-Security:
### 1. **Setup Apache Axis2**
Ensure that you have... | 841 | [
{
"from": "human",
"value": "I need to call a web service written in .NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have). \nThe information that I received from the service provider included WSDL, a policyCache.config file, s... |
Does somebody know how to recover a never-starting eclipse when the error "org.eclipse.swt.SWTError: Item not added" is raising againg and again?
I'm using WebSphere Studio Site Developer (Windows) 5.1.0
The only stack trace in the .metadata/log file is:
SESSION ---------------------------------------------------------... | The error message you're encountering, specifically `org.eclipse.swt.SWTError: Item not added`, suggests that there might be a problem with the SWT (Standard Widget Toolkit) components in your Eclipse installation, or it might be related to corrupted workspace settings. Here are several steps you can take to troublesho... | 3,959 | [
{
"from": "human",
"value": "Does somebody know how to recover a never-starting eclipse when the error \"org.eclipse.swt.SWTError: Item not added\" is raising againg and again?\nI'm using WebSphere Studio Site Developer (Windows) 5.1.0\nThe only stack trace in the .metadata/log file is:\nSESSION -----------... |
I want to access messages in Gmail from a Java application using JavaMail and IMAP. Why am I getting a SocketTimeoutException ?
Here is my code:
Properties props = System.getProperties();
props.setProperty("mail.imap.host", "imap.gmail.com");
props.setProperty("mail.imap.port", "993");
props.setProperty("mail.imap.conn... | The `SocketTimeoutException` you're encountering when trying to connect to Gmail's IMAP server using JavaMail can be caused by several issues. Let's go through some possible causes and solutions to troubleshoot this problem.
### 1. Enable "Less Secure Apps" in Gmail
If you are using a regular username and password fo... | 2,915 | [
{
"from": "human",
"value": "I want to access messages in Gmail from a Java application using JavaMail and IMAP. Why am I getting a SocketTimeoutException ?\nHere is my code:\nProperties props = System.getProperties();\nprops.setProperty(\"mail.imap.host\", \"imap.gmail.com\");\nprops.setProperty(\"mail.ima... |
Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.
In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.
I also have seen mic... | The halting problem is a fundamental result in computer science that demonstrates the limitations of what can be computed. While it is true that the general case of the halting problem is undecidable—meaning that there is no algorithm that can determine for every possible program and input whether it will halt or run i... | 4,264 | [
{
"from": "human",
"value": "Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.\nIn cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based a... |
Let's say you have a class called Customer, which contains the following fields:
UserName
Email
First Name
Last Name
Let's also say that according to your business logic, all Customer objects must have these four properties defined.
Now, we can do this pretty easily by forcing the constructor to specify each of these... | You're right that having a constructor with too many parameters can make the code difficult to use, maintain, and understand. There are several design patterns and practices you can utilize to manage this situation more effectively. Here are a few alternatives to consider:
### 1. **Builder Pattern**
The Builder patter... | 1,362 | [
{
"from": "human",
"value": "Let's say you have a class called Customer, which contains the following fields:\n\nUserName\nEmail\nFirst Name\nLast Name\n\nLet's also say that according to your business logic, all Customer objects must have these four properties defined.\nNow, we can do this pretty easily by... |
I'm going to build an API for a web app and I'm interested in what people can suggest as good practices.
I'm already planning to make it versioned (version 1 can only control certain aspects of the system, version 2 could control more, but this may need a change in the way authentication is performed that would be inco... | Building a well-structured API is essential for ensuring usability, security, and maintainability. Here are some good practices and considerations you can implement while building your API:
### 1. **Design with REST Principles**:
- **Resources**: Use nouns to define your endpoints that represent resources (e.g., `/... | 1,260 | [
{
"from": "human",
"value": "I'm going to build an API for a web app and I'm interested in what people can suggest as good practices.\nI'm already planning to make it versioned (version 1 can only control certain aspects of the system, version 2 could control more, but this may need a change in the way auth... |
What would be the best method for getting a custom element (that is using J2ME native Graphics) painted on LWUIT elements?
The custom element is an implementation from mapping library, that paints it's content (for example Google map) to Graphics object. How would it be possible to paint the result directly on LWUIT el... | It sounds like you're trying to integrate a custom mapping library that uses J2ME's native graphics drawing capabilities with LWUIT components. Given the nature of LWUIT and its rendering mechanisms, combining the two can be challenging, particularly because LWUIT manages its own rendering cycle and graphics context.
... | 3,143 | [
{
"from": "human",
"value": "What would be the best method for getting a custom element (that is using J2ME native Graphics) painted on LWUIT elements?\nThe custom element is an implementation from mapping library, that paints it's content (for example Google map) to Graphics object. How would it be possibl... |
I am using the code snippet below, however it's not working quite as I understand it should.
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
try {
line = br.readLine();
while(line != null) {
Syst... | Your confusion stems from how the `BufferedReader.readLine()` method works and how it handles input from the console.
According to the Java documentation you read, `BufferedReader.readLine()` returns `null` only when the end of the stream is reached. When reading from standard input (like the console), the end of the ... | 3,366 | [
{
"from": "human",
"value": "I am using the code snippet below, however it's not working quite as I understand it should. \npublic static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n try {\n line = br.readLine();... |
Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the 'Visual Studio Command Prompt'. When starting this command prompt it sets various environment variables that the C++ compiler, cl, uses when compiling.
This is not always desirable. If, for example, I want to run... | Yes, you can run the Visual C++ compiler (`cl`) outside of the Visual Studio Command Prompt by manually setting the required environment variables in your own script or Ant build file. The `vcvars32.bat` (for 32-bit) or `vcvarsall.bat` (for both 32-bit and 64-bit) scripts that come with Visual Studio set up the necessa... | 4,128 | [
{
"from": "human",
"value": "Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the 'Visual Studio Command Prompt'. When starting this command prompt it sets various environment variables that the C++ compiler, cl, uses when compiling.\nThis is not always ... |
I am working with both amq.js (ActiveMQ) and Google Maps. I load my scripts in this order
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>AMQ & Maps Demo</title>
<!-- Stylesheet -->
<link rel="stylesheet" type="text/css" href="style.css"></link>
<!-- Google APIs ... | To ensure that your scripts are loaded and executed in the correct order, you can implement a few strategies. Since `amq.js` depends on `prototype.js`, you need to ensure that both are loaded before trying to use the `amq` object in your `application.js`.
Here are a few options to consider:
### 1. Using `onload` Even... | 2,858 | [
{
"from": "human",
"value": "I am working with both amq.js (ActiveMQ) and Google Maps. I load my scripts in this order\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>AMQ & Maps Demo</title>\n\n <!-- Stylesheet -->\n <link rel=\"stylesheet\" type=\"tex... |
Example
I have Person, SpecialPerson, and User. Person and SpecialPerson are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. User has all of the same data as Person and potentially SpecialPerson, along with a user name and password as they are regis... | Your understanding of the problem highlights a common scenario in database design where you have a base entity with shared attributes and specialized entities with additional attributes. In this case, you have a `Person`, `SpecialPerson`, and `User`.
Here’s a structured approach to address this problem:
### 1. Entity... | 2,751 | [
{
"from": "human",
"value": "Example\nI have Person, SpecialPerson, and User. Person and SpecialPerson are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. User has all of the same data as Person and potentially SpecialPerson, along with ... |
When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page.
I already saw people hiding selects when opening a popup div, that leads to pretty bad user experience having control... | You're correct that Internet Explorer's rendering of `<select>` elements can pose challenges when trying to position overlay elements. The solutions you've mentioned are indeed some of the more common workarounds. Below are a few additional ideas you might consider, focusing on improving accessibility and user experien... | 943 | [
{
"from": "human",
"value": "When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page.\nI already saw people hiding selects when opening a popup div, that leads to... |
public class MyClass
{
public int Age;
public int ID;
}
public void MyMethod()
{
MyClass m = new MyClass();
int newID;
}
To my understanding, the following is true:
The reference m lives on the stack and goes out of scope when MyMethod() exits.
The value type newID lives on the stack and goes out of... | You have a good understanding of how memory management works in C# with respect to value types and reference types. Let's clarify your questions regarding value types within objects, boxing/unboxing, and provide some additional resources.
### Do Value Types within Objects Live on the Stack or the Heap?
- **Value Type... | 1,994 | [
{
"from": "human",
"value": "public class MyClass\n{\n public int Age;\n public int ID;\n}\n\npublic void MyMethod() \n{\n MyClass m = new MyClass();\n int newID;\n}\n\nTo my understanding, the following is true:\n\nThe reference m lives on the stack and goes out of scope when MyMethod() exits.\... |
In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'm just working around it in the best way that I possibly can.
Anyway, I'm not... | It's great that you're working on your own object-relational mapping (ORM) solution! Handling variable arguments for prepared statements in PHP can indeed be a bit tricky, but there are ways to achieve it without resorting to `eval()`, which is generally discouraged due to security and maintainability concerns. Here ar... | 2,445 | [
{
"from": "human",
"value": "In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out \"how on earth?\", relax -- I haven't found a way to make late static binding work -- I'm just working around it in the be... |
Either I had a bad dream recently or I am just too stupid to google, but I remember that someone somewhere wrote that ASP.net has a Function which allows "merging" multiple JavaScript files automatically and only delivering one file to the client, thus reducing the number of HTTP Requests.
Server Side, you still kept a... | Yes, you are correct! ASP.NET does have features that can help you merge and minify JavaScript files to reduce the number of HTTP requests made by the client. This is particularly useful for improving performance by combining multiple scripts into a single file. While it might not be a single built-in function, there a... | 4,039 | [
{
"from": "human",
"value": "Either I had a bad dream recently or I am just too stupid to google, but I remember that someone somewhere wrote that ASP.net has a Function which allows \"merging\" multiple JavaScript files automatically and only delivering one file to the client, thus reducing the number of H... |
How do I make open “read only” the only option within a SharePoint document library?
When using either Word 2003 or 2007 and saving the document as a template or modifying the file properties as “read only” doesn’t prevent modification of the file in a SharePoint document library. Modifying the document library permis... | To make documents in a SharePoint document library effectively "read-only" for all users, you have a few options, but it is important to note that there are some limitations with standard SharePoint permissions and document behavior. Below are a few approaches you can take to achieve a "read-only" status:
### Option 1... | 3,873 | [
{
"from": "human",
"value": "How do I make open “read only” the only option within a SharePoint document library?\nWhen using either Word 2003 or 2007 and saving the document as a template or modifying the file properties as “read only” doesn’t prevent modification of the file in a SharePoint document libra... |
When supplying dates to a stored procedure via a parameter I'm a little confused over which format to use for the dates. My original VBA syntax used the ADO Connection object to execute the stored procedure:
Set SentDetailRS = Me.ADOConnectionToIntegrity.Execute("dbo.s_SelectAggregatedSentDetailList '" & fCSQLDate(Effe... | The issue you're experiencing is likely due to differences in regional settings between users and how SQL Server interprets date formats. Here are some key points that can help clarify the situation and guide you toward a solution:
### 1. Date Formats in SQL Server:
SQL Server can interpret dates in several formats, b... | 3,155 | [
{
"from": "human",
"value": "When supplying dates to a stored procedure via a parameter I'm a little confused over which format to use for the dates. My original VBA syntax used the ADO Connection object to execute the stored procedure:\nSet SentDetailRS = Me.ADOConnectionToIntegrity.Execute(\"dbo.s_SelectA... |
How do you make your application multithreaded ?
Do you use asynch functions ?
or do you spawn a new thread ?
I think that asynch functions are already spawning a thread so if your job is doing just some file reading, being lazy and just spawning your job on a thread would just "waste" ressources...
So is there some ki... | Creating a multithreaded application can be approached in several ways, depending on the requirements of your application, the programming language being used, and the nature of the tasks that need to be performed concurrently. Below, I'll provide an overview of both threading and asynchronous programming, and discuss ... | 2,990 | [
{
"from": "human",
"value": "How do you make your application multithreaded ?\nDo you use asynch functions ?\nor do you spawn a new thread ?\nI think that asynch functions are already spawning a thread so if your job is doing just some file reading, being lazy and just spawning your job on a thread would ju... |
What kind of programming problems are state machines most suited for?
I have read about parsers being implemented using state machines, but would like to find out about problems that scream out to be implemented as a state machine.
| State machines are particularly well-suited for a variety of programming problems that involve different states and transitions based on inputs or events. Here are some common scenarios where state machines are an ideal choice:
1. **User Interfaces**:
- GUI applications often have different states depending on use... | 3,663 | [
{
"from": "human",
"value": "What kind of programming problems are state machines most suited for?\nI have read about parsers being implemented using state machines, but would like to find out about problems that scream out to be implemented as a state machine.\n"
},
{
"from": "gpt",
"value": "S... |
So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.
In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so if I use the... | In Subversion (SVN), there isn't an out-of-the-box feature like `.gitignore` for Git, which allows users to specify ignore patterns locally without affecting the repository. However, you can manage your personal ignore patterns without affecting the shared repository in a couple of ways:
### 1. Local `svn:ignore` in W... | 3,040 | [
{
"from": "human",
"value": "So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.\nIn other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense t... |
I'm still new to the ASP.NET world, so I could be way off base here, but so far this is to the best of my (limited) knowledge!
Let's say I have a standard business object "Contact" in the Business namespace. I write a Web Service to retrieve a Contact's info from a database and return it. I then write a client applicat... | You've identified a common issue in ASP.NET web service development, particularly when it involves web services and the proxies that are generated from WSDL. This mismatch between the service's data contract and your business object's data type can indeed be challenging, but there are several strategies you can employ ... | 1,290 | [
{
"from": "human",
"value": "I'm still new to the ASP.NET world, so I could be way off base here, but so far this is to the best of my (limited) knowledge!\nLet's say I have a standard business object \"Contact\" in the Business namespace. I write a Web Service to retrieve a Contact's info from a database a... |
How are you handling the entry of numeric values in WPF applications?
Without a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly.
Has anyone found a more graceful way to get numeric data from the user without relying on a third-party contro... | Handling numeric input in a WPF application can indeed get a bit unwieldy without a dedicated `NumericUpDown` control. However, there are more elegant ways to achieve this without the need for third-party libraries. Here's an approach that utilizes a combination of the `PreviewTextInput` event and input validation, whi... | 3,190 | [
{
"from": "human",
"value": "How are you handling the entry of numeric values in WPF applications?\nWithout a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly.\nHas anyone found a more graceful way to get numeric data from the u... |
What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.
Currently I use code like this:
// mObjList is a List<MyObject>
MyObject match = null;
foreach (MyObject mo in mObjList)
{
if ... | Your current implementations for finding an item in a list using a loop are clear and straightforward, but there are ways to improve or refactor your code to make it more readable or efficient. Since you're interested in options that work with both LINQ (for later versions of C#) and pre-LINQ methods suitable for C# 2.... | 4,064 | [
{
"from": "human",
"value": "What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.\nCurrently I use code like this:\n// mObjList is a List<MyObject>\nMyObject match = null;... |
My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flushed. At this point, modified objects are written to the database.
How does Hibernate decide which objects are 'dirty' and need to be written?
Do t... | Hibernate determines whether an entity object is "dirty" (i.e., modified and needing to be updated in the database) primarily through a process called **dirty checking**. Here's an overview of how this works:
### Dirty Checking Mechanism
1. **Initial State Tracking**:
- When an entity is loaded into the Hibernate... | 2,716 | [
{
"from": "human",
"value": "My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flushed. At this point, modified objects are written to the database.\nHow does Hibernate decide which object... |
I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first list onto.
So far, I found two solutions:
... | Implementing drag-and-drop functionality in ASP.NET can be achieved using several different approaches, even without using a high-priced solution like Telerik's RadGrid. Below are some options and pointers that can help you achieve the desired functionality:
### 1. jQuery UI and AJAX
Using jQuery UI's sortable functi... | 814 | [
{
"from": "human",
"value": "I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first l... |
In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?
Example:
DataTable myDt = new DataTable();
if (myDt != null && myDt.Rows.Count > 0)
{
//do some stuff with myDt
}
Which statement does the runtime evaluate first -
myDt != null
or:
myDt.Rows.Count > 0
?... | In C#, the evaluation of logical statements follows certain rules based on the operator used. In the example you provided:
```csharp
if (myDt != null && myDt.Rows.Count > 0)
{
//do some stuff with myDt
}
```
### Evaluation Order
The statement `myDt != null && myDt.Rows.Count > 0` uses the `&&` (logical AND) oper... | 2,872 | [
{
"from": "human",
"value": "In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?\nExample:\nDataTable myDt = new DataTable();\nif (myDt != null && myDt.Rows.Count > 0)\n{\n //do some stuff with myDt\n}\n\nWhich statement does the runtime evaluate ... |
First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.
I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable.
Currently there are a few op... | Linking to Samba file shares directly in a web browser is a bit tricky due to the varying ways browsers handle such protocols and paths. Here are some considerations and suggestions for your project:
### Linking to Samba Shares in HTML
1. **Protocol Handlers**: Most modern web browsers do not natively support the `sm... | 3,809 | [
{
"from": "human",
"value": "First off if you're unaware, samba or smb == Windows file sharing, \\\\computer\\share etc.\nI have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something ... |
Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.
But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.
Why does Java choose this strategy and what is the benefit from this?
Is this better t... | Java and Python both manage memory, but they do so using different strategies, each with its own pros and cons. Understanding the reasons behind Java's garbage collection (GC) and the reference counting method in Python can shed light on their benefits and drawbacks.
### Java's Garbage Collection Strategy
1. **Backgr... | 2,787 | [
{
"from": "human",
"value": "Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.\nBut, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.\nWhy does Java choose this strategy and what... |
Does Facelets have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF?
For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages.
Clarification: I know that I can add a message file entry that ... | Facelets, as a templating language used with JSF, provides some features that can help to create a more readable and maintainable approach to internationalized user interface text labels. While Facelets does not fundamentally change how you handle internationalization in JSF, it allows for some additional conveniences ... | 4,011 | [
{
"from": "human",
"value": "Does Facelets have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF?\nFor example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages.\nClarification: I kno... |
I want to create a number of masked edit extenders from codebehind. Something like:
private MaskedEditExtender m_maskedEditExtender;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
m_maskedEditExtender = new MaskedEditExtender()
{
BehaviorID = "clientName"
};
m_maskedEditExtend... | When working with `MaskedEditExtender` or any other AJAX Control Toolkit extender, you need to make sure that you properly set up the target control and the behavior ID. In your case, it seems you are trying to dynamically create the `MaskedEditExtender` without specifying the target control correctly, which is likely ... | 3,026 | [
{
"from": "human",
"value": "I want to create a number of masked edit extenders from codebehind. Something like:\nprivate MaskedEditExtender m_maskedEditExtender;\nprotected override void OnLoad(EventArgs e)\n{\n base.OnLoad(e);\n m_maskedEditExtender = new MaskedEditExtender()\n {\n Behavio... |
I have a list, each item of which has several things in it, including a JProgressBar which can be updated a lot. Each time one of the items updates its JProgressBar, the ListDataListener on the list tries to scroll it to the visible range using
/*
* This makes the updating content item automatically scroll
* into vie... | It seems like you're facing a painting issue with your `JList` and `JProgressBar` while trying to keep the list items visible. Here are a few suggestions to help you resolve the issue of components painting outside of their clipping area:
1. **Revalidate and Repaint**: Make sure to call `revalidate()` and `repaint()` ... | 3,963 | [
{
"from": "human",
"value": "I have a list, each item of which has several things in it, including a JProgressBar which can be updated a lot. Each time one of the items updates its JProgressBar, the ListDataListener on the list tries to scroll it to the visible range using\n/*\n * This makes the updating co... |
After trying to avoid JavaScript for years, Iv started using Query for validation in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is.
Firstly is there a way to get intellisense working for jQuery and its validation plugin, so that i don have to learn ... | To enhance your experience with jQuery, including the validation plugin, and to create a validation summary in your ASP.NET MVC application, here's how you can tackle both your questions:
### 1. Intellisense for jQuery
To get IntelliSense for jQuery and its validation plugin in Visual Studio, you can follow these ste... | 3,099 | [
{
"from": "human",
"value": "After trying to avoid JavaScript for years, Iv started using Query for validation in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good jQuery is. \nFirstly is there a way to get intellisense working for jQuery and its valid... |
I would like to "post-process" my app.config file and perform some token replacements after the project builds.
Is there an easy way to do this using a VS post-build event command?
(Yeah I know I could probably use NAnt or something, looking for something simple.)
| Yes, you can perform token replacements in your `app.config` file using a Visual Studio post-build event command. While there are various ways to do this, one of the simplest methods is to use the command-line `sed` tool (or a similar text-processing tool available on your system) directly in the post-build event.
Her... | 4,371 | [
{
"from": "human",
"value": "I would like to \"post-process\" my app.config file and perform some token replacements after the project builds.\nIs there an easy way to do this using a VS post-build event command?\n(Yeah I know I could probably use NAnt or something, looking for something simple.)\n"
},
... |
I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My id... | In Common Lisp, macros work with the syntax and structure of the code itself rather than with the values of the variables directly. When you attempt to use `(incf variable)` within your macro definition, you're actually trying to increment the symbol `variable` rather than the value of the variable that gets passed to ... | 4,245 | [
{
"from": "human",
"value": "I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if... |
I have two arrays of animals (for example).
$array = array(
array(
'id' => 1,
'name' => 'Cat',
),
array(
'id' => 2,
'name' => 'Mouse',
)
);
$array2 = array(
array(
'id' => 2,
'age' => 321,
),
array(
'id' => 1,
'age' => 123,
... | You can merge the two arrays based on the `id` field by creating a new array that combines elements from both arrays where their IDs match. One way to achieve this in PHP is to use a nested loop or to use a more efficient approach with associative arrays.
Here's how you can do it using an associative array approach, w... | 3,763 | [
{
"from": "human",
"value": "I have two arrays of animals (for example).\n$array = array(\n array(\n 'id' => 1,\n 'name' => 'Cat',\n ),\n array(\n 'id' => 2,\n 'name' => 'Mouse',\n )\n);\n\n$array2 = array(\n array(\n 'id' => 2,\n 'age' => 321,\n )... |
I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:
<%@ Import Namespace="System.Query" %>
However, this fails and tells me it cannot find the namespace.
The type or namespace name 'Query' does not exist in the namespace 'System'
I have also tried with no luck:
Syst... | It appears that you are trying to use LINQ in your ASP.NET application, which is supported in .NET 3.5. However, your import statement should be directed to the correct namespace for LINQ. Here's how you can correctly import LINQ and work with it in your ASP.NET page.
1. **Correct Namespace**: The correct namespace fo... | 3,742 | [
{
"from": "human",
"value": "I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:\n<%@ Import Namespace=\"System.Query\" %>\n\nHowever, this fails and tells me it cannot find the namespace.\n\nThe type or namespace name 'Query' does not exist in the namespace ... |
Are people still writing SOAP services or is it a technology that has passed its architectural shelf life? Are people returning to binary formats?
| As of my last update in October 2023, SOAP (Simple Object Access Protocol) services are not as prevalent as they once were, especially compared to RESTful APIs. The trend has shifted towards more lightweight, easier-to-use technologies such as RESTful APIs, which use JSON for data interchange. REST is often preferred d... | 5,987 | [
{
"from": "human",
"value": "Are people still writing SOAP services or is it a technology that has passed its architectural shelf life? Are people returning to binary formats?\n"
},
{
"from": "gpt",
"value": "As of my last update in October 2023, SOAP (Simple Object Access Protocol) services ar... |
Even though chrome runs tabs as different processes it appears to not support this... any ideas or documentation I might have missed?
| It seems like you’re referring to the way Google Chrome manages tabs and processes. Chrome does indeed run each tab (and extensions) in separate processes to improve stability and security. However, certain limitations can arise depending on the specific functionality or behavior you're expecting.
If you're experienci... | 5,156 | [
{
"from": "human",
"value": "Even though chrome runs tabs as different processes it appears to not support this... any ideas or documentation I might have missed?\n"
},
{
"from": "gpt",
"value": "It seems like you’re referring to the way Google Chrome manages tabs and processes. Chrome does inde... |
I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:
set FILENAME=%~f1
sed 's/Some Pattern/%FILENAME%/' inputfile
(Note: %~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt)
I found that the backslashes in %FILENAME% are just escaping the next lette... | To handle the escaping of backslashes in a DOS filename for use with `sed`, you can follow the approach you've outlined but let's clarify and ensure it's working smoothly. Since you're using Cygwin, here’s a structured way to achieve your goal:
1. **Store the DOS filename:** You are already using `set FILENAME=%~f1` t... | 3,772 | [
{
"from": "human",
"value": "I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:\nset FILENAME=%~f1\n\nsed 's/Some Pattern/%FILENAME%/' inputfile\n\n(Note: %~f1 - expands %1 to a Fully qualified path name - C:\\utils\\MyFile.txt)\nI found that the backslash... |
As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
| It seems like you might be referring to specific technologies, but you haven’t mentioned which ones. If you could provide the names or types of the technologies you are comparing, I’d be glad to help explain how they might complement each other and where their functionalities overlap! | 7,736 | [
{
"from": "human",
"value": "As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?\n"
},
{
"from": "gpt",
"value": "It seems like you might be referring to specific technologies... |
I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...
| Starting a `pthread` that is a member of a C++ class requires you to handle the thread function and its parameters correctly. Here's a common approach to achieve this:
### Example Class with a Pthread
```cpp
#include <iostream>
#include <pthread.h>
class MyClass {
public:
MyClass() {
// Start the thread ... | 3,881 | [
{
"from": "human",
"value": "I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...\n"
},
{
"from": "gpt",
"value": "Starting a `pthread` that is a member of a C++ class requires you to handle the thread function and its parameters ... |
In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes.
How can I keep the mouse cursor from being hidden?
| The behavior you're experiencing with the mouse cursor being hidden when you call `CComboBox::ShowDropDown()` is likely due to the way the combo box handles mouse capture and focus during its drop-down state. This is a common behavior in MFC applications, particularly when dealing with control focus management.
To kee... | 3,110 | [
{
"from": "human",
"value": "In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes.\nHow can I keep the mouse cursor ... |
I am looking for a simple system to manage inbound emails from a support mailbox for a group with about 3 support people. I've looked at OTRS which seems to have the features that we need. Unfortunately, so far the UI still looks like a confusing mess.
Are there any good FOSS tools that would meet this need? I've he... | If you're looking for open-source tools to manage inbound emails for a support team, there are several options besides OTRS that might meet your needs with a simpler and more user-friendly interface. Here are a few suggestions:
1. **Zammad**: Zammad is a web-based support ticket system with a modern interface. It prov... | 4,593 | [
{
"from": "human",
"value": "I am looking for a simple system to manage inbound emails from a support mailbox for a group with about 3 support people. I've looked at OTRS which seems to have the features that we need. Unfortunately, so far the UI still looks like a confusing mess.\nAre there any good FOSS... |
If I have:
signed char * p;
and I do a comparison:
if ( *p == 0xFF )
break;
it will never catch 0XFF, but if I replace it with -1 it will:
if ( *p == (signed char)0xFF )
break;
How can this happen? Is it something with the sign flag? I though that 0xFF == -1 == 255.
| The behavior you are observing has to do with the representation of signed and unsigned integers in C/C++, particularly with how values are interpreted in the context of signed types.
### Key Concepts
1. **Representation of Values**:
- A `signed char` can store values from -128 to 127. The binary representation of... | 2,935 | [
{
"from": "human",
"value": "If I have: \nsigned char * p;\n\nand I do a comparison:\nif ( *p == 0xFF )\n break;\n\nit will never catch 0XFF, but if I replace it with -1 it will:\nif ( *p == (signed char)0xFF )\n break;\n\nHow can this happen? Is it something with the sign flag? I though that 0xFF == -1... |
In a VB6 application, I have a Dictionary whose keys are Strings and values are instances of a custom class. If I call RemoveAll() on the Dictionary, will it first free the custom objects? Or do I explicitly need to do this myself?
Dim d as Scripting.Dictionary
d("a") = New clsCustom
d("b") = New clsCustom
' Are th... | In VB6, when you use a `Scripting.Dictionary` to store instances of a custom class, calling the `RemoveAll` method will clear all entries in the dictionary, but it does not automatically free the memory used by the objects (instances of your custom class) that were stored as values.
Here's a breakdown of the process:... | 5,569 | [
{
"from": "human",
"value": "In a VB6 application, I have a Dictionary whose keys are Strings and values are instances of a custom class. If I call RemoveAll() on the Dictionary, will it first free the custom objects? Or do I explicitly need to do this myself?\nDim d as Scripting.Dictionary\n\nd(\"a\") = ... |
Has the introduction of the .net framework made raw programming in COM and DCOM redundant ?
(Except for using some COM+ services, e.g. for transaction management through the System.EnterpriseServices namespace)
| The introduction of the .NET Framework has indeed made certain aspects of raw programming in COM (Component Object Model) and DCOM (Distributed Component Object Model) less common, but it hasn't rendered them completely redundant. Here are some points to consider:
1. **Abstraction and Ease of Use**: The .NET Framework... | 4,342 | [
{
"from": "human",
"value": "Has the introduction of the .net framework made raw programming in COM and DCOM redundant ? \n(Except for using some COM+ services, e.g. for transaction management through the System.EnterpriseServices namespace)\n"
},
{
"from": "gpt",
"value": "The introduction of t... |
Let's say I have the following simple table variable:
declare @databases table
(
DatabaseID int,
Name varchar(15),
Server varchar(15)
)
-- insert a bunch rows into @databases
Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another way?
| No, using a cursor is not your only option for iterating through the rows in a table variable in SQL Server. While cursors can be used to iterate through the rows one at a time, they are often less efficient and less readable than set-based operations.
Here are a few alternative approaches you can use to handle the r... | 3,352 | [
{
"from": "human",
"value": "Let's say I have the following simple table variable:\ndeclare @databases table\n(\n DatabaseID int,\n Name varchar(15), \n Server varchar(15)\n)\n-- insert a bunch rows into @databases\n\nIs declaring and using a cursor my only option if I wanted to it... |
I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection.
What is the most elegant way of doing this when you don't have access to the Page.Request object?
| If you want to parse a query string like `p1=6&p2=7&p3=8` into a `NameValueCollection` without access to the `Page.Request` object (commonly used in ASP.NET), you can use the `NameValueCollection` class provided by the `System.Collections.Specialized` namespace.
Here's a simple and elegant way to do this using `HttpU... | 4,858 | [
{
"from": "human",
"value": "I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection.\nWhat is the most elegant way of doing this when you don't have access to the Page.Request object?\n"
},
{
"from": "gpt",
"value": "If you want to parse a query string like `p1=6&p2=7&p... |
I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio.
I am thinking in terms of nightly builds, etc., but then could... | Learning MSBuild syntax can definitely be beneficial, particularly if you are looking to customize and automate the build process for .NET projects. Here are some points to consider:
### Advantages of Learning MSBuild
1. **Customization**: MSBuild allows for fine-grained control over the build process. You can custom... | 3,820 | [
{
"from": "human",
"value": "I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio. \nI am thinking in ter... |
Do you guys know how I can use the Curl command line to POST SOAP to test a web service?
I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.
Thanks!
| Absolutely! You can use the `curl` command to POST a SOAP message to a web service. Below is a simple way to do this using your `soap.xml` file.
Assuming you have the `soap.xml` file ready and your web service endpoint URL, you can use the following command in your terminal:
```bash
curl -X POST -H "Content-Type: tex... | 3,884 | [
{
"from": "human",
"value": "Do you guys know how I can use the Curl command line to POST SOAP to test a web service?\nI have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.\nThanks!\n"
},
{
"from": "gpt",
"value": "Absolutely! Yo... |
What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?
| In C++, while you can certainly loop through the characters of a string and build a new one to remove spaces, there are more modern and convenient methods available, especially with the introduction of the C++ Standard Library features.
One of the preferred ways to remove spaces from a string is to use the `std::remov... | 3,497 | [
{
"from": "human",
"value": "What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?\n"
},
{
"from": "gpt",
"value": "In C++, while you can certainly loop through the characters of a string and bu... |
How to you find the URL that represents the documentation of a .NET framework method on the MSDN website?
For example, I want to embed the URL for the .NET framework method into some comments in some code. The normal "mangled" URL that one gets searching MSDN isn't very friendly looking: http://msdn.microsoft.com/libr... | To find a clean and user-friendly URL for .NET framework method documentation on the Microsoft Docs website, follow these steps:
1. **Use the Microsoft Documentation Site**: Microsoft has transitioned much of the .NET documentation from MSDN to a new platform. Visit the official .NET documentation site at [docs.micros... | 5,991 | [
{
"from": "human",
"value": "How to you find the URL that represents the documentation of a .NET framework method on the MSDN website?\nFor example, I want to embed the URL for the .NET framework method into some comments in some code. The normal \"mangled\" URL that one gets searching MSDN isn't very frie... |
I have three tables: page, attachment, page-attachment
I have data like this:
page
ID NAME
1 first page
2 second page
3 third page
4 fourth page
attachment
ID NAME
1 foo.word
2 test.xsl
3 mm.ppt
page-attachment
ID PAGE-ID ATTACHMENT-ID
1 2 1
2 2 2
3 3... | To get the desired output where you include pages with 0 attachments, you should use a **LEFT JOIN** instead of an **INNER JOIN**. The **LEFT JOIN** will return all rows from the `page` table and the matching rows from the `page-attachment` table. If there is no match, it will return `NULL` for the columns from `page-a... | 3,603 | [
{
"from": "human",
"value": "I have three tables: page, attachment, page-attachment\nI have data like this:\npage\nID NAME\n1 first page\n2 second page\n3 third page\n4 fourth page\n\nattachment\nID NAME\n1 foo.word\n2 test.xsl\n3 mm.ppt\n\npage-attachment\nID PAGE-ID ... |
I get this error:
Can't locate Foo.pm in @INC
Is there an easier way to install it than downloading, untarring, making, etc?
| The error message "Can't locate Foo.pm in @INC" indicates that Perl is unable to find the module `Foo.pm`. This usually happens when the module is not installed or not in the directories listed in Perl's `@INC` array.
To install Perl modules more easily than manually downloading and compiling, you can use the `cpan` (... | 5,127 | [
{
"from": "human",
"value": "I get this error:\nCan't locate Foo.pm in @INC\nIs there an easier way to install it than downloading, untarring, making, etc?\n"
},
{
"from": "gpt",
"value": "The error message \"Can't locate Foo.pm in @INC\" indicates that Perl is unable to find the module `Foo.pm`... |
This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is org.eclipse.core.resources.
I want to get an IFile corresponding to a location String I have:
"platform:/resource/Tracbility_All_Supported_lib/processes/gastuff/globalht/GlobalHTInterface.wsdl"
I have the enclosing IWo... | To convert a `platform:/resource/...` URI into an `IPath`, you can use the `IURIConverter` from the `org.eclipse.core.resources` package. The process involves converting the URI into an `IPath` which can then be used to retrieve the `IFile` using the `IWorkspaceRoot`.
Here’s a step-by-step guide on how to do that:
1.... | 4,393 | [
{
"from": "human",
"value": "This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is org.eclipse.core.resources. \nI want to get an IFile corresponding to a location String I have:\n \"platform:/resource/Tracbility_All_Supported_lib/processes/gastuff/globalht/Globa... |
After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript).
Has anyone else found this to be true? Any interesting work-arounds t... | Yes, you've observed a significant difference in how Firefox and Internet Explorer (IE) handle the `innerHTML` property. Your findings align with the historical behavior of these browsers:
1. **Firefox**: When you access the `innerHTML` of an element, it returns the HTML content as it appears in the source code or mar... | 3,625 | [
{
"from": "human",
"value": "After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript).\nHas anyone else found this ... |
We've been running eAccelerator on each of 3 webservers and are looking to move to a memcache pool across all 3, hopefully reducing by about 2/3 our db lookups.
One of the handy things about eAccelerator is the web-based control interface (control.php), which has proved very useful when we've had to flush the cache une... | If you’re looking for a web-based interface to manage and monitor your Memcached instances, there are several tools available that can provide similar functionalities to what you enjoyed with eAccelerator. Here are some options to consider:
1. **phpMemcachedAdmin**: This is a simple and lightweight web interface for m... | 4,162 | [
{
"from": "human",
"value": "We've been running eAccelerator on each of 3 webservers and are looking to move to a memcache pool across all 3, hopefully reducing by about 2/3 our db lookups.\nOne of the handy things about eAccelerator is the web-based control interface (control.php), which has proved very us... |
It seems like if you want to get the keys of a mapping, you ask for them; otherwise, give me the whole mapping (constituted by a set of key-value pairs). Is there a historical reason for this?
| The design choice of distinguishing between retrieving keys and fetching the entire mapping in programming languages and data structures often stems from performance considerations and the semantic clarity of operations.
### Historical Context and Reasons:
1. **Efficiency**: In many implementations, particularly in e... | 5,729 | [
{
"from": "human",
"value": "It seems like if you want to get the keys of a mapping, you ask for them; otherwise, give me the whole mapping (constituted by a set of key-value pairs). Is there a historical reason for this?\n"
},
{
"from": "gpt",
"value": "The design choice of distinguishing betwe... |
I have this code in jQuery, that I want to reimplement with the prototype library.
// make external links open in popups
// this will apply a window.open() behaviour to all anchor links
// the not() functions filter iteratively filter out http://www.foo.com
// and http://foo.com so they don't trigger off the pop-ups
... | To replicate the jQuery code using the Prototype library, you will need to utilize Prototype's DOM manipulation and collection handling methods. Prototype provides functionality to select elements, filter them, and add event handlers, though it does not have a direct equivalent to jQuery's `not()` method. Instead, you ... | 3,770 | [
{
"from": "human",
"value": "I have this code in jQuery, that I want to reimplement with the prototype library.\n// make external links open in popups\n// this will apply a window.open() behaviour to all anchor links\n// the not() functions filter iteratively filter out http://www.foo.com \n// and http://fo... |
Is there any difference between:
if foo is None: pass
and
if foo == None: pass
The convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter. None is an instance (and the only instance, IIRC) of NoneType, so it shouldn't matter, r... | Yes, there is a difference between using `is` and `==` in Python, particularly when checking for `None`.
1. **Identity vs Equality**:
- `is`: This operator checks for identity, meaning it checks whether two references point to the same object in memory. Since `None` is a singleton in Python (there is only one insta... | 5,347 | [
{
"from": "human",
"value": "Is there any difference between:\nif foo is None: pass\n\nand\nif foo == None: pass\n\nThe convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter. None is an instance (and the only instanc... |
What do you think is the best set-up for RoR in a Win Vista environment? I've tried the radrails eclipse plug-in, and it just seemed too bulky for me, I've also started to just use Textpad and the command line, but I'm used to having somewhat of an IDE to work with.
| Setting up Ruby on Rails (RoR) in a Windows Vista environment can be a bit challenging, especially with older versions of Windows. However, there are several options you can explore to find an IDE or setup that suits your preferences better than RadRails. Here are some recommendations:
1. **RubyInstaller + DevKit**:
... | 1,391 | [
{
"from": "human",
"value": "What do you think is the best set-up for RoR in a Win Vista environment? I've tried the radrails eclipse plug-in, and it just seemed too bulky for me, I've also started to just use Textpad and the command line, but I'm used to having somewhat of an IDE to work with.\n"
},
{... |
In my code behind I wire up my events like so:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
btnUpdateUser.Click += btnUpateUserClick;
}
I've done it this way because that's what I've seen in examples.
Does the base.OnInit() method need to be called?
Will it be implicitly be called?
Is it b... | When you override the `OnInit` method in a derived class, it's important to call the base class's `OnInit` method. Here's a breakdown of your questions:
1. **Does the base.OnInit() method need to be called?**
- Yes, it should be called to ensure that any initialization logic implemented in the base class is execute... | 3,372 | [
{
"from": "human",
"value": "In my code behind I wire up my events like so:\nprotected override void OnInit(EventArgs e)\n{\n base.OnInit(e);\n btnUpdateUser.Click += btnUpateUserClick;\n}\n\nI've done it this way because that's what I've seen in examples. \n\nDoes the base.OnInit() method need to be ... |
I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.
I can use .as... | Using JavaScript to help reduce spam submissions on forms is a common technique, as many automated bots may not execute JavaScript. Here's a simple approach using ASP.NET (either .aspx or .asp) to implement a JavaScript-based honeypot or validation that can help reduce form spam:
### Method: JavaScript Validation
1. ... | 2,766 | [
{
"from": "human",
"value": "I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't bro... |
Let's say I want a web page that contains a Flash applet and I'd like to drag and drop some objects from or to the rest of the web page, is this at all possible?
Bonus if you know a website somewhere that does that!
| Using Flash applets for web applications is largely considered outdated, as Adobe Flash has been officially discontinued as of December 31, 2020. Most modern web browsers no longer support Flash content, which makes it challenging to develop new web applications using this technology. Instead, HTML5, CSS3, and JavaScri... | 2,797 | [
{
"from": "human",
"value": "Let's say I want a web page that contains a Flash applet and I'd like to drag and drop some objects from or to the rest of the web page, is this at all possible?\nBonus if you know a website somewhere that does that!\n"
},
{
"from": "gpt",
"value": "Using Flash apple... |
Has anyone got experience with the white framework?
www.codeplex.com/white ?
I'm thinking about using it for the next project for basic smoke tests of our windows client. I'd like some advice on articles or your own experiences. Thanks.
| The White framework is a popular open-source UI automation library for Windows applications, primarily designed to help automate desktop applications built on technologies such as WPF, WinForms, and others. It's built on top of UI Automation (UIA) and is especially useful for writing automated tests for desktop apps.
... | 4,780 | [
{
"from": "human",
"value": "Has anyone got experience with the white framework?\nwww.codeplex.com/white ?\nI'm thinking about using it for the next project for basic smoke tests of our windows client. I'd like some advice on articles or your own experiences. Thanks.\n"
},
{
"from": "gpt",
"valu... |
I have the following arrays:
$artist = ["the roots", "michael jackson", "billy idol", "more", "and more", "and_YET_MORE"];
$count = [5, 3, 9, 1, 1, 3];
I want to generate a tag cloud that will have artists with a higher number in $count enclosed in h6 tags and the lowest enclosed h1 tags.
| To create a tag cloud based on the given `$artist` and `$count` arrays, where artists with higher counts are enclosed in `<h6>` tags and the lowest counts in `<h1>` tags, you can follow these steps in PHP:
1. **Pair the artists with their respective counts.**
2. **Determine the maximum and minimum counts.**
3. **Gener... | 1,730 | [
{
"from": "human",
"value": "I have the following arrays:\n$artist = [\"the roots\", \"michael jackson\", \"billy idol\", \"more\", \"and more\", \"and_YET_MORE\"];\n$count = [5, 3, 9, 1, 1, 3];\n\nI want to generate a tag cloud that will have artists with a higher number in $count enclosed in h6 tags and t... |
I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views.
Anyway, I wonder if anyone here could recommend a utility to automatically generate diagrams to help me visualise the whole structure.
What's the best program you'v... | When it comes to visualizing the structure of an MS SQL database, including views, tables, and relationships, there are several tools that can be helpful. Here are some recommendations:
1. **SQL Server Management Studio (SSMS)**: SSMS has built-in functionality to create database diagrams. You can right-click on "Data... | 4,545 | [
{
"from": "human",
"value": "I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views. \nAnyway, I wonder if anyone here could recommend a utility to automatically generate diagrams to help me visualise the whol... |
I used the LINQ to SQL designer in Visual Studio to create an object model of a database. Now, I want to add XML comments to each generated property but I can't figure out how to do it without erasing the properties the next time the dbml file is refreshed.
How can this be done?
| When working with LINQ to SQL and the .dbml designer in Visual Studio, any modifications you make directly in the designer (like adding XML comments) can be lost when you refresh the model, since the designer regenerates the code. To avoid losing your comments and other custom code when refreshing the .dbml file, you c... | 1,715 | [
{
"from": "human",
"value": "I used the LINQ to SQL designer in Visual Studio to create an object model of a database. Now, I want to add XML comments to each generated property but I can't figure out how to do it without erasing the properties the next time the dbml file is refreshed.\nHow can this be don... |
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the Nobot control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question in any form. No riddles, no what's in this image.
| If you're looking for unobtrusive CAPTCHA solutions that don't involve traditional UI elements like questions or image recognition tasks, there are several options that can be effective without requiring direct user interaction. Here are some of the best approaches:
1. **Honeypot Technique**: This method involves addi... | 2,581 | [
{
"from": "human",
"value": "What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the Nobot control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question in any for... |
What fonts do you use for programming, and for what language/IDE? I use Consolas for all my Visual Studio work, any other recommendations?
| Consolas is a popular choice for programming in Visual Studio, and it’s a solid option due to its clear readability and good spacing. Here are some other font recommendations that are commonly used for various programming languages and IDEs:
1. **Fira Code**:
- **Language/IDE**: Works well with many languages and p... | 1,089 | [
{
"from": "human",
"value": "What fonts do you use for programming, and for what language/IDE? I use Consolas for all my Visual Studio work, any other recommendations?\n"
},
{
"from": "gpt",
"value": "Consolas is a popular choice for programming in Visual Studio, and it’s a solid option due to ... |
I'm looking around for a Java code signing certificate so my Java applets don't throw up such scary security warnings. However, all the places I've found offering them charge (in my opinion) way too much, like over USD200 per year. While doing research, a code signing certificate seems almost exactly the same as an SSL... | While it's understandable to look for ways to reduce costs, it's important to know that SSL certificates and code signing certificates serve different purposes and are not interchangeable.
### Key Differences:
1. **Purpose**:
- **SSL Certificates**: These are used to secure communications over networks (like HTTPS... | 4,981 | [
{
"from": "human",
"value": "I'm looking around for a Java code signing certificate so my Java applets don't throw up such scary security warnings. However, all the places I've found offering them charge (in my opinion) way too much, like over USD200 per year. While doing research, a code signing certificat... |
Should you ever use protected member variables? What are the the advantages and what issues can this cause?
| Using protected member variables in object-oriented programming (OOP) has its advantages and disadvantages. Let's explore both sides:
### Advantages of Protected Member Variables:
1. **Controlled Access**: Protected members can be accessed by the class itself and by derived classes, allowing for a controlled level of... | 4,668 | [
{
"from": "human",
"value": "Should you ever use protected member variables? What are the the advantages and what issues can this cause?\n"
},
{
"from": "gpt",
"value": "Using protected member variables in object-oriented programming (OOP) has its advantages and disadvantages. Let's explore bot... |
I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call default(T) on an object, it returns null. For various reasons we nee... | You are correct in noting that handling the case for `string` in a way that feels clean and maintainable is important. While your current solution does work, there are better ways to achieve this without having to hardcode specific types like `string`.
One way to handle this is to check if `T` is a reference type and ... | 4,656 | [
{
"from": "human",
"value": "I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call default(T) on an object, it... |
I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment nu... | TNT's consignment numbers, like many other courier companies, do have a specific format, but the details of their validation algorithms are not publicly disclosed. TNT tracking numbers typically consist of a series of numeric and alphanumeric characters and can vary in length depending on the type of shipment.
While ... | 6,345 | [
{
"from": "human",
"value": "I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a \"weighted average mod system\" which can be used to identify if a number is a valid tracking num... |
I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so?
public interface Foo { Bar GetBar(); }
public struct Fubar : Foo { public Bar GetBar() { return new Bar(); }... | Implementing interfaces in structs in C# isn't inherently "bad," but there are some important considerations and potential unintended consequences that you should be aware of.
### Key Considerations:
1. **Value Semantics**:
- Structs are value types, meaning they are copied on assignment. When you implement an in... | 2,620 | [
{
"from": "human",
"value": "I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so?\npublic interface Foo { Bar GetBar(); }\npublic struct Fubar : Foo ... |
What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful?
What if my hoster doesn't permit PUT and DELETE?
Is this actually important, can I live happily ever after with just GET and POST ?
Update: Thanks for the answers folks, Roger's answer was probably best becaus... | To be considered RESTful, a web service should ideally support the four main HTTP verbs that correspond to the basic CRUD (Create, Read, Update, Delete) operations:
1. **GET** - Retrieve a resource.
2. **POST** - Create a new resource.
3. **PUT** - Update an existing resource or create it if it doesn't exist.
4. **DEL... | 4,738 | [
{
"from": "human",
"value": "What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful? \nWhat if my hoster doesn't permit PUT and DELETE?\nIs this actually important, can I live happily ever after with just GET and POST ?\n\nUpdate: Thanks for the answers f... |
Is it possible to use an IF clause within a WHERE clause in MS SQL?
Example:
WHERE
IF IsNumeric(@OrderNumber) = 1
OrderNumber = @OrderNumber
ELSE
OrderNumber LIKE '%' + @OrderNumber + '%'
| In SQL Server, you cannot use an `IF` statement directly inside a `WHERE` clause. However, you can achieve similar logic using a combination of boolean logic within the `WHERE` clause.
You can use a conditional expression like `CASE` or simply combine conditions using `AND` and `OR` operators. Here’s how you can rewri... | 6,537 | [
{
"from": "human",
"value": "Is it possible to use an IF clause within a WHERE clause in MS SQL?\nExample:\nWHERE\n IF IsNumeric(@OrderNumber) = 1\n OrderNumber = @OrderNumber\n ELSE\n OrderNumber LIKE '%' + @OrderNumber + '%'\n\n"
},
{
"from": "gpt",
"value": "In SQL Server,... |
I have a series of PDFs named sequentially like so:
01_foo.pdf
02_bar.pdf
03_baz.pdf
etc.
Using Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the job.
If this isn't possible in Ruby, how about another language? No commercial com... | It's great to see that you found a solution using `pdftk`! For others who may be interested, here's a bit more detail about your approach and an alternative solution using Ruby without needing external tools like `pdftk`.
### Using pdftk (as you mentioned)
You can use `pdftk` to combine PDF files efficiently, as you'... | 4,890 | [
{
"from": "human",
"value": "I have a series of PDFs named sequentially like so:\n\n01_foo.pdf\n02_bar.pdf\n03_baz.pdf\netc.\n\nUsing Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the job.\nIf this isn't possible in Ru... |
We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients use different collation for the connections ... | The requirement for SQL Server Enterprise Edition based on collation differences across databases in a single instance may be overstated. In SQL Server, the collation settings at the database level can differ, and SQL Server does allow you to host multiple databases with different collations within the same instance of... | 3,149 | [
{
"from": "human",
"value": "We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients use... |
Here is a sample from Kernighan & Ritchie's "The C Programming Language":
int getline(char s[], int lim)
{
int c, i = 0;
while (--lim > 0; && (c=getchar()) !=EOF && c !='\n')
{
s[i++] = c;
}
if (c =='\n')
{
s[i++] = c;
}
s[i] = '\0';
return i;
}
Why do we should check if c !... | In the provided code from the `getline` function, checking `c != '\n'` before reading the character into the string `s` serves a few important purposes:
1. **Control Loop Execution**: The `while` loop is designed to read characters until it either reaches the end of the input (EOF), runs out of space in the buffer (de... | 5,638 | [
{
"from": "human",
"value": "Here is a sample from Kernighan & Ritchie's \"The C Programming Language\":\nint getline(char s[], int lim)\n{\n int c, i = 0;\n\n while (--lim > 0; && (c=getchar()) !=EOF && c !='\\n')\n {\n s[i++] = c;\n }\n\n if (c =='\\n') \n {\n s[i++] = c;\n }\n\n ... |
Is there a way in .net 2.0 to discover the network alias for the machine that my code is running on? Specifically, if my workgroup sees my machine as //jekkedev01, how do I retrieve that name programmatically?
| In .NET 2.0, you can retrieve the network alias (also known as the NetBIOS name) of the machine using the `System.Net.Dns` class combined with the `System.Environment` class. While .NET does not provide a direct method to get the NetBIOS name, you can access the host name of the machine, which is usually what you see i... | 5,270 | [
{
"from": "human",
"value": "Is there a way in .net 2.0 to discover the network alias for the machine that my code is running on? Specifically, if my workgroup sees my machine as //jekkedev01, how do I retrieve that name programmatically?\n"
},
{
"from": "gpt",
"value": "In .NET 2.0, you can ret... |
Consider:
List<String> someList = new ArrayList<>();
// add "monkey", "donkey", "skeleton key" to someList
for (String item : someList) {
System.out.println(item);
}
What would the equivalent for loop look like without using the for each syntax?
People new to Java commonly encounter issues when trying to modify ... | To rewrite the `for-each` loop using a traditional `for` loop, you would need to access the elements of the `List` by their index. Here’s how you can do it:
```java
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> someList = new A... | 4,708 | [
{
"from": "human",
"value": "Consider:\nList<String> someList = new ArrayList<>();\n// add \"monkey\", \"donkey\", \"skeleton key\" to someList\n\nfor (String item : someList) {\n System.out.println(item);\n}\n\nWhat would the equivalent for loop look like without using the for each syntax?\n\nPeople new... |
How do you unit test a HttpModule in asp.net given that HttpApplication and HttpContext do no implement an interface ?
| Unit testing an `HttpModule` in ASP.NET can be a bit challenging due to the tight coupling with `HttpApplication` and `HttpContext`. However, you can employ some techniques to facilitate testing. Here’s a general approach:
### Steps to Unit Test an HttpModule
1. **Use Mocking Frameworks**: Since `HttpApplication` and... | 4,028 | [
{
"from": "human",
"value": "How do you unit test a HttpModule in asp.net given that HttpApplication and HttpContext do no implement an interface ?\n"
},
{
"from": "gpt",
"value": "Unit testing an `HttpModule` in ASP.NET can be a bit challenging due to the tight coupling with `HttpApplication` a... |
Got a bluescreen in windows while cloning a mercurial repository.
After reboot, I now get this message for almost all hg commands:
c:\src\>hg commit
waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
interrupted!
Google is no h... | The error message you're seeing indicates that Mercurial (hg) is trying to access a repository lock that it believes is held by a process that is not identifiable (the lock identifier is represented by a series of null characters). This could be a result of the bluescreen crash during your cloning operation, which may ... | 4,450 | [
{
"from": "human",
"value": "Got a bluescreen in windows while cloning a mercurial repository.\nAfter reboot, I now get this message for almost all hg commands:\n\nc:\\src\\>hg commit\nwaiting for lock on repository c:\\src\\McVrsServer held by '\\x00\\x00\\x00\\x00\\x00\\\nx00\\x00\\x00\\x00\\x00\\x00\\x00... |
What does it mean if a task is declared with the automatic keyword in Verilog?
task automatic do_things;
input [31:0] number_of_things;
reg [31:0] tmp_thing;
begin
// ...
end
endtask;
Note: This question is mostly because I'm curious if there are any hardware programmers on the site. :)
| In Verilog, when a task is declared with the `automatic` keyword, it indicates that the task is reentrant and has its own local variables that are not shared between different invocations of the task. This behavior is particularly useful in situations where the task may be called multiple times, potentially from differ... | 2,952 | [
{
"from": "human",
"value": "What does it mean if a task is declared with the automatic keyword in Verilog?\ntask automatic do_things;\n input [31:0] number_of_things;\n reg [31:0] tmp_thing;\n begin\n // ...\n end\nendtask;\n\nNote: This question is mostly because I'm curious if there are any hardwa... |
In .Net you can read a string value into another data type using either <datatype>.parse or Convert.To<DataType>.
I'm not familiar with the fundamentals of parse versus convert so I am always at a loss when asked which one is better/faster/more appropriate.
So - which way is best in what type of circumstances?
| In .NET, both `Type.Parse` (like `int.Parse`, `double.Parse`, etc.) and `Convert.To<Type>` (like `Convert.ToInt32`, `Convert.ToDouble`, etc.) are used to convert string representations of data types into actual data types, but they behave differently and have different use cases. Here’s a breakdown of each approach:
#... | 666 | [
{
"from": "human",
"value": "In .Net you can read a string value into another data type using either <datatype>.parse or Convert.To<DataType>. \nI'm not familiar with the fundamentals of parse versus convert so I am always at a loss when asked which one is better/faster/more appropriate. \nSo - which way is... |
Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class?
class Base {
public:
bool someGuaranteedResult() { return true; }
};
class Child : public Base {
public:
bool someGuaranteedResult() { return false; /* Haha I broke thing... | In C++, you can prevent a derived class from overriding a method by using the `final` specifier. This specifier can only be applied to virtual methods. However, since you are specifically looking to prevent overriding a non-virtual method, C++ doesn't have a direct language feature to enforce this, as you have observed... | 5,722 | [
{
"from": "human",
"value": "Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class?\nclass Base {\npublic:\n bool someGuaranteedResult() { return true; }\n};\n\nclass Child : public Base {\npublic:\n bool someGuarant... |
Add service reference to Amazon service fails, saying
"Could not load file or assembly "System.Core, Version=3.5.0.0,...' or
one or more of it dependencies. The module was expected to contain an
assembly manifest."
This is in VS 2008, haven't installed SP1 on this machine yet.
Any ideas?
| The error message you’re encountering suggests that there is a problem with the assembly reference for `System.Core`, which is a part of the .NET Framework. Here are some potential solutions to help you resolve the issue:
### 1. **Install .NET Framework 3.5 SP1**
Since you’re using Visual Studio 2008 and have not inst... | 2,451 | [
{
"from": "human",
"value": "Add service reference to Amazon service fails, saying \n\n\"Could not load file or assembly \"System.Core, Version=3.5.0.0,...' or\n one or more of it dependencies. The module was expected to contain an\n assembly manifest.\"\n\nThis is in VS 2008, haven't installed SP1 on thi... |
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5?
| It appears that you are experiencing an issue with TinyMCE not displaying properly in Drupal 5 when using the Google Chrome browser. Here are some troubleshooting steps and solutions you can try:
1. **Check for JavaScript Errors**: Open the Developer Console in Chrome (right-click on the page and select "Inspect," the... | 4,720 | [
{
"from": "human",
"value": "My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5?\n"
},
{
"from": "gpt",
"value": "It appears that you are experiencing an issue with TinyMCE not displaying prope... |
I'm introducing Subversion into our web shop. I want to want the checked in files to be uploaded into the server via FTP (and as they get use to Subversion, via SFTP). The files are sent to a release candidate page for testing purposes. A script can be called to move the files into production.
My question is this: How ... | To automate the process of transferring files to your web server via FTP (or SFTP) upon a Subversion commit, you can create a post-commit hook in Subversion. This hook will execute a script after every successful commit, allowing you to push the updated files to your web server.
Here’s how to set it up:
### Step 1: C... | 1,684 | [
{
"from": "human",
"value": "I'm introducing Subversion into our web shop. I want to want the checked in files to be uploaded into the server via FTP (and as they get use to Subversion, via SFTP). The files are sent to a release candidate page for testing purposes. A script can be called to move the files i... |
This snippet of Perl code in my program is giving the wrong result.
$condition ? $a = 2 : $a = 3 ;
print $a;
No matter what the value of $condition is, the output is always 3, how come?
| The issue with your Perl code is in the way the conditional operator (`? :`) is being used. The conditional operator returns a value based on the condition, but it does not work the way you are using it when you are trying to assign a value to `$a`.
Here's your original line:
```perl
$condition ? $a = 2 : $a = 3 ;
``... | 5,640 | [
{
"from": "human",
"value": "This snippet of Perl code in my program is giving the wrong result.\n$condition ? $a = 2 : $a = 3 ;\nprint $a;\n\nNo matter what the value of $condition is, the output is always 3, how come?\n"
},
{
"from": "gpt",
"value": "The issue with your Perl code is in the way... |
Why should I or shouldn't I use dirty reads:
set transaction isolation level read uncommitted
in SQL Server?
| Using the `READ UNCOMMITTED` isolation level in SQL Server, which allows for dirty reads, has its advantages and disadvantages. Below are some considerations to help you decide whether to use it or not:
### Reasons to Use Dirty Reads (`READ UNCOMMITTED`):
1. **Performance Improvement**:
- Dirty reads can significa... | 3,374 | [
{
"from": "human",
"value": "Why should I or shouldn't I use dirty reads:\nset transaction isolation level read uncommitted\n\nin SQL Server?\n"
},
{
"from": "gpt",
"value": "Using the `READ UNCOMMITTED` isolation level in SQL Server, which allows for dirty reads, has its advantages and disadvan... |
I'm customizing a SugarCRM 5, and in my SugarCRM database I have all invoices which were imported from our ERP. Now, I would like to know if it is possible to create a new sub-panel in the Accounts Panel without editing the original SugarCRM files, so that my client invoices index are visible in that interface.
| Creating a new sub-panel in SugarCRM 5 for displaying your client invoices without directly editing the core files is feasible through the use of custom modules and extensions. Here are the steps you can follow to achieve this:
### Steps to Create a Sub-panel for Client Invoices
1. **Create a Custom Module**:
- Us... | 3,619 | [
{
"from": "human",
"value": "I'm customizing a SugarCRM 5, and in my SugarCRM database I have all invoices which were imported from our ERP. Now, I would like to know if it is possible to create a new sub-panel in the Accounts Panel without editing the original SugarCRM files, so that my client invoices ind... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.