instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I need the "Select Data Source" dialog added to my application so that the user can manually select a range (or ranges) in Excel and the range is pasted in my text box. This functionality is everywhere in Excel (most notably when selecting a range for a chart). How can I easily do this?
| To implement a "Select Data Source" dialog in your application where users can manually select a range in Excel and have that range pasted into a text box in your application, you can utilize the Excel Object Model via VBA (Visual Basic for Applications) if your application is a VBA-based solution, or you can use a .NE... | 24,214 | [
{
"from": "human",
"value": "I need the \"Select Data Source\" dialog added to my application so that the user can manually select a range (or ranges) in Excel and the range is pasted in my text box. This functionality is everywhere in Excel (most notably when selecting a range for a chart). How can I easil... |
In Kohana/CodeIgniter, I can have a URL in this form:
http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ...
And then read the parameters in my controller as follows:
class MyController
{
public function method_name($param_A, $param_B, $param_C ...)
{
// ... code
}... | In Zend Framework, you can achieve similar functionality using routes and controller actions. Here's how you can define routes and read parameters in your controller.
### Step 1: Define Routes
In your `module.config.php` or `module[YourModule]/config/module.config.php`, you can define routes to map the URLs to your c... | 25,302 | [
{
"from": "human",
"value": "In Kohana/CodeIgniter, I can have a URL in this form:\nhttp://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ...\n\nAnd then read the parameters in my controller as follows:\nclass MyController \n{\n public function method_name($param_A, $param_B... |
I'm planning to write gateway web application, which would need "terminal window" with VT100/ANSI escape code support. Are there any AJAX based alternatives for such a task?
I'm thinking something like this: http://tryruby.hobix.com/
My preferred backend for the system is Python/Twisted/Pylons, but since I'm just plann... | Creating a web-based terminal emulator that supports VT100/ANSI escape codes is an interesting challenge. Since you're considering a Python backend, you're in a good position as there are libraries and frameworks available to assist with this. For the frontend, using AJAX or WebSocket can provide the real-time interact... | 25,536 | [
{
"from": "human",
"value": "I'm planning to write gateway web application, which would need \"terminal window\" with VT100/ANSI escape code support. Are there any AJAX based alternatives for such a task?\nI'm thinking something like this: http://tryruby.hobix.com/\nMy preferred backend for the system is Py... |
How can I change a file's extension using PHP?
Ex: photo.jpg to photo.exe
| In PHP, you can change a file's extension by renaming the file using the `rename()` function. Here's how you can do it:
1. Use `pathinfo()` to get the file name and its extension.
2. Change the extension as desired.
3. Use `rename()` to rename the file.
Here's an example script that changes a file's extension from `.... | 29,994 | [
{
"from": "human",
"value": "How can I change a file's extension using PHP?\nEx: photo.jpg to photo.exe\n"
},
{
"from": "gpt",
"value": "In PHP, you can change a file's extension by renaming the file using the `rename()` function. Here's how you can do it:\n\n1. Use `pathinfo()` to get the file ... |
I need to get a listing of a server-side directory inside SAP. How do I achieve this in ABAP? Are there any built-in SAP functions I can call?
Ideally I want a function which I can pass a path as input, and which will return a list of filenames in an internal table.
| In ABAP, you can use the function module `EPS_GET_DIRECTORY_LISTING` to retrieve a listing of files from a specified directory on the server. This function module allows you to pass a directory path and returns the file names in an internal table.
Here's a simple example of how to use `EPS_GET_DIRECTORY_LISTING` to ge... | 26,416 | [
{
"from": "human",
"value": "I need to get a listing of a server-side directory inside SAP. How do I achieve this in ABAP? Are there any built-in SAP functions I can call?\nIdeally I want a function which I can pass a path as input, and which will return a list of filenames in an internal table.\n"
},
{... |
I need to present a wizard once, the first time my windows forms application is run after install. I could use a user setting like firstrun = false I suppose. But I also need handle the case where the program is uninstalled, then reinstalled. How will that user setting be reset? It's already present in the config file ... | To ensure that your wizard runs every time your application is installed anew, even after an uninstallation, you need to consider how user settings are persisted and managed during install and uninstall processes.
### Common Approaches:
1. **Registry Entry**: Instead of using a user setting in the application’s confi... | 28,534 | [
{
"from": "human",
"value": "I need to present a wizard once, the first time my windows forms application is run after install. I could use a user setting like firstrun = false I suppose. But I also need handle the case where the program is uninstalled, then reinstalled. How will that user setting be reset?... |
If I am debugging (in this case a Visual Studio assembly called by Excel) and the code updates the Excel worksheet, how do I get Excel to redraw the current sheet / window whilst paused in the debugger?
| When debugging an assembly called by Excel, and you need to force Excel to redraw the current sheet or window while paused in the debugger, you can follow these steps:
1. **Use the Excel Object Model**: You can call methods from the Excel object model to trigger a redraw. The method `Application.ScreenUpdating` can be... | 26,425 | [
{
"from": "human",
"value": "If I am debugging (in this case a Visual Studio assembly called by Excel) and the code updates the Excel worksheet, how do I get Excel to redraw the current sheet / window whilst paused in the debugger?\n"
},
{
"from": "gpt",
"value": "When debugging an assembly call... |
Short version
If I split my users into shards, how do I offer a "user search"? Obviously, I don't want every search to hit every shard.
Long version
By shard, I mean have multiple databases where each contains a fraction of the total data. For (a naive) example, the databases UserA, UserB, etc. might contain users wh... | Yes, search can be scaled in a sharded database architecture, and your idea of using indexing is a common and effective approach. Here are some strategies for scaling searches across shards:
### 1. **Use a Global Index:**
- Maintain a central index that records the locations of users across the shards. This index c... | 27,365 | [
{
"from": "human",
"value": "Short version\nIf I split my users into shards, how do I offer a \"user search\"? Obviously, I don't want every search to hit every shard.\nLong version\nBy shard, I mean have multiple databases where each contains a fraction of the total data. For (a naive) example, the datab... |
There's a lot of interest these days in Erlang as a language for writing parallel programs on multicore. I've heard people argue that Erlang's message-passing model is easier to program than the dominant shared-memory models such as threads.
Conversely, in the high-performance computing community the dominant parallel... | The difference in perception between message-passing models in the IT and HPC communities can be attributed to several factors, including the design goals, intended use cases, and the underlying abstractions of the programming models.
### 1. **Purpose and Design Goals**
- **Erlang**: Erlang was designed for building ... | 16,926 | [
{
"from": "human",
"value": "There's a lot of interest these days in Erlang as a language for writing parallel programs on multicore. I've heard people argue that Erlang's message-passing model is easier to program than the dominant shared-memory models such as threads. \nConversely, in the high-performance... |
I was trying to test code using com class to display Word files but I cannot seem to get the answer and still searching. I get errors and sometimes, programs do not display anything at all. Please give me some ideas. I'm working with PHP 4.
| Using COM objects in PHP to manipulate Microsoft Word documents can be quite challenging, especially with older PHP versions like PHP 4. However, I can give you a general idea on how to work with COM and Word documents in PHP. Please note that PHP 4 is very outdated, and upgrading to at least PHP 5 or higher would prov... | 24,053 | [
{
"from": "human",
"value": "I was trying to test code using com class to display Word files but I cannot seem to get the answer and still searching. I get errors and sometimes, programs do not display anything at all. Please give me some ideas. I'm working with PHP 4.\n"
},
{
"from": "gpt",
"va... |
When uninstalling my application, I'd like to configure the Wix setup to remove all the files that were added after the original installation. It seems like the uninstaller removes only the directories and files that were originally installed from the MSI file and it leaves everything else that was added later in the a... | To configure your WiX setup to remove all files added to your application directory during the uninstallation process, including those that were added after the original installation, you can use a combination of WiX features. The goal is to ensure that the directory is fully purged during uninstall.
Here's how to do ... | 21,616 | [
{
"from": "human",
"value": "When uninstalling my application, I'd like to configure the Wix setup to remove all the files that were added after the original installation. It seems like the uninstaller removes only the directories and files that were originally installed from the MSI file and it leaves ever... |
I have a new project that needs a good binary protocol.
I was thinking of using Hessian, unless anyone has any better ideas.
I was reading through some of their documentation and it's not as straightforward as I thought, so I have a couple of quick questions.
The home page has a section titled "Documentation" that has ... | Here are the answers to your questions regarding Hessian and its documentation:
### 1) What is the difference between these?
- **Hessian Documentation**: This is a general guide to understanding Hessian, including its concepts and basic usage. It provides an overview of the protocol, its features, and how to use it in... | 22,491 | [
{
"from": "human",
"value": "I have a new project that needs a good binary protocol.\nI was thinking of using Hessian, unless anyone has any better ideas.\nI was reading through some of their documentation and it's not as straightforward as I thought, so I have a couple of quick questions.\nThe home page ha... |
The following javascript should setup an interval so a new item from the list of json objects will be added to the top of the list slowly, but instead they are all added at the same time.
<script type="text/javascript">
var json;
var count = 0;
$(document).ready(function() {
$.ajax({
typ... | The issue you are encountering is due to the way the `setTimeout` function is being called in your `createRow` function. In the current implementation, you are invoking `createRow` immediately when you call `setTimeout(createRow(), 3000);` rather than passing a reference to the function.
To fix this, you should pass ... | 26,978 | [
{
"from": "human",
"value": "The following javascript should setup an interval so a new item from the list of json objects will be added to the top of the list slowly, but instead they are all added at the same time.\n<script type=\"text/javascript\">\n var json;\n var count = 0;\n $(document).read... |
I was under the impression that I could run it on any machine, but a guy from our hosting company is saying that the csr has to be generated on the server hosting the site.
Can anyone clear this one up for me?
Thanks.
| When it comes to generating a Certificate Signing Request (CSR) for an SSL certificate, you can actually generate the CSR on any machine, as long as you have access to the private key and the certificate once it is issued. Here’s how it generally works:
1. **Generating the CSR**: You can create a CSR on your local mac... | 29,553 | [
{
"from": "human",
"value": "I was under the impression that I could run it on any machine, but a guy from our hosting company is saying that the csr has to be generated on the server hosting the site.\nCan anyone clear this one up for me?\nThanks.\n"
},
{
"from": "gpt",
"value": "When it comes ... |
I've been working with the Joomla framework and I have noticed that they use a convention to designate private or protected methods (they put an underscore "_" in front of the method name), but they do not explicitly declare any methods public, private, or protected. Why is this? Does it have to do with portability? ... | The convention used in Joomla, where a leading underscore (`_`) is placed in front of method names to indicate that they are private or protected, stems from historical practices in PHP programming, particularly before the introduction of formal visibility keywords in PHP.
### Background on Visibility in PHP
- **PHP ... | 28,407 | [
{
"from": "human",
"value": "I've been working with the Joomla framework and I have noticed that they use a convention to designate private or protected methods (they put an underscore \"_\" in front of the method name), but they do not explicitly declare any methods public, private, or protected. Why is t... |
I have a component which writes/generates javascript from a server side renderer. This component can be used in multiple times in a same page. However, once the page is loaded I have to collect all the variables or JSO written by this multiple components in the page. How can I do this so that I will have a collection o... | To collect and combine variables or JSON objects generated by multiple instances of your component after the page has loaded, you can follow these steps:
1. **Use a Consistent Naming Convention**: When generating the JavaScript variables, ensure each variable has a unique and consistent naming convention. For example,... | 23,217 | [
{
"from": "human",
"value": "I have a component which writes/generates javascript from a server side renderer. This component can be used in multiple times in a same page. However, once the page is loaded I have to collect all the variables or JSO written by this multiple components in the page. How can I d... |
Possible Duplicate:
How costly is .NET reflection?
I am currently in a programming mentality that reflection is my best friend. I use it a lot for dynamic loading of content that allows "loose implementation" rather than strict interfaces, as well as a lot of custom attributes.
What is the "real" cost to using refle... | Reflection in .NET is a powerful feature that allows you to inspect and interact with objects at runtime, enabling dynamic behavior in your applications. However, it comes with its own set of trade-offs, particularly regarding performance.
### Performance Costs of Reflection
1. **Execution Time**: Reflection operation... | 25,019 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nHow costly is .NET reflection? \n\nI am currently in a programming mentality that reflection is my best friend. I use it a lot for dynamic loading of content that allows \"loose implementation\" rather than strict interfaces, as well as a lot of custom att... |
Normally I program in C# but have been forced to do some work in C++. It seems that the integration with Visual Studio (2008) is really poor compared to C# but I was wondering if there are any good tools, plugins or configurations that can improve the situation.
Another post pointed out the program Visual Assist X, whi... | Transitioning from C# to C++ can indeed be challenging, especially given the differences in error reporting, tooling, and language paradigms. Here are some suggestions for tools and configurations that can improve your experience with C++ development in Visual Studio 2008:
### 1. **Static Analysis Tools**
Using static... | 22,243 | [
{
"from": "human",
"value": "Normally I program in C# but have been forced to do some work in C++. It seems that the integration with Visual Studio (2008) is really poor compared to C# but I was wondering if there are any good tools, plugins or configurations that can improve the situation.\nAnother post po... |
I am part of a team creating a web application using PHP and MySQL. The application will have multiple users with different roles. The application will also be used in a geographically distributed manner. Accordingly we need to create an access control system that operates at the following two levels:
Controls user pe... | Hi Vinayak,
Designing a robust access control system that manages both page-level and record-level permissions is essential for creating secure web applications. Below are some strategies to help you implement this system effectively.
### 1. User Roles and Permissions Design
Start by defining the roles and permissio... | 22,552 | [
{
"from": "human",
"value": "I am part of a team creating a web application using PHP and MySQL. The application will have multiple users with different roles. The application will also be used in a geographically distributed manner. Accordingly we need to create an access control system that operates at th... |
I need to test a web form that takes a file upload.
The filesize in each upload will be about 10 MB.
I want to test if the server can handle over 100 simultaneous uploads, and still remain
responsive for the rest of the site.
Repeated form submissions from our office will be limited by our local DSL line.
The server is... | Testing a web form that handles file uploads, especially under high load conditions, requires a structured approach. Here are some steps and considerations based on experience and best practices to effectively perform the load testing you described:
### 1. **Define Your Testing Goals:**
- Ensure the server can hand... | 22,797 | [
{
"from": "human",
"value": "I need to test a web form that takes a file upload.\nThe filesize in each upload will be about 10 MB.\nI want to test if the server can handle over 100 simultaneous uploads, and still remain\nresponsive for the rest of the site.\nRepeated form submissions from our office will be... |
I would like to change the "Row Source" values in an Access table through code.
This way I can filter what a user can choose in a column's combo box.
| In Microsoft Access, if you want to dynamically change the "Row Source" of a combo box to filter the options a user can select, you can achieve this using VBA (Visual Basic for Applications). Here’s how you can do this.
### Steps to Change the Row Source of a Combo Box
1. **Open your Access Database** and navigate to... | 26,762 | [
{
"from": "human",
"value": "I would like to change the \"Row Source\" values in an Access table through code.\nThis way I can filter what a user can choose in a column's combo box.\n"
},
{
"from": "gpt",
"value": "In Microsoft Access, if you want to dynamically change the \"Row Source\" of a co... |
We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have.
Is key framing the animations our only option... | Animating characters in a Silverlight 2 project, especially for a game, can be approached in several ways. Here are some suggestions and options for implementing character animations effectively:
### 1. **Keyframe Animation:**
Keyframing is one of the primary methods to animate characters in Silverlight. You can creat... | 25,685 | [
{
"from": "human",
"value": "We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have.\nIs ... |
Instead of using the <input type="file"> tag I'd like to have a button that launches a file browser dialog.
My first thought was to have a hidden file input tag and a button. I'd use the button click on the button to fire the onclick of the hidden file input, but I haven't been able to get this working properly.
So th... | Yes, it's definitely possible to use a hidden file input element and a button to open the file browser dialog. This is a common approach and works well with basic JavaScript and HTML.
Here's a simple example to demonstrate how you can achieve this:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UT... | 21,415 | [
{
"from": "human",
"value": "Instead of using the <input type=\"file\"> tag I'd like to have a button that launches a file browser dialog.\nMy first thought was to have a hidden file input tag and a button. I'd use the button click on the button to fire the onclick of the hidden file input, but I haven't b... |
Does anyone have a good articles or tutorial on correctly using dispose and IDisposable. I am trying to explain this to some junior dev and wanted to get some extra material, examples, etc.
| Certainly! The `IDisposable` interface in .NET is crucial for managing resources, especially when dealing with unmanaged resources such as file handles, database connections, or network connections. Here's a concise breakdown along with links to useful articles and tutorials.
### Key Concepts
1. **Purpose of IDisposa... | 24,073 | [
{
"from": "human",
"value": "Does anyone have a good articles or tutorial on correctly using dispose and IDisposable. I am trying to explain this to some junior dev and wanted to get some extra material, examples, etc.\n"
},
{
"from": "gpt",
"value": "Certainly! The `IDisposable` interface in .... |
Can JQuery and YUI live together w/o any conflicts?
| Yes, jQuery and YUI (Yahoo User Interface Library) can coexist in the same project without conflicts, but there are some important considerations to ensure smooth interoperability between the two libraries.
### Key Points for Coexistence:
1. **No Conflict Mode**: jQuery has a built-in mechanism called "noConflict" mo... | 24,502 | [
{
"from": "human",
"value": "Can JQuery and YUI live together w/o any conflicts?\n"
},
{
"from": "gpt",
"value": "Yes, jQuery and YUI (Yahoo User Interface Library) can coexist in the same project without conflicts, but there are some important considerations to ensure smooth interoperability be... |
I have some user controls that I'm loading in SharePoint and I would prefer to have all those styles contained in an external style sheet. What's the best way to link to an external stylesheet in CSS?
Thanks.
| To link to an external stylesheet in your SharePoint user controls (or in any HTML document), you can use the `<link>` HTML tag within the `<head>` section of your user control or page. Here's how to do it:
1. **Create your external stylesheet**: First, make sure you have your CSS file ready and accessible via a URL.
... | 25,843 | [
{
"from": "human",
"value": "I have some user controls that I'm loading in SharePoint and I would prefer to have all those styles contained in an external style sheet. What's the best way to link to an external stylesheet in CSS?\nThanks.\n"
},
{
"from": "gpt",
"value": "To link to an external ... |
Put it another way: what code have you written that cannot fail. I'm interested in hearing from those who have worked on projects dealing with heart monitors, water testing, economic fundamentals, missile trajectories, or the O2 concentration on the space shuttle.
How did you prepare for writing this sort of code: met... | Writing code for critical systems—such as heart monitors, water testing, economic fundamentals, missile trajectories, or life-support systems in space—requires a rigorous, methodical, and often interdisciplinary approach to minimize the risk of failure. Here’s how one might prepare for such projects:
### Methodologica... | 25,077 | [
{
"from": "human",
"value": "Put it another way: what code have you written that cannot fail. I'm interested in hearing from those who have worked on projects dealing with heart monitors, water testing, economic fundamentals, missile trajectories, or the O2 concentration on the space shuttle.\nHow did you ... |
I have made a bunch of changes to a number of files in a project. Every commit (usually at the file level) was accompanied by a comment of what was changed.
Is there a way to get a list from CVS of these comments on changes since the last tagged version?
Bonus if I can do this via the eclipse CVS plugin.
UPDATE: I'd l... | In CVS (Concurrent Versions System), you can use the `cvs log` command to obtain the commit messages for files in a repository since a particular tag. Here’s how you can achieve this from the command line:
1. **Identify the Tag**: First, determine the tag name for the last tagged version you want to compare against.
... | 26,497 | [
{
"from": "human",
"value": "I have made a bunch of changes to a number of files in a project. Every commit (usually at the file level) was accompanied by a comment of what was changed. \nIs there a way to get a list from CVS of these comments on changes since the last tagged version?\nBonus if I can do thi... |
Either for comparisons or initialization of a new variable, does it make a difference which one of these you use?
I know that BigDecimal.ZERO is a 1.5 feature, so that's a concern, but assuming I'm using 1.5 does it matter?
Thanks.
| When using `BigDecimal.ZERO` in Java, you're essentially utilizing a predefined constant representing the value of zero. This can be beneficial for both comparisons and variable initialization for a few reasons:
1. **Readability**: Using `BigDecimal.ZERO` can make your code more readable and self-explanatory. It's cle... | 29,385 | [
{
"from": "human",
"value": "Either for comparisons or initialization of a new variable, does it make a difference which one of these you use?\nI know that BigDecimal.ZERO is a 1.5 feature, so that's a concern, but assuming I'm using 1.5 does it matter?\nThanks.\n"
},
{
"from": "gpt",
"value": "... |
Goal:
Allow the user to delete a record by dragging a row from an AdvancedDataGrid, dropping it onto a trash-can icon and verify the user meant to do that via a popup alert with "OK" and "Cancel" buttons.
What is working:
Dragging/Dropping a row onto the trash icon.
If the user clicks the "OK" button, the record is ... | The issue you're experiencing, where dragging is disabled after the user clicks "Cancel" in the alert popup, could be related to the drag-and-drop event handling in your `AdvancedDataGrid` or how the event is managed after the user closes the popup. Below are a few steps and suggestions to troubleshoot and potentially ... | 22,505 | [
{
"from": "human",
"value": "Goal:\nAllow the user to delete a record by dragging a row from an AdvancedDataGrid, dropping it onto a trash-can icon and verify the user meant to do that via a popup alert with \"OK\" and \"Cancel\" buttons. \nWhat is working:\n\nDragging/Dropping a row onto the trash icon.\n... |
Probably a long question for a simple solution, but here goes...
I have a custom made silverlight control for selecting multiple files and sending them to the server. It sends files to a general handler (FileReciever.ashx) using the OpenWriteAsync method of a WebCLient control.
Basically, the silverlight code does some... | The problem you're facing is related to the asynchronous nature of the `WebClient` operations in Silverlight. The `OpenWriteCompleted` event is triggered once the data is sent, but it doesn't guarantee that the server has finished processing that data. Unfortunately, `WebClient` doesn't provide a built-in mechanism to ... | 23,111 | [
{
"from": "human",
"value": "Probably a long question for a simple solution, but here goes...\nI have a custom made silverlight control for selecting multiple files and sending them to the server. It sends files to a general handler (FileReciever.ashx) using the OpenWriteAsync method of a WebCLient control.... |
I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument.
That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP?
... | To create a password prompt in PHP that doesn't echo the typed characters to the screen and replaces them with asterisks (`*`), you can use the PHP `readline` extension, which is available on most Unix-like systems, including Linux and macOS.
However, note that the `readline` function does not support replacing chara... | 26,335 | [
{
"from": "human",
"value": "I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. \nThat's easy enough, but I'd like it to not echo the password to the screen as... |
I'm a doing some blackbox testing of a ASP.Net website and I need to test different session timeout scenarios.
I'm not sure they fully encapsulated session timeouts. Other then leaving a page open for 20 minutes is there an easier way to force a session timeout?
| Yes, there are several methods to test session timeouts without waiting for the designated timeout period. Here are a few approaches you can use to force a session timeout for black box testing in an ASP.NET website:
1. **Modify Session Timeout in Web.Config:**
If you have access to the web application's configurat... | 27,885 | [
{
"from": "human",
"value": "I'm a doing some blackbox testing of a ASP.Net website and I need to test different session timeout scenarios. \nI'm not sure they fully encapsulated session timeouts. Other then leaving a page open for 20 minutes is there an easier way to force a session timeout?\n"
},
{
... |
What's the difference between the list methods append() and extend()?
| In Python, both `append()` and `extend()` are methods used to add elements to a list, but they work in different ways:
1. **`append()`**:
- The `append()` method adds a single element to the end of the list.
- The argument passed to `append()` can be any object (e.g., an integer, a string, another list, etc.), b... | 26,483 | [
{
"from": "human",
"value": "What's the difference between the list methods append() and extend()?\n"
},
{
"from": "gpt",
"value": "In Python, both `append()` and `extend()` are methods used to add elements to a list, but they work in different ways:\n\n1. **`append()`**:\n - The `append()` me... |
I'm searching for a PHP syntax highlighting engine that can be customized (i.e. I can provide my own tokenizers for new languages) and that can handle several languages simultaneously (i.e. on the same output page). This engine has to work well together with CSS classes, i.e. it should format the output by inserting <s... | If you're looking for a PHP-based syntax highlighting engine with the capabilities you described, here are some options that might meet your requirements:
1. **Pygments with a PHP Wrapper**:
While Pygments itself is a Python library, you can use it in PHP via command line. There are PHP libraries like [Pygments.php... | 23,965 | [
{
"from": "human",
"value": "I'm searching for a PHP syntax highlighting engine that can be customized (i.e. I can provide my own tokenizers for new languages) and that can handle several languages simultaneously (i.e. on the same output page). This engine has to work well together with CSS classes, i.e. it... |
I have two multidimensional arrays (well actually they're only 2D) which have inferred size. How do I deep clone them? Here's what I have gotten so far:
public foo(Character[][] original){
clone = new Character[original.length][];
for(int i = 0; i < original.length; i++)
clone[i] = (Character[]) origi... | In Java, the `equals` method for arrays does not check for deep equality of their contents, but rather checks for reference equality. This means that calling `original.equals(clone)` will return `false` because `original` and `clone` are two different objects, even if they contain the same elements.
To check for deep ... | 26,315 | [
{
"from": "human",
"value": "I have two multidimensional arrays (well actually they're only 2D) which have inferred size. How do I deep clone them? Here's what I have gotten so far:\npublic foo(Character[][] original){\n clone = new Character[original.length][];\n for(int i = 0; i < original.length; i... |
I want an simple IDE/editor for C in Linux to which I can add features easily. For example: I want to add a right click menu item and a related action for the editor. It should be easy to extent and add any desirable functionality. I tried eclipse CDT but its to much of learning(I mean knowing the eclipse plug-in archi... | If you're looking for a simple and extensible IDE/editor for C development on Linux, you might want to consider the following options:
### 1. **Geany**
- **Description:** Geany is a lightweight and fast IDE that supports C and many other programming languages. It has a plugin system that makes it easy to extend functi... | 25,666 | [
{
"from": "human",
"value": "I want an simple IDE/editor for C in Linux to which I can add features easily. For example: I want to add a right click menu item and a related action for the editor. It should be easy to extent and add any desirable functionality. I tried eclipse CDT but its to much of learning... |
I'm looking for some good ideas for a simple 3d graphics program as my final project for an intro to computer graphics class. As for some background information, we'll be using opengl and will have a little over a month to work on it, so nothing too far-fetched. The simpler and "prettier" looking, the better. It doe... | 3D Tetris is a great choice! Here are some more ideas for simple yet engaging 3D graphics projects that you might consider for your final project:
1. **3D Maze Exploration Game**:
- Create a procedurally generated maze where the player can navigate using keyboard controls. The goal can be to reach the exit within a... | 28,177 | [
{
"from": "human",
"value": "I'm looking for some good ideas for a simple 3d graphics program as my final project for an intro to computer graphics class. As for some background information, we'll be using opengl and will have a little over a month to work on it, so nothing too far-fetched. The simpler an... |
We are making a Ruby On Rails webapp where every customer gets their own database.
The database needs to be created after they fill out a form on our website.
We have a template database that has all of the tables and columns that we need to copy. How can I do this in programatically from ruby on rails?
| Creating a new database for each customer in a Ruby on Rails web application can be accomplished by following these general steps:
1. **Setup the Template Database**: Make sure you have a template database that contains all the tables and columns that you want to copy for each new customer.
2. **Database Connection M... | 24,638 | [
{
"from": "human",
"value": "We are making a Ruby On Rails webapp where every customer gets their own database.\nThe database needs to be created after they fill out a form on our website.\nWe have a template database that has all of the tables and columns that we need to copy. How can I do this in program... |
I am writing an application that is linked to Active Directory, and I need to store the userPrincipalName in a database table, but I do not know how big the field would need to be.
On MSDN, no Length is given, and neither in RFC 822. Now, before I revert to the DOMAIN\Username that has a defined Length (sAMAccountName ... | The `userPrincipalName` (UPN) in Active Directory is defined as a standard email address format, which is typically structured as `username@domain`. The UPN is a combination of the user's account name and the domain in which the account resides.
While there isn't a strict formal limit specified in an RFC for the lengt... | 29,766 | [
{
"from": "human",
"value": "I am writing an application that is linked to Active Directory, and I need to store the userPrincipalName in a database table, but I do not know how big the field would need to be.\nOn MSDN, no Length is given, and neither in RFC 822. Now, before I revert to the DOMAIN\\Username... |
I would like to write a driver to talk to my Suunto t3 watch in Python on a Mac. My day job is doing basic web work in C# so my familiarity with Python and developing on a Mac is limited.
Can you suggest how one would start doing driver development in general and then more specifically on a Mac. I.e. how to easily see ... | Creating a driver for a specific device like the Suunto T3 watch can be a challenging but rewarding project. Here’s a step-by-step guide on how you might approach this task, along with specific instructions for working on a Mac using Python.
### General Steps for Driver Development
1. **Understand the Device Protocol... | 19,993 | [
{
"from": "human",
"value": "I would like to write a driver to talk to my Suunto t3 watch in Python on a Mac. My day job is doing basic web work in C# so my familiarity with Python and developing on a Mac is limited.\nCan you suggest how one would start doing driver development in general and then more spec... |
Joining an existing team with a large codebase already in place can be daunting. What's the best approach;
Broad; try to get a general overview of how everything links together, from the code
Narrow; focus on small sections of code at a time, understanding how they work fully
Pick a feature to develop and learn as you... | Joining an existing team with a large codebase can indeed be a challenging yet rewarding experience. Here’s a consolidated approach based on your summary, with added strategies to help you quickly become productive while minimizing frustration:
1. **Familiarization Phase**:
- **Read Documentation**: Begin with any ... | 26,215 | [
{
"from": "human",
"value": "Joining an existing team with a large codebase already in place can be daunting. What's the best approach;\n\nBroad; try to get a general overview of how everything links together, from the code\nNarrow; focus on small sections of code at a time, understanding how they work full... |
I come from a .NET world and I'm new to writting C++. I'm just wondering what are the preferred naming conventions when it comes to naming local variables and struct members.
For example, the legacy code that I've inheritted has alot of these:
struct MyStruct
{
TCHAR szMyChar[STRING_SIZE];
bool ... | Naming conventions in C++ can vary widely between different projects, teams, and coding standards. While there is no universally accepted standard, there are several prevalent conventions that you might encounter. Let’s break down the two approaches you mentioned, as well as some best practices:
### 1. Hungarian Notat... | 24,096 | [
{
"from": "human",
"value": "I come from a .NET world and I'm new to writting C++. I'm just wondering what are the preferred naming conventions when it comes to naming local variables and struct members.\nFor example, the legacy code that I've inheritted has alot of these:\nstruct MyStruct\n{\n TCHAR ... |
I'm trying to compile such code:
#include <iostream>
using namespace std;
class CPosition
{
private:
int itsX,itsY;
public:
void Show();
void Set(int,int);
};
void CPosition::Set(int a, int b)
{
itsX=a;
itsY=b;
}
void CPosition::Show()
{
cout << "x:" << itsX << " y:" << itsY << endl;
}
class... | The issue you are encountering is related to access control in C++. The `CPosition` class is a friend of `CCube`, which means that `CPosition` has access to the private members of `CCube`, but it does not mean that instances of `CPosition` within `CCube` are accessible from outside of `CCube`.
To make the `Position` m... | 28,875 | [
{
"from": "human",
"value": "I'm trying to compile such code:\n#include <iostream>\nusing namespace std;\n\nclass CPosition\n{\n private:\n int itsX,itsY;\n public:\n void Show();\n void Set(int,int);\n};\n\nvoid CPosition::Set(int a, int b)\n{\n itsX=a;\n itsY=b;\n}\n\nvoid CPosition::Show()\n... |
I was recently tasked to document a large JavaScript application I have been maintaining for some time. So I do have a good knowledge of the system.
But due the sheer size of the application, it will probably take a lot of time even with prior knowledge around the code and the source code itself in uncompressed form.
S... | Documenting a large JavaScript application can indeed be a daunting task, especially if you're working with a substantial codebase. Fortunately, there are several tools that can help you explore the code, understand the relationships between classes and methods, and assist in generating documentation. Here are some too... | 26,205 | [
{
"from": "human",
"value": "I was recently tasked to document a large JavaScript application I have been maintaining for some time. So I do have a good knowledge of the system.\nBut due the sheer size of the application, it will probably take a lot of time even with prior knowledge around the code and the ... |
I have an Excel spreadsheet with 1 column, 700 rows. I care about every seventh line. I don't want to have to go in and delete the 6 rows between each row I care about. So my solution was to create another sheet and specify a reference to each cell I want.
=sheet1!a1
=sheet1!a8
=sheet1!a15
But I don't want to type in ... | You can achieve this efficiently using a combination of the `INDEX` function in Excel along with a formula to create a sequence of references to every seventh row. Here's how you can do it:
1. **Go to the new sheet** where you want to reference the values from the original sheet (let's say it's named `Sheet2`).
2. ... | 29,954 | [
{
"from": "human",
"value": "I have an Excel spreadsheet with 1 column, 700 rows. I care about every seventh line. I don't want to have to go in and delete the 6 rows between each row I care about. So my solution was to create another sheet and specify a reference to each cell I want.\n=sheet1!a1\n=sheet1!a... |
I have a large number of files in a .tar.gz archive. Checking the file type with the command
file SMS.tar.gz
gives the response
gzip compressed data - deflate method , max compression
When I try to extract the archive with gunzip, after a delay I receive the message
gunzip: SMS.tar.gz: unexpected end of file
Is the... | The error message "unexpected end of file" indicates that the `SMS.tar.gz` file is likely corrupted, which can happen due to incomplete downloads, filesystem errors, or other issues. While recovery is not always guaranteed, there are several approaches you can try to salvage whatever data you can from the corrupted arc... | 24,831 | [
{
"from": "human",
"value": "I have a large number of files in a .tar.gz archive. Checking the file type with the command\nfile SMS.tar.gz\n\ngives the response\ngzip compressed data - deflate method , max compression\n\nWhen I try to extract the archive with gunzip, after a delay I receive the message\ngu... |
After I read a bunch of LINQ related stuff, I suddenly realized that no articles introduce how to write asynchronous LINQ query.
Suppose we use LINQ to SQL, below statement is clear. However, if the SQL database responds slowly, then the thread using this block of code would be hindered.
var result = from item in Prod... | Asynchronous programming with LINQ is possible, but it requires the use of asynchronous methods provided by the data access technology you are using (e.g., Entity Framework, Dapper, etc.). LINQ itself does not provide built-in support for asynchronous queries, but you can utilize async methods from your data access lib... | 26,054 | [
{
"from": "human",
"value": "After I read a bunch of LINQ related stuff, I suddenly realized that no articles introduce how to write asynchronous LINQ query. \nSuppose we use LINQ to SQL, below statement is clear. However, if the SQL database responds slowly, then the thread using this block of code would b... |
Each of my clients can have many todo items and every todo item has a due date.
What would be the query for discovering the next undone todo item by due date for each file? In the event that a client has more than one todo, the one with the lowest id is the correct one.
Assuming the following minimal schema:
clients (... | To retrieve the next undone todo item by due date for each client, while ensuring that in the event of multiple todos with the same due date, the one with the lowest ID is selected, you can use a combination of SQL queries, specifically utilizing Common Table Expressions (CTEs) or subqueries. Below is a query that will... | 27,699 | [
{
"from": "human",
"value": "Each of my clients can have many todo items and every todo item has a due date.\nWhat would be the query for discovering the next undone todo item by due date for each file? In the event that a client has more than one todo, the one with the lowest id is the correct one.\nAssum... |
I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use
- the most derived type for return values.
- the least derived type for input parameters.
So, it means that, for example, a method has to get a ReadOnlyCollection as parameter, and a... | Your friend raises some interesting points about the usage of collections in method parameters and return values, particularly in the context of public APIs. Let's break down the key ideas:
### 1. Most Derived Type for Return Values
- **Reasoning**: The idea here is to return the most specific type that still conforms... | 25,976 | [
{
"from": "human",
"value": "I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use\n- the most derived type for return values.\n- the least derived type for input parameters.\nSo, it means that, for example, a method has to ... |
I have a news site with articles tagged in categories.
My Controller is called "Category" and this URL:
http://mysite.com/Category/Sport
passes Sport to action Index in controller Category.
I want to allow the following URLs:
http://mysite.com/Sport/Hockey
http://mysite.com/Sport/Football
http://mysite.com/Science/E... | To create a catch-all route in an ASP.NET MVC application that routes URLs like `/Sport/Hockey`, `/Sport/Football`, and `/Science/Evolution` to the `Index` action of the `Category` controller, you can use the routing configuration provided by ASP.NET MVC.
You would typically define your routes in the `RouteConfig.cs` ... | 26,353 | [
{
"from": "human",
"value": "I have a news site with articles tagged in categories.\nMy Controller is called \"Category\" and this URL:\n\nhttp://mysite.com/Category/Sport\n\npasses Sport to action Index in controller Category.\nI want to allow the following URLs:\n\nhttp://mysite.com/Sport/Hockey\nhttp://m... |
Actually, two sizes: initially committed and total reserved.
Do you use static or dynamic analysis? Which tools? Which techniques?
| In the context of analyzing software, both static and dynamic analysis have their specific uses, tools, and techniques. Here's a brief overview of each:
### Static Analysis
**Definition**: Static analysis involves examining the code without executing it. The goal is to find bugs, vulnerabilities, and ensure adherence... | 25,891 | [
{
"from": "human",
"value": "Actually, two sizes: initially committed and total reserved.\nDo you use static or dynamic analysis? Which tools? Which techniques?\n"
},
{
"from": "gpt",
"value": "In the context of analyzing software, both static and dynamic analysis have their specific uses, tools... |
I am writing a C# Windows Forms application which calls Oracle stored procedures.
I chose to use typed datasets in the application, these correctly populate various datagrids, but I am having trouble when invoking the UpdateCommand or the InsertCommand. I have manually coded these commands because a) I am using Oracle... | It sounds like you're facing a common challenge when working with Oracle stored procedures in C#, particularly with passing parameters correctly. Let's go through the steps and some suggestions that might help you troubleshoot and resolve the issue with your `OracleDataAdapter.Update()` method and stored procedures.
#... | 24,284 | [
{
"from": "human",
"value": "I am writing a C# Windows Forms application which calls Oracle stored procedures.\nI chose to use typed datasets in the application, these correctly populate various datagrids, but I am having trouble when invoking the UpdateCommand or the InsertCommand. I have manually coded t... |
Looking for sites which offer templates for creating styled table-based web page forms.
Similar to css-based forms at:
http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/
(please no css is better than tables discussions)
| If you are looking for sites that offer templates for creating styled table-based web page forms, here are several resources you can explore:
1. **TemplateMo** (https://templatemo.com)
- TemplateMo offers a variety of free HTML templates, including form templates. Some of them use table-based layouts, making it eas... | 23,770 | [
{
"from": "human",
"value": "Looking for sites which offer templates for creating styled table-based web page forms. \nSimilar to css-based forms at:\nhttp://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/\n(please no css is better than tables discussions)\n"
},
{
"from": "gpt"... |
I am having difficulty refreshing windows forms controls that are using a BindingSource object. We have a CAB/MVP/SCSF client that I (actually “we” since it is a team effort) are developing that will interact with WCF services running on a remote server. (This is our first attempt at this, so we are in a learning mode... | It sounds like you're making good progress with your application, but it seems you're facing issues with updating the bindings when new data is retrieved from the WCF service. The fact that your binding works on the first call but doesn't refresh with new data indicates that the `BindingSource` isn't being properly not... | 25,451 | [
{
"from": "human",
"value": "I am having difficulty refreshing windows forms controls that are using a BindingSource object. We have a CAB/MVP/SCSF client that I (actually “we” since it is a team effort) are developing that will interact with WCF services running on a remote server. (This is our first atte... |
I need to switch among 3 different environments when developing my web app - Development, UAT, and Prod. I have different database connections in my configuration files for all 3. I have seen switching these settings done manually by changing all references and then rebuilding the solution, and also done with preproces... | Yes, there are more streamlined approaches to manage different configurations for Development, UAT, and Production environments without manually changing references or relying solely on preprocessor directives. Here are several approaches you can consider:
### 1. **Environment-Specific Configuration Files**:
You can u... | 25,548 | [
{
"from": "human",
"value": "I need to switch among 3 different environments when developing my web app - Development, UAT, and Prod. I have different database connections in my configuration files for all 3. I have seen switching these settings done manually by changing all references and then rebuilding t... |
Consider the following two ways of writing a loop in Java to see if a list contains a given value:
Style 1
boolean found = false;
for(int i = 0; i < list.length && !found; i++)
{
if(list[i] == testVal)
found = true;
}
Style 2
boolean found = false;
for(int i = 0; i < list.length && !found; i++)
{
found = (l... | Your question revolves around the performance differences between two styles of writing a loop that checks if a list contains a specified value in Java.
### Performance Analysis
1. **Style 1**:
```java
boolean found = false;
for(int i = 0; i < list.length && !found; i++) {
if(list[i] == testVal)
... | 25,712 | [
{
"from": "human",
"value": "Consider the following two ways of writing a loop in Java to see if a list contains a given value:\nStyle 1\nboolean found = false;\nfor(int i = 0; i < list.length && !found; i++)\n{\n if(list[i] == testVal)\n found = true;\n}\n\nStyle 2\nboolean found = false;\nfor(int i ... |
In SQL 2005/2008 management studio, how to I get the 'summary' tab to be visible?
I close it by mistake and want to open it again...any way without restarting it?
| In SQL Server Management Studio (SSMS) 2005/2008, if you've accidentally closed the 'Summary' tab and want to reopen it without restarting the application, you can do the following:
1. **Use the View Menu**:
- Go to the **View** menu in the menu bar.
- Look for **Summary** (or sometimes called **Object Explorer ... | 27,747 | [
{
"from": "human",
"value": "In SQL 2005/2008 management studio, how to I get the 'summary' tab to be visible?\nI close it by mistake and want to open it again...any way without restarting it?\n"
},
{
"from": "gpt",
"value": "In SQL Server Management Studio (SSMS) 2005/2008, if you've accidental... |
In SQL Server, why is this:
[dbo].[table_name]
preferable to this:
dbo.table_name
And along those lines, why even list the dbo at all if there's only one schema?
| In SQL Server, using the bracketed notation `[dbo].[table_name]` is often considered preferable to the unqualified notation `dbo.table_name` for several reasons:
1. **Clarity and Readability**: The bracketed notation clearly distinguishes the schema and object names, making it easier to read, especially in complex que... | 27,141 | [
{
"from": "human",
"value": "In SQL Server, why is this:\n[dbo].[table_name]\n\npreferable to this:\ndbo.table_name\n\nAnd along those lines, why even list the dbo at all if there's only one schema?\n"
},
{
"from": "gpt",
"value": "In SQL Server, using the bracketed notation `[dbo].[table_name]`... |
We are trying to get our .NET devs to use the ASP.NET Development Server (VS2008) for web development instead of a local instance of IIS.
I received this response as a reason why some of our devs can't use it:
"Our XXXX Online Sales application uses SSL to protect passwords. While Visual Studio does permit some basic w... | Yes, the response you received makes sense. The ASP.NET Development Server, also known as Cassini, included with Visual Studio 2008 does not support SSL (HTTPS) out of the box. This limitation can make it challenging for developers working on applications that require secure connections, such as those handling sensitiv... | 25,508 | [
{
"from": "human",
"value": "We are trying to get our .NET devs to use the ASP.NET Development Server (VS2008) for web development instead of a local instance of IIS.\nI received this response as a reason why some of our devs can't use it:\n\"Our XXXX Online Sales application uses SSL to protect passwords. ... |
This is my first time attempting to call an ASP.NET page method from jQuery. I am getting a status 500 error with the responseText message that the web method cannot be found. Here is my jQuery $.ajax call:
function callCancelPlan(activePlanId, ntLogin) {
var paramList = '{"activePlanId":"' + activePlanId + '","ntL... | It looks like you're encountering a common issue with calling ASP.NET web methods from jQuery. The status 500 error typically indicates a server error, and the message that the web method cannot be found suggests that there may be an issue with how the method is defined or how you're calling it.
Here are a few things ... | 22,580 | [
{
"from": "human",
"value": "This is my first time attempting to call an ASP.NET page method from jQuery. I am getting a status 500 error with the responseText message that the web method cannot be found. Here is my jQuery $.ajax call:\nfunction callCancelPlan(activePlanId, ntLogin) {\n var paramList = '... |
I know there is done some research on TDD at the North Carolina State University. They have published a paper called 'An Initial Investigation of Test Driven Development in Industry'. Other publications by NCSU can be found here.
Can anybody point me to other good publications on this topic?
| Certainly! Test-Driven Development (TDD) has been the subject of various research studies and publications across the years. Here are some notable publications and resources you might find helpful:
1. **"Test-Driven Development: A Technical Review"** - This paper provides an overview of TDD, examining its effectivenes... | 29,599 | [
{
"from": "human",
"value": "I know there is done some research on TDD at the North Carolina State University. They have published a paper called 'An Initial Investigation of Test Driven Development in Industry'. Other publications by NCSU can be found here.\nCan anybody point me to other good publications ... |
The following code receives seg fault on line 2:
char *str = "string";
str[0] = 'z'; // could be also written as *str = 'z'
printf("%s\n", str);
While this works perfectly well:
char str[] = "string";
str[0] = 'z';
printf("%s\n", str);
Tested with MSVC and GCC.
| The reason for the segmentation fault (segfault) in the first piece of code but not in the second relates to how string literals and character arrays are stored in memory in C.
### Explanation
1. **String Literals**:
```c
char *str = "string";
```
In this line, `str` is a pointer to a string literal. Stri... | 28,492 | [
{
"from": "human",
"value": "The following code receives seg fault on line 2:\nchar *str = \"string\";\nstr[0] = 'z'; // could be also written as *str = 'z'\nprintf(\"%s\\n\", str);\n\nWhile this works perfectly well:\nchar str[] = \"string\";\nstr[0] = 'z';\nprintf(\"%s\\n\", str);\n\nTested with MSVC and... |
In my previous job I designed and helped build a run-time(production) Profiler tool that among other cool features was able to give me .Net stack traces for every SQL statement that executed. Think of it as SQL-Server Profiler on steroids. So instead of just seeing SQL statements and duration, you also got the context ... | It sounds like you had a very useful profiling tool in your previous job! While specific tools that provide .NET stack traces for every SQL statement executed may not be common, here are some alternatives and approaches you might consider for similar functionality:
1. **SQL Server Extended Events**: This is a lightwei... | 28,087 | [
{
"from": "human",
"value": "In my previous job I designed and helped build a run-time(production) Profiler tool that among other cool features was able to give me .Net stack traces for every SQL statement that executed. Think of it as SQL-Server Profiler on steroids. So instead of just seeing SQL statement... |
i have the following script
import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
if i name this getopt.py and run it doesn't work as it tries to import itself
is there a way around this, so i can keep this filename but specify on import that i want the st... | Yes, you've encountered a common issue where the script name conflicts with a standard library module name. When you name your file `getopt.py`, Python tries to import your script instead of the built-in `getopt` module when you use `import getopt`.
One solution, as you've mentioned, is to modify the `sys.path` to ens... | 28,904 | [
{
"from": "human",
"value": "i have the following script\nimport getopt, sys\nopts, args = getopt.getopt(sys.argv[1:], \"h:s\")\nfor key,value in opts:\n print key, \"=>\", value\n\nif i name this getopt.py and run it doesn't work as it tries to import itself\nis there a way around this, so i can keep th... |
I have a web project, a C# library project, and a web setup project in Visual Studio 2005. The web project needs the C# library needs to be registered in the GAC. This is simple, just add the GAC folder to the setup project and drop the primary output of the C# library in there. The C# library also needs to be register... | Registering a .NET assembly for COM interop using a Visual Studio setup project can be tricky due to the interactions between the various components. Since you're facing issues with primary output and custom actions, let's go through a proper way to accomplish this.
### Steps to Properly Register a .NET Assembly for C... | 24,394 | [
{
"from": "human",
"value": "I have a web project, a C# library project, and a web setup project in Visual Studio 2005. The web project needs the C# library needs to be registered in the GAC. This is simple, just add the GAC folder to the setup project and drop the primary output of the C# library in there.... |
In the context of a Google App Engine Webapp framework application:
I want to changed the request verb of a request in the case a
parameter _method is provided, for example if a POST request comes in
with a parameter _method=PUT, I need to change the request to call the
put method of the handler. This is to cope with t... | It looks like you're trying to modify the HTTP method of incoming requests in your Google App Engine Webapp application based on a `_method` parameter, but you're encountering an issue where the request parameters become empty when the appropriate handler method (like `put` or `delete`) is called.
One possible reason ... | 26,677 | [
{
"from": "human",
"value": "In the context of a Google App Engine Webapp framework application:\nI want to changed the request verb of a request in the case a\nparameter _method is provided, for example if a POST request comes in\nwith a parameter _method=PUT, I need to change the request to call the\nput ... |
I have an abstract Class Monitor.java which is subclassed by a Class EmailMonitor.java.
The method:
public abstract List<? extends MonitorAccount> performMonitor(List<? extends MonitorAccount> accounts)
is defined in Monitor.java and must be overridden in EmailMonitor.java.
I currently have the method overridden in E... | The issue you're facing arises from the fact that Java uses "type erasure" for generics, which means that during compilation, the generic types are removed, and only the raw types remain. As a result, your method `performMonitor(List<EmailAccount>)` in `EmailMonitor` has the same erased type as `performMonitor(List<? e... | 26,463 | [
{
"from": "human",
"value": "I have an abstract Class Monitor.java which is subclassed by a Class EmailMonitor.java. \nThe method:\npublic abstract List<? extends MonitorAccount> performMonitor(List<? extends MonitorAccount> accounts)\n\nis defined in Monitor.java and must be overridden in EmailMonitor.java... |
I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking that it could make the process of developing my applications much easier. The problem is i like to... | Using `__autoload` (or the newer `spl_autoload_register` in PHP) can greatly simplify the inclusion of classes in your PHP applications, especially as your project grows in complexity. However, there are some considerations regarding performance and maintainability when it comes to autoloading classes from a deep direc... | 26,085 | [
{
"from": "human",
"value": "I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking that it could make the process of developing my applicati... |
Is there a way to see, via hex editor or otherwise, if data in a binary file is aligned or packed, specifically for an HPUX system?
| To determine whether data in a binary file is aligned or packed on an HPUX (Hewlett Packard UNIX) system, you can use a hex editor along with knowledge of the data structures and alignment rules used in HPUX. Here are some steps to help you analyze the binary file:
### 1. **Understand Data Structure Alignment:**
- ... | 25,790 | [
{
"from": "human",
"value": "Is there a way to see, via hex editor or otherwise, if data in a binary file is aligned or packed, specifically for an HPUX system?\n"
},
{
"from": "gpt",
"value": "To determine whether data in a binary file is aligned or packed on an HPUX (Hewlett Packard UNIX) syst... |
I have something here that is really catching me off guard.
I have an ObservableCollection of T that is filled with items. I also have an event handler attached to the CollectionChanged event.
When you Clear the collection it causes an CollectionChanged event with e.Action set to NotifyCollectionChangedAction.Reset. Ok... | The behavior you are observing when you clear an `ObservableCollection` and receive a `NotifyCollectionChangedAction.Reset` event is indeed expected in the design of the `ObservableCollection<T>`. When you invoke the `Clear` method, the collection's state is reset, and as per the design, it does not provide any `OldIte... | 24,861 | [
{
"from": "human",
"value": "I have something here that is really catching me off guard.\nI have an ObservableCollection of T that is filled with items. I also have an event handler attached to the CollectionChanged event.\nWhen you Clear the collection it causes an CollectionChanged event with e.Action set... |
I've got a page layout for a publishing site with an odd behaviour.
Imagine a publishing site (site) with a subsite (subsite1) which has the following pages (page1 [default], page2, and page3)
for page 2 and page three the breadcrumb renders correctly:
site > subsite1 > page2
site > subsite1 > page3
however for the... | It sounds like you're encountering a common issue with breadcrumb navigation, particularly with default or home pages in a subsite structure. Breadcrumbs often rely on the URL or the page hierarchy to determine their structure, and sometimes default pages are treated differently in terms of rendering. Here are several ... | 27,733 | [
{
"from": "human",
"value": "I've got a page layout for a publishing site with an odd behaviour. \nImagine a publishing site (site) with a subsite (subsite1) which has the following pages (page1 [default], page2, and page3)\nfor page 2 and page three the breadcrumb renders correctly:\nsite > subsite1 > pag... |
I'm writing a bash script that needs to delete old files.
It's currently implemented using :
find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete
This will delete of the files older than 1 day.
However, what if I need a finer resolution that 1 day, say like 6 hours old? Is there a nice clean way to do it, li... | Yes, you can achieve finer time resolution with the `find` command using the `-mmin` option. The `-mmin` option allows you to specify the age of files in minutes instead of days.
If you want to delete files that are older than 6 hours, you can calculate the equivalent in minutes (6 hours * 60 minutes = 360 minutes) a... | 30,158 | [
{
"from": "human",
"value": "I'm writing a bash script that needs to delete old files.\nIt's currently implemented using :\nfind $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete\n\nThis will delete of the files older than 1 day.\nHowever, what if I need a finer resolution that 1 day, say like 6 hou... |
I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?
| Yes, it is possible to retrieve the Active Directory (AD) username of a user on a PHP web application running on an intranet, but it typically requires the environment to be set up correctly and may involve additional configurations. Here are some common methods:
### 1. Using Windows Authentication
If your intranet i... | 23,171 | [
{
"from": "human",
"value": "I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?\n"
},
{
"from": "gpt",
"value":... |
In particular, I am interested in:
1) Getting up a free environment setup to do workflows.
2) How to use existing workflow items/states and what is involved in that.
Thanks!
| Setting up a free environment for workflows and understanding how to use existing workflow items and states can be a crucial part of managing projects efficiently. Below are some suggestions and steps to guide you through both points:
### 1) Setting Up a Free Environment for Workflows
To set up a free environment for... | 23,869 | [
{
"from": "human",
"value": "In particular, I am interested in:\n1) Getting up a free environment setup to do workflows.\n2) How to use existing workflow items/states and what is involved in that.\nThanks!\n"
},
{
"from": "gpt",
"value": "Setting up a free environment for workflows and understan... |
I have a Flex application that calls a function which searches a large document collection. Depending on the search term, the user may want to stop the request from flex.
I’d like to not only stop the flex application from expecting the request, but also stop the CFC request. Is this possible? What’s the best approach... | In a Flex application that calls a ColdFusion Component (CFC) for searching a large document collection, you may indeed want to allow users to cancel the request. However, achieving this requires careful handling, both on the client side (Flex) and the server side (CFC).
### Client Side (Flex)
1. **Request Cancellati... | 23,272 | [
{
"from": "human",
"value": "I have a Flex application that calls a function which searches a large document collection. Depending on the search term, the user may want to stop the request from flex. \nI’d like to not only stop the flex application from expecting the request, but also stop the CFC request. ... |
Today I happens to find that one C# class can inherit one interface both in implicit and explicit way. This surprises me. If C# works in this way, then one instance can behave differently when referenced in different way.
interface IFoo
{
void DoSomething();
}
class Foo : IFoo
{
#region IFoo Members
public... | The ability to implement the same interface both implicitly and explicitly in C# serves a specific purpose and can be quite useful in certain scenarios. Let me explain the rationale behind this design choice and its implications.
### Implicit vs. Explicit Interface Implementation
1. **Implicit Interface Implementatio... | 27,058 | [
{
"from": "human",
"value": "Today I happens to find that one C# class can inherit one interface both in implicit and explicit way. This surprises me. If C# works in this way, then one instance can behave differently when referenced in different way.\ninterface IFoo\n{\n void DoSomething();\n}\n\nclass F... |
When calling DirectoryInfo.GetDirectories(".") on an instance of a DirectoryInfo class which points to a valid folder (excluding drive roots), the result is a DirectoryInfo array whose first (and only) element points to a invalid directory named the same as itself, below itself.
For example:
static void Main(string[] a... | What you're experiencing is indeed an interesting behavior related to how the `GetDirectories` method processes the path when using `"."` as a search pattern. The `"."` in Windows file systems refers to the current directory, and thus it's intended to match the directory itself. However, the way the `GetDirectories` me... | 28,470 | [
{
"from": "human",
"value": "When calling DirectoryInfo.GetDirectories(\".\") on an instance of a DirectoryInfo class which points to a valid folder (excluding drive roots), the result is a DirectoryInfo array whose first (and only) element points to a invalid directory named the same as itself, below itsel... |
I am working with a set of data that looks something like the following.
StudentName | AssignmentName | Grade
---------------------------------------
StudentA | Assignment 1 | 100
StudentA | Assignment 2 | 80
StudentA | Total | 180
StudentB | Assignment 1 | 100
StudentB | Assignmen... | To achieve the transformation of your dataset without using dynamic SQL in SQL Server 2005, you'll face certain limitations because traditional PIVOT operations require explicit column names. However, if you want to avoid dynamic SQL and you're willing to manually specify the columns, you can use a straightforward PIVO... | 26,242 | [
{
"from": "human",
"value": "I am working with a set of data that looks something like the following.\n\nStudentName | AssignmentName | Grade\n---------------------------------------\nStudentA | Assignment 1 | 100\nStudentA | Assignment 2 | 80\nStudentA | Total | 180\nStudentB ... |
I have a couple tables in which I created an object ID as either an Int or Bigint, and in both cases, they seem to autoincrement by 10 (ie, the first insert is object ID 1, the second is object ID 11, the third is object ID 21, etc). Two questions:
Why does it do that?
Is that a problem?
| It sounds like you are using an auto-incrementing integer field in your tables, and the IDs are incrementing by 10 instead of the typical increment of 1. This behavior can occur for a few reasons, and I'll address your questions:
### 1. Why does it do that?
The increment behavior of the auto-increment column can be a... | 28,170 | [
{
"from": "human",
"value": "I have a couple tables in which I created an object ID as either an Int or Bigint, and in both cases, they seem to autoincrement by 10 (ie, the first insert is object ID 1, the second is object ID 11, the third is object ID 21, etc). Two questions:\n\nWhy does it do that?\nIs t... |
I have a simple iphone app that's based on the CrashLanding sample app. So basically you tap the title screen and do some stuff... all on the same "view". I want to add an "options" screen/page/view whatever with a few UISwitches. What's the easiest way to do this?
Cheers!
| To add an options screen with a few `UISwitch` controls to your existing iPhone app, you can follow these simple steps. This guide assumes that you're using UIKit for your app's UI. Here’s how to do it:
### Step 1: Create a New View Controller
1. **Create a New Swift File**:
- In your Xcode project, right-click on... | 18,933 | [
{
"from": "human",
"value": "I have a simple iphone app that's based on the CrashLanding sample app. So basically you tap the title screen and do some stuff... all on the same \"view\". I want to add an \"options\" screen/page/view whatever with a few UISwitches. What's the easiest way to do this?\nCheer... |
I tried to use this on my class library "mylib.core.data.dll" and got a successful obfuscation, however, when I import this dll into another project via "Reference" and tried
imports --- My library "mylib.core.data.dll", doesn't show except for "e" and "h". Can someone tell me what I missed during the obfuscation proc... | It sounds like you're encountering issues with visibility of the types in your obfuscated DLL when trying to reference it in another project. Obfuscation tools typically rename classes, methods, and other members to make it difficult to reverse-engineer your code. This can sometimes lead to issues with referencing and ... | 28,421 | [
{
"from": "human",
"value": "I tried to use this on my class library \"mylib.core.data.dll\" and got a successful obfuscation, however, when I import this dll into another project via \"Reference\" and tried \nimports --- My library \"mylib.core.data.dll\", doesn't show except for \"e\" and \"h\". Can someo... |
I have an animation that I'm displaying using a UIImageView:
imageView.animationImages = myImages;
imageView.animationDuration = 3;
[imageView startAnimating];
I know I can stop it using stopAnimating, but what I want is to be able to pause it. The reason is that when you call stop, none of your animation images are d... | To achieve the effect of pausing an animation in a `UIImageView` while keeping the last displayed image visible, you'll need to implement a custom pause functionality since `UIImageView` doesn’t natively support pausing animations.
Here's a simple approach to accomplish this:
1. Keep track of the current animation fr... | 27,189 | [
{
"from": "human",
"value": "I have an animation that I'm displaying using a UIImageView:\nimageView.animationImages = myImages;\nimageView.animationDuration = 3;\n[imageView startAnimating];\n\nI know I can stop it using stopAnimating, but what I want is to be able to pause it. The reason is that when you ... |
I am working on an application that will sport a web-based point of sale interface.
The point of sale PC (I am not sure as of now whether it will run on Linux or Windows) must have a fiscal printer attached to it, but like any web app, it is the server which processes all stuff. Both server and PoS machines are on the ... | Creating a web-based point of sale (PoS) system with a fiscal printer involves several steps to ensure that the system can communicate with the printer directly while also maintaining real-time communication with the server. Below is a high-level outline and potential approach to achieve this.
### Overview
1. **Web-Ba... | 21,620 | [
{
"from": "human",
"value": "I am working on an application that will sport a web-based point of sale interface.\nThe point of sale PC (I am not sure as of now whether it will run on Linux or Windows) must have a fiscal printer attached to it, but like any web app, it is the server which processes all stuff... |
The company I work for has a large webapp written in C++ as an ISAPI extension (not a filter). We're currently enhancing our system to integrate with several 3rd party tools that have SOAP interfaces. Rather than roll our own, I think it would probably be best if we used some SOAP library. Ideally, it would be free ... | Integrating a SOAP library into your existing C++ web application while maintaining access to shared data structures is certainly a challenge, particularly when working with an ISAPI extension. Here are some potential approaches and libraries that could meet your needs:
### 1. **gSOAP**
gSOAP is a popular choice for S... | 26,549 | [
{
"from": "human",
"value": "The company I work for has a large webapp written in C++ as an ISAPI extension (not a filter). We're currently enhancing our system to integrate with several 3rd party tools that have SOAP interfaces. Rather than roll our own, I think it would probably be best if we used some ... |
I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article?
Also - If you do store them in the filesystem, is it possible to change the path of the App_Themes directory to a diffe... | Yes, you can store themes in a database and apply them programmatically in ASP.NET, though it requires a bit more work than loading them from the file system. Here's a brief outline of how you might accomplish this:
### Storing Themes in a Database
1. **Database Structure**: Create a database table to store theme dat... | 24,751 | [
{
"from": "human",
"value": "I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article?\nAlso - If you do store them in the filesystem, is it possible to change the p... |
I'm currently studying Computer Science at College where they mainly teach Java standard edition, I see that in the industry this isn't used much, instead Java EE is used. If my College is teaching me Java SE rather than Java EE does this make me less employable?
And what exact are the differences? different syntax? di... | It's great that you are studying Computer Science and learning Java. Understanding the differences between Java SE (Standard Edition) and Java EE (Enterprise Edition) can help you grasp why some employers may prefer candidates with knowledge of Java EE.
### Differences Between Java SE and Java EE:
1. **Purpose**:
... | 23,728 | [
{
"from": "human",
"value": "I'm currently studying Computer Science at College where they mainly teach Java standard edition, I see that in the industry this isn't used much, instead Java EE is used. If my College is teaching me Java SE rather than Java EE does this make me less employable?\nAnd what exact... |
When debugging, a trick I do whenever I want to exit the current method without running of its any statements, I move the current execution pointer to the end of the method, then click F10/11.
Is there a keyboard shortcut (or can I program one) to accomplish this?
(I don't mean shift-F11 (step out) - that does run all ... | In many IDEs, there isn't a built-in keyboard shortcut to jump directly to the end of the current method without executing the statements in between. However, you can achieve this functionality in a couple of ways depending on the IDE you are using.
### For Visual Studio:
1. **Using Bookmarks**: You can manually set ... | 24,204 | [
{
"from": "human",
"value": "When debugging, a trick I do whenever I want to exit the current method without running of its any statements, I move the current execution pointer to the end of the method, then click F10/11.\nIs there a keyboard shortcut (or can I program one) to accomplish this?\n(I don't mea... |
Can someone tell me method to define the MIME-Type of a static XHTML File as text/html …. I don’t want to use php, asp.net…….. javascript would be ok
| To define the MIME type of a static XHTML file as `text/html` without using server-side languages like PHP or ASP.NET, you generally rely on server configuration. However, if you're serving the XHTML file from a web server and have access to its configuration, you can specify the MIME type directly in the server settin... | 26,638 | [
{
"from": "human",
"value": "Can someone tell me method to define the MIME-Type of a static XHTML File as text/html …. I don’t want to use php, asp.net…….. javascript would be ok\n"
},
{
"from": "gpt",
"value": "To define the MIME type of a static XHTML file as `text/html` without using server-s... |
I am reading WIX script written by others. There are some code really confuses me.
<Custom Action='UnLoadSchedulerPerfCounters' After='InstallInitialize'>
<![CDATA[(Installed) AND (!Scheduler = 3)]]>
</Custom>
<Custom Action='RollbackSchedulerPerfCounters' After='WriteRegistryValues'>
<![CDATA[(&Scheduler ... | In WiX (Windows Installer XML), the use of `!` and `&` prefixes before a property in a condition has specific meanings that are important to understand when reading WiX scripts.
1. **`!` (Not)**: The `!` prefix negates the condition. This means that the condition will evaluate to true when the specified property is no... | 28,921 | [
{
"from": "human",
"value": "I am reading WIX script written by others. There are some code really confuses me. \n<Custom Action='UnLoadSchedulerPerfCounters' After='InstallInitialize'>\n <![CDATA[(Installed) AND (!Scheduler = 3)]]>\n</Custom>\n<Custom Action='RollbackSchedulerPerfCounters' After='WriteR... |
According to Wikipedia when rounding a negative number, you round the absolute number. So by that reasoning, -3.5 would be rounded to -4. But when I use java.lang.Math.round(-3.5) returns -3. Can someone please explain this?
| The confusion arises from the distinction between rounding towards the nearest integer and the method used to round negative numbers in the Java programming language.
In general, when rounding numbers:
- Rounding a positive number like 3.5 typically goes up to 4.
- Rounding a negative number like -3.5, using typical m... | 29,407 | [
{
"from": "human",
"value": "According to Wikipedia when rounding a negative number, you round the absolute number. So by that reasoning, -3.5 would be rounded to -4. But when I use java.lang.Math.round(-3.5) returns -3. Can someone please explain this?\n"
},
{
"from": "gpt",
"value": "The confu... |
I like the flexibility of Dynamic SQL and I like the security + improved performance of Prepared Statements. So what I really want is Dynamic Prepared Statements, which is troublesome to make because bind_param and bind_result accept "fixed" number of arguments. So I made use of an eval() statement to get around this... | Yes, using `eval()` in your code is generally considered a bad practice due to security vulnerabilities, maintainability issues, and debugging difficulties. Even if you try to mitigate risks related to code injection, using `eval()` opens up your code to other potential problems, especially if you ever modify how param... | 25,388 | [
{
"from": "human",
"value": "I like the flexibility of Dynamic SQL and I like the security + improved performance of Prepared Statements. So what I really want is Dynamic Prepared Statements, which is troublesome to make because bind_param and bind_result accept \"fixed\" number of arguments. So I made us... |
For example, suppose I have a class:
class Foo
{
public:
std::string& Name()
{
m_maybe_modified = true;
return m_name;
}
const std::string& Name() const
{
return m_name;
}
protected:
std::string m_name;
bool m_maybe_modified;
};
And somewhere else in the code, I... | In the example you've provided, the reason the compiler chooses the non-const version of the `Name` method when you call `a->Name()` lies in the nature of the pointer `a` and how member function overload resolution works in C++.
1. **Pointer Type**: You have declared `a` as a pointer to `Foo` (`Foo *a`). This means th... | 27,800 | [
{
"from": "human",
"value": "For example, suppose I have a class:\nclass Foo\n{\npublic:\n std::string& Name()\n {\n m_maybe_modified = true;\n return m_name;\n }\n\n const std::string& Name() const\n {\n return m_name;\n }\nprotected:\n std::string m_name;\n boo... |
trying to get a side project hobby going to keep me motivated from my 9-5 job on C# and was looking at Boo. some ?'s
what has your experience being with Boo?
what kind of apps/projects have you done with Boo or
what is Boo capable of?
Guess being the web world, would like to get my hands dirty with desktop applicati... | Boo is a statically typed programming language for the Common Language Infrastructure (CLI), which was designed to be similar to Python but with a syntax that is closer to C#. It has a focus on static typing and type inference, which can help catch errors at compile time rather than runtime.
### Experience with Boo
W... | 26,674 | [
{
"from": "human",
"value": "trying to get a side project hobby going to keep me motivated from my 9-5 job on C# and was looking at Boo. some ?'s\n\nwhat has your experience being with Boo?\nwhat kind of apps/projects have you done with Boo or \nwhat is Boo capable of?\n\nGuess being the web world, would li... |
Can someone point me in the right direction? I wish to distribute a WCF peer to peer cloud over the internet. So far I've seen examples of how it works on the same subnet. I wish to push it a little further.
| Distributing a Windows Communication Foundation (WCF) peer-to-peer (P2P) application over the internet introduces additional complexities compared to a local subnet setup. Here are some steps and considerations to help you set up a WCF P2P application over the internet:
### 1. Understanding WCF P2P
WCF P2P is designe... | 21,683 | [
{
"from": "human",
"value": "Can someone point me in the right direction? I wish to distribute a WCF peer to peer cloud over the internet. So far I've seen examples of how it works on the same subnet. I wish to push it a little further.\n"
},
{
"from": "gpt",
"value": "Distributing a Windows Com... |
I have a SQL CLR function in SQL Server 2005. I want to profile this function to make sure there are no memory leaks. Any recommendations on how to determine if my function is behaving properly?
| Profiling a SQL CLR function to ensure there are no memory leaks or performance issues involves a few steps. SQL Server 2005 has limited built-in tools compared to later versions, but you can still effectively monitor and evaluate the performance of your CLR function using the following methods:
### 1. Enable CLR Inte... | 23,664 | [
{
"from": "human",
"value": "I have a SQL CLR function in SQL Server 2005. I want to profile this function to make sure there are no memory leaks. Any recommendations on how to determine if my function is behaving properly?\n"
},
{
"from": "gpt",
"value": "Profiling a SQL CLR function to ensur... |
In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves members of that class. All other operations which can be written by using only mem... | You've raised a valid concern, and it's a common point of contention among C++ developers regarding the balance between encapsulation and usability, especially as it pertains to the visibility of functions.
### Weighing the Arguments
**Encapsulation and Design**: The recommendations from Sutter and Alexandrescu focus... | 26,288 | [
{
"from": "human",
"value": "In the (otherwise) excellent book C++ Coding Standards, Item 44, titled \"Prefer writing nonmember nonfriend functions\", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves members of that class. All other operat... |
What's the best algorithm for comparing two arrays to see if they have the same members?
Assume there are no duplicates, the members can be in any order, and that neither is sorted.
compare(
[a, b, c, d],
[b, a, d, c]
) ==> true
compare(
[a, b, e],
[a, b, c]
) ==> false
compare(
[a, b, c],
[a,... | To compare two arrays to see if they have the same members (assuming no duplicates, any order, and neither is sorted), you can use one of the following algorithms:
### 1. Using Sets
This is the simplest and most efficient method, as sets automatically handle duplicates and allow for easy comparison.
Here's how you ca... | 27,021 | [
{
"from": "human",
"value": "What's the best algorithm for comparing two arrays to see if they have the same members?\nAssume there are no duplicates, the members can be in any order, and that neither is sorted.\ncompare(\n [a, b, c, d],\n [b, a, d, c]\n) ==> true\n\ncompare(\n [a, b, e],\n [a, ... |
I have a query that is currently using a correlated subquery to return the results, but I am thinking the problem could be solved more eloquently perhaps using ROW_NUMBER().
The problem is around the profile of a value v, through a number of years for an Item. Each item has a number of versions, each with its own prof... | Yes, you can indeed achieve your desired result more elegantly by using the `ROW_NUMBER()` window function instead of a correlated subquery. This approach should provide better performance, especially with larger datasets, as it avoids the repeated subquery execution for each row.
Here's how you can rewrite your query... | 29,515 | [
{
"from": "human",
"value": "I have a query that is currently using a correlated subquery to return the results, but I am thinking the problem could be solved more eloquently perhaps using ROW_NUMBER().\nThe problem is around the profile of a value v, through a number of years for an Item. Each item has a ... |
If I have "Full Control" permission on a list, is there a way for me to see all the individuals who have an alert set for that list?
Some people in my department are better at managing their own subscriptions than others, and this is a question I have received from several team leads. They want to be able to see and c... | In SharePoint, if you have "Full Control" permissions on a list, you can typically see who has alerts set up for that list. However, the method to view alert subscriptions can vary depending on whether you're using SharePoint Online, SharePoint Server, or an older version. Here's a general approach to check alerts for ... | 28,135 | [
{
"from": "human",
"value": "If I have \"Full Control\" permission on a list, is there a way for me to see all the individuals who have an alert set for that list?\nSome people in my department are better at managing their own subscriptions than others, and this is a question I have received from several te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.