instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Right now I'm doing something like this:
RewriteRule ^/?logout(/)?$ logout.php
RewriteRule ^/?config(/)?$ config.php
I would much rather have one rules that would do the same thing for each url, so I don't have to keep adding them every time I add a new file.
Also, I like to match things like '/config/new' to 'config_... | You can achieve the desired functionality using a single `RewriteRule` along with a regular expression in your `.htaccess` file. The idea is to capture the base filename and any additional segments in the URL path, and then use those to construct the target PHP filename accordingly.
Here's how you can set it up:
```a... | 9,707 | [
{
"from": "human",
"value": "Right now I'm doing something like this:\nRewriteRule ^/?logout(/)?$ logout.php\nRewriteRule ^/?config(/)?$ config.php\n\nI would much rather have one rules that would do the same thing for each url, so I don't have to keep adding them every time I add a new file.\nAlso, I like ... |
We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was wondering if we could have a redundant conne... | In an ASP.NET application using `ActiveDirectoryMembershipProvider`, there isn't a built-in way to directly specify a primary and backup domain controller within the provider's configuration. However, you can implement a solution that allows you to connect to a backup domain controller when the primary one is unavailab... | 10,064 | [
{
"from": "human",
"value": "We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was won... |
By default, Eclipse won't show my .htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences.
| Eclipse does not show files that begin with a dot (like `.htaccess`) by default because these files are considered hidden in Unix-based systems. To make Eclipse display your `.htaccess` file in the Package Explorer (or Project Explorer), you can follow these steps:
1. **Switch to Project Explorer:**
- If you are us... | 11,463 | [
{
"from": "human",
"value": "By default, Eclipse won't show my .htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences.\n"
},
{
"from": "gpt",
"value": "Eclipse does not show files that begin w... |
In C# there are String objects and string objects.
What is the difference between the two?
What are the best practices regarding which to use?
| In C#, the terms `String` and `string` refer to the same underlying type, which is `System.String`. The difference lies primarily in their usage and context.
### Differences Between `String` and `string`:
1. **Case Sensitivity**:
- `String` is the .NET Framework class name (found in the `System` namespace).
- `... | 9,472 | [
{
"from": "human",
"value": "In C# there are String objects and string objects. \nWhat is the difference between the two? \nWhat are the best practices regarding which to use?\n"
},
{
"from": "gpt",
"value": "In C#, the terms `String` and `string` refer to the same underlying type, which is `Sys... |
I like InnoDB's safety, consistency, and self-checking.
But I need MyISAM's speed and light weight.
How can I make MyISAM less prone to corruption due to crashes, bad data, etc.? It takes forever to go through a check (either CHECK TABLE or myisamchk).
I'm not asking for transactional security -- that's what InnoDB is... | If you want to mitigate the risks associated with using MyISAM tables and enhance their reliability without sacrificing performance, here are some strategies you can consider:
1. **Frequent Backups**: Schedule regular backups of your MyISAM tables. This can be done using the `mysqldump` utility or similar tools. Incre... | 7,520 | [
{
"from": "human",
"value": "I like InnoDB's safety, consistency, and self-checking.\nBut I need MyISAM's speed and light weight.\nHow can I make MyISAM less prone to corruption due to crashes, bad data, etc.? It takes forever to go through a check (either CHECK TABLE or myisamchk). \nI'm not asking for tra... |
I'm a member of ACM, and I have limited access to both Books 24x7 and Safari Books Online, however if I was interested in moving up to a full account for greater access to other books what online book service would you recommend?
| If you're considering upgrading your access for greater book availability, I recommend looking into **O'Reilly Online Learning** (formerly Safari Books Online). This platform offers a vast library of technical and business books, video courses, and learning paths that cover a wide range of topics, including programming... | 10,672 | [
{
"from": "human",
"value": "I'm a member of ACM, and I have limited access to both Books 24x7 and Safari Books Online, however if I was interested in moving up to a full account for greater access to other books what online book service would you recommend?\n"
},
{
"from": "gpt",
"value": "If y... |
I'm using a library to get an 'oAuth_token' and 'oAuth_token_secret'.
If I make a request to a REST web service how are those two keys leveraged to verify authentication?
| When you use OAuth for authentication with a REST web service, the `oAuth_token` and `oAuth_token_secret` are key components in the OAuth authentication process. Here's how they are typically leveraged to verify authentication:
1. **Obtaining the OAuth Token and Secret**: Initially, you authenticate with the service p... | 9,081 | [
{
"from": "human",
"value": "I'm using a library to get an 'oAuth_token' and 'oAuth_token_secret'.\nIf I make a request to a REST web service how are those two keys leveraged to verify authentication?\n"
},
{
"from": "gpt",
"value": "When you use OAuth for authentication with a REST web service,... |
I am considering converting a project that I've inherited from .net 1.1 to .net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail.
I'm not ready to re-write all the components using the obsolete System.Web.Mail, so I'm curious to hear if any community... | Transitioning from .NET 1.1 to .NET 2.0 brings some significant improvements, and one of the recommended changes is moving from `System.Web.Mail` to `System.Net.Mail`. While `System.Web.Mail` may still function in .NET 2.0, it is considered obsolete, and there are several reasons to consider making the switch:
1. **De... | 8,680 | [
{
"from": "human",
"value": "I am considering converting a project that I've inherited from .net 1.1 to .net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail.\nI'm not ready to re-write all the components using the obsolete System.Web.Mai... |
Can anyone recommend an open source Ruby library for adding XMP metadata to JPEG images?
| Yes, you can use the `mini_exiftool` gem, which is a Ruby wrapper for ExifTool, a powerful tool for reading and writing metadata in images, including XMP metadata. Here's how to get started with it:
1. **Install the gem**: You can add it to your Gemfile or install it directly using the command:
```bash
gem inst... | 11,094 | [
{
"from": "human",
"value": "Can anyone recommend an open source Ruby library for adding XMP metadata to JPEG images?\n"
},
{
"from": "gpt",
"value": "Yes, you can use the `mini_exiftool` gem, which is a Ruby wrapper for ExifTool, a powerful tool for reading and writing metadata in images, inclu... |
How do I quickly rename a MySQL database (change its schema name)?
Usually I just dump a database and re-import it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; does bad things, exists only in a handful of versions, and is a bad idea overall... | Renaming a MySQL database directly is not supported as a standard operation across all versions of MySQL, especially for InnoDB databases, and while the command `RENAME DATABASE` is not advisable, you do have some alternatives. Here are a couple of safe ways to achieve this goal without needing to dump and reload a ver... | 4,129 | [
{
"from": "human",
"value": "How do I quickly rename a MySQL database (change its schema name)?\nUsually I just dump a database and re-import it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; does bad things, exists only in a hand... |
Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like
foo(fun x -> x ** 3)
More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.
| Yes, in F#, you can pass functions (including lambda functions) as parameters to other functions. This is a common practice in functional programming and is fully supported in F#.
To pass a lambda function to another function, you need to define the parameter type for the function you want to pass. Here’s an example ... | 10,742 | [
{
"from": "human",
"value": "Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like\nfoo(fun x -> x ** 3)\nMore specifically, I need to know how I would refer to the passed function in a function that I wrote myself.\n"
},
{
... |
I want to practice my skills away from a keyboard (i.e. pen and paper) and I'm after simple practice questions like Fizz Buzz, Print the first N primes.
What are your favourite simple programming questions?
| Practicing programming concepts on pen and paper is a great way to enhance your problem-solving skills! Here are some simple yet effective programming questions you can work on:
1. **Fizz Buzz**: Write a program that prints the numbers from 1 to 100. But for multiples of three, print "Fizz" instead of the number and f... | 10,445 | [
{
"from": "human",
"value": "I want to practice my skills away from a keyboard (i.e. pen and paper) and I'm after simple practice questions like Fizz Buzz, Print the first N primes.\nWhat are your favourite simple programming questions?\n"
},
{
"from": "gpt",
"value": "Practicing programming con... |
I just want my apache to register some of my predefined environment so that i can retrieve it using getenv function in php. How can i do this? I tried adding /etc/profile.d/foo.sh with export FOO=/bar/baz using root and restarted apache.
| To set environment variables for your Apache server so that they are accessible via the `getenv()` function in PHP, you can follow these steps:
### Method 1: Using Apache's Configuration
1. **Edit Apache Configuration**:
You can set environment variables directly in your Apache configuration file (usually `httpd.c... | 9,492 | [
{
"from": "human",
"value": "I just want my apache to register some of my predefined environment so that i can retrieve it using getenv function in php. How can i do this? I tried adding /etc/profile.d/foo.sh with export FOO=/bar/baz using root and restarted apache.\n"
},
{
"from": "gpt",
"value... |
What is the best way to implement mutliple Default Buttons on a ASP.NET Webform?
I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search field with a search button.
| In ASP.NET Web Forms, you can have multiple default buttons on the same page using the `DefaultButton` property of the `Panel` or `Form` control. This allows you to specify which button should be triggered when the user presses the Enter key in a specific input field.
To implement this with a login area and a search ... | 5,890 | [
{
"from": "human",
"value": "What is the best way to implement mutliple Default Buttons on a ASP.NET Webform?\nI have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search field with a search button.\n"... |
In Python there is a really neat function called zip which can be used to iterate through two lists at the same time:
list1 = [1, 2, 3]
list2 = ["a", "b", "c"]
for v1, v2 in zip(list1, list2):
print v1 + " " + v2
The above code should produce the following:
1 a
2 b
3 c
I wonder if there is a method like it availab... | In .NET, particularly with C#, there isn't a built-in function exactly like Python's `zip`, but you can achieve similar functionality using LINQ. Here’s how you can do it:
### Using LINQ in C#
You can use the `Zip` method provided by LINQ to combine two sequences. Here's an example that demonstrates how you can use `... | 11,478 | [
{
"from": "human",
"value": "In Python there is a really neat function called zip which can be used to iterate through two lists at the same time:\nlist1 = [1, 2, 3]\nlist2 = [\"a\", \"b\", \"c\"]\nfor v1, v2 in zip(list1, list2):\n print v1 + \" \" + v2\n\nThe above code should produce the following:\n1... |
Is there a way?
I need all types that implement a specific interface to have a parameterless constructor, can it be done?
I am developing the base code for other developers in my company to use in a specific project.
There's a proccess which will create instances of types (in different threads) that perform certain tas... | In C#, there's no built-in way to enforce a parameterless constructor for all implementations of an interface directly. However, there are a few approaches you can take to achieve your goal of requiring that all types implementing a specific interface have a parameterless constructor.
### Option 1: Use Abstract Base C... | 7,108 | [
{
"from": "human",
"value": "Is there a way?\nI need all types that implement a specific interface to have a parameterless constructor, can it be done?\nI am developing the base code for other developers in my company to use in a specific project.\nThere's a proccess which will create instances of types (in... |
I'm using ADO.NET to access SQL Server 2005 and would like to be able to log from inside the T-SQL stored procedures that I'm calling. Is that somehow possible?
I'm unable to see output from the 'print'-statement when using ADO.NET and since I want to use logging just for debuging the ideal solution would be to emit me... | Logging from within T-SQL stored procedures in SQL Server can be a bit tricky since you don't have direct access to the environment where the ADO.NET application is running. However, you can use a couple of approaches to log messages that can be captured by tools like DebugView or logged into a database table.
Here ar... | 6,459 | [
{
"from": "human",
"value": "I'm using ADO.NET to access SQL Server 2005 and would like to be able to log from inside the T-SQL stored procedures that I'm calling. Is that somehow possible?\nI'm unable to see output from the 'print'-statement when using ADO.NET and since I want to use logging just for debug... |
Supposedly, it is possible to get this from Google Maps or some such service. (US addresses only is not good enough.)
| It seems you might be looking for specific data or features from a mapping service like Google Maps that go beyond just U.S. addresses. Could you clarify what exactly you're trying to obtain? For instance, are you looking for geographic data, route planning, business information, or something else? This will help me pr... | 13,917 | [
{
"from": "human",
"value": "Supposedly, it is possible to get this from Google Maps or some such service. (US addresses only is not good enough.)\n"
},
{
"from": "gpt",
"value": "It seems you might be looking for specific data or features from a mapping service like Google Maps that go beyond j... |
We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products.
What I would like to know is this: Are there standard "Best Practices" for the development of these types of API?
I am thinki... | When developing a middleware SDK, especially one intended for use in game development, animation software, and avatar development, adhering to best practices is crucial for usability, readability, efficiency, and overall developer experience. Here are some guidelines categorized by various aspects of SDK development:
... | 3,524 | [
{
"from": "human",
"value": "We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products.\nWhat I would like to know is this: Are there standard \"Best Practices\" for the de... |
I have an application that sends the customer to another site to handle the payments. The other site, outside of the customer, calls a page on our server to let us know what the status is of the payment. The called page checks the parameters that are given by the payment application and checks to see whether the transa... | Your presumption that a servlet could be a more appropriate choice for handling this specific functionality is indeed valid. Here are the answers to your questions:
### 1. Is my presumption correct?
Yes, your presumption is correct. While JSP (JavaServer Pages) can be used for various functionalities, servlets are ge... | 6,993 | [
{
"from": "human",
"value": "I have an application that sends the customer to another site to handle the payments. The other site, outside of the customer, calls a page on our server to let us know what the status is of the payment. The called page checks the parameters that are given by the payment applica... |
What is the correct way to import a C++ class from a DLL? We're using Visual C++.
There's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work?
| Yes, you are correct that the issues with importing C++ classes from a DLL in Visual C++ are primarily due to name mangling. C++ functions and methods have their names "mangled" by the compiler to support function overloading and other language features. This makes it difficult to use `LoadLibrary` and `GetProcAddress`... | 8,276 | [
{
"from": "human",
"value": "What is the correct way to import a C++ class from a DLL? We're using Visual C++. \nThere's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work?\n"
},
{... |
I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the command to jump to the end of the line that I am currently on?
| In command mode, you can jump to the end of the current line by pressing the `$` key. This will move the cursor to the last character of the line you are currently on. | 14,216 | [
{
"from": "human",
"value": "I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the command to jump to the end of the line that I am currently on?\n"
},
{
"from": "gpt",
"value": "In command mode, you can jump to the end of the current line by p... |
Our CruiseControl system checks out from starteam. I've noticed that it is sometimes not checking out new versions of files, only added files.
Does anyone know why this is?
| When using CruiseControl with a version control system like StarTeam, there are a few reasons why it might not check out new versions of files, but only added files. Here are some potential causes and troubleshooting steps you can consider:
1. **Polling Interval**: CruiseControl typically checks the repository at spec... | 9,009 | [
{
"from": "human",
"value": "Our CruiseControl system checks out from starteam. I've noticed that it is sometimes not checking out new versions of files, only added files.\nDoes anyone know why this is?\n"
},
{
"from": "gpt",
"value": "When using CruiseControl with a version control system like ... |
I've searched for this a little but I have not gotten a particularly straight answer. In C (and I guess C++), how do you determine what comes after the % when using printf?. For example:
double radius = 1.0;
double area = 0.0;
area = calculateArea( radius );
printf( "%10.1f %10.2\n", radius, area );
I took this ex... | In C (and C++), the formatting string used in the `printf` function specifies how the output should be formatted. The format specifiers you see, such as `%10.1f` and `%10.2`, are used to control the appearance of floating-point numbers when they are printed.
Let's break down the format specifiers:
### Format Specifie... | 8,529 | [
{
"from": "human",
"value": "I've searched for this a little but I have not gotten a particularly straight answer. In C (and I guess C++), how do you determine what comes after the % when using printf?. For example:\ndouble radius = 1.0;\ndouble area = 0.0;\narea = calculateArea( radius );\nprintf( \"%10.1f... |
Everywhere I look always the same explanation pop ups.
Configure the view resolver.
<bean id="viewMappings"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<property name="basename" value="views" />
</bean>
And then put a file in the classpath named view.properties with some key-valu... | In a Spring MVC application, the `ResourceBundleViewResolver` is used to resolve view names to actual views by using a resource bundle. This mechanism enables you to map logical view names (like "logout") to actual JSP files or other view technologies (like Thymeleaf, FreeMarker, etc.).
### Explanation of `logout.clas... | 9,882 | [
{
"from": "human",
"value": "Everywhere I look always the same explanation pop ups.\nConfigure the view resolver.\n<bean id=\"viewMappings\"\n class=\"org.springframework.web.servlet.view.ResourceBundleViewResolver\">\n <property name=\"basename\" value=\"views\" />\n</bean>\n\nAnd then put a file i... |
I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.
| To analyze performance monitoring data captured in PerfMon (Performance Monitor) files, you have several options for tools that can help you crunch the information and visualize the average statistics per hour for the monitored object counters. Here are a few of the best options:
1. **Windows Performance Analyzer (WPA... | 9,795 | [
{
"from": "human",
"value": "I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.\n"
},
{
"from": "gpt",
"value"... |
I have the following code:
string prefix = "OLD:";
Func<string, string> prependAction = (x => prefix + x);
prefix = "NEW:";
Console.WriteLine(prependAction("brownie"));
Because the compiler replaces the prefix variable with a closure "NEW:brownie" is printed to the console.
Is there an easy way to prevent the compiler... | The issue you're encountering is related to how closures work in C#. When you define a lambda expression that uses a variable from the outer scope (like your `prefix` variable), the compiler captures that variable in a closure. This means that any changes to the variable in the outer scope will be reflected in the lamb... | 8,641 | [
{
"from": "human",
"value": "I have the following code:\nstring prefix = \"OLD:\";\nFunc<string, string> prependAction = (x => prefix + x);\nprefix = \"NEW:\";\nConsole.WriteLine(prependAction(\"brownie\"));\n\nBecause the compiler replaces the prefix variable with a closure \"NEW:brownie\" is printed to th... |
We have a client/server application with a rich client front end (in .Net) and also an administration portal (Asp.Net). Currently users have to sign on in both the rich client and on the website. We'd like to enable them to sign into the rich client, but not have to sign on to the website if they launch it from within... | To achieve seamless authentication between your rich client (built in .NET) and your ASP.NET web portal, you can implement a Single Sign-On (SSO) solution. Here’s a general approach to facilitate SSO for both scenarios you outlined:
### 1. Implement OAuth 2.0 / OpenID Connect
Using an OAuth 2.0 or OpenID Connect-base... | 6,600 | [
{
"from": "human",
"value": "We have a client/server application with a rich client front end (in .Net) and also an administration portal (Asp.Net). Currently users have to sign on in both the rich client and on the website. We'd like to enable them to sign into the rich client, but not have to sign on to ... |
The eval function is a powerful and easy way to dynamically generate code, so what are the caveats?
| The `eval` function in programming languages like JavaScript and Python is indeed powerful, allowing developers to execute code represented as a string. However, it comes with several significant caveats and risks:
1. **Security Risks**:
- **Code Injection**: Using `eval` can open up your application to code inject... | 4,350 | [
{
"from": "human",
"value": "The eval function is a powerful and easy way to dynamically generate code, so what are the caveats?\n"
},
{
"from": "gpt",
"value": "The `eval` function in programming languages like JavaScript and Python is indeed powerful, allowing developers to execute code repres... |
I need to rotate an image at 12 midnight every day from a group of 5-10 images. How can I go about doing this with JavaScript or jQuery or even PHP?
| To rotate an image at midnight every day using JavaScript, jQuery, or PHP, you'll need to consider a few steps. The core logic would typically involve storing the images and determining the current date and time to decide which image to display.
Here's a simple approach using JavaScript, which can be set up on a webpa... | 6,295 | [
{
"from": "human",
"value": "I need to rotate an image at 12 midnight every day from a group of 5-10 images. How can I go about doing this with JavaScript or jQuery or even PHP?\n"
},
{
"from": "gpt",
"value": "To rotate an image at midnight every day using JavaScript, jQuery, or PHP, you'll nee... |
I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the "Specify configuration setings directly" option)
This works well when I'm using the Database connection that I specified when developing the package. However when I run it on a server (64 bit) in the testin... | It sounds like you're facing an issue with SSIS package configurations that may not be updating correctly when you change the connection string. Here are some steps and tips to troubleshoot the issue:
### 1. Check Package Configuration
First, confirm that the package configurations are set up correctly. Make sure tha... | 6,834 | [
{
"from": "human",
"value": "I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the \"Specify configuration setings directly\" option)\nThis works well when I'm using the Database connection that I specified when developing the package. However when... |
I have an NSArray and I'd like to create a new NSArray with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a BOOL.
I can create an NSMutableArray, iterate through the source array and copy over the objects that the filter function accepts and then create a... | Yes, there is a more efficient and concise way to filter an `NSArray` based on a condition defined by a function. Instead of manually iterating through the array and using an `NSMutableArray`, you can use the `filter` method in combination with blocks (if you are using Objective-C with modern syntax) or use the `NSPred... | 8,425 | [
{
"from": "human",
"value": "I have an NSArray and I'd like to create a new NSArray with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a BOOL.\nI can create an NSMutableArray, iterate through the source array and copy over the objects that the... |
I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add functionality or fixed bugs. Unfortuna... | Convincing skeptical developers about the value of unit testing can be challenging, especially when dealing with a legacy codebase that may not have been designed with testability in mind. Here are some strategies to help you promote the benefits of unit testing effectively:
### 1. **Educate on Benefits:**
- **Impr... | 4,639 | [
{
"from": "human",
"value": "I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we a... |
Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions.
Is there any way to enable code completion for Perl in vim?
| Yes, you can enable code completion for Perl (and other languages) in Vim using various plugins and built-in features. Here are a few methods you can try to get code completion in Vim for Perl:
### 1. **Using Vim’s Built-in Omnicompletion**
Vim has built-in support for code completion using the `Ctrl + x` followed by ... | 7,593 | [
{
"from": "human",
"value": "Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions.\nIs there any way to enable code completion for Perl in vim?\n"
},
{
"from"... |
How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly.
There are probably a nice little function that returns all i... | To check for the installation of a specific OLEDB driver in a Delphi application using ADO, you can utilize the ADO interface to enumerate the available providers. This can be done by querying the `MSDASQL` provider or using the `ADODB` components to list the available OLEDB providers. Here's how you can implement this... | 8,274 | [
{
"from": "human",
"value": "How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly.\nThere are probably... |
How can I make a style have all of the properties of the style defined in .a .b .c except for background-color (or some other property)? This does not seem to work.
.a .b .c
{
background-color: #0000FF;
color: #ffffff;
border: 1px solid #c0c0c0;
margin-top: 4px;
padding: 3px;
text-align: center;... | In CSS, there isn't a way to inherit all properties from another style while excluding specific properties directly. However, you can achieve this effect by using the `inherit` keyword for certain properties, or by redefining the properties you want to exclude in the child class.
Here’s how you could do it for your e... | 8,359 | [
{
"from": "human",
"value": "How can I make a style have all of the properties of the style defined in .a .b .c except for background-color (or some other property)? This does not seem to work.\n.a .b .c\n{\n background-color: #0000FF;\n color: #ffffff;\n border: 1px solid #c0c0c0;\n margin-top:... |
In the early days of SharePoint 2007 beta, I've come across the ability to customize the template used to emit the RSS feeds from lists. I can't find it again. Anybody know where it is?
| In SharePoint 2007, customizing the RSS feed templates for lists can be done by modifying the relevant XSLT (Extensible Stylesheet Language Transformations) files. These files dictate how the RSS feeds are formatted when they are generated.
To customize the RSS feed output for lists in SharePoint 2007, follow these st... | 9,550 | [
{
"from": "human",
"value": "In the early days of SharePoint 2007 beta, I've come across the ability to customize the template used to emit the RSS feeds from lists. I can't find it again. Anybody know where it is?\n"
},
{
"from": "gpt",
"value": "In SharePoint 2007, customizing the RSS feed t... |
I have a .Net compact framework application with a frankly unimpressive UI.
My win32 app uses Dev Express components and looks great, but I can't find anything similar for the compact framework.
Can anyone recommend components that will jazz up my UI?
Does such a thing exist, oram I going to have to owner draw my compo... | When developing for the .NET Compact Framework, the options for third-party UI components are indeed more limited compared to the full .NET Framework. However, there are still a few approaches you can consider to improve your application's UI without resorting to owner-drawing or extensive native code development:
1. ... | 8,504 | [
{
"from": "human",
"value": "I have a .Net compact framework application with a frankly unimpressive UI.\nMy win32 app uses Dev Express components and looks great, but I can't find anything similar for the compact framework.\nCan anyone recommend components that will jazz up my UI?\nDoes such a thing exist,... |
I am working on a project that requires the manipulation of enormous matrices, specifically pyramidal summation for a copula calculation.
In short, I need to keep track of a relatively small number of values (usually a value of 1, and in rare cases more than 1) in a sea of zeros in the matrix (multidimensional array).
... | For handling sparse matrices efficiently, especially when dealing with a large number of dimensions and needing fast access to a small number of non-zero elements, you have a few options that might be more suitable than a binary search tree. Here are some recommended approaches and data structures:
### 1. **Compressed... | 5,495 | [
{
"from": "human",
"value": "I am working on a project that requires the manipulation of enormous matrices, specifically pyramidal summation for a copula calculation.\nIn short, I need to keep track of a relatively small number of values (usually a value of 1, and in rare cases more than 1) in a sea of zero... |
on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem : when I stop easyphp, the other apache is stopped too.
The problem do not occur on all PC I have, but seems very strange to me.
Any idea?
more information a... | The issue you're experiencing with EasyPHP stopping your standalone Apache service could be due to a couple of reasons, even if they are running on different ports or have different service names. Here are a few things to consider and troubleshoot:
1. **Service Interference**: Sometimes, applications can unintentional... | 10,132 | [
{
"from": "human",
"value": "on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem : when I stop easyphp, the other apache is stopped too.\nThe problem do not occur on all PC I have, but seems very s... |
I am trying to join together several audio files into one mp4/m4a file containing chapter metadata.
I am currently using QTKit to do this but unfortunately when QTKit exports to m4a format the metadata is all stripped out (this has been confirmed as a bug by Apple) see sample code. I think this rules QTKit out for this... | If you are looking to concatenate audio files into an M4A file while preserving chapter metadata, you have several alternatives to QTKit that can handle this task effectively, including command-line tools.
### Using FFmpeg
One of the most powerful command-line tools for audio and video processing is **FFmpeg**. It's ... | 7,395 | [
{
"from": "human",
"value": "I am trying to join together several audio files into one mp4/m4a file containing chapter metadata.\nI am currently using QTKit to do this but unfortunately when QTKit exports to m4a format the metadata is all stripped out (this has been confirmed as a bug by Apple) see sample c... |
I was wondering if there are any code or class libraries out there on how to implement multithreading or "green threading" in ActionScript.
As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago event.
Regard... | In ActionScript, particularly for ActionScript 3 (AS3), multithreading is not natively supported in the same way that it is in languages like Java or C#. However, you can achieve a form of concurrency by using `Worker` threads introduced in Adobe AIR 3.0, which allows you to create separate threads to run scripts concu... | 7,969 | [
{
"from": "human",
"value": "I was wondering if there are any code or class libraries out there on how to implement multithreading or \"green threading\" in ActionScript.\nAs you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his perfor... |
I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border:
input.button {
background: #eee;
border: 1px solid #ccc;
}
This looks just right in Firefox, Safari and Opera. The problem is with Internet Explorer, both 6 and 7.
S... | To address the issue of the unwanted black border (or "focus outline") around your custom styled submit buttons in Internet Explorer 6 and 7, you can apply the following CSS:
1. Use the `outline` property to remove the outline on focus.
2. Optionally, you can provide additional styling to give a visual cue for focus i... | 11,034 | [
{
"from": "human",
"value": "I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border:\ninput.button {\n background: #eee;\n border: 1px solid #ccc;\n}\n\nThis looks just right in Firefox, Safari and Opera. The prob... |
I'm using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature:
String^ GetWindowText()
However, when I'm using this method from C#, the signature is:
string GetWindowTextW();
How do I get rid of the extra "W" at the end of the method's name?
| The extra "W" at the end of the method name (`GetWindowTextW`) suggests that the method is being recognized as a Windows API function which is usually suffixed with "W" to indicate that it is the Unicode version of the API (in contrast to the ANSI version which would be suffixed with "A").
To prevent the automatic ge... | 8,038 | [
{
"from": "human",
"value": "I'm using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature:\nString^ GetWindowText()\n\nHowever, when I'm using this method from C#, the signature is:\nstring GetWindowTextW();\n\nHow do I get rid of th... |
When you create a Microsoft Access 2003 link to an Oracle table using Oracle's ODBC driver, you are sometimes asked to state which columns are the primary key(s).
I would like to know how to change that initial assignment, or even how to get Access/ODBC to forget the assignment. In my limited testing I wonder if the as... | When dealing with Microsoft Access 2003 and Oracle ODBC drivers, the primary key assignment can sometimes be persistent due to how Access caches metadata about linked tables. If you need to change or reset the primary key assignment for an Oracle table linked in Access, you can try the following steps:
### Change or R... | 6,584 | [
{
"from": "human",
"value": "When you create a Microsoft Access 2003 link to an Oracle table using Oracle's ODBC driver, you are sometimes asked to state which columns are the primary key(s).\nI would like to know how to change that initial assignment, or even how to get Access/ODBC to forget the assignment... |
SQL Server 2000 Standard, Windows 2003
My coworker removed 'BUILTIN\Administrators' group from SQL Server which results in 'SQL Server Agent' not working.
All my TSQLs to synchronize databases stopped working.
I have Administrator rights on the server and my database user is in sysadmin role.
Does any one have idea... | It's great to hear that you found a solution! For anyone else who might be facing a similar issue with SQL Server 2000 where the `BUILTIN\Administrators` group has been removed, here’s a concise summary of the steps to restore it without restoring the master database:
### Steps to Restore 'BUILTIN\Administrators' in S... | 11,488 | [
{
"from": "human",
"value": "SQL Server 2000 Standard, Windows 2003\nMy coworker removed 'BUILTIN\\Administrators' group from SQL Server which results in 'SQL Server Agent' not working.\nAll my TSQLs to synchronize databases stopped working.\n\n\nI have Administrator rights on the server and my database use... |
I want to insert some special characters at the caret inside textboxes using javascript on a button. How can this be done?
The script needs to find the active textbox and insert the character at the caret in that textbox. The script also needs to work in IE and Firefox.
EDIT: It is also ok to insert the character "last... | You can insert special characters at the caret position in a textbox using JavaScript by manipulating the `selectionStart` and `selectionEnd` properties of the input element. Below is a script that demonstrates how to accomplish this. The code supports both Internet Explorer and Firefox.
Here's a complete example:
``... | 7,947 | [
{
"from": "human",
"value": "I want to insert some special characters at the caret inside textboxes using javascript on a button. How can this be done?\nThe script needs to find the active textbox and insert the character at the caret in that textbox. The script also needs to work in IE and Firefox.\nEDIT: ... |
I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects?
The first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL scripts doing all the work. But in this case I'll have to remember about cr... | Upgrading a database schema in an application that uses ORM tools like JPOX (now known as DataNucleus) or Hibernate can indeed be a challenging task. However, there are strategies and tools that can help simplify the process. Here are some best practices and suggestions for managing database schema migrations in Java p... | 6,277 | [
{
"from": "human",
"value": "I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects?\nThe first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL scripts doing all the work. But i... |
For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code.
Normally, I have 2 windows in a split (C-x 3):
alt text http://bitthicket.com/files/emacs-2split.JPG
And I use the right window for code buffers and the left window for the CScope search buffer.... | You can achieve this setup in Emacs with a combination of window management and custom settings for `cscope`. Here’s how you can configure your Emacs to have a three-window split as described:
1. **Set Up the Window Layout:**
Start by splitting your window into three sections as follows:
- Split vertically to g... | 7,088 | [
{
"from": "human",
"value": "For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code.\nNormally, I have 2 windows in a split (C-x 3):\nalt text http://bitthicket.com/files/emacs-2split.JPG\nAnd I use the right window for code buffers and t... |
Today I discovered that my fresh installation of Apache HTTP Server is able to serve files from my C:\uploads\ directory.
I have two folders in C:\uploads:
C:\uploads\templates
C:\uploads\sites
Both folders contain testimage.jpg.
I found that Apache will serve the files from the templates folder if I request:
http:... | It sounds like you're encountering some default behaviors of the Apache HTTP Server, along with possibly some configuration settings that may be at play. Let's break down the issues you're seeing:
1. **Why does Apache serve the `templates` folder? Is it special?**
- Apache itself doesn't inherently treat any direct... | 6,185 | [
{
"from": "human",
"value": "Today I discovered that my fresh installation of Apache HTTP Server is able to serve files from my C:\\uploads\\ directory.\nI have two folders in C:\\uploads:\n\nC:\\uploads\\templates \nC:\\uploads\\sites\n\nBoth folders contain testimage.jpg.\nI found that Apache will serve ... |
Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and .Net?
| For generating charts such as bar charts and pie charts that can run on both Java and .NET, you might want to consider using **JFreeChart** for Java and **OxyPlot** or **LiveCharts** for .NET. However, these libraries do not run on both platforms directly.
If you are looking for a solution that can be utilized in both... | 9,968 | [
{
"from": "human",
"value": "Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and .Net?\n"
},
{
"from": "gpt",
"value": "For generating charts such as bar charts and pie charts that can run on both Java and .NET, you might want to consider... |
AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question.
Probably the friendliest place is the Monastery of Perl Monks. ... | When looking for answers to Perl-related questions, there are several excellent resources I would consider:
1. **Perl Monks**: As you mentioned, the Monastery of Perl Monks is a great community for Perl enthusiasts. It has a friendly environment where users can ask questions, share knowledge, and collaborate on Perl-r... | 7,870 | [
{
"from": "human",
"value": "AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question.\nProbably the friendli... |
I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime.
But how do I define the dataset off which the Crystal Report is developed?
Crystal Reports has a great tool to build a dataset from an SQL database. Is there something simil... | Creating a Crystal Report from an XML dataset involves a few key steps, and while Crystal Reports does have robust tools for SQL databases, it can also handle XML data effectively. Here’s how you can define a dataset for a Crystal Report using an XML schema:
### Step 1: Prepare Your XML Schema
Before you start, ensure... | 5,405 | [
{
"from": "human",
"value": "I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime.\nBut how do I define the dataset off which the Crystal Report is developed?\nCrystal Reports has a great tool to build a dataset from... |
So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?
Typically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or direct to a db.
So, the real question is, wh... | Implementing effective logging practices can significantly enhance your ability to diagnose issues and improve your applications. Here are some ideas and best practices based on common approaches in larger organizations:
### 1. **Establish Logging Levels**
- **Trace**: Detailed information, typically of interest on... | 8,258 | [
{
"from": "human",
"value": "So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?\nTypically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or di... |
Is there a difference between just saying throw; and throw ex; assuming ex is the exception you're catching?
| Yes, there is a significant difference between using `throw;` and `throw ex;` in exception handling in C# (and in many other programming languages that use similar constructs).
1. **`throw ex;`**:
- When you use `throw ex;`, you are rethrowing the caught exception (`ex`) that was caught in the `catch` block.
- T... | 7,511 | [
{
"from": "human",
"value": "Is there a difference between just saying throw; and throw ex; assuming ex is the exception you're catching?\n"
},
{
"from": "gpt",
"value": "Yes, there is a significant difference between using `throw;` and `throw ex;` in exception handling in C# (and in many other ... |
Is it possible to use XPath to select only the nodes that have a particular child elements? For example, from this XML I only want the elements in pets that have a child of 'bar'. So the resulting dataset would contain the lizard and pig elements from this example:
<pets>
<cat>
<foo>don't care about this</foo>
... | Yes, you can use XPath to select only the nodes that have a particular child element. In your case, if you want to select the `lizard` and `pig` elements because they have a child element named `bar`, you can use the following XPath expression:
```xpath
/pets/*[bar]
```
Here's how this XPath works:
- `/pets/*` selec... | 13,160 | [
{
"from": "human",
"value": "Is it possible to use XPath to select only the nodes that have a particular child elements? For example, from this XML I only want the elements in pets that have a child of 'bar'. So the resulting dataset would contain the lizard and pig elements from this example:\n<pets>\n ... |
I have a button bar inf flex along with several other input controls, I have set the tabIndex property for each control and all goes well until I tab to the ButtonBar.
The ButtonBar has 3 buttons but tabbing to it, only the first button gets focus, tab again and the focus goes back to the top control...
How can I make... | In Flex, the behavior you're observing with the ButtonBar and tabbing is due to how the ButtonBar manages focus. By default, only the first button in a ButtonBar receives focus when you tab to it, and pressing tab again sends focus back out of the ButtonBar to the next focusable control.
To enable tabbing through all ... | 7,311 | [
{
"from": "human",
"value": "I have a button bar inf flex along with several other input controls, I have set the tabIndex property for each control and all goes well until I tab to the ButtonBar. \nThe ButtonBar has 3 buttons but tabbing to it, only the first button gets focus, tab again and the focus goes... |
Let's say I want a way to display just the the center 50x50px of an image that's 250x250px in HTML. How can I do that. Also, is there a way to do this for css:url() references?
I'm aware of clip in CSS, but that seems to only work when used with absolute positioning.
| To display just the center 50x50px of a 250x250px image in HTML using CSS, you can use the following method with a `div` container and `background-image`. This solution allows you to achieve the desired effect without needing to rely on absolute positioning for clipping. You can use `background-size` and `background-po... | 8,567 | [
{
"from": "human",
"value": "Let's say I want a way to display just the the center 50x50px of an image that's 250x250px in HTML. How can I do that. Also, is there a way to do this for css:url() references?\n\nI'm aware of clip in CSS, but that seems to only work when used with absolute positioning.\n"
},
... |
Looking to get your take on an automated testing tool (voting should bring good ones to the top)
Ideal tool would:
Eliminate the need to present a set
of values to a method.
employ techniques such as Interactive
Exploratory Testing where the code
is examined to determine what values
are required to exercise all code
... | You’re looking for automated testing tools that can generate unit tests based on code analysis rather than requiring a predefined set of input values. This approach can significantly enhance test coverage by automatically identifying edge cases and various execution paths within your code.
### For Java:
You mentioned ... | 6,100 | [
{
"from": "human",
"value": "Looking to get your take on an automated testing tool (voting should bring good ones to the top)\nIdeal tool would:\n\nEliminate the need to present a set\nof values to a method. \nemploy techniques such as Interactive\nExploratory Testing where the code\nis examined to determin... |
I have around 1000 pdf filesand I need to convert them to 300 dpi tiff files. What is the best way to do this? If there is an SDK or something or a tool that can be scripted that would be ideal.
| To convert a large number of PDF files to 300 DPI TIFF files, you can use various tools and SDKs that allow scripting for batch processing. Here are some of the best options you can consider:
### 1. **ImageMagick**
ImageMagick is a powerful command-line tool that can convert PDF files to TIFF format while allowing you... | 7,051 | [
{
"from": "human",
"value": "I have around 1000 pdf filesand I need to convert them to 300 dpi tiff files. What is the best way to do this? If there is an SDK or something or a tool that can be scripted that would be ideal. \n"
},
{
"from": "gpt",
"value": "To convert a large number of PDF files... |
By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can easily get a status of the current compilation by just looking at the compile... | To automatically scroll to the bottom of the compilation buffer when you invoke the compile command in Emacs, you can customize the behavior using a combination of hooks and functions. Here’s a way to do it:
1. Add a function to scroll to the bottom of the compilation buffer after it is created or updated.
2. Use hook... | 8,901 | [
{
"from": "human",
"value": "By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can easily get a status of the current c... |
Consider an indexed MySQL table with 7 columns, being constantly queried and written to. What is the advisable number of rows that this table should be allowed to contain before the performance would be improved by splitting the data off into other tables?
| The advisable number of rows in a MySQL table before performance issues arise can vary widely depending on several factors, including:
1. **Indexes**: The presence and type of indexes can significantly affect query performance. Properly indexed tables can handle larger volumes of data without performance degradation.
... | 9,399 | [
{
"from": "human",
"value": "Consider an indexed MySQL table with 7 columns, being constantly queried and written to. What is the advisable number of rows that this table should be allowed to contain before the performance would be improved by splitting the data off into other tables?\n"
},
{
"from"... |
To make a JavaScript class with a public method I'd do something like:
function Restaurant() {}
Restaurant.prototype.buy_food = function(){
// something here
}
Restaurant.prototype.use_restroom = function(){
// something here
}
That way users of my class can:
var restaurant = new Restaurant();
restaurant.buy_f... | In JavaScript, there are a few ways to create private methods that are only accessible within the scope of a class or function, while still being callable from public methods. Since ES6, using the class syntax and private methods has become more straightforward.
Here's a method using ES6 classes with private class fi... | 10,333 | [
{
"from": "human",
"value": "To make a JavaScript class with a public method I'd do something like:\nfunction Restaurant() {}\n\nRestaurant.prototype.buy_food = function(){\n // something here\n}\n\nRestaurant.prototype.use_restroom = function(){\n // something here\n}\n\nThat way users of my class can:... |
I have a winforms application that normally is at about 2-4% CPU. We are seeing some spikes up to 27% of CPU for limited number of times. What is the best profiling tool to determine what is actually causing this spike. We use dottrace but i dont see how to map that to exactly the CPU spikes?
Appreciate the help
| To effectively diagnose CPU spikes in your WinForms application, you can use several profiling tools. Since you're already using dotTrace, here are some steps to help you pinpoint the cause of the CPU spikes, along with other recommended tools:
### Using dotTrace:
1. **Take Snapshots During Spikes**: When you notice a... | 7,585 | [
{
"from": "human",
"value": "I have a winforms application that normally is at about 2-4% CPU. We are seeing some spikes up to 27% of CPU for limited number of times. What is the best profiling tool to determine what is actually causing this spike. We use dottrace but i dont see how to map that to exactl... |
Had a conversation with a coworker the other day about this.
There's the obvious using a constructor, but what are the other ways there?
| It sounds like you might be referring to various ways to create objects in object-oriented programming, particularly in languages like Java, C#, or JavaScript. Here are some common methods:
1. **Constructor**: The most straightforward way to create an object. You call a class constructor to create an instance.
```... | 9,042 | [
{
"from": "human",
"value": "Had a conversation with a coworker the other day about this.\nThere's the obvious using a constructor, but what are the other ways there?\n"
},
{
"from": "gpt",
"value": "It sounds like you might be referring to various ways to create objects in object-oriented progr... |
So, I have 2 database instances, one is for development in general, another was copied from development for unit tests.
Something changed in the development database that I can't figure out, and I don't know how to see what is different.
When I try to delete from a particular table, with for example:
delete from mysche... | It sounds like you are encountering an issue with a `DELETE` operation in your DB2 development database due to a potential trigger, function, or some other schema-level difference compared to your unit test database. The error message you are receiving suggests that when you attempt to execute the `DELETE` command, DB2... | 5,432 | [
{
"from": "human",
"value": "So, I have 2 database instances, one is for development in general, another was copied from development for unit tests.\nSomething changed in the development database that I can't figure out, and I don't know how to see what is different.\nWhen I try to delete from a particular ... |
We're replicating a database between London and Hong Kong using SQL Server 2005 Merge replication. The replication is set to synchronise every one minute and it works just fine. There is however the option to set the synchronisation to be "Continuous". Is there any real difference between replication every one minute a... | When using SQL Server 2005 Merge replication, you have a couple of options for how the replication process occurs: scheduled (like every one minute) or continuous replication. Here are some considerations regarding the two methods:
### Differences Between Scheduled and Continuous Replication
1. **Timeliness**:
- *... | 6,372 | [
{
"from": "human",
"value": "We're replicating a database between London and Hong Kong using SQL Server 2005 Merge replication. The replication is set to synchronise every one minute and it works just fine. There is however the option to set the synchronisation to be \"Continuous\". Is there any real differ... |
I need to display many pages of news in a site. Should I do the pagination in the database query using LIMIT or with the PHP script after getting all the results?
| For a news site that needs to display many pages of content, it's generally much more efficient to handle pagination in the database query using `LIMIT` rather than fetching all results and then paginating them in PHP. Here are several reasons why:
1. **Performance**: Fetching all records from the database and then pa... | 10,379 | [
{
"from": "human",
"value": "I need to display many pages of news in a site. Should I do the pagination in the database query using LIMIT or with the PHP script after getting all the results?\n"
},
{
"from": "gpt",
"value": "For a news site that needs to display many pages of content, it's gener... |
I want to allow users to upload avatar-type images in a variety of formats (GIF, JPEG, and PNG at least), but to save them all as PNG database BLOBs. If the images are oversized, pixelwise, I want to resize them before DB-insertion.
What is the best way to use GD to do the resizing and PNG conversion?
Edit: Sadly, only... | To allow users to upload avatar-type images in various formats and resize them using GD, you can follow these steps. This example assumes you have a form that allows users to upload images, and you want to resize any oversized images before saving them as PNG blobs in your database.
Here's a step-by-step guide on how ... | 5,055 | [
{
"from": "human",
"value": "I want to allow users to upload avatar-type images in a variety of formats (GIF, JPEG, and PNG at least), but to save them all as PNG database BLOBs. If the images are oversized, pixelwise, I want to resize them before DB-insertion.\nWhat is the best way to use GD to do the resi... |
Is there a good .Net implementation of the NNTP protocol?
| Yes, there are several libraries available for implementing the NNTP (Network News Transfer Protocol) in .NET. Here are a few notable ones:
1. **NNTPClient**:
- This is a simple .NET client for NNTP that allows you to interact with NNTP servers. You can find this on GitHub or NuGet repositories. It provides basic f... | 7,096 | [
{
"from": "human",
"value": "Is there a good .Net implementation of the NNTP protocol?\n"
},
{
"from": "gpt",
"value": "Yes, there are several libraries available for implementing the NNTP (Network News Transfer Protocol) in .NET. Here are a few notable ones:\n\n1. **NNTPClient**:\n - This is ... |
Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.
| Using SOAP (Simple Object Access Protocol) for communication between the front end (like a web browser running JavaScript) and back-end services has several drawbacks that generally make it less suitable compared to more modern alternatives like RESTful APIs or GraphQL. Here are some reasons:
1. **Complexity**: SOAP i... | 9,997 | [
{
"from": "human",
"value": "Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.\n"
},
{
"from": "gpt",
"value": "Using SOAP (Simple Object Access Protocol) for communication between the front end (like a web browser running Ja... |
I'd like to execute JavaScript code from within a C# assembly and have the results of the JavaScript code returned to the calling C# code.
It's easier to define things that I'm not trying to do:
I'm not trying to call a JavaScript function on a web page from my code behind.
I'm not trying to load a WebBrowser control.... | To execute JavaScript code from within a C# assembly and retrieve the results without relying on a web browser or other cumbersome methods, you can use a JavaScript engine that can be integrated into .NET applications. One popular choice for this purpose is the **Jint** library, which is a JavaScript interpreter for .N... | 6,336 | [
{
"from": "human",
"value": "I'd like to execute JavaScript code from within a C# assembly and have the results of the JavaScript code returned to the calling C# code.\nIt's easier to define things that I'm not trying to do:\n\nI'm not trying to call a JavaScript function on a web page from my code behind.\... |
The following will cause infinite recursion on the == operator overload method
Foo foo1 = null;
Foo foo2 = new Foo();
Assert.IsFalse(foo1 == foo2);
public static bool operator ==(Foo foo1, Foo foo2) {
if (foo1 == null) return foo2 == null;
return foo1.Equals(foo2);
}
How do I check... | The issue you're encountering with the `==` operator overload is that within your implementation, you're trying to use the `==` operator recursively when you check `foo1 == null`. This leads to infinite recursion because the `==` operator calls itself indefinitely when checking if `foo1` is null.
To avoid this issue, ... | 10,557 | [
{
"from": "human",
"value": "The following will cause infinite recursion on the == operator overload method\n Foo foo1 = null;\n Foo foo2 = new Foo();\n Assert.IsFalse(foo1 == foo2);\n\n public static bool operator ==(Foo foo1, Foo foo2) {\n if (foo1 == null) return foo2 == null;\n ... |
I have a custom action in a workflow and would like to report an error to the user when something goes wrong. What's the best way of doing that?
UPD: Ideally I would like to put the workflow in the error state and log a message to the workflow log. That doesn't seem possible. What's the closest I can get to it? I wa... | To effectively handle errors in a custom action within a SharePoint Designer (SPD) workflow while also making it reusable for others, you can follow a structured approach. Here’s a way to accomplish this:
### Step-by-Step Solution
1. **Create a Custom Workflow Action**: If you haven't already, create a custom action ... | 6,657 | [
{
"from": "human",
"value": "I have a custom action in a workflow and would like to report an error to the user when something goes wrong. What's the best way of doing that?\nUPD: Ideally I would like to put the workflow in the error state and log a message to the workflow log. That doesn't seem possible.... |
Using the svnmerge.py tool it is possible to merge between branches, up and down. It is hard to find the details for doing this. Hopefully, v1.5 will have a neat method for doing this without using svnmerge.py - details requested!
| As of Subversion 1.5, the support for merging between branches has been significantly improved, making it easier to manage merges without relying on external tools like `svnmerge.py`. Here are the key features and methods introduced in Subversion 1.5 that facilitate merging:
### Key Improvements in SVN 1.5
1. **Merge... | 8,802 | [
{
"from": "human",
"value": "Using the svnmerge.py tool it is possible to merge between branches, up and down. It is hard to find the details for doing this. Hopefully, v1.5 will have a neat method for doing this without using svnmerge.py - details requested!\n"
},
{
"from": "gpt",
"value": "A... |
I want to query a table of public methods of a specific class and a count of each methods usage in NDepend CQL. Currently query looks like this:
SELECT METHODS
FROM TYPES "AE.DataAccess.DBHelper"
WHERE IsPublic
Is it possible to aggregate queries in CQL?
| Yes, in CQL (CQLinq), which is the query language used in NDepend, you can perform aggregation operations. To count the usage of public methods in a specific class, you can modify your query to use an aggregation function like `Count()`. Below is an example of how you can construct your query to achieve this:
```cshar... | 11,629 | [
{
"from": "human",
"value": "I want to query a table of public methods of a specific class and a count of each methods usage in NDepend CQL. Currently query looks like this:\nSELECT METHODS \nFROM TYPES \"AE.DataAccess.DBHelper\" \nWHERE IsPublic\n\nIs it possible to aggregate queries in CQL?\n"
},
{
... |
I am wanting to use ActiveScaffold to create assignment records for several students in a single step. The records will all contain identical data, with the exception of the student_id.
I was able to override the default form and replace the dropdown box for selecting the student name with a multi-select box - which i... | To achieve the functionality you’re looking for with ActiveScaffold—creating multiple records for different students with the same data in a single step—you'll need to make a few modifications to your setup. Here's a general approach to accomplish this without diving too deep into the ActiveScaffold internals.
### Ste... | 8,043 | [
{
"from": "human",
"value": "I am wanting to use ActiveScaffold to create assignment records for several students in a single step. The records will all contain identical data, with the exception of the student_id.\nI was able to override the default form and replace the dropdown box for selecting the stud... |
I'm trying to load a page that is basically an edit form inside a
dialog (ui.dialog). I can load this page fine from an external (I'm
using asp.net) page.
The problem is that inside of my "popup" form, I need to $(function()
{my function here}); syntax to do some stuff when the page loads,
along with registering some ... | It sounds like you're facing issues with executing JavaScript when loading a page inside a jQuery UI dialog. When you load a page via AJAX into a dialog, the scripts within that page may not automatically execute, which can cause the behavior you're observing.
Here are some strategies you can use to ensure your script... | 6,429 | [
{
"from": "human",
"value": "I'm trying to load a page that is basically an edit form inside a\ndialog (ui.dialog). I can load this page fine from an external (I'm\nusing asp.net) page.\nThe problem is that inside of my \"popup\" form, I need to $(function()\n{my function here}); syntax to do some stuff wh... |
What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting.
I have some scripts that need to run 24/7 and for the most part I can run them using nohup. But if they go down, what's the best way to monitor it so it can be automatically restarted?
| Running a PHP script as a daemon for continuous execution is a common requirement, especially for background tasks. Here are some best practices for achieving this, along with methods to monitor and restart the script if it goes down.
### 1. Use `systemd` (Preferred for Linux)
The best way to run a PHP script as a da... | 6,146 | [
{
"from": "human",
"value": "What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting.\nI have some scripts that need to run 24/7 and for the most part I can run them using nohup. But if they go down, what's the best way to monitor it so it can be ... |
My question is pertaining to the best practice for accessing a child object's parent. So let's say a class instantiates another class, that class instance is now referenced with an object. From that child object, what is the best way to reference back to the parent object? Currently I know of a couple ways that I use o... | Accessing a parent object from a child object can be approached in several ways, and the best practice often depends on the specific use case and the design principles you want to adhere to. Here’s a breakdown of the methods you mentioned, along with some insights on their pros and cons:
### 1. Using `getDefinitionByN... | 8,396 | [
{
"from": "human",
"value": "My question is pertaining to the best practice for accessing a child object's parent. So let's say a class instantiates another class, that class instance is now referenced with an object. From that child object, what is the best way to reference back to the parent object? Curre... |
I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has anything entered. If nothing is entered in the second ... | In WinForms, you can indeed implement custom tab behavior in your UserControl while detecting how the control received focus (via Tab/Shift-Tab or by mouse click). However, WinForms does not natively expose a way to directly determine the cause of focus change.
Here's a workaround you can implement. The idea is to se... | 6,521 | [
{
"from": "human",
"value": "I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has anything ente... |
In PHP, a string enclosed in "double quotes" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?
| In Python, the behavior regarding string literals is a bit different compared to PHP. In Python, both single quotes (`'`) and double quotes (`"`) are used to define string literals and they function the same way in terms of interpreting the content of the string.
Python does not have a concept of variable interpolatio... | 11,737 | [
{
"from": "human",
"value": "In PHP, a string enclosed in \"double quotes\" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?\n"
},
{
"from": "gpt",
"value": "In Python, the behavior regarding string literals is a bit ... |
I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'.
Is ther... | Yes, you can remove leading zeros from a VARCHAR field in SQL Server using a combination of string functions. The `LTRIM` function is used to remove leading spaces, while the `REPLACE` function can help with removing specific characters. However, for your specific requirement of removing leading zeros, you can also use... | 7,781 | [
{
"from": "human",
"value": "I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement ... |
Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover). Is there any reason... | When transitioning from a default ASPX page to a user control (ASCX) in a master page setup, there are several potential reasons why the extender functionality might not be working. Here are a few suggestions and things to check:
1. **Script References**: Ensure that any JavaScript or CSS files required by the extende... | 7,742 | [
{
"from": "human",
"value": "Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdow... |
When someone talks about a variables storage class specifier, what are they talking about?
They also often talk about variable linkage in the same context, what is that?
| In the context of programming, particularly in languages like C and C++, a variable's **storage class specifier** defines the variable's lifespan, visibility, and storage location. The storage class affects how and where the variable is allocated in memory and how it can be accessed in different scopes.
### Storage Cl... | 9,138 | [
{
"from": "human",
"value": "When someone talks about a variables storage class specifier, what are they talking about?\nThey also often talk about variable linkage in the same context, what is that?\n"
},
{
"from": "gpt",
"value": "In the context of programming, particularly in languages like C... |
I just installed Java 1.6_07 so I could try profiling with VisualVM. It tells me that my app is spending 60% of its time in sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
How do I find out what it was doing during that time? How much of the time was it waiting for something to call it, or doing something e... | Profiling Java applications, especially when dealing with RMI (Remote Method Invocation) calls, can be challenging. VisualVM is a powerful tool, but it can sometimes be less intuitive when trying to drill down into the specifics of what a method is doing, especially with low-level system classes like `TCPTransport$Conn... | 6,698 | [
{
"from": "human",
"value": "I just installed Java 1.6_07 so I could try profiling with VisualVM. It tells me that my app is spending 60% of its time in sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run \nHow do I find out what it was doing during that time? How much of the time was it waiting for ... |
I need to send MMS thought a C# application. I have already found 2 interesting components:
http://www.winwap.com
http://www.nowsms.com
Does anyone have experience with other third party components?
Could someone explain what kind of server I need to send those MMS? Is it a classic SMTP Server?
| Sending MMS (Multimedia Messaging Service) messages from a C# application typically involves using a third-party service or gateway that provides the necessary infrastructure for sending multimedia content to mobile devices. Here are some insights regarding the components and servers needed:
### Third-Party Components... | 7,492 | [
{
"from": "human",
"value": "\nI need to send MMS thought a C# application. I have already found 2 interesting components:\nhttp://www.winwap.com\nhttp://www.nowsms.com\nDoes anyone have experience with other third party components?\nCould someone explain what kind of server I need to send those MMS? Is it ... |
Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deployments, this can include over 20 assemblies. Each of these assemblies has settings or configuration information. Our team tends to like the VS set... | Managing large .NET configuration files, particularly when multiple shared assemblies are involved, can indeed be cumbersome. To streamline this process while maintaining custom configuration sections, you can adopt several techniques:
### 1. **Custom Configuration Sections with a Single Configuration Source**
Crea... | 5,403 | [
{
"from": "human",
"value": "Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deployments, this can include over 20 assemblies. Each of these assemblies has settings or configuration inform... |
When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right
padding in my custom paint method that is applied by the control itself for non-custom-drawn items.
Is there a way to programmatically retrieve ... | When you are working with custom drawing in a ListView control in report/details view, you can indeed achieve consistent padding for your custom-drawn subitems by retrieving the default padding values used by the control itself.
### 1. Default Padding Values
Unfortunately, there are no direct APIs provided by the Wind... | 7,820 | [
{
"from": "human",
"value": "When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right\npadding in my custom paint method that is applied by the control itself for non-custom-drawn items.\nI... |
I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and deve... | Yes, there are several tools and methods you can use to generate INSERT statements from your SQL Server database for the purpose of source control. Here are some popular options:
### 1. SQL Server Management Studio (SSMS)
You can use the built-in export functionality in SSMS to generate INSERT statements:
1. Right-cl... | 5,397 | [
{
"from": "human",
"value": "I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert script... |
In the build log I'd like to the start and end time of each project's compilation. Is there any way to get VS to do this?
| In Visual Studio, you can enable logging for your build process to capture detailed information, including the start and end times of each project's compilation. Here's how you can do that:
### Method 1: Using the Command Line with MSBuild
1. **Open Developer Command Prompt for Visual Studio:**
- You can find it i... | 7,056 | [
{
"from": "human",
"value": "In the build log I'd like to the start and end time of each project's compilation. Is there any way to get VS to do this?\n"
},
{
"from": "gpt",
"value": "In Visual Studio, you can enable logging for your build process to capture detailed information, including the s... |
I'm working on a system with four logical CPS (two dual-core CPUs if it matters). I'm using make to parallelize twelve trivially parallelizable tasks and doing it from cron.
The invocation looks like:
make -k -j 4 -l 3.99 -C [dir] [12 targets]
The trouble I'm running into is that sometimes one job will finish but the... | It sounds like you're running into issues with the `make` command when scheduling multiple long-running tasks in parallel. Given the setup you described, here are some potential causes and suggestions for troubleshooting the issue:
### Potential Causes:
1. **Long Execution Times**: With each target taking about four h... | 4,710 | [
{
"from": "human",
"value": "I'm working on a system with four logical CPS (two dual-core CPUs if it matters). I'm using make to parallelize twelve trivially parallelizable tasks and doing it from cron.\nThe invocation looks like:\nmake -k -j 4 -l 3.99 -C [dir] [12 targets]\n\nThe trouble I'm running into ... |
What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!
| Subversion (SVN) hook scripts are powerful tools that allow you to enforce policies and automate processes in your version control workflow. Here are some common types of hooks used with Subversion, along with examples of each type.
### 1. Pre-commit Hook
**Purpose:** To validate commit messages, check for prohibited... | 4,845 | [
{
"from": "human",
"value": "What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!\n"
},
{
"from": "gpt",
"value": "Subversion (SVN) hook scripts are powerful tools that allow you to enforce policies and automate processes in your version con... |
Is there any way to use this kind of format in .Net (C#)?
I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background.
Any ideas?
Thanks for your time.
| To achieve a transparent background in a .NET application (C#), particularly when trying to replicate a skin format like that of uTorrent, you can utilize the Windows Forms or WPF frameworks. Below are some guidelines on how to accomplish this, focusing mainly on Windows Forms since that's where transparency is a bit t... | 6,936 | [
{
"from": "human",
"value": "Is there any way to use this kind of format in .Net (C#)?\nI want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background.\nAny ideas?\nThanks for your time.\n"
},
{
"from": "gpt",
"value": "To achieve a transparent backgr... |
If I need to choose a collation mode to work with, how do I know what collations are available?
| The availability of collations depends on the specific database system you are using. Different database management systems (DBMS) have different sets of collations. Below are some common DBMS and how you can check the available collations in each:
### 1. **MySQL**
To view the available collations in MySQL, you can us... | 8,447 | [
{
"from": "human",
"value": "If I need to choose a collation mode to work with, how do I know what collations are available?\n"
},
{
"from": "gpt",
"value": "The availability of collations depends on the specific database system you are using. Different database management systems (DBMS) have di... |
This has me puzzled. This code worked on another server, but it's failing on Perl v5.8.8 with Date::Manip loaded from CPAN today.
Warning:
Use of uninitialized value in numeric lt (<) at /home/downside/lib/Date/Manip.pm line 3327.
at dailyupdate.pl line 13
main::__ANON__('Use of uninitialized value in numeric l... | The warning you're encountering indicates that the variable `$tz` in the Date::Manip code is being evaluated when it hasn't been properly initialized. This issue arises because the `Date_Init` function is not setting the expected timezone configuration in the `%Cnf` hash, which ultimately leads to the use of an uniniti... | 10,409 | [
{
"from": "human",
"value": "This has me puzzled. This code worked on another server, but it's failing on Perl v5.8.8 with Date::Manip loaded from CPAN today.\nWarning:\nUse of uninitialized value in numeric lt (<) at /home/downside/lib/Date/Manip.pm line 3327.\nat dailyupdate.pl line 13\n main::__AN... |
If you have several divs on a page, you can use CSS to size, float them and move them round a little... but I can't see a way to get past the fact that the first div will show near the top of the page and the last div will be near the bottom! I cannot completely override the order of the elements as they come from the ... | You're correct that HTML elements will naturally render in the order they appear in the source code. However, there are various CSS techniques that allow you to change the visual arrangement of elements on the page without altering the underlying HTML structure. Here are a few approaches you can consider:
1. **Flexbox... | 7,972 | [
{
"from": "human",
"value": "If you have several divs on a page, you can use CSS to size, float them and move them round a little... but I can't see a way to get past the fact that the first div will show near the top of the page and the last div will be near the bottom! I cannot completely override the ord... |
On a quest to migrate some new UI into Managed/C# land, I have recently turned on Common Language Runtime Support (/clr) on a large legacy project, which uses MFC in a Shared DLL and relies on about a dozen other projects within our overall solution. This project is the core of our application, and would drive any mana... | It sounds like you're facing a common limitation when mixing managed and unmanaged code in a single assembly, especially when dealing with legacy projects that have significant complexity. The `TypeLoadException: Internal limitation: too many fields` is indeed a challenging situation, especially if you can't refactor t... | 6,408 | [
{
"from": "human",
"value": "On a quest to migrate some new UI into Managed/C# land, I have recently turned on Common Language Runtime Support (/clr) on a large legacy project, which uses MFC in a Shared DLL and relies on about a dozen other projects within our overall solution. This project is the core of ... |
I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version. I assume it is retrieving a cached version.
| When you use `URLDownloadToFile` to download a file, if the file is being cached by either the server or your local system, subsequent calls may indeed return a cached version rather than the most up-to-date file. To prevent this from happening, you can take the following steps:
### Options to Bypass Caching:
1. **Ad... | 6,897 | [
{
"from": "human",
"value": "I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version. I assume it is retrieving a cached version.\n"
},
{
"from": "gpt",
"value": "When you use `URLDownloadToFile` to download a file... |
I'm using the cacheCounter in CakePHP, which increments a counter for related fields.
Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or many Person rows.
cacheCounter is working great when I change the value of a so... | In CakePHP, you can determine if a field has changed by using the `isDirty()` method. This method is part of the Entity class and allows you to check if a specific field has been modified since the entity was loaded or last saved.
Here's how you can utilize it in your `afterSave` method to conditionally update the cac... | 9,137 | [
{
"from": "human",
"value": "I'm using the cacheCounter in CakePHP, which increments a counter for related fields.\nExample, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or many Person rows.\ncacheCounter is wo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.